grotesque: Convert Python shebangs, use games.eclass, revbump
[gentoo-interactive-fiction.git] / dev-games / xglk / xglk-0.4.11-r1.ebuild
blobd14f6bd694451648a124e3fd43daefb95ef367f1
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 inherit eutils autotools
7 MY_P=${P//./}
8 DESCRIPTION="An X Window implementation of the Glk API"
9 HOMEPAGE="http://www.eblong.com/zarf/glk/"
10 SRC_URI="mirror://ifarchive/programming/glk/implementations/${MY_P}.tar.Z
11 mirror://ifarchive/programming/glk/implementations/patches/xglk0411-sdl-mixer-sound.tgz"
13 LICENSE="Zarf"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="jpeg png sdl"
18 RDEPEND="x11-libs/libX11
19 jpeg? ( media-libs/jpeg )
20 png? ( media-libs/libpng )
21 sdl? ( media-libs/libsdl
22 media-libs/sdl-mixer )"
23 DEPEND="${RDEPEND}
24 >=dev-games/glk-headers-0.7.0-r1
25 dev-util/pkgconfig"
27 S=${WORKDIR}/${PN}
29 src_unpack() {
30 unpack ${A}
31 cd "${S}"
33 epatch ../xglk-sdl-mixer-24bit-sanity.diff
34 epatch "${FILESDIR}"/xglk-0.4.11-64bit.patch
35 epatch "${FILESDIR}"/xglk-0.4.11-optional-sdl.patch
36 epatch "${FILESDIR}"/xglk-0.4.11-r1-garglk-extensions.patch
38 cp "${FILESDIR}"/xglk-0.4.11-configure.ac configure.ac || die "cp configure.ac failed"
39 cp "${FILESDIR}"/xglk-0.4.11-Makefile.am Makefile.am || die "cp Makefile.am failed"
40 sed -i -e "s,@PV@,${PV}," configure.ac || die "sed failed"
41 eautoreconf
43 rm glk.h gi_blorb.h gi_dispa.h glkstart.h || die "rm glk headers failed"
46 src_compile() {
47 econf $(use_with jpeg) \
48 $(use_with png) \
49 $(use_with sdl) || die "econf failed"
50 emake || die "emake failed"
53 src_install() {
54 emake DESTDIR="${D}" install || die "emake install failed"
55 dodoc PREFS README TODO || die "dodoc failed"
57 insinto /etc/glkloader.d
58 cat >"${T}"/xglk.rc <<-EOF
59 [X]
60 path = /usr/$(get_libdir)/libxglk.so
61 EOF
62 doins "${T}"/xglk.rc || die "doins xglk.rc failed"