aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-num/APKBUILD
blob: a60307e15a46ecb169f6bcaef36e7178822ce989 (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
# Contributor: alpine-mips-patches <info@mobile-stream.com>
# Maintainer: alpine-mips-patches <info@mobile-stream.com>
pkgname=ocaml-num
_pkgname=num
pkgver=1.2
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-DESTDIR.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	make
}

check() {
	make test
}

package() {
	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="cf6b5e026d82235e9ed2cc31cbe1bf29171964a364c6ff23aaf0cc864f646002ce2be5b7296488f1568c7b2166d298298cd086f26fb10b52863dbf78f8b23844  ocaml-num-1.2.tar.gz
536ca5a1b0d76d9e6f1f33a560974bbebaebdcc020040631bb79d93748313691f8681cc6b43dc77a3dee78feb723b68e6220fa76b8276ad2577f23edd04aa15a  install-DESTDIR.patch"