angband-4.0.5.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils gnome2-utils versionator games
  5. MAJOR_PV=$(get_version_component_range 1-2)
  6. DESCRIPTION="A roguelike dungeon exploration game based on the books of J.R.R. Tolkien"
  7. HOMEPAGE="http://rephial.org/"
  8. SRC_URI="http://rephial.org/downloads/${MAJOR_PV}/${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 ppc x86"
  12. IUSE="ncurses sdl +sound X"
  13. RDEPEND="X? ( x11-libs/libX11 )
  14. !ncurses? ( !X? ( !sdl? ( sys-libs/ncurses:0=[unicode] ) ) )
  15. ncurses? ( sys-libs/ncurses:0=[unicode] )
  16. sdl? ( media-libs/libsdl[video,X]
  17. media-libs/sdl-ttf
  18. media-libs/sdl-image
  19. sound? ( media-libs/sdl-mixer[mp3]
  20. media-libs/libsdl[sound] ) )"
  21. DEPEND="${RDEPEND}
  22. dev-python/docutils
  23. virtual/pkgconfig"
  24. src_prepare() {
  25. sed -i -e '/libpath/s#datarootdir#datadir#' configure.ac || die
  26. sed -i -e "/^.SILENT/d" mk/buildsys.mk.in || die
  27. sed -i -e '/^DOC =/s/=.*/=/' doc/Makefile || die
  28. if use !sound ; then
  29. sed -i -e 's/sounds//' lib/Makefile || die
  30. fi
  31. # Game constant files are now system config files in Angband, but
  32. # users will be hidden from applying updates by default
  33. {
  34. echo "CONFIG_PROTECT_MASK=\"${GAMES_SYSCONFDIR}/${PN}/customize/\""
  35. echo "CONFIG_PROTECT_MASK=\"${GAMES_SYSCONFDIR}/${PN}/gamedata/\""
  36. } > "${T}"/99${PN} || die
  37. eautoreconf
  38. }
  39. src_configure() {
  40. local myconf
  41. if use sdl; then
  42. myconf="$(use_enable sound sdl-mixer)"
  43. else
  44. myconf="--disable-sdl-mixer"
  45. fi
  46. ac_cv_path_NCURSES_CONFIG="pkg-config ncursesw" \
  47. egamesconf \
  48. --bindir="${GAMES_BINDIR}" \
  49. --with-private-dirs \
  50. $(use_enable X x11) \
  51. $(use_enable sdl) \
  52. $(use_enable ncurses curses) \
  53. $(use !sdl && use !ncurses && use !X && \
  54. echo --enable-curses) \
  55. ${myconf}
  56. }
  57. src_install() {
  58. DOCS="changes.txt faq.txt readme.txt thanks.txt" \
  59. default
  60. dohtml doc/manual.html
  61. doenvd "${T}"/99${PN}
  62. if use X || use sdl ; then
  63. if use X; then
  64. make_desktop_entry "angband -mx11" "Angband (X11)" "${PN}"
  65. fi
  66. if use sdl; then
  67. make_desktop_entry "angband -msdl" "Angband (SDL)" "${PN}"
  68. fi
  69. local s
  70. for s in 16 32 128 256 512
  71. do
  72. newicon -s ${s} lib/icons/att-${s}.png "${PN}.png"
  73. done
  74. newicon -s scalable lib/icons/att.svg "${PN}.svg"
  75. fi
  76. prepgamesdirs
  77. }
  78. pkg_preinst() {
  79. games_pkg_preinst
  80. if use X || use sdl ; then
  81. gnome2_icon_savelist
  82. fi
  83. }
  84. pkg_postinst() {
  85. echo
  86. elog "Angband now uses private savefiles instead of system-wide ones."
  87. elog "This version of Angband is not compatible with the save files"
  88. elog "of previous versions."
  89. echo
  90. games_pkg_postinst
  91. if use X || use sdl ; then
  92. gnome2_icon_cache_update
  93. fi
  94. }