732495e1c9633134e75d4ca9f0f2cb618c60131b
[gentoo.git] / games-engines / frotz / frotz-2.50_beta2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs
7
8 MY_PV="${PV/_beta/b}"
9 MY_P="${PN}-${MY_PV}"
10 DESCRIPTION="Interpreter for Z-code based text games"
11 HOMEPAGE="https://661.org/proj/if/frotz/"
12 SRC_URI="https://gitlab.com/DavidGriffith/${PN}/-/archive/${MY_PV}/${MY_P}.tar.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm ~x86"
17 IUSE="ncurses sdl sound unicode"
18 REQUIRED_USE="sound? ( || ( ncurses sdl ) )"
19
20 DEPEND="
21         ncurses? (
22                 sys-libs/ncurses:0=[unicode?]
23                 sound? (
24                         media-libs/libao
25                         media-libs/libmodplug
26                         media-libs/libsamplerate[sndfile]
27                         media-libs/libsndfile[-minimal]
28                         media-libs/libvorbis
29                 )
30         )
31         sdl? (
32                 media-libs/freetype:2
33                 media-libs/libpng:0=
34                 media-libs/libsdl2[sound,threads,video]
35                 media-libs/sdl2-mixer[mod,vorbis,wav]
36                 sys-libs/zlib
37                 virtual/jpeg:0=
38         )
39 "
40
41 RDEPEND="${DEPEND}"
42 BDEPEND="virtual/pkgconfig"
43
44 S="${WORKDIR}/${MY_P}"
45
46 PATCHES=(
47         "${FILESDIR}"/dumb-ldflags.patch
48 )
49
50 src_compile() {
51         emake \
52                 dumb \
53                 $(use ncurses && echo ncurses) \
54                 $(use sdl && echo sdl) \
55                 AR="$(tc-getAR)" \
56                 CC="$(tc-getCC)" \
57                 PKG_CONFIG="$(tc-getPKG_CONFIG)" \
58                 RANLIB="$(tc-getRANLIB)" \
59                 CURSES=$(usex unicode ncursesw ncurses) \
60                 USE_UTF8=$(usex unicode yes "") \
61                 SOUND=$(usex sound ao none) \
62                 PREFIX="${EPREFIX}/usr" \
63                 SYSCONFDIR="${EPREFIX}/etc"
64 }
65
66 src_install () {
67         emake \
68                 install_dumb \
69                 $(use ncurses && echo install) \
70                 $(use sdl && echo install_sdl) \
71                 PREFIX="${EPREFIX}/usr" \
72                 DESTDIR="${D}"
73
74         dodoc \
75                 AUTHORS ChangeLog CONTRIBUTORS DUMB HOW_TO_PLAY README TODO \
76                 doc/frotz.conf-{big,small}
77 }
78
79 pkg_postinst() {
80         echo
81         elog "Global config file can be installed in ${EPREFIX}/etc/frotz.conf"
82         elog "Sample config files are in ${EPREFIX}/usr/share/doc/${PF}"
83         echo
84 }