aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-num/APKBUILD
blob: 450736b45a147873a430afb55f1710af3d7fad6a (plain) (blame)
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
# Contributor: alpine-mips-patches <info@mobile-stream.com>
# Maintainer: alpine-mips-patches <info@mobile-stream.com>
pkgname=ocaml-num
_pkgname=num
pkgver=1.1
pkgrel=0
pkgdesc="Arbitray-precision rational arithmetic for OCaml"
url="https://github.com/ocaml/num"
arch="aarch64 ppc64le x86_64"  # reflect ocaml aport platforms
license="LGPL-2.1-or-later-WITH-linking-exception-AND-MIT"
depends="ocaml-runtime"
makedepends="ocaml ocaml-compiler-libs ocaml-findlib"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml/$_pkgname/archive/v$pkgver.tar.gz
	install-findlib.patch
	install-DESTDIR.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	make
}

check() {
	make test
}

package() {
	cd "$builddir"

	local _libdir="usr/lib/ocaml"
	mkdir -p "$pkgdir/$_libdir"

	OCAMLFIND_DESTDIR="$pkgdir/$_libdir" \
	OCAMLFIND_LDCONF="ignore" \
	make DESTDIR="$pkgdir" findlib-install

	# drop temporary files
	find "$pkgdir/$_libdir" -name '*.cmti' -delete

	# move dllnums.so into standard shared stublibs dir
	local _numdir="$_libdir/$_pkgname"
	mkdir -p "$pkgdir/$_libdir/stublibs"
	mv "$pkgdir/$_numdir/"dll*.so "$pkgdir/$_libdir/stublibs"
}

dev() {
	depends="$pkgname=$pkgver-r$pkgrel"
	pkgdesc="$pkgdesc (development files)"

	local _numdir="usr/lib/ocaml/$_pkgname"
	mkdir -p "$subpkgdir/$_numdir"
	for p in '*.a' '*.cmx' '*.cmxa' '*.mli'; do
		mv "$pkgdir/$_numdir/"$p "$subpkgdir/$_numdir"
	done
}

sha512sums="e7ee54e83eaab15ee879c5bb6deb0d76a3adf1ffd2cbd3f93cda63e7bc7b3a90313b94b4be078ecddaeee90a8a98a986d80c2fd6f1ad38faa35a318f77ec890e  ocaml-num-1.1.tar.gz
d07720ba5c0c26d31e4fb054d8d3fd6ab4cd9c0496ccf110efe77ecd17e5a0c8c68b8cade42a1cecb1adc74773b04ced8b08032e9b7a8c7e6e4a722501933c28  install-findlib.patch
536ca5a1b0d76d9e6f1f33a560974bbebaebdcc020040631bb79d93748313691f8681cc6b43dc77a3dee78feb723b68e6220fa76b8276ad2577f23edd04aa15a  install-DESTDIR.patch"