1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 19:25:25 +03:00
aports/community/ocaml/APKBUILD
psykose 885fd221a6 community/ocaml: run tests in parallel
this s much faster, to put it mildly
2023-01-19 02:25:46 +01:00

116 lines
2.6 KiB
Text

# Contributor: Borys Zhukov <mp5@mp5.im>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=ocaml
pkgver=4.14.1
pkgrel=1
pkgdesc="Main implementation of the Caml programming language"
url="https://ocaml.org/"
arch="all !riscv64" # hangs forever at final build step
license="LGPL-2.1-or-later-WITH-linking-exception"
depends="$pkgname-runtime=$pkgver-r$pkgrel gcc"
makedepends="gdbm-dev libc-dev ncurses-dev zlib-dev binutils-dev"
checkdepends="parallel"
subpackages="
$pkgname-doc
$pkgname-dev
$pkgname-ocamldoc
$pkgname-compiler-libs:_compiler_libs
$pkgname-runtime
"
source="https://caml.inria.fr/pub/distrib/ocaml-${pkgver%.*}/ocaml-$pkgver.tar.gz"
# 32bit archs
case "$CARCH" in
armv7|armhf|x86)
options="$options textrels"
export LDFLAGS="$LDFLAGS -Wl,-z,notext"
;;
esac
build() {
./configure \
--prefix /usr \
--bindir /usr/bin \
--libdir /usr/lib/ocaml \
--mandir /usr/share/man \
CC="${CC:-gcc}" \
AS="${CC:-gcc} -c" \
ASPP="${CC:-gcc} -c"
make world.opt
}
check() {
make -C testsuite parallel
}
package() {
make DESTDIR="$pkgdir" install
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
install -Dm644 Changes "$pkgdir"/usr/share/doc/$pkgname/Changes
cd "$pkgdir"
# Remove annotation files and sources.
find usr/lib/ocaml \
\( -name '*.cmt' -o -name '*.cmti' -o -name '*.ml' \) \
-a -delete
# To be consistent with other binaries.
mv usr/bin/ocamldoc usr/bin/ocamldoc.byte
ln -s ocamldoc.opt usr/bin/ocamldoc
}
dev() {
pkgdesc="OCaml bytecode executables"
_submv 'usr/bin/*.byte'
}
ocamldoc() {
pkgdesc="Documentation generator for OCaml"
depends="$pkgname=$pkgver-r$pkgrel"
replaces="$pkgname" # for backward compatibility
_submv usr/bin/ocamldoc\*
_submv usr/lib/ocaml/ocamldoc
}
_compiler_libs() {
pkgdesc="Compiler libraries for OCaml"
depends="$pkgname=$pkgver-r$pkgrel"
replaces="$pkgname" # for backward compatibility
_submv usr/lib/ocaml/compiler-libs
}
runtime() {
pkgdesc="OCaml runtime environment"
depends=""
replaces="$pkgname" # for backward compatibility
_submv usr/bin/ocamlrun
local i; for i in \
'*.cmo' \
'*.cmi' \
'*.cma' \
'stublibs' \
'threads/*.cmi' \
'threads/*.cma'
do
_submv "usr/lib/ocaml/$i"
done
}
_submv() {
local path="$1"
mkdir -p "$subpkgdir"/${path%/*}
mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/
rmdir -p "$pkgdir"/${path%/*} 2>/dev/null || true
}
sha512sums="
8fdeb1b370cb1f8a469a57966ac7dcb64814dd7c098a432c76bc61ba0f59d067e2b36aa29da9b86d048738db230dc5d813b99d577cdeeb4b1aa18ee563528f60 ocaml-4.14.1.tar.gz
"