aboutsummaryrefslogtreecommitdiffstats
path: root/main/gmp/APKBUILD
blob: d562f9b526a16a836ef2a1b3e076f15456ac85ef (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
59
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gmp
pkgver=6.1.0
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="https://gmplib.org/download/gmp/gmp-$pkgver.tar.xz
	"
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
	if [ "$CBUILD" = "$CHOST" ]; then
		make check || return 1
	fi
}

package() {
	cd "$_builddir"
	make -j1 DESTDIR="${pkgdir}" install || 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="a9868ef2556ad6a2909babcd1428f3c7  gmp-6.1.0.tar.xz"
sha256sums="68dadacce515b0f8a54f510edf07c1b636492bcdb8e8d54c56eb216225d16989  gmp-6.1.0.tar.xz"
sha512sums="3647f07914e6c01b28d94f2d9783e50b0ca9f742a694f56d5759e79a057143ded578b71707ff909c6b0f5710862974606461608e73b33af3114b5338670d8630  gmp-6.1.0.tar.xz"