commit:     fe98a4171f21caa41ec6b9bcba9d1b3f0f5aa6f7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  6 04:02:26 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun  6 04:02:26 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe98a417

sys-apps/dtc: conditionally build tests

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/dtc/dtc-1.7.0.ebuild | 12 +++++++++++-
 sys-apps/dtc/dtc-9999.ebuild  | 12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/sys-apps/dtc/dtc-1.7.0.ebuild b/sys-apps/dtc/dtc-1.7.0.ebuild
index 3c46abe827ed..117f6b36238e 100644
--- a/sys-apps/dtc/dtc-1.7.0.ebuild
+++ b/sys-apps/dtc/dtc-1.7.0.ebuild
@@ -18,7 +18,8 @@ HOMEPAGE="https://devicetree.org/ 
https://git.kernel.org/cgit/utils/dtc/dtc.git/
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="static-libs yaml"
+IUSE="static-libs test yaml"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
        sys-devel/bison
@@ -39,10 +40,19 @@ PATCHES=(
        "${FILESDIR}"/${P}-meson-macos.patch
 )
 
+src_prepare() {
+       default
+
+       if ! use test ; then
+               sed -i -e "/subdir('tests')/d" meson.build || die
+       fi
+}
+
 src_configure() {
        local emesonargs=(
                -Ddefault_library=$(usex static-libs both shared)
                -Dpython=disabled
+               -Dtools=true
                -Dvalgrind=disabled # only used for some tests
                $(meson_feature yaml)
        )

diff --git a/sys-apps/dtc/dtc-9999.ebuild b/sys-apps/dtc/dtc-9999.ebuild
index b1873ee6eac6..ce10f9e3b775 100644
--- a/sys-apps/dtc/dtc-9999.ebuild
+++ b/sys-apps/dtc/dtc-9999.ebuild
@@ -18,7 +18,8 @@ HOMEPAGE="https://devicetree.org/ 
https://git.kernel.org/cgit/utils/dtc/dtc.git/
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="static-libs yaml"
+IUSE="static-libs test yaml"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
        sys-devel/bison
@@ -34,10 +35,19 @@ DOCS=(
        Documentation/manual.txt
 )
 
+src_prepare() {
+       default
+
+       if ! use test ; then
+               sed -i -e "/subdir('tests')/d" meson.build || die
+       fi
+}
+
 src_configure() {
        local emesonargs=(
                -Ddefault_library=$(usex static-libs both shared)
                -Dpython=disabled
+               -Dtools=true
                -Dvalgrind=disabled # only used for some tests
                $(meson_feature yaml)
        )

Reply via email to