aboutsummaryrefslogtreecommitdiffstats
path: root/main/gmp5/APKBUILD
blob: 1e369065563e6703a7bea4b8c97b2e2abf980d56 (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
60
61
62
63
64
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_name=gmp
pkgname=${_name}5

pkgver=5.1.3
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 gmp-dev libgmpxx"
source="ftp://ftp.gnu.org/gnu/gmp/gmp-$pkgver.tar.bz2
	gmp-4.1.4-noexecstack.patch
	"

_builddir="$srcdir"/$_name-$pkgver

prepare() {
	cd "$_builddir"
	patch -p1 < "$srcdir"/gmp-4.1.4-noexecstack.patch || return 1
	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
}

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

dev() {
	replaces="gmp gmp5-dev"
	default_dev
}

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

md5sums="a082867cbca5e898371a97bb27b31fea  gmp-5.1.3.tar.bz2
13c34f00e77ded6673270cfea06c35c3  gmp-4.1.4-noexecstack.patch"
sha256sums="752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160  gmp-5.1.3.tar.bz2
68601777151a1628d7bc839eddd037685c5d2e76c9453166890a5eb3cf6000c3  gmp-4.1.4-noexecstack.patch"
sha512sums="f42ce1fa02962d25f94e21c79837f0eac1f8fc8d5c7804b7413926be8739ae0e8da33c63b5cebad17b3b6caae495ace0ef2e54dd2f194a0870e85c48172382dc  gmp-5.1.3.tar.bz2
74b8b68061a1a5ac0f8b163974834465e86e930884e1a9cd15c4c948fdae95ffdcbb6e0210d56df6d0dcf1ccbe13dbdfe45552e645c3fdea6454747731b63bc8  gmp-4.1.4-noexecstack.patch"