summaryrefslogtreecommitdiffstats
path: root/main/gmp/APKBUILD
blob: 36754f55f7e4ce7a7f98b74ba7add83ee5a4fb78 (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
57
58
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gmp
pkgver=6.0.0a
pkgrel=0
pkgdesc="A free library for arbitrary precision arithmetic"
url="http://gmplib.org/"
arch="all"
license="LGPL3"
makedepends="m4 texinfo"
depends=
subpackages="$pkgname-doc $pkgname-dev libgmpxx"
source="ftp://ftp.gnu.org/gnu/gmp/gmp-$pkgver.tar.bz2
	"
replaces="gmp5"
_builddir="$srcdir"/gmp-${pkgver%[a-z]}

prepare() {
	cd "$_builddir"
	sed -i -e "/# We cannot seem to hardcode it, guess we'll fake it./"'{ n; s/add_dir="-L$libdir"/add_dir="-L$lt_sysroot$libdir"/ }' ltmain.sh || return 1
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--with-sysroot=$CBUILDROOT \
		--prefix=/usr \
		--infodir=/usr/share/info \
		--mandir=/usr/share/man \
		--localstatedir=/var/state/gmp \
		--enable-cxx \
		--with-pic \
		|| return 1
	make || return 1
	make check || return 1
}

package() {
	cd "$_builddir"
	make -j1 DESTDIR="${pkgdir}" install || return 1
	rm "$pkgdir"/usr/lib/*.la || return 1
}

libgmpxx() {
	pkgdesc="C++ support for gmp"
	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/libgmpxx.so.* "$subpkgdir"/usr/lib/
}

doc() {
	default_doc
	replaces="gmp5-doc"
}

md5sums="b7ff2d88cae7f8085bd5006096eed470  gmp-6.0.0a.tar.bz2"
sha256sums="7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf  gmp-6.0.0a.tar.bz2"
sha512sums="04c8fde7f6e9c2e42753cebf6345d74ef6bdae5ef764df303b6615d17c8d851ac2876ca32c6ba5e111a8d07575c8b725c7b90518a6616be27a7b46d6aeb82c1a  gmp-6.0.0a.tar.bz2"