1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 19:25:25 +03:00
aports/testing/libtree/APKBUILD
Jakub Jirutka 4916970125 testing/libtree: properly fix build when tests are disabled
This reverts commits 5b11a2f8f7 and
a92551c9c2.

/cc @PureTryOut
2021-12-13 01:09:10 +01:00

56 lines
1.6 KiB
Text

# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libtree
pkgver=2.0.0
pkgrel=0
pkgdesc="ldd as a tree with an option to bundle dependencies into a single folder"
url="https://github.com/haampie/libtree"
arch="all"
license="MIT"
depends="cmd:chrpath cmd:strip"
makedepends="
cmake
cxxopts-dev
elfio-dev
termcolor-dev
"
checkdepends="
bash
diffutils
gtest-dev
"
subpackages="$pkgname-doc"
source="https://github.com/haampie/libtree/archive/v$pkgver/libtree-$pkgver.tar.gz
alpine-skip-default.patch
fix-default-platform.patch
"
build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=None \
-DLIBTREE_BUILD_TESTS=$(want_check && echo ON || echo OFF) \
-DLIBTREE_DEFAULT_PLATFORM=$CARCH \
$CMAKE_CROSSOPTS .
cmake --build build
}
check() {
cd build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
9272afd8540110f43ade864a2df58d8b8a7690c79cd29a9804b43e7e550bc05a4da530a763a27bd85a474673055e7a5ba63c0aa0bcaf8b246fbfc73a4f36c870 libtree-2.0.0.tar.gz
ff0fc62afe71ef21f3e0dba5f4983c81f29fd2164ea4703343a5c6dd830fdf9a080359d07a1a47f5c7cce4890eb6fb308e36184b7fa8a80716476606ccb36268 alpine-skip-default.patch
52570245e0fabc17f5bf1c14c427e56a08eb7b4623c4da272a102ff7ced9290c5a11c2bf5e11f3b8c5bfea8d5d24edb82c622c4ac9e6eeacd11e9286b2c5f6c4 fix-default-platform.patch
"