x11-apps/igt-gpu-tools: update USE flags for meson
authorDenis Lisov <dennis.lissov@gmail.com>
Thu, 9 May 2019 17:01:21 +0000 (20:01 +0300)
committerMatt Turner <mattst88@gentoo.org>
Thu, 9 May 2019 21:42:50 +0000 (14:42 -0700)
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
profiles/arch/base/package.use.mask
profiles/arch/x86/package.use.mask
profiles/base/package.use.force
x11-apps/igt-gpu-tools/igt-gpu-tools-1.23-r1.ebuild [new file with mode: 0644]
x11-apps/igt-gpu-tools/igt-gpu-tools-9999.ebuild
x11-apps/igt-gpu-tools/metadata.xml

index 16f29053d76104bcc1d937e48097ecdf827805ad..7f5f720859617566eb077fd82e4335dfda9741a9 100644 (file)
 
 #--- END OF EXAMPLES ---
 
+# Denis Lisov <dennis.lissov@gmail.com> (09 May 2019)
+# Overlay can only be built on amd64 and x86
+x11-apps/igt-gpu-tools -overlay
+
 # Sergei Trofimovich <slyfox@gentoo.org> (16 Mar 2019)
 # sys-block/megactl works on x86 and amd64
 www-apps/phpsysinfo -megactl
index c80bc9f0d7f19965d06cb07b1aa642eea4a6a0f9..614b36ab75816398f0738151fd20abde1f46ac25 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Denis Lisov <dennis.lissov@gmail.com> (09 May 2019)
+# Overlay can only be built on amd64 and x86
+x11-apps/igt-gpu-tools overlay
+
 # Sergei Trofimovich <slyfox@gentoo.org> (16 Mar 2019)
 # sys-block/megactl works only on amd64 and x86 so far, bug #670564
 www-apps/phpsysinfo megactl
index 6aa126754ab078a147eafafba4f3da04bd0570eb..9fb753ae9e5f221ed30ea7aa4b35c4b2ee214af6 100644 (file)
@@ -3,6 +3,10 @@
 
 # This file requires >=portage-2.1.1
 
+# Denis Lisov <dennis.lissov@gmail.com> (09 May 2019)
+# Overlay can only be built on amd64 and x86
+x11-apps/igt-gpu-tools -overlay
+
 # Sergei Trofimovich <slyfox@gentoo.org> (16 Mar 2019)
 # sys-block/megactl works on x86 and amd64
 www-apps/phpsysinfo -megactl
index e18ccc6024ffd0829d96d341bec68572b8b109f1..04fc8f63c5251a8e783f2c4de7f86dad02813606 100644 (file)
@@ -24,12 +24,6 @@ net-misc/netkit-bootparamd libtirpc
 sci-astronomy/esomidas libtirpc
 sys-cluster/glusterfs libtirpc
 
-# Matt Turner <mattst88@gentoo.org> (13 Jun 2018)
-# Upstream is transitioning to Meson, but does not yet have any configuration
-# options. Until those configuration options are provided, force USE flags on
-# to avoid automagic deps.
->=x11-apps/igt-gpu-tools-1.23 alsa chamelium doc glib gsl sound valgrind video_cards_amdgpu video_cards_intel video_cards_nouveau X xrandr xv
-
 # NP-Hardass <NP-Hardass@gentoo.org> (10 Apr 2017)
 # Always force patch on appropriate variant to ensure
 # similar experience when using app-emulation/wine-any
diff --git a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.23-r1.ebuild b/x11-apps/igt-gpu-tools/igt-gpu-tools-1.23-r1.ebuild
new file mode 100644 (file)
index 0000000..8318e1c
--- /dev/null
@@ -0,0 +1,104 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+EGIT_REPO_URI="https://gitlab.freedesktop.org/drm/${PN}.git"
+if [[ ${PV} = *9999* ]]; then
+       GIT_ECLASS="git-r3"
+fi
+
+inherit ${GIT_ECLASS} meson
+
+DESCRIPTION="Intel GPU userland tools"
+
+HOMEPAGE="https://01.org/linuxgraphics https://gitlab.freedesktop.org/drm/igt-gpu-tools"
+if [[ ${PV} = *9999* ]]; then
+       SRC_URI=""
+else
+       KEYWORDS="~amd64 ~x86"
+       SRC_URI="https://www.x.org/releases/individual/app/${P}.tar.xz"
+fi
+LICENSE="MIT"
+SLOT="0"
+IUSE="chamelium doc man overlay sound valgrind video_cards_amdgpu video_cards_intel video_cards_nouveau X xv"
+REQUIRED_USE="
+       || ( video_cards_amdgpu video_cards_intel video_cards_nouveau )
+       overlay? (
+               video_cards_intel
+               || ( X xv )
+       )
+"
+RESTRICT="test"
+
+RDEPEND="
+       dev-libs/glib:2
+       dev-libs/openssl:=
+       sys-apps/kmod:=
+       sys-libs/libunwind:=
+       sys-libs/zlib:=
+       sys-process/procps:=
+       virtual/libudev:=
+       >=x11-libs/cairo-1.12.0[X?]
+       >=x11-libs/libdrm-2.4.82[video_cards_amdgpu?,video_cards_intel?,video_cards_nouveau?]
+       >=x11-libs/libpciaccess-0.10
+       chamelium? (
+               dev-libs/xmlrpc-c
+               sci-libs/gsl
+               x11-libs/pixman
+       )
+       overlay? (
+               >=x11-libs/libXrandr-1.3
+               xv? (
+                       x11-libs/libX11
+                       x11-libs/libXext
+                       x11-libs/libXv
+               )
+       )
+       sound? (
+               sci-libs/gsl
+               media-libs/alsa-lib:=
+       )
+       valgrind? ( dev-util/valgrind )
+       "
+DEPEND="${RDEPEND}
+       doc? ( >=dev-util/gtk-doc-1.25-r1 )
+       man? ( dev-python/docutils )
+       overlay? (
+               >=dev-util/peg-0.1.18
+               x11-base/xorg-proto
+       )
+       video_cards_intel? (
+               sys-devel/bison
+               sys-devel/flex
+       )
+"
+
+src_prepare() {
+       sed -e "s/rst2man/rst2man.py/" -i man/rst2man.sh
+       sed -e "s/find_program('rst2man'/find_program('rst2man.py'/" -i man/meson.build
+       default_src_prepare
+}
+
+src_configure() {
+       local gpus=""
+       use video_cards_amdgpu  && gpus+="amdgpu,"
+       use video_cards_intel   && gpus+="intel,"
+       use video_cards_nouveau && gpus+="nouveau,"
+
+       local overlay_backends=""
+       use overlay && use xv && overlay_backends+="xv,"
+       use overlay && use X && overlay_backends+="x,"
+
+       local emesonargs=(
+               -Dbuild_audio=$(usex sound true false)
+               -Dbuild_chamelium=$(usex chamelium true false)
+               -Dbuild_docs=$(usex doc true false)
+               -Dbuild_man=$(usex man true false)
+               -Dbuild_overlay=$(usex overlay true false)
+               -Dbuild_tests=$(usex doc true false) # Test build is required for docs
+               -Doverlay_backends=${overlay_backends%?}
+               -Dwith_libdrm=${gpus%?}
+               -Dwith_valgrind=$(usex valgrind true false)
+       )
+       meson_src_configure
+}
index 65bdd0b606896829d408db2ae6fe5ccbd38c0b50..81fff23b3e7493efae888f444de6a4c3243c7b13 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -20,35 +20,84 @@ else
 fi
 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 )"
+IUSE="chamelium doc man overlay runner unwind valgrind video_cards_amdgpu video_cards_intel video_cards_nouveau X xv"
+REQUIRED_USE="
+       || ( video_cards_amdgpu video_cards_intel video_cards_nouveau )
+       overlay? (
+               video_cards_intel
+               || ( X xv )
+       )
+"
 RESTRICT="test"
 
-X86_RDEPEND="
-       xv? (
-               x11-libs/libX11
-               x11-libs/libXext
-               x11-libs/libXv
-       )"
-X86_DEPEND="x11-base/xorg-proto
-       >=dev-util/peg-0.1.18"
-RDEPEND="sys-apps/kmod:=
+RDEPEND="
+       dev-libs/elfutils
+       dev-libs/glib:2
+       sys-apps/kmod:=
        sys-libs/libunwind:=
+       sys-libs/zlib:=
        sys-process/procps:=
        virtual/libudev:=
        >=x11-libs/cairo-1.12.0[X?]
        >=x11-libs/libdrm-2.4.82[video_cards_amdgpu?,video_cards_intel?,video_cards_nouveau?]
        >=x11-libs/libpciaccess-0.10
-       alsa? ( media-libs/alsa-lib:= )
-       chamelium? ( dev-libs/xmlrpc-c )
-       glib? ( dev-libs/glib:2 )
-       gsl? ( sci-libs/gsl )
+       x11-libs/pixman
+       chamelium? (
+               dev-libs/xmlrpc-c[curl]
+               sci-libs/gsl
+               media-libs/alsa-lib:=
+       )
+       overlay? (
+               >=x11-libs/libXrandr-1.3
+               xv? (
+                       x11-libs/libX11
+                       x11-libs/libXext
+                       x11-libs/libXv
+               )
+       )
+       runner? ( dev-libs/json-c:= )
+       unwind? ( sys-libs/libunwind )
        valgrind? ( dev-util/valgrind )
-       video_cards_intel? ( sys-libs/zlib:= )
-       xrandr? ( >=x11-libs/libXrandr-1.3 )
-       amd64? ( ${X86_RDEPEND} )
-       x86? ( ${X86_RDEPEND} )"
+       "
 DEPEND="${RDEPEND}
-       amd64? ( ${X86_DEPEND} )
-       x86? ( ${X86_DEPEND} )
-       doc? ( >=dev-util/gtk-doc-1.25-r1 )"
+       doc? ( >=dev-util/gtk-doc-1.25-r1 )
+       man? ( dev-python/docutils )
+       overlay? (
+               >=dev-util/peg-0.1.18
+               x11-base/xorg-proto
+       )
+       video_cards_intel? (
+               sys-devel/bison
+               sys-devel/flex
+       )
+"
+
+src_prepare() {
+       sed -e "s/find_program('rst2man-3'/find_program('rst2man.py', 'rst2man-3'/" -i man/meson.build
+       default_src_prepare
+}
+
+src_configure() {
+       local gpus=""
+       use video_cards_amdgpu  && gpus+="amdgpu,"
+       use video_cards_intel   && gpus+="intel,"
+       use video_cards_nouveau && gpus+="nouveau,"
+
+       local overlay_backends=""
+       use overlay && use xv && overlay_backends+="xv,"
+       use overlay && use X && overlay_backends+="x,"
+
+       local emesonargs=(
+               -Dbuild_chamelium=$(usex chamelium true false)
+               -Dbuild_docs=$(usex doc true false)
+               -Dbuild_man=$(usex man true false)
+               -Dbuild_overlay=$(usex overlay true false)
+               -Dbuild_runner=$(usex runner true false)
+               -Dbuild_tests=$(usex doc true false) # Test build is required for docs
+               -Doverlay_backends=${overlay_backends%?}
+               -Dwith_libdrm=${gpus%?}
+               -Dwith_libunwind=$(usex unwind true false)
+               -Dwith_valgrind=$(usex valgrind true false)
+       )
+       meson_src_configure
+}
index df5e452097051749a285b3ae72aa921fd95950e2..d1c1f29fe122193eb5d4c9a2142f57f6c32f91f0 100644 (file)
@@ -8,7 +8,12 @@
 <use>
  <flag name="chamelium">Enables support for building Chamelium tests</flag>
  <flag name="glib">Support reading config files via glib helpers</flag>
+ <flag name="man">Build and install man pages</flag>
+ <flag name="overlay">Build the intel-gpu-overlay utility</flag>
+ <flag name="runner">Build the test runner</flag>
  <flag name="valgrind">Support valgrind annotations</flag>
  <flag name="xrandr">Enable support for the X RandR extension</flag>
+ <flag name="xv">Enable intel-gpu-overlay xv backend</flag>
+ <flag name="X">Enable intel-gpu-overlay xlib/cairo backend</flag>
 </use>
 </pkgmetadata>