xonotic-0.8.1.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils check-reqs toolchain-funcs games
  5. # Switch to ^ when we switch to EAPI=6.
  6. MY_PN="X${PN:1}"
  7. DESCRIPTION="Fork of Nexuiz, Deathmatch FPS based on DarkPlaces, an advanced Quake 1 engine"
  8. HOMEPAGE="http://www.xonotic.org/"
  9. SRC_URI="http://dl.xonotic.org/${P}.zip"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="amd64 x86"
  13. IUSE="alsa debug dedicated doc ode sdl"
  14. UIRDEPEND="
  15. media-libs/libogg
  16. media-libs/libtheora
  17. media-libs/libvorbis
  18. media-libs/libmodplug
  19. x11-libs/libX11
  20. x11-libs/libXau
  21. x11-libs/libXpm
  22. x11-libs/libXext
  23. x11-libs/libXdmcp
  24. x11-libs/libXxf86dga
  25. x11-libs/libXxf86vm
  26. virtual/opengl
  27. media-libs/freetype:2
  28. alsa? ( media-libs/alsa-lib )
  29. ode? ( dev-games/ode[double-precision] )
  30. sdl? ( media-libs/libsdl[X,sound,joystick,opengl,video,alsa?] )"
  31. UIDEPEND="
  32. x11-proto/xextproto
  33. x11-proto/xf86dgaproto
  34. x11-proto/xf86vidmodeproto
  35. x11-proto/xproto"
  36. RDEPEND="
  37. sys-libs/zlib
  38. virtual/jpeg:0
  39. media-libs/libpng:0
  40. net-misc/curl
  41. ~dev-libs/d0_blind_id-0.5
  42. !dedicated? ( ${UIRDEPEND} )"
  43. DEPEND="${RDEPEND}
  44. !dedicated? ( ${UIDEPEND} )"
  45. CHECKREQS_DISK_BUILD="1200M"
  46. CHECKREQS_DISK_USR="950M"
  47. S=${WORKDIR}/${MY_PN}
  48. pkg_pretend() {
  49. check-reqs_pkg_pretend
  50. }
  51. pkg_setup() {
  52. check-reqs_pkg_setup
  53. games_pkg_setup
  54. }
  55. src_prepare() {
  56. sed -i \
  57. -e "/^EXE_/s:darkplaces:${PN}:" \
  58. -e "s:-O3:${CFLAGS}:" \
  59. -e "/-lm/s:$: ${LDFLAGS}:" \
  60. -e '/^STRIP/s/strip/true/' \
  61. source/darkplaces/makefile.inc || die
  62. if ! use alsa; then
  63. sed -i \
  64. -e "/DEFAULT_SNDAPI/s:ALSA:OSS:" \
  65. source/darkplaces/makefile || die
  66. fi
  67. }
  68. src_compile() {
  69. local t="$(use debug && echo debug || echo release)"
  70. local i
  71. tc-export CC CXX LD AR RANLIB
  72. # use a for-loop wrt bug 473352
  73. for i in sv-${t} $(use !dedicated && echo "cl-${t} $(use sdl && echo sdl-${t})") ; do
  74. emake \
  75. -C source/darkplaces \
  76. DP_LINK_ODE=$(usex ode shared no) \
  77. DP_FS_BASEDIR="${GAMES_DATADIR}/${PN}" \
  78. ${i}
  79. done
  80. }
  81. src_install() {
  82. if ! use dedicated; then
  83. dogamesbin source/darkplaces/${PN}-glx
  84. newicon misc/logos/${PN}_icon.svg ${PN}.svg
  85. make_desktop_entry ${PN}-glx "${MY_PN} (GLX)"
  86. if use sdl; then
  87. dogamesbin source/darkplaces/${PN}-sdl
  88. make_desktop_entry ${PN}-sdl "${MY_PN} (SDL)"
  89. fi
  90. fi
  91. dogamesbin source/darkplaces/${PN}-dedicated
  92. dodoc Docs/*.txt
  93. use doc && dohtml -r Docs
  94. insinto "${GAMES_DATADIR}/${PN}"
  95. doins -r key_0.d0pk server data
  96. prepgamesdirs
  97. elog "If you are using opensource drivers you should consider installing: "
  98. elog " media-libs/libtxc_dxtn"
  99. }