nexuiz-2.5.2-r1.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils
  5. MY_PN=Nexuiz
  6. MY_P=${PN}-${PV//./}
  7. MAPS=nexmappack_r2
  8. DESCRIPTION="Deathmatch FPS based on DarkPlaces, an advanced Quake 1 engine"
  9. HOMEPAGE="http://www.nexuiz.com/"
  10. SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip
  11. maps? ( mirror://sourceforge/${PN}/${MAPS}.zip )"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS="~amd64 ~ppc ~x86"
  15. IUSE="alsa dedicated maps opengl sdl"
  16. # no headers for libpng needed
  17. UIRDEPEND="
  18. media-libs/libmodplug
  19. media-libs/libogg
  20. >=media-libs/libpng-1.4:0
  21. media-libs/libtheora
  22. media-libs/libvorbis
  23. x11-libs/libX11
  24. x11-libs/libXau
  25. x11-libs/libXdmcp
  26. x11-libs/libXext
  27. x11-libs/libXpm
  28. x11-libs/libXxf86dga
  29. x11-libs/libXxf86vm
  30. virtual/opengl
  31. alsa? ( media-libs/alsa-lib )
  32. sdl? ( media-libs/libsdl[joystick,opengl,video] )"
  33. UIDEPEND="x11-proto/xextproto
  34. x11-proto/xf86dgaproto
  35. x11-proto/xf86vidmodeproto
  36. x11-proto/xproto"
  37. RDEPEND="virtual/jpeg:0
  38. net-misc/curl
  39. opengl? ( ${UIRDEPEND} )
  40. !dedicated? ( !opengl? ( ${UIRDEPEND} ) )"
  41. DEPEND="${RDEPEND}
  42. app-arch/unzip
  43. opengl? ( ${UIDEPEND} )
  44. !dedicated? ( !opengl? ( ${UIDEPEND} ) )"
  45. S=${WORKDIR}/darkplaces
  46. PATCHES=(
  47. "${FILESDIR}"/${P}-libpng-1.4.patch
  48. )
  49. src_unpack() {
  50. unpack ${MY_P}.zip
  51. local f
  52. for f in "${MY_PN}"/sources/*.zip ; do
  53. unpack ./${f}
  54. done
  55. if use maps ; then
  56. cd "${WORKDIR}"/${MY_PN}
  57. unpack ${MAPS}.zip
  58. fi
  59. }
  60. src_prepare() {
  61. default
  62. # Make the game automatically look in the correct data directory
  63. sed -i \
  64. -e "/^CC=/d" \
  65. -e "s:-O2:${CFLAGS}:" \
  66. -e "/-lm/s:$: ${LDFLAGS}:" \
  67. -e '/^STRIP/s/strip/true/' \
  68. makefile.inc || die
  69. sed -i \
  70. -e '1i DP_LINK_TO_LIBJPEG=1' \
  71. -e "s:ifdef DP_.*:DP_FS_BASEDIR=/usr/share/${PN}\n&:" \
  72. makefile || die
  73. if ! use alsa ; then
  74. sed -i \
  75. -e "/DEFAULT_SNDAPI/s:ALSA:OSS:" \
  76. makefile || die
  77. fi
  78. }
  79. src_compile() {
  80. if use opengl || ! use dedicated ; then
  81. emake cl-${PN}
  82. if use sdl ; then
  83. emake sdl-${PN}
  84. fi
  85. fi
  86. if use dedicated ; then
  87. emake sv-${PN}
  88. fi
  89. }
  90. src_install() {
  91. if use opengl || ! use dedicated ; then
  92. dobin ${PN}-glx
  93. doicon ${PN}.xpm
  94. make_desktop_entry ${PN}-glx "Nexuiz (GLX)"
  95. if use sdl ; then
  96. dobin ${PN}-sdl
  97. make_desktop_entry ${PN}-sdl "Nexuiz (SDL)"
  98. dosym ${PN}-sdl /usr/bin/${PN}
  99. else
  100. dosym ${PN}-glx /usr/bin/${PN}
  101. fi
  102. fi
  103. if use dedicated ; then
  104. dobin ${PN}-dedicated
  105. fi
  106. cd "${WORKDIR}"/${MY_PN} || die
  107. dodoc Docs/*.txt
  108. dodoc -r readme.html Docs
  109. insinto /usr/share/${PN}
  110. if use dedicated ; then
  111. doins -r server
  112. fi
  113. doins -r data havoc
  114. }