Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 330219 - media-sound/ncmpcpp dies on conflicting USE choices
Summary: media-sound/ncmpcpp dies on conflicting USE choices
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-28 13:17 UTC by Thomas Kahle (RETIRED)
Modified: 2010-07-28 16:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for the ebuild (ncmpcpp-0.5.4.ebuild.patch,906 bytes, text/plain)
2010-07-28 13:18 UTC, Thomas Kahle (RETIRED)
Details
fftw, visualizer handling (ncmpcpp-0.5.4.ebuild.patch,1.07 KB, patch)
2010-07-28 14:44 UTC, Alex Alexander (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kahle (RETIRED) gentoo-dev 2010-07-28 13:17:32 UTC
When setting USE="fftw -visualizer" media-sound/ncmpcpp-0.5.4 dies. This behaviour is deprecated (http://devmanual.gentoo.org/general-concepts/use-flags/index.html) and should be replaced by making a sane default choice.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Thomas Kahle (RETIRED) gentoo-dev 2010-07-28 13:18:05 UTC
Created attachment 240437 [details]
patch for the ebuild
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-07-28 14:10:08 UTC
An old inheritance. I think the following patch should do it. It actually does the opposite of what yours does.

Reasoning: you didn't want the visualizer so why would you want it based on an erroneous build/runtime dependency?. USE=fftw could be set globally by anyone thinking it could be generally useful:
fftw - Use FFTW library for computing Fourier transforms
media-sound/ncmpcpp:fftw - Build the visualizer plugin that pulls in sci-libs/fftw


Discuss!!


Index: ncmpcpp-0.5.4.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/media-sound/ncmpcpp/ncmpcpp-0.5.4.ebuild,v
retrieving revision 1.2
diff -u -B -r1.2 ncmpcpp-0.5.4.ebuild
--- ncmpcpp-0.5.4.ebuild        28 Jul 2010 13:38:54 -0000      1.2
+++ ncmpcpp-0.5.4.ebuild        28 Jul 2010 14:05:27 -0000
@@ -22,19 +22,18 @@
        taglib? ( media-libs/taglib )"
 RDEPEND="$DEPEND"
 
-pkg_setup() {
-       if ( use fftw && ! use visualizer ); then
-               die "USE=fftw requires USE=visualizer enabled"
-       fi
-}
-
 src_configure() {
-       econf $(use_enable clock) \
+       local myconf=""
+       if use fftw && use visualizer; then
+               myconf="--with-fftw"
+       fi
+       econf \
+               ${myconf} \
+               $(use_enable clock) \
                $(use_enable outputs) \
                $(use_enable unicode) \
                $(use_enable visualizer) \
                $(use_with curl) \
-               $(use_with fftw) \
                $(use_with iconv) \
                $(use_with threads) \
                $(use_with taglib)
Comment 3 Thomas Kahle (RETIRED) gentoo-dev 2010-07-28 14:20:40 UTC
(In reply to comment #2)
> Discuss!!

Right. Having USE="-visualizer" should disable fftw (That is what you are saying right?) Your reasoning is completely sound. Only I think your patch needs two negations. Here, 

> +       local myconf=""
> +       if use fftw && use visualizer; then
> +               myconf="--with-fftw"
> +       fi

don't you want
use fftw && *not* use visualizer 
and 
myconf="--without-fftw" 
in this case?
Comment 4 Alex Alexander (RETIRED) gentoo-dev 2010-07-28 14:44:46 UTC
Created attachment 240453 [details, diff]
fftw, visualizer handling

I like Jeroen's approach :)

How about this patch then?

It handles all cases and prints an ewarn when +fftw -visualizer.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-07-28 14:46:39 UTC
(In reply to comment #3)
> don't you want
> use fftw && *not* use visualizer 

The only case in which --with-fftw should be set is when USE=visualizer, so I test for
   use fftw && use visualizer

and I disagree with you there.

> myconf="--without-fftw" 

That should be added, yes, to prevent automagic dependencies.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2010-07-28 14:49:09 UTC
(In reply to comment #4)
> Created an attachment (id=240453) [details]
> fftw, visualizer handling
> 
> I like Jeroen's approach :)
> 
> How about this patch then?

I like it. Commit it if you want to.
Comment 7 Alex Alexander (RETIRED) gentoo-dev 2010-07-28 14:59:18 UTC
(In reply to comment #6)
> I like it. Commit it if you want to.

Done :)

Thomas, thanks for reporting!

wired * gentoo-x86/media-sound/ncmpcpp/ (ChangeLog ncmpcpp-0.5.4.ebuild): 
don't die on +fftw -visualizer. fixes bug #330219



Comment 8 Thomas Kahle (RETIRED) gentoo-dev 2010-07-28 15:57:13 UTC
(In reply to comment #6)
>
> > How about this patch then?
> 
> I like it. Commit it if you want to.

<pedantic> Shouldn't the fftw useflag be abandoned in this case and the visualizer useflag just trigger both --with-fftw --enable-visualizer ? </pedantic> 
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2010-07-28 16:25:21 UTC
(In reply to comment #8)
> <pedantic> Shouldn't the fftw useflag be abandoned in this case and the
> visualizer useflag just trigger both --with-fftw --enable-visualizer ?
> </pedantic> 

No, because the visualizer compiles and works fine without fftw.