aboutsummaryrefslogtreecommitdiffstats
path: root/main/cmake/APKBUILD
blob: 5e401719014aae7b863d5c8c79fa6feafc8ea13e (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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cmake
pkgver=3.10.3
pkgrel=0
pkgdesc="Cross-platform, open-source make system"
url="http://www.cmake.org"
arch="all"
license="BSD-3-Clause"
makedepends="ncurses-dev curl-dev expat-dev zlib-dev bzip2-dev libarchive-dev
    libuv-dev xz-dev rhash-dev jsoncpp-dev"
options="!checkroot !check"
checkdepends="musl-utils file"
subpackages="$pkgname-doc"

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

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

check() {
	cd "$builddir"
	CTEST_OUTPUT_ON_FAILURE=TRUE bin/ctest
}

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

sha512sums="1ba6381321cb34c3c050548a1346d3b92d590a196d8aff7435c079cd485d01f7a6cd650ad97d00931aff424fcdc195bbaa6d9d7db679bf02f72f586c7b528ae4  cmake-3.10.3.tar.gz"