uqm-0.7.0-r3.ebuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils multilib toolchain-funcs games
  5. DESCRIPTION="The Ur-Quan Masters: Port of Star Control 2"
  6. HOMEPAGE="http://sc2.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/sc2/${P}-source.tgz
  8. mirror://sourceforge/sc2/${P}-content.uqm
  9. music? ( mirror://sourceforge/sc2/${P}-3domusic.uqm )
  10. voice? ( mirror://sourceforge/sc2/${P}-voice.uqm )
  11. remix? ( mirror://sourceforge/sc2/${PN}-remix-disc1.uqm \
  12. mirror://sourceforge/sc2/${PN}-remix-disc2.uqm \
  13. mirror://sourceforge/sc2/${PN}-remix-disc3.uqm \
  14. mirror://sourceforge/sc2/${PN}-remix-disc4.uqm )"
  15. LICENSE="GPL-2+"
  16. SLOT="0"
  17. KEYWORDS="amd64 ppc ppc64 x86"
  18. IUSE="music opengl remix voice"
  19. RDEPEND="media-libs/libmikmod
  20. media-libs/libogg
  21. >=media-libs/libpng-1.4:0
  22. media-libs/libsdl[X,sound,joystick,video]
  23. media-libs/libvorbis
  24. media-libs/sdl-image[png]
  25. sys-libs/zlib
  26. opengl? ( virtual/opengl )"
  27. DEPEND="${RDEPEND}
  28. virtual/pkgconfig"
  29. src_prepare() {
  30. local myopengl
  31. use opengl \
  32. && myopengl=opengl \
  33. || myopengl=pure
  34. epatch \
  35. "${FILESDIR}"/${P}-tempdir.patch \
  36. "${FILESDIR}"/${P}-warning.patch
  37. cat <<-EOF > config.state
  38. CHOICE_debug_VALUE='nodebug'
  39. CHOICE_graphics_VALUE='${myopengl}'
  40. CHOICE_sound_VALUE='mixsdl'
  41. CHOICE_accel_VALUE='plainc'
  42. INPUT_install_prefix_VALUE='${GAMES_PREFIX}'
  43. INPUT_install_bindir_VALUE='\$prefix/bin'
  44. INPUT_install_libdir_VALUE='\$prefix/lib'
  45. INPUT_install_sharedir_VALUE='${GAMES_DATADIR}/'
  46. EOF
  47. # Take out the read so we can be non-interactive.
  48. sed -i \
  49. -e '/read CHOICE/d' build/unix/menu_functions || die
  50. # respect CFLAGS
  51. sed -i \
  52. -e "s/-O3//" build/unix/build.config || die
  53. sed -i \
  54. -e "s:@INSTALL_LIBDIR@:$(games_get_libdir)/:g" \
  55. build/unix/uqm-wrapper.in || die
  56. # respect CC
  57. sed -i \
  58. -e "s/PROG_gcc_FILE=\"gcc\"/PROG_gcc_FILE=\"$(tc-getCC)\"/" \
  59. build/unix/config_proginfo_build || die
  60. }
  61. src_compile() {
  62. MAKE_VERBOSE=1 ./build.sh uqm || die
  63. }
  64. src_install() {
  65. # Using the included install scripts seems quite painful.
  66. # This manual install is totally fragile but maybe they'll
  67. # use a sane build system for the next release.
  68. newgamesbin uqm-wrapper uqm
  69. exeinto "$(games_get_libdir)"/${PN}
  70. doexe uqm
  71. insinto "${GAMES_DATADIR}"/${PN}/content/packages
  72. doins "${DISTDIR}"/${P}-content.uqm
  73. echo ${P} > "${D}${GAMES_DATADIR}"/${PN}/content/version || die
  74. insinto "${GAMES_DATADIR}"/${PN}/content/addons
  75. if use music; then
  76. doins "${DISTDIR}"/${P}-3domusic.uqm
  77. fi
  78. if use voice; then
  79. doins "${DISTDIR}"/${P}-voice.uqm
  80. fi
  81. if use remix; then
  82. insinto "${GAMES_DATADIR}"/${PN}/content/addons
  83. doins "${DISTDIR}"/${PN}-remix-disc{1,2,3,4}.uqm
  84. fi
  85. dodoc AUTHORS ChangeLog Contributing README WhatsNew doc/users/manual.txt
  86. docinto devel
  87. dodoc doc/devel/[!n]*
  88. docinto devel/netplay
  89. dodoc doc/devel/netplay/*
  90. make_desktop_entry uqm "The Ur-Quan Masters"
  91. prepgamesdirs
  92. }