gargoyle-2011.1.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # Regarding licenses: libgarglk is licensed under the GPLv2. Bundled
  4. # interpreters are licensed under GPLv2, BSD or MIT license, except:
  5. # - glulxe: custom license, see "terps/glulxle/README"
  6. # - hugo: custom license, see "licenses/HUGO License.txt"
  7. # Since we don't compile or install any of the bundled fonts, their licenses
  8. # don't apply. (Fonts are installed through dependencies instead.)
  9. EAPI=5
  10. inherit eutils flag-o-matic multiprocessing toolchain-funcs gnome2-utils games
  11. DESCRIPTION="An Interactive Fiction (IF) player supporting all major formats"
  12. HOMEPAGE="http://ccxvii.net/gargoyle/"
  13. SRC_URI="https://garglk.googlecode.com/files/${P}-sources.zip"
  14. LICENSE="BSD GPL-2 MIT Hugo Glulxe"
  15. SLOT="0"
  16. KEYWORDS="amd64 x86"
  17. IUSE=""
  18. RDEPEND="
  19. >=media-fonts/libertine-5
  20. media-fonts/liberation-fonts
  21. media-libs/freetype:2
  22. media-libs/libpng:0
  23. media-libs/sdl-mixer
  24. media-libs/sdl-sound[modplug,mp3,vorbis]
  25. sys-libs/zlib
  26. virtual/jpeg:0
  27. x11-libs/gtk+:2"
  28. DEPEND="${RDEPEND}
  29. app-arch/unzip
  30. dev-util/ftjam
  31. virtual/pkgconfig"
  32. S=${WORKDIR}
  33. src_prepare() {
  34. # Substitute custom CFLAGS/LDFLAGS.
  35. sed -i -e \
  36. "/^\s*OPTIM = / {
  37. s/ \(-O.*\)\? ;/ ;/
  38. a LINKFLAGS = ${LDFLAGS} ;
  39. a SHRLINKFLAGS = ${LDFLAGS} ;
  40. }" Jamrules || die
  41. # Don't link against libraries used indirectly through SDL_sound.
  42. sed -i -e "/GARGLKLIBS/s/-lsmpeg -lvorbisfile//g" Jamrules || die
  43. # Convert garglk.ini to UNIX format.
  44. edos2unix garglk/garglk.ini
  45. # The font name of Linux Libertine changed in version 5.
  46. sed -i -e 's/Linux Libertine O/Linux Libertine/g' garglk/garglk.ini || die
  47. epatch "${FILESDIR}"/${P}-desktopfile.patch
  48. append-cflags -std=gnu89 # build with gcc5 (bug #573378)
  49. }
  50. src_compile() {
  51. # build system messes up flags and toolchain completely
  52. # append flags to compiler commands to have consistent behavior
  53. jam \
  54. -sAR="$(tc-getAR) cru" \
  55. -sCC="$(tc-getCC) ${CFLAGS}" \
  56. -sCCFLAGS="" \
  57. -sC++="$(tc-getCXX) ${CXXFLAGS}" \
  58. -sCXX="$(tc-getCXX) ${CXXFLAGS}" \
  59. -sC++FLAGS="" \
  60. -sGARGLKINI="${GAMES_SYSCONFDIR}/garglk.ini" \
  61. -sUSESDL=yes \
  62. -sBUNDLEFONTS=no \
  63. -dx \
  64. -j$(makeopts_jobs) || die
  65. }
  66. src_install() {
  67. DESTDIR="${D}" \
  68. _BINDIR="${GAMES_PREFIX}/libexec/${PN}" \
  69. _APPDIR="${GAMES_PREFIX}/libexec/${PN}" \
  70. _LIBDIR="$(games_get_libdir)" \
  71. EXEMODE=755 \
  72. FILEMODE=755 \
  73. jam install || die
  74. # Install config file.
  75. insinto "${GAMES_SYSCONFDIR}"
  76. newins garglk/garglk.ini garglk.ini
  77. # Install application entry and icon.
  78. domenu garglk/${PN}.desktop
  79. doicon -s 32 garglk/${PN}-house.png
  80. # Symlink binaries to avoid name clashes.
  81. for terp in advsys agility alan2 alan3 frotz geas git glulxe hugo jacl \
  82. level9 magnetic nitfol scare tadsr
  83. do
  84. dosym "${GAMES_PREFIX}/libexec/${PN}/${terp}" \
  85. "${GAMES_BINDIR}/${PN}-${terp}"
  86. done
  87. # Also symlink the main binary since it resides in libexec.
  88. dosym "${GAMES_PREFIX}/libexec/${PN}/${PN}" \
  89. "${GAMES_BINDIR}/${PN}"
  90. prepgamesdirs
  91. }
  92. pkg_preinst() {
  93. games_pkg_preinst
  94. gnome2_icon_savelist
  95. }
  96. pkg_postinst() {
  97. games_pkg_postinst
  98. gnome2_icon_cache_update
  99. }
  100. pkg_postrm() {
  101. gnome2_icon_cache_update
  102. }