| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/celestia/celestia-1.6.1.ebuild,v 1.13 2012/06/03 15:37:31 jlec Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils flag-o-matic gnome2 autotools pax-utils
|
| 8 |
|
| 9 |
DESCRIPTION="OpenGL 3D space simulator"
|
| 10 |
HOMEPAGE="http://www.shatters.net/celestia/"
|
| 11 |
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
|
| 12 |
|
| 13 |
LICENSE="GPL-2"
|
| 14 |
SLOT="0"
|
| 15 |
KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
|
| 16 |
IUSE="cairo gnome gtk nls pch theora threads"
|
| 17 |
|
| 18 |
RDEPEND="
|
| 19 |
virtual/opengl
|
| 20 |
virtual/jpeg
|
| 21 |
media-libs/libpng
|
| 22 |
<dev-lang/lua-5.2
|
| 23 |
gtk? ( !gnome? ( x11-libs/gtk+:2 >=x11-libs/gtkglext-1.0 ) )
|
| 24 |
gnome? (
|
| 25 |
x11-libs/gtk+:2
|
| 26 |
>=x11-libs/gtkglext-1.0
|
| 27 |
>=gnome-base/libgnomeui-2.0
|
| 28 |
)
|
| 29 |
!gtk? ( !gnome? ( media-libs/freeglut ) )
|
| 30 |
cairo? ( x11-libs/cairo )
|
| 31 |
theora? ( media-libs/libtheora )"
|
| 32 |
|
| 33 |
DEPEND="${RDEPEND}
|
| 34 |
virtual/pkgconfig"
|
| 35 |
|
| 36 |
pkg_setup() {
|
| 37 |
# Check for one for the following use flags to be set.
|
| 38 |
if use gnome; then
|
| 39 |
einfo "USE=\"gnome\" detected."
|
| 40 |
USE_DESTDIR="1"
|
| 41 |
CELESTIA_GUI="gnome"
|
| 42 |
elif use gtk; then
|
| 43 |
einfo "USE=\"gtk\" detected."
|
| 44 |
CELESTIA_GUI="gtk"
|
| 45 |
else
|
| 46 |
ewarn "If you want to use the full gui, set USE=\"{gnome|gtk}\""
|
| 47 |
ewarn "Defaulting to glut support (no GUI)."
|
| 48 |
CELESTIA_GUI="glut"
|
| 49 |
fi
|
| 50 |
}
|
| 51 |
|
| 52 |
src_prepare() {
|
| 53 |
# make better desktop files
|
| 54 |
epatch "${FILESDIR}"/${PN}-1.5.0-desktop.patch
|
| 55 |
# add a ~/.celestia for extra directories
|
| 56 |
epatch "${FILESDIR}"/${PN}-1.6.0-cfg.patch
|
| 57 |
# fix missing includes for gcc-4.6
|
| 58 |
epatch "${FILESDIR}"/${P}-gcc46.patch
|
| 59 |
# missing zlib.h include with libpng15
|
| 60 |
epatch "${FILESDIR}"/${P}-libpng15.patch \
|
| 61 |
"${FILESDIR}"/${P}-linking.patch
|
| 62 |
|
| 63 |
# gcc-47, #414015
|
| 64 |
epatch "${FILESDIR}"/${P}-gcc47.patch
|
| 65 |
|
| 66 |
# remove flags to let the user decide
|
| 67 |
local
|
| 68 |
for cf in -O2 -ffast-math \
|
| 69 |
-fexpensive-optimizations \
|
| 70 |
-fomit-frame-pointer; do
|
| 71 |
sed -i \
|
| 72 |
-e "s/${cf}//g" \
|
| 73 |
configure.in admin/* || die "sed failed"
|
| 74 |
done
|
| 75 |
# remove an unused gconf macro killing autoconf when no gnome
|
| 76 |
# (not needed without eautoreconf)
|
| 77 |
if ! use gnome; then
|
| 78 |
sed -i \
|
| 79 |
-e '/AM_GCONF_SOURCE_2/d' \
|
| 80 |
configure.in || die "sed failed"
|
| 81 |
fi
|
| 82 |
eautoreconf
|
| 83 |
filter-flags "-funroll-loops -frerun-loop-opt"
|
| 84 |
|
| 85 |
### This version of Celestia has a bug in the font rendering and
|
| 86 |
### requires -fsigned-char. We should be able to force this flag
|
| 87 |
### on all architectures. See bug #316573.
|
| 88 |
append-flags "-fsigned-char"
|
| 89 |
}
|
| 90 |
|
| 91 |
src_configure() {
|
| 92 |
# force lua in 1.6.1. seems to be inevitable
|
| 93 |
econf \
|
| 94 |
--disable-rpath \
|
| 95 |
--with-${CELESTIA_GUI} \
|
| 96 |
--with-lua \
|
| 97 |
$(use_enable cairo) \
|
| 98 |
$(use_enable threads threading) \
|
| 99 |
$(use_enable nls) \
|
| 100 |
$(use_enable pch) \
|
| 101 |
$(use_enable theora)
|
| 102 |
}
|
| 103 |
|
| 104 |
src_install() {
|
| 105 |
if [[ ${CELESTIA_GUI} == gnome ]]; then
|
| 106 |
gnome2_src_install
|
| 107 |
else
|
| 108 |
emake DESTDIR="${D}" install
|
| 109 |
local size
|
| 110 |
for size in 16 22 32 48 ; do
|
| 111 |
insinto /usr/share/icons/hicolor/${size}x${size}/apps
|
| 112 |
newins "${S}"/src/celestia/kde/data/hi${size}-app-${PN}.png ${PN}.png
|
| 113 |
done
|
| 114 |
fi
|
| 115 |
[[ ${CELESTIA_GUI} == glut ]] && domenu celestia.desktop
|
| 116 |
dodoc AUTHORS README TRANSLATORS *.txt
|
| 117 |
pax-mark -m "${ED}"/usr/bin/${PN} #365359
|
| 118 |
}
|