summaryrefslogtreecommitdiff
blob: ad906d98acf205eef1b74222b5e9ec268a87f637 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/widelands/widelands-0.0.9.5-r1.ebuild,v 1.1 2006/03/21 21:57:17 jokey Exp $

inherit eutils games subversion

DESCRIPTION="A game similar to Settlers 2"
HOMEPAGE="http://widelands.sourceforge.net/"
#SRC_URI="mirror://sourceforge/${PN}/${PN}-b${PV:4:1}half-source.tar.bz2"
#ECVS_SERVER="widelands.cvs.sourceforge.net:/cvsroot/widelands"
#ECVS_MODULE="widelands"
ESVN_REPO_URI="https://svn.sourceforge.net/svnroot/widelands/trunk"

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

DEPEND="media-libs/libpng
	media-libs/libsdl
	media-libs/sdl-image
	media-libs/sdl-mixer
	media-libs/sdl-net
	media-libs/sdl-ttf
	sys-libs/zlib
	dev-util/scons
	ggz? ( dev-games/libggz )"
RDEPEND=${DEPEND}

src_compile() {
	# sandbox fixing
	sed -i -e "s:SetOption('implicit_cache', 1):\0\nenv = Environment()\nenv.SConsignFile():" SConstruct

	# gentoo users can set build flags themselves
	sed -i -e "s:, '-ffast-math', '-funroll-loops'::" \
		-e "s:-fexpensive-optimizations:${CXXFLAGS--O2}:" -e "s:-O3::" \
		-e "s:LINKFLAGS='-s':LINKFLAGS='${LDFLAGS}':" -e "s:-O0::" \
		SConstruct
	sed -i "s:LOCALE_PATH \"locale\":LOCALE_PATH \"${GAMES_DATADIR}/${PN}/locale\":" src/constants.h
	use nls && sed -i "s:locale/??_??:locale:" SConstruct

	use debug && sconsopts="build=debug" || sconsopts="build=release"
	use ggz && sconsopts="${sconsopts} use_ggz=1"
	scons ${sconsopts} || die "scons ${sconsopts} failed"

	if use nls; then
		cd ${S}/locale
		../utils/buildcat.py
		rm SConscript *.p* .cvsignore
	fi
}

src_install() {
	scons install_prefix=${D}/usr \
		datadir=${D}${GAMES_DATADIR}/${PN} \
		bindir=${D}${GAMES_BINDIR} \
		install || die "scons install failed"
	dodoc CREDITS ChangeLog README.developers

	newicon pics/wl-ico-48.png widelands.png
	make_desktop_entry widelands Widelands widelands.png
	prepgamesdirs
}