dev-libs/capstone:guard tests building behind USE=test, bug #663006
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 18 Sep 2019 22:11:26 +0000 (23:11 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Wed, 18 Sep 2019 22:12:21 +0000 (23:12 +0100)
Reported-by: Michał Górny
Closes: https://bugs.gentoo.org/663006
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
dev-libs/capstone/capstone-4.0.1.ebuild

index e4931c690d0d814a254adf83d225c833c0272594..77b9b960a5834e51990819e8db01f802030d15b2 100644 (file)
@@ -16,7 +16,9 @@ LICENSE="BSD"
 SLOT="0/4" # libcapstone.so.4
 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
 
-IUSE="python"
+RESTRICT="!test? ( test )"
+
+IUSE="python test"
 RDEPEND="python? ( ${PYTHON_DEPS} )"
 DEPEND="${RDEPEND}
        python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
@@ -63,6 +65,11 @@ src_configure() {
                EOF
        } >> config.mk || die
 
+       if ! use test; then
+               # Don't build tests if not requested: bug #663006
+               sed -i tests/Makefile -e 's@all: $(BINARY)@all:@' || die
+       fi
+
        wrap_python ${FUNCNAME}
 }