public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] USE variables in ebuilds and using them for multiple install paths
@ 2003-04-18 13:36 Jeff Stuart
  2003-04-18 18:12 ` Matt Tucker
  2003-04-19 11:18 ` foser
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Stuart @ 2003-04-18 13:36 UTC (permalink / raw
  To: gentoo-dev

OK, I've got the following ebuild that I tried to make work with both GTK1 and GTK2.  

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $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 $

DESCRIPTION="GTK-2 theme engine to make GTK look like KDE"
HOMEPAGE="http://www.kde-look.org/content/show.php?content=3952"
SLOT="2"

inherit gtk-engines

KEYWORDS="~x86"

newdepend ">=media-libs/gdk-pixbuf-0.21"

src_install() {
    einstall \
    THEME_DIR=${D}/usr/share/themes \
    ENGINE_DIR=${D}/usr/lib/gtk/themes/engines \
    || die "Installation failed"

    for dc in AUTHORS BUGS ChangeLog CONFIGURATION COPYING CUSTOMIZATION \
        NEWS README THANKS TODO
    do
        [ -s $doc ] && dodoc $doc
    done
}

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.

What I TRIED was the following:

if [ "`use gtk2`" -a "`use gtk`" ]
then
	einfo "AHH gtk1 AND gtk2 OK..."
fi

if [ ! "`use gtk2`" -a "`use gtk`" ]
then
	einfo "AHH OK, just gtk1..."
fi

of [ "`use gtk2`" -a ! "`use gtk`" ] 
then
	einfo "You're doing what??? LOL OK.. just gtk2!"
fi

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  

Finally, would that be the proper use of the USE flags?  


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths
  2003-04-18 13:36 [gentoo-dev] USE variables in ebuilds and using them for multiple install paths Jeff Stuart
@ 2003-04-18 18:12 ` Matt Tucker
  2003-04-19 11:18 ` foser
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Tucker @ 2003-04-18 18:12 UTC (permalink / raw
  To: Jeff Stuart; +Cc: gentoo-dev

-- Jeff Stuart <jstuart@computer-city.net> spake thusly:

> 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.
> 
> What I TRIED was the following:
<snip>
> 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  
> 
> Finally, would that be the proper use of the USE flags?  

All of those should work fine:

    $ export USE="gtk gtk2"
    $ use() { local x; for x in ${USE}; do
    >           if [ "${x}" = "${1}" ]; then
    >             echo "${x}";
    >             return 0;
    >           fi;
    >         done;
    >         return 1;
    > }
    $ use gtk
    gtk
    $ [ "`use gtk`" -a "`use gtk2`" ] && echo true
    true
    $ USE="gtk"
    $ use gtk2
    $ [ "`use gtk`" -a "`use gtk2`" ] && echo true
    $ [ "`use gtk`" -a ! "`use gtk2`" ] && echo true
    true

Sure, this doesn't test actually setting your USE flags, but it does
test the [] functionality. You could try doing "echo $USE" before your
tests, just to make sure that you know what you're working with.

For what it's worth, I just tried setting USE="gtk gtk2" in my
make.conf, and then doing 'USE="-gtk2" ebuild ...' on the command line,
and everything worked as you would expect.


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths
  2003-04-18 13:36 [gentoo-dev] USE variables in ebuilds and using them for multiple install paths Jeff Stuart
  2003-04-18 18:12 ` Matt Tucker
@ 2003-04-19 11:18 ` foser
  1 sibling, 0 replies; 3+ messages in thread
From: foser @ 2003-04-19 11:18 UTC (permalink / raw
  To: gentoo-dev

gtk-engines eclass works revision based right now, you just have to 
create one gtk1 and one gtk2 revision. I'm not completely happy with how 
it functions at the moment, but until someone rewrites the eclass we're 
gonna stick with this i guess.

- foser


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-19 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-18 13:36 [gentoo-dev] USE variables in ebuilds and using them for multiple install paths Jeff Stuart
2003-04-18 18:12 ` Matt Tucker
2003-04-19 11:18 ` foser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox