aboutsummaryrefslogtreecommitdiffstats
path: root/main/cmake/APKBUILD
blob: 0e9293fe2c8980cd8cfc59e87533b4221d7f4fb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cmake
pkgver=3.13.0
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
	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="c353d20afc657f84e71aa5d6e9aa93caaca4eba33e3d1d75d25a504e50a1a8651bce1a27989998629449f36b3ed5c3be4c0a11b7f490f22abec9e73c1aa9073e  cmake-3.13.0.tar.gz"