APKBUILD 1.8 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
3
pkgver=2.8.11.2
4
pkgrel=1
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
19
source="http://www.cmake.org/files/$_v/cmake-${pkgver}.tar.gz
	fix-execinfo.h-detection.patch"
Natanael Copa's avatar
Natanael Copa committed
20

21
_builddir="$srcdir/$pkgname-$pkgver"
Natanael Copa's avatar
Natanael Copa committed
22
23
24
25
26
27
28
29
30
31
32

parallel_opt() {
	local i n
	for i in $MAKEOPTS; do 
		case "$i" in
			-j*) n=${i#-j};;
		esac;
	done
	[ -n "$n" ] && echo "--parallel $n"
}

33
34
35
36
37
38
39
40
41
42
43
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"
44
45
	# bug in cmake.
	# http://www.mail-archive.com/cmake@cmake.org/msg09515.html
Natanael Copa's avatar
Natanael Copa committed
46
47
#	export CC="gcc"
#	export CXX="g++"
48

Natanael Copa's avatar
Natanael Copa committed
49
50
	./bootstrap --prefix=/usr \
		--mandir=/share/man \
Natanael Copa's avatar
Natanael Copa committed
51
		--docdir=/share/cmake-${pkgver%.*}/doc \
52
		--system-libs \
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

63
64
65
66
67
68
md5sums="6f5d7b8e7534a5d9e1a7664ba63cf882  cmake-2.8.11.2.tar.gz
892a67b8d52f3fd81ffb2077e2292e7c  fix-execinfo.h-detection.patch"
sha256sums="b32acb483afdd14339941c6e4ec25f633d916a7a472653a0b00838771a6c0562  cmake-2.8.11.2.tar.gz
fac853838e95c36d80f478402f21f0b0c2c76e93c7eb5070df0f84820ed74f64  fix-execinfo.h-detection.patch"
sha512sums="05ac2293300bf15fdcf98f07dfa7b9862b117cd0d6f7e30c1995ecb8a3bfd94e2b7e778caaa05bc46bd88eca5afe7f6be38b1904275a9a2aeae562bfdbaeec94  cmake-2.8.11.2.tar.gz
857ced87d530aa88875df9ff313fe5617368b7be8661030bb3e66537a5416a2151fa671a94e901a1db30f0b4ebe76de787ebdd237d181d893c269ac7530ac705  fix-execinfo.h-detection.patch"