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.
Created attachment 207171 [details] app-text/yagf ebuild with xsane optional This way xsane installs only if the "scanner" keyword is set.
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?
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.
Created attachment 208172 [details] A patch to disable SANE. This patch removes the function, that calls SANE, and alters interface appropriately.
Created attachment 208173 [details] yagf-0.8.1 ebuild that uses no-SANE patch This ebuild applies the no-SANE patch if USE=-scanner.
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
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.
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...
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.