Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 772896 - app-text/pdfarranger and USE to request media-gfx/img2pdf
Summary: app-text/pdfarranger and USE to request media-gfx/img2pdf
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrey Grozin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-25 13:49 UTC by Christophe PEREZ
Modified: 2021-08-22 01:27 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe PEREZ 2021-02-25 13:49:19 UTC
Hi,

When you install pdfarranger, you get a warning saying :
 * Optional dependency:
 *   media-gfx/img2pdf for image file import

But why not having a USE to have it in dependency ?

I think it would be more in the gentoo spirit, than to have to install img2pdf separately.
Comment 1 Andreas Sturmlechner gentoo-dev 2021-02-25 13:56:48 UTC
Package informs you post installation:

> * Optional dependency:
> *   media-gfx/img2pdf for image file import

Otherwise Portage does not yet support optional runtime dependencies.
Comment 2 Christophe PEREZ 2021-02-25 14:03:10 UTC
I don't understand.
If you have a USE "img" for pdfarranger, and img2pdf as a dependency on this useflag, why it shouldn't work ?

You have this on every gentoo ebuild. Why not here ?

USE="img" emerge pdfarranger => img2pdf + pdfarranger
USE="-img" emerge pdfarranger => pdfarranger

I must not manage to make myself understood.
Comment 3 Christophe PEREZ 2021-02-25 14:11:31 UTC
# diff -u /usr/portage/app-text/pdfarranger/pdfarranger-1.6.2.ebuild  /usr/local/portage/app-text/pdfarranger/pdfarranger-1.6.2.ebuild 
--- /usr/portage/app-text/pdfarranger/pdfarranger-1.6.2.ebuild  2021-02-11 15:39:19.000000000 -0400
+++ /usr/local/portage/app-text/pdfarranger/pdfarranger-1.6.2.ebuild    2021-02-25 10:08:06.965508654 -0400
@@ -14,7 +14,7 @@
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="amd64"
-IUSE=""
+IUSE="img"
 
 RDEPEND="
        app-text/poppler[introspection,cairo]
@@ -23,6 +23,7 @@
        dev-python/pygobject:3[${PYTHON_USEDEP},cairo]
        x11-libs/gtk+:3[introspection]
        x11-libs/pango[introspection]
+       img? ( media-gfx/img2pdf )
 "
 DEPEND="${RDEPEND}
        dev-python/python-distutils-extra[${PYTHON_USEDEP}]

And it works like I suggested.
I don't understand the problem at all.
Comment 4 Andreas Sturmlechner gentoo-dev 2021-02-25 15:15:44 UTC
Support by Portage would mean that switching the IUSE would not cause package rebuild.

https://www.gentoo.org/glep/glep-0062.html

Optional IUSE that are effective exclusively in RDEPEND are banned by QA.

As long as that is the case, we have optfeature.eclass that is used in this package.
Comment 5 Andreas Sturmlechner gentoo-dev 2021-02-25 15:18:00 UTC
Of course another solution the package maintainer may choose to do is making media-gfx/img2pdf a permanent RDEPEND.
Comment 6 Christophe PEREZ 2021-07-03 15:21:25 UTC
I don't understand all answers.

Isn't it possible to add a USE flag "image" to make img2pdf as a dependency when we want to use pdfarranger with images ?

I don't understand all about 

> Optional IUSE that are effective exclusively in RDEPEND are banned by QA.
> As long as that is the case, we have optfeature.eclass that is used in this 
> package.

But I don't care.

I find it silly not to want to add a USE flag for an option provided by the software developer and even mentioned in the ebuild itself. This is the very principle of the USE flag.
Comment 7 Louis Sautier (sbraz) gentoo-dev 2021-08-22 01:27:15 UTC
Hi Christophe,

As Andreas explained, we cannot do that because it's *strictly* a runtime dependency. It does not need to be here during the build phase.

If we add this flag and emerge pdfarranger with USE=img, we will rebuild pdfarranger, which is not necessary. This is why such USE flags are banned (even though you might see a few ebuilds in the tree that have them, for historical reasons).


To complement my explanation, here is an excerpt from https://devmanual.gentoo.org/general-concepts/use-flags/index.html:

> The usage of a USE flag should not control runtime dependencies when the package does not link to it. Doing so will create extra configuration for the package and re-compilation for no underlying file change on disk. This should be avoided and instead can be conveyed to the user via post install messages if needed.