summaryrefslogtreecommitdiff
blob: a8d5dde8309032bfd765e41c9047e4882f69a921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-puzzle/enigma/enigma-0.92.ebuild,v 1.3 2006/10/05 18:11:51 nyhm Exp $

inherit eutils games

DESCRIPTION="puzzle game similar to Oxyd"
HOMEPAGE="http://www.nongnu.org/enigma/"
SRC_URI="http://savannah.nongnu.org/download/enigma/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ppc ~sparc x86"
IUSE="nls"

RDEPEND="media-libs/sdl-ttf
	>=media-libs/libsdl-1.2.0
	>=media-libs/sdl-mixer-1.2.4
	>=media-libs/sdl-image-1.2.0
	>=dev-lang/lua-4.0
	nls? ( virtual/libintl )"
DEPEND="${RDEPEND}
	nls? ( sys-devel/gettext )"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# fix up the locale install location
	if use nls ; then
		sed -i \
			-e "/^datadir/s:=.*:= /usr/share:" \
			po/Makefile.in.in \
			src/Makefile.am \
			|| die "sed failed"
	fi

	# thanks, we'll handle the doc install ourselves.
	sed -i \
		-e 's/: install-docDATA/:/' \
		-e '/^SUBDIRS/s/doc//' Makefile.in \
		|| die "sed failed"

	epatch "${FILESDIR}"/${P}-gcc41.patch
}

src_compile() {
	egamesconf \
		--disable-dependency-tracking \
		--enable-optimize \
		$(use_enable nls) \
		|| die
	emake || die "emake failed"
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed"
	mv "${D}/${GAMES_PREFIX}/share/"* "${D}/usr/share/"
	rm -r "${D}/${GAMES_PREFIX}/share"
	dodoc NEWS README AUTHORS ChangeLog \
		doc/{TODO,CREATING-LEVELS,HACKING}
	dohtml -r doc/*
	doman doc/enigma.6
	prepgamesdirs
}