d2x-rebirth-0.58.1.ebuild 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils scons-utils games
  5. DV=2
  6. MY_P=dxx-rebirth-${PV}-d2x
  7. DESCRIPTION="Descent Rebirth - enhanced Descent ${DV} engine"
  8. HOMEPAGE="http://www.dxx-rebirth.com/"
  9. SRC_URI="https://github.com/dxx-rebirth/dxx-rebirth/archive/0.58.1-d2x.tar.gz -> ${P}.tar.gz
  10. opl3-musicpack? ( http://www.dxx-rebirth.com/download/dxx/res/d${DV}xr-opl3-music.zip )
  11. sc55-musicpack? ( http://www.dxx-rebirth.com/download/dxx/res/d${DV}xr-sc55-music.zip )
  12. l10n_de? ( http://www.dxx-rebirth.com/download/dxx/res/d${DV}xr-briefings-ger.zip )"
  13. LICENSE="D1X GPL-2 public-domain"
  14. SLOT="0"
  15. KEYWORDS="amd64 x86"
  16. IUSE="cdinstall debug demo ipv6 l10n_de +music opengl opl3-musicpack sc55-musicpack"
  17. REQUIRED_USE="?? ( opl3-musicpack sc55-musicpack )
  18. opl3-musicpack? ( music )
  19. sc55-musicpack? ( music )"
  20. RDEPEND="dev-games/physfs[hog,mvl,zip]
  21. media-libs/libsdl[X,sound,joystick,opengl?,video]
  22. music? (
  23. media-libs/sdl-mixer[timidity,vorbis]
  24. )
  25. opengl? (
  26. virtual/opengl
  27. virtual/glu
  28. )"
  29. DEPEND="${RDEPEND}
  30. app-arch/unzip"
  31. PDEPEND="cdinstall? ( games-action/descent2-data )
  32. demo? ( games-action/descent2-demodata )"
  33. S=${WORKDIR}/${MY_P}
  34. src_unpack() {
  35. unpack ${P}.tar.gz
  36. }
  37. src_prepare() {
  38. epatch "${FILESDIR}"/${P}-flags.patch
  39. DOCS=( {CHANGELOG,INSTALL,README,RELEASE-NOTES}.txt )
  40. edos2unix ${DOCS[@]}
  41. }
  42. src_compile() {
  43. escons \
  44. verbosebuild=1 \
  45. sharepath="${GAMES_DATADIR}/d${DV}x" \
  46. $(use_scons ipv6) \
  47. $(use_scons music sdlmixer) \
  48. $(use_scons debug) \
  49. $(use_scons opengl) \
  50. || die
  51. }
  52. src_install() {
  53. dodoc ${DOCS[@]}
  54. insinto "${GAMES_DATADIR}/d${DV}x"
  55. # None of the following zip files need to be extracted.
  56. use l10n_de && newins "${DISTDIR}"/d${DV}xr-briefings-ger.zip d${DV}xr-briefings-ger.dxa
  57. use opl3-musicpack && newins "${DISTDIR}"/d${DV}xr-opl3-music.zip d${DV}xr-opl3-music.dxa
  58. use sc55-musicpack && newins "${DISTDIR}"/d${DV}xr-sc55-music.zip d${DV}xr-sc55-music.dxa
  59. doicon ${PN}.xpm
  60. dogamesbin ${PN}
  61. make_desktop_entry ${PN} "Descent ${DV} Rebirth"
  62. prepgamesdirs
  63. }
  64. pkg_postinst() {
  65. games_pkg_postinst
  66. if ! use cdinstall ; then
  67. echo
  68. elog "To play the full game enable USE=\"cdinstall\" or manually "
  69. elog "copy the files to ${GAMES_DATADIR}/d${DV}x."
  70. elog "See /usr/share/doc/${PF}/INSTALL.txt for details."
  71. echo
  72. fi
  73. elog 'AddOns now use filename extension ".dxa".'
  74. elog 'Your old AddOns will not work anymore.'
  75. elog 'You can either re-download them or simply'
  76. elog 'rename them from *.zip to *.dxa.'
  77. }