diff options
author | Alastair Tse <liquidx@gentoo.org> | 2003-06-18 23:40:44 +0000 |
---|---|---|
committer | Alastair Tse <liquidx@gentoo.org> | 2003-06-18 23:40:44 +0000 |
commit | 878e05bb245e45924b171b178d7c01321e1e4ee3 (patch) | |
tree | 33894eea2a622c2dd389a1d0d62f9f5991f6f0fc /eclass/gtk-engines2.eclass | |
parent | manifest fix (diff) | |
download | gentoo-2-878e05bb245e45924b171b178d7c01321e1e4ee3.tar.gz gentoo-2-878e05bb245e45924b171b178d7c01321e1e4ee3.tar.bz2 gentoo-2-878e05bb245e45924b171b178d7c01321e1e4ee3.zip |
re-write of the gtk-engines2 eclass. read the actual eclass for more reasons
Diffstat (limited to 'eclass/gtk-engines2.eclass')
-rw-r--r-- | eclass/gtk-engines2.eclass | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/eclass/gtk-engines2.eclass b/eclass/gtk-engines2.eclass new file mode 100644 index 000000000000..46f352d45928 --- /dev/null +++ b/eclass/gtk-engines2.eclass @@ -0,0 +1,122 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/gtk-engines2.eclass,v 1.1 2003/06/18 23:40:44 liquidx Exp $ + +# This is a utility eclass for installing GTK+ Theme Engines. It detects +# whether gtk+-1 and/or gtk+-2 is installed and sets up variables to help with +# installing the engines into the right position. +# +# Variables it sets are : +# +# HAS_GTK1 / HAS_GTK2 -- simply if GTK+1 or GTK+2 is installed +# GTK1_ENGINES_DIR -- directory where gtk+1 engines are installed +# GTK2_ENGINES_DIR -- directory where gtk+2 engines are installed +# +# *** NOTE *** If your engine has both GTK+1 and GTK+2 versions : +# +# Set the following variables if they are in different directories: +# +# GTK1_S -- GTK+1 Source Directory +# GTK2_S -- GTK+2 Source Directory +# +# Also note you should not set DEPEND and let the eclass set the dependencies +# +# Comments: +# +# Most theme engines include ./configure scripts that solve most of the +# path problems. Sometimes there are certain versions that have trouble +# with paths. If they do, then you can use the above variables +# +# We do not employ USE flags "gtk" and "gtk2" because they are unsuitable +# in this case. We install the whole package of themes available, both +# GTK+1 and GTK+2 if available. We assume that the user would want both +# since the space savings are negligible. +# +# Note that this deals specifically with GTK ENGINES and not GTK THEMES. Some +# engines have themes that accompany them, and they are thus installed. You +# should not be using this eclass (it won't help anyway) if you are making +# a pure GTK+ theme ebuild. +# +# - liquidx@gentoo.org (16 Jun 2003) + +ECLASS="gtk-engines2" +INHERITED="$INHERITED $ECLASS" + +DESCRIPTION="GTK+1/2 ${PN/gtk-engines-} Theme Engine" +HOMEPAGE="http://art.gnome.org/ http://themes.freshmeat.net/" + +# --- here we define some useful variables for gtk-engines installation + +if has_version "=x11-libs/gtk+-1.2*"; then + HAS_GTK1=1 + GTK1_ENGINES_DIR=/usr/lib/gtk/themes/engines +fi + +if has_version ">=x11-libs/gtk+-2" || use gtk2; then + HAS_GTK2=1 + GTK2_FULL_VER=$(pkg-config gtk+-2.0 --modversion) + GTK2_MAJOR_VER=${GTK2_FULL_VER%.*}.0 + GTK2_ENGINES_DIR=/usr/lib/gtk-2.0/${GTK2_MAJOR_VER}/engines +fi + +# --- if we don't have any gtk version, we depend on USE flags to tell us +# --- which one to use. otherwise, we don't add any deps. make the ebuild +# --- tell us what DEPEND it wants. + +if ! has_version "x11-libs/gtk+"; then + use gtk2 \ + && newdepend ">=x11-libs/gtk+-2" \ + || newdepend "=x11-libs/gtk+-1.2*" +fi + +# --- if GTK1_S and GTK2_S is set, then we do both themes, +# --- otherwise, just do the normal src_compile/install wrap. + +gtk-engines2_src_compile() { + + if [ -n "${GTK2_S}" -a -n "${GTK1_S}" ]; then + if [ -n "${HAS_GTK2}" ]; then + cd ${GTK2_S} + econf || die "gtk2 configure failed" + emake || die "gtk2 make failed" + fi + if [ -n "${HAS_GTK1}" ]; then + cd ${GTK1_S} + econf || die "gtk1 configure failed" + emake || die "gtk1 make failed" + fi + else + cd ${S} + econf ${@} || die "configure failed" + emake || make || die "make failed" + fi +} + +DEFAULT_DOCS="COPYING README NEWS AUTHORS ChangeLog INSTALL" + +gtk-engines2_src_install() { + + if [ -n "${GTK2_S}" -a -n "${GTK1_S}" ]; then + if [ -n "${HAS_GTK2}" ]; then + cd ${GTK2_S} + make DESTDIR=${D} install || die "gtk2 install failed" + for x in ${DEFAULT_DOCS} ${DOCS}; do + newdoc ${x} ${x}.gtk2 + done + fi + if [ -n "${HAS_GTK1}" ]; then + cd ${GTK1_S} + make DESTDIR=${D} install || die "gtk1 install failed" + for x in ${DEFAULT_DOCS} ${DOCS}; do + newdoc ${x} ${x}.gtk1 + done + fi + else + cd ${S} + make DESTDIR=${D} ${@} install || die "install failed" + dodoc ${DEFAULT_DOCS} ${DOCS} + fi +} + +EXPORT_FUNCTIONS src_compile src_install + |