| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-games/gnome-games-3.2.1-r1.ebuild,v 1.7 2012/09/25 09:02:41 tetromino Exp $
|
| 4 |
|
| 5 |
EAPI="3"
|
| 6 |
GNOME_TARBALL_SUFFIX="xz"
|
| 7 |
GCONF_DEBUG="no"
|
| 8 |
GNOME2_LA_PUNT="yes"
|
| 9 |
WANT_AUTOMAKE="1.11"
|
| 10 |
PYTHON_DEPEND="2:2.5"
|
| 11 |
PYTHON_USE_WITH="xml"
|
| 12 |
|
| 13 |
# make sure games is inherited first so that the gnome2
|
| 14 |
# functions will be called if they are not overridden
|
| 15 |
inherit autotools games eutils gnome2 python virtualx
|
| 16 |
|
| 17 |
DESCRIPTION="Collection of games for the GNOME desktop"
|
| 18 |
HOMEPAGE="http://live.gnome.org/GnomeGames/"
|
| 19 |
|
| 20 |
LICENSE="GPL-2 GPL-3 FDL-1.1"
|
| 21 |
SLOT="0"
|
| 22 |
# TODO: file KEYWORDREQ bug once it's determined that seed is usable
|
| 23 |
KEYWORDS="~amd64 ~mips ~x86"
|
| 24 |
IUSE="artworkextra +aisleriot +clutter +introspection glchess seed +sudoku test"
|
| 25 |
|
| 26 |
COMMON_DEPEND="
|
| 27 |
>=dev-libs/dbus-glib-0.75
|
| 28 |
>=dev-libs/glib-2.25.7
|
| 29 |
>=dev-libs/libxml2-2.4.0
|
| 30 |
>=gnome-base/gconf-2.31.1
|
| 31 |
>=gnome-base/librsvg-2.32
|
| 32 |
>=x11-libs/cairo-1
|
| 33 |
>=x11-libs/gtk+-2.91.7:3[introspection?]
|
| 34 |
|
| 35 |
media-libs/libcanberra[gtk3]
|
| 36 |
x11-libs/libSM
|
| 37 |
|
| 38 |
artworkextra? ( >=gnome-extra/gnome-games-extra-data-3.0.0 )
|
| 39 |
clutter? (
|
| 40 |
>=dev-libs/gobject-introspection-0.6.3
|
| 41 |
>=x11-libs/gtk+-2.90:3[introspection]
|
| 42 |
>=gnome-base/gconf-2.31.1[introspection]
|
| 43 |
>=media-libs/clutter-gtk-0.91.6:1.0[introspection]
|
| 44 |
seed? ( >=dev-libs/seed-2.91.90 ) )
|
| 45 |
introspection? (
|
| 46 |
>=dev-libs/gobject-introspection-0.6.3
|
| 47 |
media-libs/clutter:1.0[introspection] )
|
| 48 |
glchess? (
|
| 49 |
dev-db/sqlite:3
|
| 50 |
>=gnome-base/librsvg-2.32
|
| 51 |
virtual/glu
|
| 52 |
virtual/opengl
|
| 53 |
x11-libs/libX11 )"
|
| 54 |
RDEPEND="${COMMON_DEPEND}
|
| 55 |
sudoku? (
|
| 56 |
|| (
|
| 57 |
dev-python/pygobject:3[cairo]
|
| 58 |
>=dev-python/pygobject-2.28.3:2[cairo,introspection] )
|
| 59 |
dev-python/pycairo
|
| 60 |
x11-libs/gdk-pixbuf:2[introspection]
|
| 61 |
x11-libs/pango[introspection]
|
| 62 |
>=x11-libs/gtk+-3.0.0:3[introspection] )
|
| 63 |
|
| 64 |
!<gnome-extra/gnome-games-extra-data-3.0.0"
|
| 65 |
DEPEND="${COMMON_DEPEND}
|
| 66 |
glchess? ( >=dev-lang/vala-0.13.0:0.14 )
|
| 67 |
virtual/pkgconfig
|
| 68 |
>=dev-util/intltool-0.40.4
|
| 69 |
>=sys-devel/gettext-0.10.40
|
| 70 |
>=gnome-base/gnome-common-2.12.0
|
| 71 |
>=app-text/scrollkeeper-0.3.8
|
| 72 |
>=app-text/gnome-doc-utils-0.10
|
| 73 |
test? ( >=dev-libs/check-0.9.4 )"
|
| 74 |
|
| 75 |
# For compatibility with older versions of the gnome-games package
|
| 76 |
PDEPEND="aisleriot? ( games-board/aisleriot )"
|
| 77 |
|
| 78 |
# Others are installed below; multiples in this package.
|
| 79 |
DOCS="AUTHORS HACKING MAINTAINERS TODO"
|
| 80 |
|
| 81 |
_omitgame() {
|
| 82 |
G2CONF="${G2CONF},${1}"
|
| 83 |
}
|
| 84 |
|
| 85 |
pkg_setup() {
|
| 86 |
# create the games user / group
|
| 87 |
games_pkg_setup
|
| 88 |
|
| 89 |
python_set_active_version 2
|
| 90 |
python_pkg_setup
|
| 91 |
|
| 92 |
G2CONF="${G2CONF}
|
| 93 |
--disable-silent-rules
|
| 94 |
--disable-schemas-compile
|
| 95 |
--disable-static
|
| 96 |
--enable-sound
|
| 97 |
$(use_enable introspection)"
|
| 98 |
|
| 99 |
# Should be after $(use_enable introspection), but before --enable-omitgames
|
| 100 |
use clutter && G2CONF="${G2CONF} --enable-introspection"
|
| 101 |
|
| 102 |
use glchess && G2CONF="${G2CONF} VALAC=$(type -p valac-0.14)"
|
| 103 |
|
| 104 |
# Staging games are needed for swell-foop and lightsoff
|
| 105 |
G2CONF="${G2CONF}
|
| 106 |
--enable-staging
|
| 107 |
--with-scores-group=${GAMES_GROUP}
|
| 108 |
--with-platform=gnome
|
| 109 |
--with-smclient
|
| 110 |
--with-gtk=3.0
|
| 111 |
--enable-omitgames=none" # This line should be last for _omitgame
|
| 112 |
|
| 113 |
# FIXME: Use REQUIRED_USE once games.eclass is ported to EAPI 4
|
| 114 |
if ! use clutter; then
|
| 115 |
ewarn "USE='-clutter' => quadrapassel, swell-foop, lightsoff, gnibbles won't be installed"
|
| 116 |
_omitgame quadrapassel
|
| 117 |
_omitgame gnibbles
|
| 118 |
_omitgame swell-foop
|
| 119 |
_omitgame lightsoff
|
| 120 |
use seed && ewarn "USE='seed' has no effect with USE='-clutter'"
|
| 121 |
elif ! use seed; then
|
| 122 |
ewarn "USE='-seed' => swell-foop, lightsoff won't be installed"
|
| 123 |
_omitgame swell-foop
|
| 124 |
_omitgame lightsoff
|
| 125 |
fi
|
| 126 |
|
| 127 |
if ! use glchess; then
|
| 128 |
_omitgame glchess
|
| 129 |
fi
|
| 130 |
|
| 131 |
if ! use sudoku; then
|
| 132 |
_omitgame gnome-sudoku
|
| 133 |
fi
|
| 134 |
}
|
| 135 |
|
| 136 |
src_prepare() {
|
| 137 |
use sudoku && python_convert_shebangs -r 2 gnome-sudoku/src
|
| 138 |
|
| 139 |
# TODO: File upstream bug for this
|
| 140 |
epatch "${FILESDIR}/${PN}-2.91.90-fix-conditional-ac-prog-cxx.patch"
|
| 141 |
|
| 142 |
# Without this, --enable-staging enables all those games unconditionally
|
| 143 |
epatch "${FILESDIR}/${PN}-fix-staging-games.patch"
|
| 144 |
|
| 145 |
# gnome-sudoku patch, will be in next release
|
| 146 |
epatch "${FILESDIR}/${P}-sudoku-borders.patch"
|
| 147 |
|
| 148 |
# patch from upstream git master fixing sudoku with pygobject-3.0.3, #397501
|
| 149 |
epatch "${FILESDIR}/${P}-pygobject-3.0.3.patch"
|
| 150 |
|
| 151 |
eautoreconf
|
| 152 |
|
| 153 |
# disable pyc compiling
|
| 154 |
echo > py-compile
|
| 155 |
|
| 156 |
gnome2_src_prepare
|
| 157 |
}
|
| 158 |
|
| 159 |
src_test() {
|
| 160 |
Xemake check || die "tests failed"
|
| 161 |
}
|
| 162 |
|
| 163 |
src_install() {
|
| 164 |
gnome2_src_install
|
| 165 |
|
| 166 |
# Documentation install for each of the games
|
| 167 |
for game in \
|
| 168 |
$(find . -maxdepth 1 -type d ! -name po ! -name libgames-support); do
|
| 169 |
docinto ${game}
|
| 170 |
for doc in AUTHORS ChangeLog NEWS README TODO; do
|
| 171 |
[ -s ${game}/${doc} ] && dodoc ${game}/${doc}
|
| 172 |
done
|
| 173 |
done
|
| 174 |
}
|
| 175 |
|
| 176 |
pkg_preinst() {
|
| 177 |
gnome2_pkg_preinst
|
| 178 |
# Avoid overwriting previous .scores files
|
| 179 |
local basefile
|
| 180 |
for scorefile in "${ED}"/var/lib/games/*.scores; do
|
| 181 |
basefile=$(basename $scorefile)
|
| 182 |
if [ -s "${EROOT}/var/lib/games/${basefile}" ]; then
|
| 183 |
cp "${EROOT}/var/lib/games/${basefile}" \
|
| 184 |
"${ED}/var/lib/games/${basefile}"
|
| 185 |
fi
|
| 186 |
done
|
| 187 |
}
|
| 188 |
|
| 189 |
pkg_postinst() {
|
| 190 |
games_pkg_postinst
|
| 191 |
gnome2_pkg_postinst
|
| 192 |
python_need_rebuild
|
| 193 |
use sudoku && python_mod_optimize gnome_sudoku
|
| 194 |
}
|
| 195 |
|
| 196 |
pkg_postrm() {
|
| 197 |
gnome2_pkg_postrm
|
| 198 |
python_mod_cleanup gnome_sudoku
|
| 199 |
}
|