/[gentoo-x86]/eclass/gtk-engines2.eclass
Gentoo

Contents of /eclass/gtk-engines2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Mon Nov 30 04:19:36 2009 UTC (4 years, 9 months ago) by abcd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +1 -1 lines
FILE REMOVED
Remove eclasses that have been marked as deprecated for >=2 years; schedule other deprecated eclasses for removal

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/gtk-engines2.eclass,v 1.16 2008/02/10 14:47:14 eva Exp $
4
5 # IMPORTANT:
6 # This eclass is deprecated and should not be used in new ebuilds.
7
8 # Author: Alastair Tse <liquidx@gentoo.org>
9 #
10 # This is a utility eclass for installing GTK+ Theme Engines. It detects
11 # whether gtk+-1 and/or gtk+-2 is installed and sets up variables to help with
12 # installing the engines into the right position.
13 #
14 # Variables it sets are :
15 #
16 # HAS_GTK1 / HAS_GTK2 -- simply if GTK+1 or GTK+2 is installed
17 # GTK1_ENGINES_DIR -- directory where gtk+1 engines are installed
18 # GTK2_ENGINES_DIR -- directory where gtk+2 engines are installed
19 #
20 # *** NOTE *** If your engine has both GTK+1 and GTK+2 versions :
21 #
22 # Set the following variables if they are in different directories:
23 #
24 # GTK1_S -- GTK+1 Source Directory
25 # GTK2_S -- GTK+2 Source Directory
26 #
27 # Also note you should not set DEPEND and let the eclass set the dependencies
28 #
29 # Comments:
30 #
31 # Most theme engines include ./configure scripts that solve most of the
32 # path problems. Sometimes there are certain versions that have trouble
33 # with paths. If they do, then you can use the above variables
34 #
35 # We do not employ USE flags "gtk" and "gtk2" because they are unsuitable
36 # in this case. We install the whole package of themes available, both
37 # GTK+1 and GTK+2 if available. We assume that the user would want both
38 # since the space savings are negligible.
39 #
40 # Note that this deals specifically with GTK ENGINES and not GTK THEMES. Some
41 # engines have themes that accompany them, and they are thus installed. You
42 # should not be using this eclass (it won't help anyway) if you are making
43 # a pure GTK+ theme ebuild.
44 #
45 # - liquidx@gentoo.org (16 Jun 2003)
46
47 inherit eutils
48
49
50 DESCRIPTION="GTK+1/2 ${PN/gtk-engines-} Theme Engine"
51 HOMEPAGE="http://art.gnome.org/ http://themes.freshmeat.net/"
52
53 # --- here we define some useful variables for gtk-engines installation
54
55 if has_version "=x11-libs/gtk+-1.2*"; then
56 HAS_GTK1=1
57 GTK1_ENGINES_DIR=/usr/$(get_libdir)/gtk/themes/engines
58 fi
59
60 if has_version ">=x11-libs/gtk+-2" || use gtk2; then
61 HAS_GTK2=1
62 GTK_VERSION=$(pkg-config --variable=gtk_binary_version gtk+-2.0)
63 GTK2_ENGINES_DIR=/usr/$(get_libdir)/gtk-2.0/${GTK_VERSION}/engines
64 fi
65
66 # --- define some deps for binary packages
67 if [ -n "${HAS_GTK1}" -a ! -n "${HAS_GTK2}" ]; then
68 DEPEND="${DEPEND} =x11-libs/gtk+-1.2*"
69 elif [ -n "${HAS_GTK1}" -a -n "${HAS_GTK2}" ]; then
70 DEPEND="${DEPEND} =x11-libs/gtk+-1.2* =x11-libs/gtk+-2*"
71 elif [ ! -n "${HAS_GTK1}" -a -n "${HAS_GTK2}" ]; then
72 DEPEND="${DEPEND} >=x11-libs/gtk+-2"
73 fi
74
75 # --- if we don't have any gtk version, we depend on USE flags to tell us
76 # --- which one to use. otherwise, we don't add any deps. make the ebuild
77 # --- tell us what DEPEND it wants.
78
79 if ! has_version "x11-libs/gtk+"; then
80 DEPEND="gtk2? ( >=x11-libs/gtk+-2 ) !gtk2? ( =x11-libs/gtk+-1.2* )"
81 use gtk2 \
82 && HAS_GTK2=1 \
83 || HAS_GTK1=1
84 fi
85
86 # --- if GTK1_S and GTK2_S is set, then we do both themes,
87 # --- otherwise, just do the normal src_compile/install wrap.
88
89 gtk-engines2_src_compile() {
90
91 if [ -n "${GTK2_S}" -a -n "${GTK1_S}" ]; then
92 if [ -n "${HAS_GTK2}" ]; then
93 cd ${GTK2_S}
94 econf || die "gtk2 configure failed"
95 emake || die "gtk2 make failed"
96 fi
97 if [ -n "${HAS_GTK1}" ]; then
98 cd ${GTK1_S}
99 econf || die "gtk1 configure failed"
100 emake || die "gtk1 make failed"
101 fi
102 else
103 cd "${S}"
104 econf ${@} || die "configure failed"
105 emake || make || die "make failed"
106 fi
107 }
108
109 DEFAULT_DOCS="AUTHORS ChangeLog NEWS README"
110
111 gtk-engines2_src_install() {
112
113 if [ -n "${GTK2_S}" -a -n "${GTK1_S}" ]; then
114 if [ -n "${HAS_GTK2}" ]; then
115 cd ${GTK2_S}
116 make DESTDIR="${D}" install || die "gtk2 install failed"
117 for x in ${DEFAULT_DOCS} ${DOCS}; do
118 newdoc ${x} ${x}.gtk2
119 done
120 fi
121 if [ -n "${HAS_GTK1}" ]; then
122 cd ${GTK1_S}
123 make DESTDIR="${D}" install || die "gtk1 install failed"
124 for x in ${DEFAULT_DOCS} ${DOCS}; do
125 newdoc ${x} ${x}.gtk1
126 done
127 fi
128 else
129 cd "${S}"
130 make DESTDIR="${D}" ${@} install || die "install failed"
131 dodoc ${DEFAULT_DOCS} ${DOCS}
132 fi
133 }
134
135 EXPORT_FUNCTIONS src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20