summaryrefslogtreecommitdiff
path: root/games-strategy/spring/spring-0.82.7.1-r1.ebuild
blob: 6704e0cf12e5f85f11f8331a4cc830a2c82b6f14 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit cmake-utils eutils fdo-mime flag-o-matic games

DESCRIPTION="a 3D multiplayer real time strategy game engine"
HOMEPAGE="http://springrts.com"
SRC_URI="mirror://sourceforge/springrts/${PF/-/_}_src.tar.lzma"
S="${WORKDIR}/${PF/-/_}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="debug java custom-cflags gml headless"
RESTRICT="nomirror"

RDEPEND="
	>=dev-libs/boost-1.35
	media-libs/devil[jpeg,png,opengl]
	>=media-libs/freetype-2.0.0
	>=media-libs/glew-1.4
	>=media-libs/libsdl-1.2.0[X,opengl]
	media-libs/openal
	sys-libs/zlib
	virtual/glu
	virtual/opengl
	java? ( virtual/jdk )
"

DEPEND="${RDEPEND}
	>=sys-devel/gcc-4.1
	app-arch/p7zip
	>=dev-util/cmake-2.6.0
"
### gcc 4.4 dependency is bad, but 4.3 causes desync problems

### where to place content files which change each spring release (as opposed to mods, ota-content which go somewhere else)
VERSION_DATADIR="${GAMES_DATADIR}/${PN}"

src_prepare() {
	if ! use gml ; then
		epatch "${FILESDIR}/no_gml.patch"
	fi


	if ! use headless ; then
		epatch "${FILESDIR}/no_headless.patch"
	fi
	cd AI/Skirmish
	git clone git://github.com/Tarendai/Shard.git
	cd ../..
}

src_configure() {
	if ! use custom-cflags ; then
		strip-flags
	else
		mycmakeargs="${mycmakeargs} -DMARCH_FLAG=$(get-flag march)"
	fi

	if ! use java ; then
		mycmakeargs="${mycmakeargs} -DAIINTERFACES=NATIVE"
	fi

	LIBDIR="$(games_get_libdir)"
	mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=/usr -DBINDIR=${GAMES_BINDIR#/usr/} -DLIBDIR=${LIBDIR#/usr/} -DDATADIR=${VERSION_DATADIR#/usr/}"
	if use debug ; then
		CMAKE_BUILD_TYPE="DEBUG"
	else
		CMAKE_BUILD_TYPE="RELEASE"
	fi

	cmake-utils_src_configure
}

src_compile () {
	cmake-utils_src_compile
}

src_install () {
	cmake-utils_src_install

	prepgamesdirs

	if use custom-cflags ; then
		ewarn "You decided to use custom CFLAGS. This may be save, or it may cause your computer to desync more or less often. If you experience desyncs, disable it before doing any bugreport. If you don't know what you are doing, *disable custom-cflags*."
	fi
}

pkg_postinst() {
	fdo-mime_mime_database_update
	games_pkg_postinst
}