Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 289139 - Make app-text/yagf dependency on media-gfx/xsane optional
Summary: Make app-text/yagf dependency on media-gfx/xsane optional
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Peter Volkov (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-14 23:58 UTC by A.C.Heron
Modified: 2009-10-28 09:21 UTC (History)
1 user (show)

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


Attachments
app-text/yagf ebuild with xsane optional (yagf-0.8.1-r1.ebuild,670 bytes, text/plain)
2009-10-15 00:00 UTC, A.C.Heron
Details
A patch to disable SANE. (yagf-no-SANE.patch,3.86 KB, text/plain)
2009-10-25 03:14 UTC, A.C.Heron
Details
yagf-0.8.1 ebuild that uses no-SANE patch (yagf-0.8.1-no-SANE.ebuild,763 bytes, text/plain)
2009-10-25 03:21 UTC, A.C.Heron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description A.C.Heron 2009-10-14 23:58:28 UTC
app-text/yagf-0.8.0 and app-text/yagf-0.8.1 explicitly demand media-gfx/xsane. However, they do not really need it and work fine without it, if a user has no scanner. The older versions used a "scanner" keyword in IUSE to determine whether to install xsane. 

Please add "scanner" keyword and make media-gfx/xsane dependency optional, as in the suggested ebuild.
Comment 1 A.C.Heron 2009-10-15 00:00:22 UTC
Created attachment 207171 [details]
app-text/yagf ebuild with xsane optional

This way xsane installs only if the "scanner" keyword is set.
Comment 2 Wormo (RETIRED) gentoo-dev 2009-10-21 05:08:09 UTC
Thanks for the suggestion, and for submitting an ebuild to demonstrate.

Initial comment on the proposed ebuild: optional features require more than just optional dependency, also the build must explicitly follow the USE flag. For instance, if user has xsane installed but specifies USE=-scanner then yagf must not build xsane support. So to finish up optional scanner support, cmake needs to be passed an option depending on the useflag setting.

Would you like to try another iteration of this ebuild?
Comment 3 A.C.Heron 2009-10-25 03:10:19 UTC
Do you want to remove SANE support from YAGF completely and without a trace? I see no reason to do so. YAGF has been designed to work both in systems with and without SANE. The SANE support is less than 0.1% of the source code size — the bloat is negligible. But there is a chance to break something this way. 

I can do it (see below), but I don't want to.

Comment 4 A.C.Heron 2009-10-25 03:14:24 UTC
Created attachment 208172 [details]
A patch to disable SANE.

This patch removes the function, that calls SANE, and alters interface appropriately.
Comment 5 A.C.Heron 2009-10-25 03:21:38 UTC
Created attachment 208173 [details]
yagf-0.8.1 ebuild that uses no-SANE patch

This ebuild applies the no-SANE patch if USE=-scanner.
Comment 6 Wormo (RETIRED) gentoo-dev 2009-10-25 06:42:02 UTC
Sorry, that's not quite what I was getting at -- the point wasn't to _always_ disable sane support, but that the use flags should control whether sane support is built or not. Your first attempt allowed sane to be "an automagic dependency"
http://www.gentoo.org/proj/en/qa/automagic.xml

Here is the problem case:

* sane happens to be installed
* user asks for scanner support NOT to be built via USE=-scanner
* yagf build notices that sane is installed, and decides to build scanner support anyways

What yagf ebuild ought to do:

* yagf build is explicitly told whether to enable scanner support, and turns it on for USE=scanner and off for USE=-scanner

The gentoo devmanual mentions how to make autotools builds conditional on USE flags here:
http://devmanual.gentoo.org/ebuild-writing/functions/src_compile/configuring/index.html

and here is an example of an ebuild doing the same thing with a cmake build:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/indilib/indilib-0.6.ebuild?rev=1.6&view=markup
Comment 7 A.C.Heron 2009-10-27 08:08:52 UTC
One of us definitely has no idea how YAGF works :)

As far as I understand, the way automagic is done in YAGF does not violate http://www.gentoo.org/proj/en/qa/automagic.xml recommendations. SANE support builds and works regardless whether SANE was installed at build time or not. There is no mention of SANE in CMakeLists.txt. And nothing to switch with USE flags at configure time. 

The only "scanner support" YAGF builds, are the "scan" button, MainForm::scanImage() and several variables they use. If they find xsane, they access scanner, if they don't, they report an error and the rest of the program continues to work. You may compile YAGF without SANE, then add SANE to the system and the scanner should work. And vice versa, you may compile YAGF on a system with SANE, then remove SANE, but other parts of YAGF should still work.

That is why I understood your suggestion to "not build xsane support" as a request to remove any mention of SANE. I'll mark the last 2 files as obsolet.
Comment 8 Wormo (RETIRED) gentoo-dev 2009-10-28 06:19:18 UTC
Ok, I can take a hint ;)

Assigning to yagf maintainer, who should be familiar enough with the package that they won't misinterpret what you were trying to say...
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2009-10-28 09:21:38 UTC
Well, I don't like optional RDEPENDencies, since when changed they require to rebuild package while nothing really changed in the package itself. But... commited in hope something better will arrive in EAPI-next. Thank you.