aboutsummaryrefslogtreecommitdiffstats
path: root/main/cmake/APKBUILD
blob: 0d4f03b654571e3aac808fec6774fd8accd7319d (plain) (blame)
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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cmake
pkgver=3.20.4
pkgrel=1
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 py3-sphinx"
options="!check"
checkdepends="file musl-utils"
subpackages="$pkgname-doc $pkgname-bash-completion
	"
case $pkgver in
*.*.*.*) _v=v${pkgver%.*.*};;
*.*.*) _v=v${pkgver%.*};;
esac

source="https://www.cmake.org/files/$_v/cmake-$pkgver.tar.gz
	patch-adjust-lib64.patch
	"

_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() {
	# 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 \
		--sphinx-man \
		--system-libs \
		--no-system-jsoncpp \
		$(_parallel_opt)
	make
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE bin/ctest
}

package() {
	cd $startdir/src/$pkgname-$pkgver
	make DESTDIR="$pkgdir" install
}

sha512sums="
f53902a917b8d7b949af305afed3b32fcf981c5c647a77ee7a3bcae1bb5620381a1eacdac4b86bd7e5ea0a7806ec5fbd9a4f4853553f78db4d41d7dd2867c99f  cmake-3.20.4.tar.gz
26e5886ffa30c801b58eaa966c410f71e219914feee446d14c42d75c0a17202a2e168f7eab40f472aa594fd2a1e8572274ec6c0a8207fd5edb75f994479344eb  patch-adjust-lib64.patch
"