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@gentoo.org>
This commit is contained in:
Sam James
2021-11-12 04:45:59 +00:00
parent 571107648a
commit c005f84331

View File

@@ -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() {