# Contributor: Valery Kartel # Maintainer: Natanael Copa pkgname=cmake pkgver=3.14.4 pkgrel=0 pkgdesc="Cross-platform, open-source make system" url="https://www.cmake.org" arch="all" license="BSD-3-Clause" makedepends="bzip2-dev curl-dev expat-dev libarchive-dev linux-headers libuv-dev ncurses-dev rhash-dev xz-dev zlib-dev" options="!checkroot !check" checkdepends="file musl-utils" subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch " case $pkgver in *.*.*.*) _v=v${pkgver%.*.*};; *.*.*) _v=v${pkgver%.*};; esac source="https://www.cmake.org/files/$_v/cmake-${pkgver}.tar.gz " builddir="$srcdir/$pkgname-$pkgver" _parallel_opt() { local i n for i in $MAKEOPTS; do case "$i" in -j*) n=${i#-j};; esac; done [ -n "$n" ] && echo "--parallel $n" } build() { cd "$builddir" # jsoncpp needs cmake to build so to avoid recursive build # dependency, we use the bundled version of jsoncpp. # Do NOT remove --no-system-jsoncpp unless you consulted # maintainer ./bootstrap \ --prefix=/usr \ --mandir=/share/man \ --datadir=/share/$pkgname \ --docdir=/share/doc/$pkgname \ --system-libs \ --no-system-jsoncpp \ $(_parallel_opt) make } check() { cd "$builddir" CTEST_OUTPUT_ON_FAILURE=TRUE bin/ctest } package() { cd $startdir/src/$pkgname-$pkgver make DESTDIR="$pkgdir" install } bashcomp() { depends="" pkgdesc="Bash completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel bash" mkdir -p "$subpkgdir"/usr/share/bash-completion mv "$pkgdir"/usr/share/cmake/completions \ "$subpkgdir"/usr/share/bash-completion/ } sha512sums="1011ba6cc54680699e97a5e25c4be6055c04f47847225f87f91ada0b2ace2d6f709a3fa49a37fd5c2276118bf29f5ce9d6e24473bff6f3c90f25e92083a5c412 cmake-3.14.4.tar.gz"