Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670282 - x11-apps/igt-gpu-tools' USE flags are force enabled
Summary: x11-apps/igt-gpu-tools' USE flags are force enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-04 16:42 UTC by mercuriete
Modified: 2019-05-19 15:51 UTC (History)
8 users (show)

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


Attachments
patch for x11-apps/igt-gpu-tools-1.23.ebuild (igt-gpu-tools-1.23-honor-VIDEO_CARDS.patch,833 bytes, patch)
2018-12-31 02:29 UTC, Will Simoneau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mercuriete 2018-11-04 16:42:02 UTC
x11-apps/igt-gpu-tools-1.23 is forcing me to build libdrm with nouveau support VIDEO_CARDS="(nouveau*)

I can understand that a tool made by intel can be vendor agnostic but forcing me to support a graphic card that i dont own i think is a bug.

Solution:
- upstream can have some build variables that disables nouveau support
- gentoo can make honor this variables and dont force me to rebuild libdrm with nouveau support.


Please if you dont think this is a bug, close it as you wish.

Thank you for your understanding and for your amazing work.

:)
Comment 1 mercuriete 2018-11-04 16:42:54 UTC
$ sudo emerge igt-gpu-tools --ask

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] dev-libs/xmlrpc-c-1.39.11-r1  USE="cgi curl cxx libxml2 -abyss -test -threads -tools" 
[ebuild  N     ] dev-util/valgrind-3.13.0  USE="-mpi" 
[ebuild     U  ] x11-libs/libdrm-2.4.96 [2.4.93] VIDEO_CARDS="nouveau*" 
[ebuild     U ~] x11-apps/igt-gpu-tools-1.23 [1.22] USE="(chamelium*) (doc*) (glib*) (gsl*) (sound*) (valgrind*) (xrandr*)" VIDEO_CARDS="(nouveau*)"
Comment 2 mercuriete 2018-11-04 16:45:01 UTC
after emerge with --ask this is append to package.use



# required by x11-apps/igt-gpu-tools-1.23::gentoo
# required by igt-gpu-tools (argument)
>=x11-libs/libdrm-2.4.96 video_cards_nouveau
Comment 3 Matt Turner gentoo-dev 2018-11-04 18:39:02 UTC
All USE flags are force enabled currently -- we switched to the Meson build system in 1.22 and upstream had not added the configuration options yet. Currently the ebuild does not have any wiring to control the options via the USE flags.

If you would like to hook them up I would be very appreciative.

> Thank you for your understanding and for your amazing work.
> 
> :)

Thanks for that! It's really appreciated :)
Comment 4 Chris 2018-11-14 21:42:17 UTC
In meson_options.txt there is the following:

option('with_libdrm',
       type : 'array',
       value : ['auto'],
       choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'],
       description : 'libdrm libraries to be used')

Is not possible to use this option via the ebuild?
Comment 5 Matt Turner gentoo-dev 2018-11-15 00:25:58 UTC
No, as explained in comment 3.
Comment 6 Lik 2018-12-06 11:34:42 UTC
According to build scripts (meson.build#n120) there are no strict requirements to enable all supported video cards, they are probed and enabled at build stage. It would be wise to require one of supported video cards, for example like LIBDRM_DEPSTRING in media-libs/mesa.
Comment 7 Will Simoneau 2018-12-31 02:29:33 UTC
Created attachment 559076 [details, diff]
patch for x11-apps/igt-gpu-tools-1.23.ebuild

How about this?
Comment 8 Tor Rune Skoglund 2019-01-29 12:54:58 UTC
(In reply to Will Simoneau from comment #7)
> Created attachment 559076 [details, diff] [details, diff]
> patch for x11-apps/igt-gpu-tools-1.23.ebuild
> 
> How about this?

The patch does not seem to work for me?  Am I doing something wrong?


babe /usr/portage/x11-apps/igt-gpu-tools # cp igt-gpu-tools-1.23.ebuild igt-gpu-tools-1.23.ebuild.old
babe /usr/portage/x11-apps/igt-gpu-tools # cat > thepatch.diff
--- igt-gpu-tools-1.23.ebuild.old       2018-10-28 21:39:34.000000000 -0400
+++ igt-gpu-tools-1.23.ebuild   2018-12-30 21:16:21.790679661 -0500
@@ -21,7 +21,8 @@
 LICENSE="MIT"
 SLOT="0"
 IUSE="alsa chamelium doc glib gsl sound valgrind video_cards_amdgpu video_cards_intel video_cards_nouveau X xrandr xv"
-REQUIRED_USE="chamelium? ( glib gsl )"
+REQUIRED_USE="chamelium? ( glib gsl )
+       || ( video_cards_amdgpu video_cards_intel video_cards_nouveau )"
 RESTRICT="test"
 
 X86_RDEPEND="
@@ -52,3 +53,13 @@
        amd64? ( ${X86_DEPEND} )
        x86? ( ${X86_DEPEND} )
        doc? ( >=dev-util/gtk-doc-1.25-r1 )"
+
+src_configure() {
+       local gpus=""
+       use video_cards_amdgpu  && gpus+="amdgpu,"
+       use video_cards_intel   && gpus+="intel,"
+       use video_cards_nouveau && gpus+="nouveau,"
+
+       local emesonargs=(-Dwith_libdrm=${gpus%?})
+       meson_src_configure
+}
babe /usr/portage/x11-apps/igt-gpu-tools # patch igt-gpu-tools-1.23.ebuild < thepatch.diff 
patching file igt-gpu-tools-1.23.ebuild
babe /usr/portage/x11-apps/igt-gpu-tools # ebuild igt-gpu-tools-1.23.ebuild manifest
>>> Creating Manifest for /usr/portage/x11-apps/igt-gpu-tools
babe /usr/portage/x11-apps/igt-gpu-tools # emerge -pv  igt-gpu-tools

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-libs/libdrm-2.4.96::gentoo  USE="-libkms -valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="amdgpu* intel nouveau* (-exynos) (-freedreno) (-omap) -radeon (-tegra) (-vc4) (-vivante) -vmware" 0 KiB
[ebuild  N    ~] x11-apps/igt-gpu-tools-1.23::gentoo  USE="(X) (alsa) (chamelium) (doc) (glib) (gsl) (sound) (valgrind) (xrandr) (xv)" VIDEO_CARDS="(amdgpu) (intel) (nouveau)" 1 022 KiB

Total: 2 packages (1 new, 1 reinstall), Size of downloads: 1 022 KiB

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by x11-apps/igt-gpu-tools-1.23::gentoo
# required by @selected
# required by @world (argument)
>=x11-libs/libdrm-2.4.96 video_cards_amdgpu video_cards_nouveau
Comment 9 Will Simoneau 2019-01-29 14:07:53 UTC
(In reply to Tor Rune Skoglund from comment #8)
> (In reply to Will Simoneau from comment #7)
> > How about this?
>
> The patch does not seem to work for me?  Am I doing something wrong?

The patch only tries to implement working USE logic in the ebuild. You also need to undo the forced VIDEO_CARDS= that are currently being set by the profile in order to make use of it.

IIRC, it's something along the lines of putting this:
x11-apps/igt-gpu-tools -video_cards_amdgpu -video_cards_intel -video_cards_nouveau
... in /etc/portage/profile/package.use.force, but don't quote me on that - I don't have the machine I did it on to refer to at the moment.
Comment 10 Tor Rune Skoglund 2019-01-30 09:04:48 UTC
Ah, I see. Thanks. So the profile itself needs an update then, ideally.
Comment 11 Matt Turner gentoo-dev 2019-01-30 17:01:12 UTC
Someone send me a pull request :)
Comment 12 Larry the Git Cow gentoo-dev 2019-05-09 21:43:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df5a2d2f2df9dc919f65a50564567d04a709bd41

commit df5a2d2f2df9dc919f65a50564567d04a709bd41
Author:     Denis Lisov <dennis.lissov@gmail.com>
AuthorDate: 2019-05-09 17:01:21 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2019-05-09 21:42:50 +0000

    x11-apps/igt-gpu-tools: update USE flags for meson
    
    Initially the igt-gpu-tools meson build system had no optional
    dependencies so all USE flags were forced on.
    
    This commit restores the ability to disable optional dependencies and
    restructures the USE flags from dependency-based (alsa, gsl, xrandr) to
    feature-based (sound, overlay).
    
    Closes: https://bugs.gentoo.org/670282
    Closes: https://github.com/gentoo/gentoo/pull/11946
    Signed-off-by: Denis Lisov <dennis.lissov@gmail.com>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 profiles/arch/amd64/package.use.mask               |   4 +
 profiles/arch/base/package.use.mask                |   4 +
 profiles/arch/x86/package.use.mask                 |   4 +
 profiles/base/package.use.force                    |   6 --
 .../igt-gpu-tools/igt-gpu-tools-1.23-r1.ebuild     | 104 +++++++++++++++++++++
 x11-apps/igt-gpu-tools/igt-gpu-tools-9999.ebuild   |  95 ++++++++++++++-----
 x11-apps/igt-gpu-tools/metadata.xml                |   5 +
 7 files changed, 193 insertions(+), 29 deletions(-)
Comment 13 mercuriete 2019-05-19 15:51:10 UTC
I tested it right now and it is fixed.

:-) Thank you very much for your amazing work