summaryrefslogtreecommitdiff
blob: b58d938e738723fb60c1f19b057d93e6e6d215ef (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-misc/gaia/gaia-0.1.1.ebuild,v 1.1 2006/12/04 10:25:46 opfer Exp $

inherit eutils

DESCRIPTION="opensource 3D interface to the planet, based on NASA World Wind data"
HOMEPAGE="http://gaia.serezhkin.com/
	https://sourceforge.net/projects/gaia-clean"
SRC_URI="mirror://sourceforge/gaia-clean/${P}.tar.bz2"


SLOT="0"
LICENSE="GPL-2"

IUSE="gps doc"
KEYWORDS="~amd64 ~ppc ~x86"

RDEPEND="media-libs/jpeg
	media-libs/libpng
	>=media-libs/libsdl-1.2
	net-misc/curl
	virtual/opengl
	gps? ( sci-geosciences/gpsd )
	doc? ( app-doc/doxygen )"

DEPEND="${RDEPEND}
	dev-util/scons"

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

	# This fixes a sandbox violation
	sed -i "/PREFIX\/share\/gaia/a\SConsignFile()" SConstruct

	# the doxygen instructions have the wrong input path
	use doc && epatch "${FILESDIR}/${P}-correct_doxygen_path.patch"

	# the binary would fail with a wrong hard coded path for font.png
	cd "${S}/programs/gaia/"
	epatch "${FILESDIR}/${P}-font_inclusion.patch"
}

src_compile() {
	# Due to an error in the build script, the variable CCFLAGS is expected,
	# setting it here is simpler than patching
	export CCFLAGS=${CFLAGS}
	# respect variables from the environment
	local myconf="use_env=yes"

	if use gps; then
		myconf="${myconf} gpsd=yes"
	fi

	scons ${MAKEOPTS} ${myconf} || die

	use doc && doxygen
}

src_install() {
	dodir /usr/bin
	dodir /usr/share/gaia/

	dodoc TODO README

	if use doc; then
		rm ${S}/doc/html/*.md5
		insinto /usr/share/doc/${P}/html/
		doins ${S}/doc/html/*
	fi

	# local defines if there is installation requested, while prefix determines the
	# target 
	scons local=no  prefix="${D}/usr" install
}

pkg_postinst() {
	einfo
	einfo "please set color depth of X11 to 24 or 32 bpp"
	einfo
}