1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 # add sound support (no sound files)
9 VIRTUALX_REQUIRED="manual"
10 inherit eutils gnome2-utils toolchain-funcs games
12 MY_P="stone_soup-${PV}"
13 DESCRIPTION="Dungeon Crawl Stone Soup is a role-playing roguelike game of exploration and treasure-hunting in dungeons"
14 HOMEPAGE="http://crawl.develz.org/wordpress/"
15 SRC_URI="https://crawl.develz.org/release/stone_soup-${PV}.tar.xz
16 https://dev.gentoo.org/~hasufell/distfiles/${PN}.png
17 https://dev.gentoo.org/~hasufell/distfiles/${PN}.svg"
19 # 3-clause BSD: mt19937ar.cc, MSVC/stdint.h
20 # 2-clause BSD: all contributions by Steve Noonan and Jesse Luehrs
21 # Public Domain|CC0: most of tiles
22 # MIT: json.cc/json.h, some .js files in webserver/static/scripts/contrib/
23 LICENSE="GPL-2 BSD BSD-2 public-domain CC0-1.0 MIT"
25 KEYWORDS="~amd64 ~x86"
26 IUSE="debug luajit ncurses test +tiles"
28 # see https://crawl.develz.org/mantis/view.php?id=6121
33 luajit? ( >=dev-lang/luajit-2.0.0 )
35 !ncurses? ( !tiles? ( sys-libs/ncurses ) )
36 ncurses? ( sys-libs/ncurses )
41 media-libs/libsdl2[opengl,video]
42 media-libs/sdl2-image[png]
55 S=${WORKDIR}/${MY_P}/source
56 S_TEST=${WORKDIR}/${MY_P}_test/source
60 if use !ncurses && use !tiles ; then
61 ewarn "Neither ncurses nor tiles frontend"
62 ewarn "selected, choosing ncurses only."
63 ewarn "Note that you can also enable both."
68 epatch "${FILESDIR}"/${P}-respect-flags-and-compiler.patch \
69 "${FILESDIR}"/${P}-Use-pkg-config-for-linking-to-ncurses.patch
71 rm -r contrib/{fonts,freetype,libpng,pcre,sdl2,sdl2-image,sdl2-mixer,sqlite,zlib} || die
75 export HOSTCXX=$(tc-getBUILD_CXX)
77 # leave DATADIR at the top
79 $(usex luajit "" "BUILD_LUA=yes") # luajit is not bundled
80 USE_LUAJIT=$(usex luajit "yes" "")
81 DATADIR="${GAMES_DATADIR}/${PN}"
83 prefix="${GAMES_PREFIX}"
85 $(usex debug "FULLDEBUG=y DEBUG=y" "")
86 CFOPTIMIZE="${CXXFLAGS}"
88 MAKEOPTS="${MAKEOPTS}"
90 RANLIB="$(tc-getRANLIB)"
93 PKGCONFIG="$(tc-getPKG_CONFIG)"
97 if use ncurses || (use !ncurses && use !tiles) ; then
98 emake "${myemakeargs[@]}"
99 # move it in case we build both variants
100 use tiles && { mv crawl "${WORKDIR}"/crawl-ncurses || die ;}
105 emake "${myemakeargs[@]}" "TILES=y"
110 emake "${myemakeargs[@]}" $(usex tiles "TILES=y" "") DESTDIR="${D}" prefix_fp="" bin_prefix="${D}${GAMES_BINDIR}" install
111 [[ -e "${WORKDIR}"/crawl-ncurses ]] && dogamesbin "${WORKDIR}"/crawl-ncurses
113 # don't relocate docs, needed at runtime
114 rm -rf "${D}${GAMES_DATADIR}"/${PN}/docs/license
115 dodoc "${WORKDIR}"/${MY_P}/README.{txt,pdf}
117 # icons and menu for graphical build
119 doicon -s 48 "${DISTDIR}"/${PN}.png
120 doicon -s scalable "${DISTDIR}"/${PN}.svg
121 make_desktop_entry crawl
134 gnome2_icon_cache_update
136 if use tiles && use ncurses ; then
137 elog "Since you have enabled both tiles and ncurses frontends"
138 elog "the ncurses binary is called 'crawl-ncurses' and the"
139 elog "tiles binary is called 'crawl'."
144 gnome2_icon_cache_update