gargoyle: only grab the "-jN" option from MAKEOPTS and pass it to jam
[gentoo-interactive-fiction.git] / games-engines / gargoyle / gargoyle-2011.1.ebuild
Commit [+]AuthorDateLineData
57c2d7c7
NC
Nikos Chantziaras2012-03-26 00:47:02 +03001# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5# Regarding licenses: libgarglk is licensed under the GPLv2. Bundled
6# interpreters are licensed under GPLv2, BSD or MIT license, except:
7# - glulxe: custom license, see "terps/glulxle/README"
8# - hugo: custom license, see "licenses/HUGO License.txt"
9# Since we don't compile or install any of the bundled fonts, their licenses
10# don't apply. (Fonts are installed through dependencies instead.)
11
12MY_PV="2011.1"
13MY_P="${PN}-${MY_PV}"
14
15EAPI=3
16
17inherit eutils games
18
19DESCRIPTION="An Interactive Fiction (IF) player supporting all major formats"
20HOMEPAGE="http://ccxvii.net/gargoyle/"
21SRC_URI="http://garglk.googlecode.com/files/${MY_P}-sources.zip"
22
23LICENSE="BSD GPL-2 MIT Hugo Glulxe"
24SLOT="0"
25KEYWORDS="amd64 x86"
26
27RDEPEND="media-libs/freetype:2
28 virtual/jpeg
29 media-libs/libpng
30 media-fonts/liberation-fonts
31 >=media-fonts/libertine-ttf-5
32 sys-libs/zlib
33 x11-libs/gtk+:2
34 media-libs/sdl-mixer
35 media-libs/sdl-sound"
36
37DEPEND="${RDEPEND}
38 app-arch/unzip
39 dev-util/ftjam"
40
41src_prepare() {
42 # Substitute custom CFLAGS/LDFLAGS.
43 sed -i -e \
44 "/^\s*OPTIM = / {
45 s/ \(-O.*\)\? ;/ ${CFLAGS} ;/
46 a LINKFLAGS = ${LDFLAGS} ;
47 a SHRLINKFLAGS = ${LDFLAGS} ;
48 }" Jamrules || die
49
50 # Convert garglk.ini to UNIX format.
51 edos2unix garglk/garglk.ini
52
53 # The font name of Linux Libertine changed in version 5.
54 sed -i -e 's/Linux Libertine O/Linux Libertine/g' garglk/garglk.ini
55}
56
57src_compile() {
92b5f6b9 Nikos Chantziaras2012-03-27 08:41:03 +030058 local jamopts=$(echo "${MAKEOPTS}" | sed -ne "/-j/ { s/.*\(-j[[:space:]]*[0-9]\+\).*/\1/; p }")
57c2d7c7
NC
Nikos Chantziaras2012-03-26 00:47:02 +030059 jam \
60 -sGARGLKINI="${GAMES_SYSCONFDIR}/garglk.ini" \
61 -sUSESDL=yes \
62 -sBUNDLEFONTS=no \
92b5f6b9 Nikos Chantziaras2012-03-27 08:41:03 +030063 ${jamopts} || die
57c2d7c7
NC
Nikos Chantziaras2012-03-26 00:47:02 +030064}
65
66src_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
75 # Install config file.
76 insinto "${GAMES_SYSCONFDIR}"
77 newins garglk/garglk.ini garglk.ini || die
78
79 # Install application entry and icon.
80 insinto /usr/share/applications
81 doins garglk/${PN}.desktop || die
82 doicon garglk/${PN}-house.png || die
83
84 # Symlink binaries to avoid name clashes.
85 for terp in advsys agility alan2 alan3 frotz geas git glulxe hugo jacl \
86 level9 magnetic nitfol scare tadsr
87 do
88 dosym "${GAMES_PREFIX}/libexec/${PN}/${terp}" \
89 "${GAMES_BINDIR}/${PN}-${terp}" || die
90 done
91
92 # Also symlink the main binary since it resides in libexec.
93 dosym "${GAMES_PREFIX}/libexec/${PN}/${PN}" \
94 "${GAMES_BINDIR}/${PN}" || die
95
96 prepgamesdirs
97}