diff options
author | Chris Gianelloni <wolf31o2@gentoo.org> | 2006-10-18 22:47:14 +0000 |
---|---|---|
committer | Chris Gianelloni <wolf31o2@gentoo.org> | 2006-10-18 22:47:14 +0000 |
commit | a62d2479f8002fb8e41b682e063dbaed44ba86ca (patch) | |
tree | 7470bbbb187cfd7eb8911a673630c895b1fa55b6 /eclass/games.eclass | |
parent | Make jpeg support being always built, as intended by Doug. (diff) | |
download | historical-a62d2479f8002fb8e41b682e063dbaed44ba86ca.tar.gz historical-a62d2479f8002fb8e41b682e063dbaed44ba86ca.tar.bz2 historical-a62d2479f8002fb8e41b682e063dbaed44ba86ca.zip |
Added games_link_mods for the upcoming games-mods.eclass and also added multilib capabilities for bug #137997.
Diffstat (limited to 'eclass/games.eclass')
-rw-r--r-- | eclass/games.eclass | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/eclass/games.eclass b/eclass/games.eclass index 00d172be91af..41296e3ddc32 100644 --- a/eclass/games.eclass +++ b/eclass/games.eclass @@ -1,17 +1,19 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.115 2006/10/17 23:09:19 vapier Exp $ -# +# $Header: /var/cvsroot/gentoo-x86/eclass/games.eclass,v 1.116 2006/10/18 22:47:14 wolf31o2 Exp $ + # devlist: {vapier,wolf31o2,mr_bones_}@gentoo.org -> games@gentoo.org # # This is the games eclass for standardizing the install of games ... # you better have a *good* reason why you're *not* using games.eclass -# in a games ebuild +# in a games-* ebuild -inherit eutils +inherit multilib eutils EXPORT_FUNCTIONS pkg_preinst pkg_postinst src_compile pkg_setup +[[ -z ${GAME} ]] && GAME=${PN%%-*} + DESCRIPTION="Based on the ${ECLASS} eclass" export GAMES_PREFIX=${GAMES_PREFIX:-/usr/games} @@ -21,7 +23,7 @@ export GAMES_DATADIR_BASE=${GAMES_DATADIR_BASE:-/usr/share} # some packages auto export GAMES_SYSCONFDIR=${GAMES_SYSCONFDIR:-/etc/games} export GAMES_STATEDIR=${GAMES_STATEDIR:-/var/games} export GAMES_LOGDIR=${GAMES_LOGDIR:-/var/log/games} -export GAMES_LIBDIR=${GAMES_LIBDIR:-/usr/games/lib} +export GAMES_LIBDIR=${GAMES_LIBDIR:-/usr/games/$(get_libdir)} export GAMES_BINDIR=${GAMES_BINDIR:-/usr/games/bin} export GAMES_ENVD="90games" # if you want to use a different user/group than games.games, @@ -99,8 +101,25 @@ prepgamesdirs() { } gamesenv() { + # As much as I hate doing this, we need to be a bit more flexibility with + # our library directories. + if has_multilib_profile + then + GAMES_LIBDIRS= + for libdir in $(get_all_libdirs) + do + if [[ -z "${libdir}" ]] + then + GAMES_LIBDIRS=${GAMES_PREFIX}/${libdir} + else + GAMES_LIBDIRS="${GAMES_LIBDIR}:${GAMES_PREFIX}/${libdir}" + fi + done + else + GAMES_LIBDIRS=${GAMES_LIBDIR} + fi cat <<-EOF > "${ROOT}"/etc/env.d/${GAMES_ENVD} - LDPATH="${GAMES_LIBDIR}" + LDPATH="${GAMES_LIBDIRS}" PATH="${GAMES_BINDIR}" EOF } @@ -205,3 +224,18 @@ games_umod_unpack() { rm -f "${Ddir}"/System/{ucc-bin,{Manifest,Def{ault,User},User,UT200{3,4}}.ini,{Engine,Core,zlib,ogg,vorbis}.so,{Engine,Core}.int,ucc.log} &>/dev/null \ || die "Removing temporary files" } + +# Link mods created by games-mods.eclass into the GAMES_PREFIX_OPT directories +# so they can be found by binary versions of the games. +games_link_mods() { + if [[ -e "${GAMES_DATADIR}"/"${GAME}" ]] ; then + cd "${GAMES_DATADIR}"/"${GAME}" + for mod in $(find . -type d | cut -b3-) + do + if [[ ! -e "${Ddir}"/"${mod}" ]] ; then + elog "Creating symlink for ${mod}" + dosym "${GAMES_DATADIR}"/${GAME}/${mod} "${dir}"/${mod} || die + fi + done + fi +} |