Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 672920 - virtual/libusb should support USE=static-libs
Summary: virtual/libusb should support USE=static-libs
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: static-libs
  Show dependency tree
 
Reported: 2018-12-11 10:40 UTC by Kalin KOZHUHAROV
Modified: 2020-05-28 14:56 UTC (History)
4 users (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 Kalin KOZHUHAROV 2018-12-11 10:40:32 UTC
I have been trying to make a static binary of sys-apps/flashrom and was having problems with missing dependencies, i.e. missing USE=static-libs in certain libraries.

After some debugging, I realised that because virtual/libusb does NOT have IUSE="static-libs" it satisfies (somehow?) the requirement of sys-apps/flashrom-1.0 as found in the ebuild:

pickit2_spi? ( virtual/libusb:0[static-libs(+)] )

However `USE=static emerge flashrom` build fails due to not having dev-libs/libusb and dev-libs/libusb-comat build with USE=static-libs

I'll try to submit a PR with fixes for virtual/libusb and link it here.
Comment 1 Kalin KOZHUHAROV 2018-12-11 11:12:18 UTC
Peter Stuge <peter@stuge.se> might be interested in this...
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-11 14:16:35 UTC
We don't encourage static-libs and you don't seem to have a very good case for needing them.
Comment 3 Kalin KOZHUHAROV 2018-12-11 14:33:19 UTC
(In reply to Michał Górny from comment #2)
> We don't encourage static-libs and you don't seem to have a very good case
> for needing them.

Ookey, that is a new view for me, but thank you for clarifying it.

I understand the reasoning against static linking for normal packages that are meant to be used (present, built, updated) on the system; Here the case is using a Gentoo box as a development platform for other hardware (e.g. embedded).

Sorry for not making it clear.

Just for the record, the sole reason for static-libs here in this bug is having an easily transferable tool (flashrom) to various, less-powerful and limited hardware platforms, to work on a low-level (flash firmware).

While the proposed solution in PR is the generic one, of course it may be tackled at sys-apps/flashrom ebuild level (by not depending on virtual/libusb, but directly on dev-libs/libusb and dev-libs/libusb-compat with proper USE). But I thought it will be kind of a hack and decided to fix the general case, since dev-libs/libusb and dev-libs/libusb-compat do support static-libs already.

Are those comments grounds of reopening of this bug? If not - close it and I'll submit the other proposed solution on flashrom ebuild directly.
Comment 4 Peter Stuge 2018-12-11 15:16:21 UTC
(In reply to Kalin KOZHUHAROV from comment #3)
> (In reply to Michał Górny from comment #2)
> > We don't encourage static-libs

Gentoo is about enabling choice.

> > and you don't seem to have a very good case for needing them.
> 
> Here the case is using a Gentoo box as a development platform for
> other hardware (e.g. embedded).

I think this use case is very much valid.


> Sorry for not making it clear.

No need to apologize.


> Just for the record, the sole reason for static-libs here in this bug is
> having an easily transferable tool (flashrom) to various, less-powerful
> and limited hardware platforms, to work on a low-level (flash firmware).

It's perfectly reasonable to add IUSE=static-libs to the virtual. The
library being LGPL means that static linking is explicitly allowed by
the license, and there's no reason for Gentoo to add obstacles on that path.


> While the proposed solution in PR is the generic one, of course it may be
> tackled at sys-apps/flashrom ebuild level (by not depending on
> virtual/libusb, but directly on dev-libs/libusb and dev-libs/libusb-compat
> with proper USE). But I thought it will be kind of a hack and decided to fix
> the general case, since dev-libs/libusb and dev-libs/libusb-compat do
> support static-libs already.

I agree. I think your proposed commit is an improvement over the status quo.
I hope it gets committed quickly, and that we don't have to do the workaround
in the flashrom ebuild. (I am proxy maint.) Thanks!
Comment 5 Mike Gilbert gentoo-dev 2018-12-11 15:20:59 UTC
We will take another look at this.
Comment 6 Agostino Sarubbo gentoo-dev 2020-05-28 14:56:01 UTC
See also: https://projects.gentoo.org/qa/policy-guide/installed-files.html#pg0302