mures-0.5.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils games
  5. DESCRIPTION="A clone of Sega's Chu Chu Rocket"
  6. HOMEPAGE="http://mures.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/mures/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ppc x86"
  11. IUSE="opengl"
  12. DEPEND="media-libs/libsdl
  13. media-libs/sdl-image
  14. media-libs/sdl-net
  15. media-libs/sdl-ttf
  16. opengl? ( virtual/opengl )"
  17. RDEPEND="${DEPEND}"
  18. dir=${GAMES_DATADIR}/${PN}
  19. src_prepare() {
  20. # Disable OpenGL support if USE flag is not set
  21. if ! use opengl ; then
  22. sed -i \
  23. -e 's: -DHAVE_GL::' \
  24. -e 's: -lGL::' \
  25. configure.in || die "sed failed"
  26. fi
  27. sed -i '$ s/\\//' \
  28. src/lua/Makefile.am \
  29. src/maps/battle/Makefile.am \
  30. || die "sed failed"
  31. epatch "${FILESDIR}"/${P}-underlink.patch
  32. eautoreconf
  33. cd src
  34. # Save to HOME
  35. epatch "${FILESDIR}"/${P}-save.patch
  36. # Modify game data & scrips path
  37. sed -i \
  38. -e "s:gui/:${dir}/gui/:" \
  39. -e "s:sounds/:${dir}/sounds/:" \
  40. gui.c || die "sed gui.c failed"
  41. sed -i \
  42. -e "s:images/:${dir}/images/:" \
  43. -e "s:textures/:${dir}/textures/:" \
  44. go_sdl.c || die "sed go_sdl.c failed"
  45. sed -i \
  46. -e "s:textures/:${dir}/textures/:" \
  47. go_gl.c || die "sed go_gl.c failed"
  48. sed -i \
  49. -e "s:input.lua:${dir}/input.lua:" \
  50. gi_sdl.c || die "sed gi_sdl.c failed"
  51. sed -i \
  52. -e "s:images/:${dir}/images/:" \
  53. anim.c output.c || die "sed anim.c output.c failed"
  54. sed -i \
  55. -e "s:maps/:${dir}/maps/:" \
  56. load_maps.lua || die "sed load_maps.lua failed"
  57. sed -i \
  58. -e "s:sounds/:${dir}/sounds/:" \
  59. audio_sdl.c || die "sed audio_sdl.c failed"
  60. sed -i \
  61. -e "s:load_maps.lua:${dir}/load_maps.lua:" \
  62. map.c || die "sed map.c failed"
  63. }
  64. src_install() {
  65. # Remove makefiles before installation
  66. rm -f src/*/Makefile* src/*/*/Makefile* || die "removing makefiles"
  67. insinto "${dir}"
  68. doins -r src/{gui,images,sounds,textures,maps,*.lua}
  69. dodoc README TODO ChangeLog AUTHORS
  70. dogamesbin src/mures
  71. prepgamesdirs
  72. }