summaryrefslogtreecommitdiff
path: root/system/cmake/APKBUILD
blob: d1ac9176d0a0f6ccdf5a692af6feb3b5b2e806aa (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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=cmake
pkgver=3.13.4
pkgrel=0
pkgdesc="Cross-platform build system"
url="https://cmake.org"
arch="all"
license="CMake"
makedepends="ncurses-dev curl-dev expat-dev zlib-dev bzip2-dev libarchive-dev
	libuv-dev xz-dev rhash-dev"
checkdepends="musl-utils file"
subpackages="$pkgname-doc"

case $pkgver in
*.*.*.*) _v=v${pkgver%.*.*};;
*.*.*) _v=v${pkgver%.*};;
esac

source="https://cmake.org/files/$_v/cmake-${pkgver}.tar.gz"

_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
	./bootstrap \
		--prefix=/usr \
		--mandir=/share/man \
		--datadir=/share/$pkgname \
		--docdir=/share/doc/$pkgname \
		--system-libs \
		--no-system-jsoncpp \
		$(_parallel_opt)
	make
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE bin/ctest
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="5a2cc092109652ced5a3a6ae00fe0c7d134efa7d90d59f376368408bb684343db9e144ee53b184f3437f8a86cf9976a130a1e1676c993d56b278a6640a418c93  cmake-3.13.4.tar.gz"