ufo-ai-2.4.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic games
  5. MY_P=${P/o-a/oa}
  6. DESCRIPTION="UFO: Alien Invasion - X-COM inspired strategy game"
  7. HOMEPAGE="http://ufoai.sourceforge.net/"
  8. SRC_URI="mirror://sourceforge/ufoai/${MY_P}-source.tar.bz2
  9. mirror://sourceforge/ufoai/${MY_P}-data.tar
  10. http://mattn.ninex.info/1maps.pk3"
  11. LICENSE="GPL-2"
  12. SLOT="0"
  13. KEYWORDS="amd64 ~ppc x86"
  14. IUSE="debug dedicated editor"
  15. # Dependencies and more instructions can be found here:
  16. # http://ufoai.ninex.info/wiki/index.php/Compile_for_Linux
  17. DEPEND="!dedicated? (
  18. virtual/opengl
  19. virtual/glu
  20. media-libs/libsdl
  21. media-libs/sdl-image[jpeg,png]
  22. media-libs/sdl-ttf
  23. media-libs/sdl-mixer
  24. virtual/jpeg
  25. media-libs/libpng:0
  26. media-libs/libogg
  27. media-libs/libvorbis
  28. x11-proto/xf86vidmodeproto
  29. )
  30. net-misc/curl
  31. sys-devel/gettext
  32. sys-libs/zlib
  33. editor? (
  34. dev-libs/libxml2
  35. virtual/jpeg
  36. media-libs/openal
  37. x11-libs/gtkglext
  38. x11-libs/gtksourceview:2.0
  39. )"
  40. S=${WORKDIR}/${MY_P}-source
  41. src_prepare() {
  42. if has_version '>=sys-libs/zlib-1.2.5.1-r1' ; then
  43. sed -i -e '1i#define OF(x) x' src/common/ioapi.h || die
  44. fi
  45. # don't try to use the system mini-xml
  46. sed -i -e '/mxml/d' configure || die
  47. epatch \
  48. "${FILESDIR}"/${P}-mathlib.patch \
  49. "${FILESDIR}"/${P}-anon.patch \
  50. "${FILESDIR}"/${P}-locale.patch
  51. cp "${DISTDIR}"/1maps.pk3 "${WORKDIR}"/base/ || die
  52. mv "${WORKDIR}"/base/ "${S}"/ || die
  53. }
  54. src_configure() {
  55. # they are special and provide hand batched configure file
  56. local myconf="
  57. --disable-dependency-tracking
  58. $(use_enable !debug release)
  59. $(use_enable editor ufo2map)
  60. $(use_enable editor uforadiant)
  61. --enable-ufoded
  62. --bindir="${GAMES_BINDIR}"
  63. --libdir="$(games_get_libdir)"
  64. --datadir="${GAMES_DATADIR}/${PN/-}"
  65. --localedir="${EPREFIX}/usr/share/locale/"
  66. --prefix="${GAMES_PREFIX}"
  67. "
  68. echo "./configure ${myconf}"
  69. ./configure ${myconf} || die
  70. }
  71. src_compile() {
  72. emake
  73. emake lang
  74. if use editor; then
  75. emake uforadiant
  76. fi
  77. }
  78. src_install() {
  79. newicon src/ports/linux/ufo.png ${PN}.png
  80. dobin ufoded
  81. make_desktop_entry ufoded "UFO: Alien Invasion Server" ${PN}
  82. if ! use dedicated; then
  83. dobin ufo
  84. make_desktop_entry ufo "UFO: Alien Invasion" ${PN}
  85. fi
  86. if use editor; then
  87. dobin ufo2map ufomodel
  88. fi
  89. # install data
  90. insinto "${GAMES_DATADIR}"/${PN/-}
  91. doins -r base
  92. rm -rf "${ED}/${GAMES_DATADIR}/${PN/-}/base/game.so"
  93. dogameslib base/game.so
  94. # move translations where they belong
  95. dodir "${GAMES_DATADIR_BASE}/locale"
  96. mv "${ED}/${GAMES_DATADIR}/${PN/-}/base/i18n/"* \
  97. "${ED}/${GAMES_DATADIR_BASE}/locale/" || die
  98. rm -rf "${ED}/${GAMES_DATADIR}/${PN/-}/base/i18n/" || die
  99. prepgamesdirs
  100. }