APKBUILD 1.79 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
Natanael Copa's avatar
Natanael Copa committed
2
pkgname=cmake
Sören Tempel's avatar
Sören Tempel committed
3
pkgver=3.3.1
Natanael Copa's avatar
Natanael Copa committed
4
pkgrel=0
Natanael Copa's avatar
Natanael Copa committed
5
6
pkgdesc="CMake is a cross-platform open-source make system"
url="http://www.cmake.org"
7
arch="all"
Natanael Copa's avatar
Natanael Copa committed
8
license="CMake"
Natanael Copa's avatar
Natanael Copa committed
9
depends=
10
11
makedepends="ncurses-dev curl-dev expat-dev zlib-dev bzip2-dev libarchive-dev"
subpackages="$pkgname-doc"
12
13
14
15
16
17

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

18
source="http://www.cmake.org/files/$_v/cmake-${pkgver}.tar.gz
Natanael Copa's avatar
Natanael Copa committed
19
	musl-header-fixes.patch
Natanael Copa's avatar
Natanael Copa committed
20
	"
Natanael Copa's avatar
Natanael Copa committed
21

22
_builddir="$srcdir/$pkgname-$pkgver"
Natanael Copa's avatar
Natanael Copa committed
23
24
25

parallel_opt() {
	local i n
Sören Tempel's avatar
Sören Tempel committed
26
	for i in $MAKEOPTS; do
Natanael Copa's avatar
Natanael Copa committed
27
28
29
30
31
32
33
		case "$i" in
			-j*) n=${i#-j};;
		esac;
	done
	[ -n "$n" ] && echo "--parallel $n"
}

34
35
36
37
38
39
40
41
42
43
44
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
45
46
	# jsoncpp seems to need cmake to build so to avoid recursive build dep
	# we use the bundled
Natanael Copa's avatar
Natanael Copa committed
47
48
	./bootstrap --prefix=/usr \
		--mandir=/share/man \
Natanael Copa's avatar
Natanael Copa committed
49
50
		--datadir=/share/$pkgname \
		--docdir=/share/doc/$pkgname \
51
		--system-libs \
Natanael Copa's avatar
Natanael Copa committed
52
		--no-system-jsoncpp \
Natanael Copa's avatar
Natanael Copa committed
53
54
55
		$(parallel_opt)

	make || return 1
Natanael Copa's avatar
Natanael Copa committed
56
57
58
59
}

package() {
	cd $startdir/src/$pkgname-$pkgver
Natanael Copa's avatar
Natanael Copa committed
60
61
	make DESTDIR="$pkgdir" install
}
Natanael Copa's avatar
Natanael Copa committed
62

Sören Tempel's avatar
Sören Tempel committed
63
md5sums="52638576f4e1e621fed6c3410d3a1b12  cmake-3.3.1.tar.gz
Natanael Copa's avatar
Natanael Copa committed
64
500d40f006182e7f4e3e594347882fdf  musl-header-fixes.patch"
Sören Tempel's avatar
Sören Tempel committed
65
sha256sums="cd65022c6a0707f1c7112f99e9c981677fdd5518f7ddfa0f778d4cee7113e3d6  cmake-3.3.1.tar.gz
Natanael Copa's avatar
Natanael Copa committed
66
7169e21d649b35c031a615986ebc559d772d40667506ce495cbc51f828825ae8  musl-header-fixes.patch"
Sören Tempel's avatar
Sören Tempel committed
67
sha512sums="bc60dd58f884467d7426f73c8e3e78b7ea0a0089f2577c596f34bcfc6d38dfd5d4034589c82dd9cadf138d619dbc4f0c4519faeeeef0672b4578180de21b33f1  cmake-3.3.1.tar.gz
Natanael Copa's avatar
Natanael Copa committed
68
36ec0e51b4b1f00f8d7439d3e5a39ee8882704f69ec1ca901010ffba4914e7949aefafdb6698c28b966d5bccfa209aca993c228a37189ced047203d02644127c  musl-header-fixes.patch"