Gentoo Archives: gentoo-dev

From: Jeff Stuart <jstuart@×××××××××××××.net>
To: gentoo-dev@g.o
Subject: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths
Date: Fri, 18 Apr 2003 13:36:09
Message-Id: 20030418093613.2dc30270.jstuart@computer-city.net
1 OK, I've got the following ebuild that I tried to make work with both GTK1 and GTK2.
2
3 # Copyright 1999-2003 Gentoo Technologies, Inc.
4 # Distributed under the terms of the GNU General Public License v2
5 # $Header: /home/cvsroot/gentoo-x86/x11-themes/gtk-engines-geramik/gtk-engines-geramik-0.18-r2.ebuild,v 1.2 2003/02/13 17:39:09 vapier Exp $
6
7 DESCRIPTION="GTK-2 theme engine to make GTK look like KDE"
8 HOMEPAGE="http://www.kde-look.org/content/show.php?content=3952"
9 SLOT="2"
10
11 inherit gtk-engines
12
13 KEYWORDS="~x86"
14
15 newdepend ">=media-libs/gdk-pixbuf-0.21"
16
17 src_install() {
18 einstall \
19 THEME_DIR=${D}/usr/share/themes \
20 ENGINE_DIR=${D}/usr/lib/gtk/themes/engines \
21 || die "Installation failed"
22
23 for dc in AUTHORS BUGS ChangeLog CONFIGURATION COPYING CUSTOMIZATION \
24 NEWS README THANKS TODO
25 do
26 [ -s $doc ] && dodoc $doc
27 done
28 }
29
30 What I WANTED to do in the src_install was to check if gtk and/or gtk2 was in the USE flag. IF both, then it would copy both the gtk1 and gtk2 theme for Geramik. If only gtk1, then it would copy just the gtk1 files and remove the gtk2 files. If GTK2 only, well... that would be an odd case. ;) Then I'd copy the gtk2 files, then grab the .png's from the gtk1 theme, and finally awk the gtkrc for gtk2 theme to point to the right pixmap.
31
32 What I TRIED was the following:
33
34 if [ "`use gtk2`" -a "`use gtk`" ]
35 then
36 einfo "AHH gtk1 AND gtk2 OK..."
37 fi
38
39 if [ ! "`use gtk2`" -a "`use gtk`" ]
40 then
41 einfo "AHH OK, just gtk1..."
42 fi
43
44 of [ "`use gtk2`" -a ! "`use gtk`" ]
45 then
46 einfo "You're doing what??? LOL OK.. just gtk2!"
47 fi
48
49 And no matter WHAT I did including modifying my make.conf, passing env USE="-gtk2", etc. It STILL thought that both gtk1 AND gtk2 were set!!!! Why? :D
50
51 Finally, would that be the proper use of the USE flags?
52
53
54 --
55 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths Matt Tucker <tuck@×××××××××××××.net>
Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths foser <foser@×××××××××××××××××.net>