commit:     c005f8433101d021451beb522404bbc0bac8399d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 12 04:45:59 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 12 04:45:59 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c005f843

dev-libs/leatherman: conditionally build tests (workaround/fix build with 
glibc-2.34)

Tests are already restricted but now we can always build leatherman w/
glibc-2.34 at least.

Tweak some other bits while we're here (missing die in src_test, use
some CMake options from CMakeLists.txt).

Closes: https://bugs.gentoo.org/806607
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...n-1.12.6.ebuild => leatherman-1.12.6-r1.ebuild} | 37 +++++++++++-----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/dev-libs/leatherman/leatherman-1.12.6.ebuild 
b/dev-libs/leatherman/leatherman-1.12.6-r1.ebuild
similarity index 67%
rename from dev-libs/leatherman/leatherman-1.12.6.ebuild
rename to dev-libs/leatherman/leatherman-1.12.6-r1.ebuild
index 93aeee4fe22..33604a38cda 100644
--- a/dev-libs/leatherman/leatherman-1.12.6.ebuild
+++ b/dev-libs/leatherman/leatherman-1.12.6-r1.ebuild
@@ -10,19 +10,20 @@ HOMEPAGE="https://github.com/puppetlabs/leatherman";
 SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
 
 LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm ~hppa ppc ppc64 sparc x86"
 IUSE="debug static-libs test"
 #RESTRICT="!test? ( test )"
 RESTRICT="test"  # restricted til we don't need the shared_nowide patch
-KEYWORDS="amd64 ~arm ~hppa ppc ppc64 sparc x86"
-SLOT="0/${PV}"
 
-RDEPEND="net-misc/curl"
-DEPEND=">=dev-libs/boost-1.73:=[nls]
-       net-misc/curl
-       >=sys-devel/gcc-4.8:*"
+RDEPEND=">=dev-libs/boost-1.73:=[nls]
+       net-misc/curl"
+DEPEND="${RDEPEND}"
 
-PATCHES=( "${FILESDIR}"/portage-sandbox-test-fix.patch )
-PATCHES+=( "${FILESDIR}"/1.12.2-shared_nowide.patch )
+PATCHES=(
+       "${FILESDIR}"/portage-sandbox-test-fix.patch
+       "${FILESDIR}"/1.12.2-shared_nowide.patch
+)
 
 src_prepare() {
        sed -i 's/\-Werror\ //g' "cmake/cflags.cmake" || die
@@ -34,26 +35,24 @@ src_configure() {
        local mycmakeargs=(
                -DCMAKE_VERBOSE_MAKEFILE=ON
                -DCMAKE_BUILD_TYPE=None
+               -DLEATHERMAN_ENABLE_TESTING=$(usex test)
+               # We depend on Boost with nls, so this is always true
+               -DLEATHERMAN_USE_ICU=ON
+
+               -DLEATHERMAN_SHARED=$(usex !static-libs)
        )
-       if ! use static-libs; then
-               mycmakeargs+=(
-                       -DLEATHERMAN_SHARED=ON
-               )
-       else
-               mycmakeargs+=(
-                       -DLEATHERMAN_SHARED=OFF
-               )
-       fi
+
        if use debug; then
                mycmakeargs+=(
-                 -DCMAKE_BUILD_TYPE=Debug
+                       -DCMAKE_BUILD_TYPE=Debug
                )
        fi
+
        cmake_src_configure
 }
 
 src_test() {
-       "${WORKDIR}/${P}"_build/bin/leatherman_test
+       "${WORKDIR}/${P}"_build/bin/leatherman_test || die
 }
 
 src_install() {

Reply via email to