freecol-0.11.6.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils java-pkg-2 java-ant-2 games
  5. DESCRIPTION="An open source clone of the game Colonization"
  6. HOMEPAGE="http://www.freecol.org/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}-src.zip"
  8. LICENSE="GPL-2+"
  9. SLOT="0"
  10. KEYWORDS="amd64 x86"
  11. IUSE=""
  12. COMMON_DEP="dev-java/jsr173
  13. dev-java/wstx:3.2
  14. dev-java/commons-cli:1
  15. dev-java/cortado
  16. dev-java/miglayout"
  17. DEPEND=">=virtual/jdk-1.8
  18. app-arch/unzip
  19. ${COMMON_DEP}"
  20. RDEPEND=">=virtual/jre-1.8
  21. ${COMMON_DEP}"
  22. S=${WORKDIR}/${PN}
  23. java_prepare() {
  24. # jorbis isn't in portage yet
  25. rm jars/{commons-cli-1.1,cortado-0.6.0,miglayout-core-4.2,miglayout-swing-4.2}.jar || die
  26. epatch "${FILESDIR}"/${P}-gentoo.patch
  27. }
  28. src_prepare() {
  29. java-pkg-2_src_prepare
  30. }
  31. src_configure() {
  32. java-ant-2_src_configure
  33. }
  34. src_compile() {
  35. EANT_BUILD_TARGET=package
  36. EANT_EXTRA_ARGS="
  37. -Dstax.jar=$(java-pkg_getjars jsr173)
  38. -Dwoodstox.jar=$(java-pkg_getjars wstx-3.2)
  39. -Dcli.jar=$(java-pkg_getjars commons-cli-1)
  40. -Dmiglayout.jar=$(java-pkg_getjars miglayout)
  41. -Dcortado.jar=$(java-pkg_getjars cortado)
  42. "
  43. java-pkg-2_src_compile
  44. }
  45. src_install() {
  46. java-pkg_jarinto "${GAMES_DATADIR}"/${PN}
  47. java-pkg_dojar FreeCol.jar
  48. java-pkg_dolauncher ${PN} \
  49. -into "${GAMES_PREFIX}" \
  50. --pwd "${GAMES_DATADIR}"/${PN} \
  51. --jar FreeCol.jar \
  52. --java_args -Xmx512M
  53. insinto "${GAMES_DATADIR}"/${PN}
  54. doins -r data schema
  55. doicon data/${PN}.png
  56. make_desktop_entry ${PN} FreeCol
  57. dodoc README
  58. prepgamesdirs
  59. }
  60. pkg_setup() {
  61. games_pkg_setup
  62. java-pkg-2_pkg_setup
  63. }
  64. pkg_preinst() {
  65. games_pkg_preinst
  66. java-pkg-2_pkg_preinst
  67. }