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

Contents of /eclass/gtk-engines.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations) (download)
Fri Jul 18 20:11:22 2003 UTC (16 years, 11 months ago) by tester
Branch: MAIN
Branch point for: RELEASE-1_4
Changes since 1.23: +2 -2 lines
Adding amd64/x86_64 to a few eclasses

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/eclass/gtk-engines.eclass,v 1.23 2003/07/02 18:01:11 gmsoft Exp $
4 #
5 # The gtk-engines eclass is inherited by all gtk-engines-* ebuilds.
6 #
7 # Please note that Gtk engines are special packages that mainly provide
8 # common libraries for Gtk themes, and there is a special meta-package
9 # that have what you're probably looking for: gtk-themes.
10 #
11 # If you want themes to make your GTK 2 apps look pretty, you can do
12 # something like the following, and everything will be taken care of:
13 #
14 # emerge gtk-themes
15 #
16 # If themes for GTK 1 programs is what you're looking for, then something
17 # like this should help you:
18 #
19 # emerge =gtk-themes-1*
20
21
22 ECLASS=gtk-engines
23 INHERITED="$INHERITED $ECLASS"
24
25 [ -n "$DEBUG" ] && einfo "Entering gtk-engines.eclass"
26
27 [ -z "$DESCRIPTION" ] && DESCRIPTION="Based on the gtk-engines eclass"
28 [ -z "$HOMEPAGE" ] && HOMEPAGE="http://www.gnome.org/"
29 [ -z "$LICENSE" ] && LICENSE="GPL-2"
30
31 KEYWORDS="x86 ppc alpha sparc hppa amd64"
32
33 newdepend /c virtual/x11
34
35 case "${SLOT}" in
36 "1" )
37 newdepend '=x11-libs/gtk+-1.2*' ;;
38 "2" )
39 newdepend '>=x11-libs/gtk+-2' ;;
40 * )
41 newdepend x11-libs/gtk+ ;;
42 esac
43
44 [ -n "$DEBUG" ] && einfo "SLOT is ${SLOT}"
45
46 MY_PN="${PN}"
47 INSTALL_FONTS=0
48 ENGINE=${PN/gtk-engines-/}
49
50 [ -n "$DEBUG" ] && einfo "ENGINE is ${ENGINE}"
51
52 case "${ENGINE}" in
53 "cleanice" )
54 [ "$SLOT" -eq "2" ] && MY_PN="gtk-engines-cleanice2" ;;
55
56 "crux" )
57 MY_PN="crux" ;;
58
59 "eazel" )
60 MY_PN="eazel-engine" ;;
61
62 "flat" )
63 [ "$SLOT" -eq "2" ] && MY_PN="gtk-flat-theme-2.0" ;;
64
65 "geramik" )
66 MY_PN="3952-Geramik" ;;
67
68 "lighthouseblue" )
69 MY_PN="lighthouseblue" ;;
70
71 "metal" | "notif" | "pixbuf" | "pixmap" | "raleigh" | "redmond95" )
72 MY_PN="gtk-engines"
73 if [ "$SLOT" -eq "2" ]
74 then
75 DEPEND="${DEPEND} >=dev-util/pkgconfig-0.12.0"
76
77 # Do _NOT_ strip symbols in the build! Need both lines for Portage
78 # 1.8.9+
79 DEBUG="yes"
80 RESTRICT="nostrip"
81 # force debug information
82 CFLAGS="${CFLAGS} -g"
83 CXXFLAGS="${CXXFLAGS} -g"
84
85 else
86 newdepend '>=media-libs/imlib-1.8'
87 fi
88 ;;
89
90 "mist" )
91 MY_PN="GTK-mist-engine" ;;
92
93 "thinice" )
94 [ "$SLOT" -eq "2" ] && MY_PN="gtk-thinice-engine" ;;
95
96 "xenophilia" )
97 MY_PN="xenophilia"
98 INSTALL_FONTS=1
99 ;;
100
101 "xfce" )
102 MY_PN="gtk-xfce-engine" ;;
103 esac
104
105 MY_P="${MY_PN}-${PV}"
106
107 [ -n "$DEBUG" ] && einfo "MY_P is ${MY_P}"
108
109 if [ "X${ENGINE}" = "Xthinice" ] && [ "$SLOT" -eq "2" ]
110 then
111 SRC_URI="http://thinice.sourceforge.net/${MY_P}.tar.gz"
112
113 elif [ "X${ENGINE}" = "Xmist" ]
114 then
115 SRC_URI="http://ftp.gnome.org/pub/GNOME/teams/art.gnome.org/themes/gtk2/${MY_P}.tar.gz"
116
117 elif [ "X${ENGINE}" = "Xflat" ] && [ "$SLOT" -eq "2" ]
118 then
119 SRC_URI="http://download.freshmeat.net/themes/gtk2flat/gtk2flat-default.tar.gz"
120
121 elif [ "X${ENGINE}" = "Xgeramik" ]
122 then
123 SRC_URI="http://www.kde-look.org/content/files/${MY_P}.tar.gz"
124
125 elif [ "X${ENGINE}" = "Xxfce" ]
126 then
127 SRC_URI="mirror://sourceforge/xfce/${MY_P}.tar.gz"
128
129 elif [ "X${ENGINE}" = "Xlighthouseblue" ]
130 then
131 SRC_URI="mirror://sourceforge/lighthouseblue/${MY_P}.tar.gz"
132
133 elif [ "X${ENGINE}" = "Xcrux" ]
134 then
135 PVP=($(echo " $PV " | sed 's:[-\._]: :g'))
136 SRC_URI="mirror://gnome/sources/${MY_PN}/${PVP[0]}.${PVP[1]}/${MY_P}.tar.bz2"
137
138 elif [ "X${MY_PN}" = "Xgtk-engines" ] && [ "$SLOT" -eq "2" ]
139 then
140 PVP=($(echo " $PV " | sed 's:[-\._]: :g'))
141 SRC_URI="mirror://gnome/sources/${MY_PN}/${PVP[0]}.${PVP[1]}/${MY_P}.tar.bz2"
142
143 else
144 SRC_PATH=`echo ${MY_PN} | awk '{print substr($0,1,1);}'`
145 SRC_PATH="${SRC_PATH}/${MY_PN}/${MY_PN}_${PV}.orig.tar.gz"
146 SRC_URI="http://ftp.debian.org/debian/pool/main/$SRC_PATH"
147 fi
148
149 [ -n "$DEBUG" ] && einfo "SRC_URI is ${SRC_URI}"
150
151 gtk-engines_src_unpack() {
152 unpack ${A}
153
154 [ -f "${FILESDIR}/${P}-gentoo.diff" ] && \
155 patch -p0 < ${FILESDIR}/${P}-gentoo.diff
156
157 MY_DIR=`ls -t ${WORKDIR} | head -n 1`
158
159 mv $MY_DIR $S
160 }
161
162 gtk-engines_src_compile() {
163 econf || die "./configure failed"
164
165 [ "X${MY_PN}" = "Xgtk-engines" ] && cd ${ENGINE}
166
167 emake || die "Compilation failed"
168 }
169
170 gtk-engines_src_install() {
171 [ "X${MY_PN}" = "Xgtk-engines" ] && cd ${ENGINE}
172
173 # Some corrections to misc files
174 if [ "X${ENGINE}" = "Xxenophilia" ]
175 then
176 dodir /usr/X11R6/lib/X11/fonts/misc
177
178 mv fonts/Makefile fonts/Makefile.orig
179 sed -e 's:/usr:${D}/usr:' \
180 -e 's:local:misc:' \
181 -e '7,8d' \
182 fonts/Makefile.orig > fonts/Makefile || die
183 rm fonts/Makefile.orig
184 fi
185
186 einstall \
187 THEME_DIR=${D}/usr/share/themes \
188 ENGINE_DIR=${D}/usr/lib/gtk/themes/engines \
189 || die "Installation failed"
190
191 # Remove unwanted stuff, since some engines include GTK-1 and GTK-2
192 # support.
193 if [ "X${ENGINE}" = "Xmist" ]
194 then
195 if [ "$SLOT" -eq "2" ]
196 then
197 rm -rf ${D}/usr/lib/gtk ${D}/usr/share/themes/Mist/gtk
198 else
199 rm -rf ${D}/usr/lib/gtk-2.0 ${D}/usr/share/themes/Mist/gtk-2.0
200 fi
201
202 rm -rf ${D}/usr/share/themes/Mist/metacity-1
203
204 elif [ "X${ENGINE}" = "Xgeramik" ]
205 then
206 if [ "$SLOT" -eq "2" ]
207 then
208 mv ${D}/usr/share/themes/Geramik/gtk/*png \
209 ${D}/usr/share/themes/Geramik/gtk-2.0
210 mv ${D}/usr/share/themes/Geramik/gtk-2.0/gtkrc-2.0 \
211 ${D}/usr/share/themes/Geramik/gtk-2.0/gtkrc
212
213 rm -rf ${D}/usr/lib/gtk ${D}/usr/share/themes/Geramik/gtk
214 else
215 rm -rf ${D}/usr/lib/gtk-2.0 ${D}/usr/share/themes/Geramik/gtk-2.0
216 fi
217
218 elif [ "X${ENGINE}" = "Xlighthouseblue" ]
219 then
220 if [ "$SLOT" -eq "2" ]
221 then
222 rm -rf ${D}/usr/lib/gtk ${D}/usr/share/themes/LighthouseBlue/gtk
223 else
224 rm -rf \
225 ${D}/usr/lib/gtk-2.0 \
226 ${D}/usr/share/themes/LighthouseBlue/gtk-2.0
227 fi
228 fi
229
230 for doc in AUTHORS BUGS ChangeLog CONFIGURATION COPYING CUSTOMIZATION \
231 NEWS README THANKS TODO
232 do
233 [ -s $doc ] && dodoc $doc
234 done
235 }
236
237 gtk-engines_pkg_postinst() {
238 if [ "$INSTALL_FONTS" -ne 0 ]
239 then
240 echo ">>> Updating X fonts..."
241 mkfontdir /usr/X11R6/lib/X11/fonts/misc
242 xset fp rehash || fonts_notice
243 fi
244 }
245
246 gtk-engines_pkg_postrm() {
247 if [ "$INSTALL_FONTS" -ne 0 ]
248 then
249 echo ">>> Updating X fonts..."
250 mkfontdir /usr/X11R6/lib/X11/fonts/misc
251 xset fp rehash || fonts_notice
252 fi
253 }
254
255 fonts_notice() {
256 einfo "We can't reset the font path at the moment. You might want"
257 einfo "to run the following command manually:"
258 einfo ""
259 einfo " xset fp rehash"
260 }
261
262 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20