aboutsummaryrefslogtreecommitdiffstats
path: root/community/ocaml-camlp4/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/ocaml-camlp4/APKBUILD')
-rw-r--r--community/ocaml-camlp4/APKBUILD21
1 files changed, 21 insertions, 0 deletions
diff --git a/community/ocaml-camlp4/APKBUILD b/community/ocaml-camlp4/APKBUILD
index ea97256ea9..5f59d60ee8 100644
--- a/community/ocaml-camlp4/APKBUILD
+++ b/community/ocaml-camlp4/APKBUILD
@@ -1,4 +1,5 @@
# Contributor: Jon Ong <jonongjs@rottenmage.com>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Anil Madhavapeddy <anil@recoil.org>
pkgname=ocaml-camlp4
_pkgname=camlp4
@@ -12,9 +13,11 @@ url="https://github.com/ocaml/camlp4/releases"
arch="all !x86 !armhf !s390x" # ocaml not avail on excluded platforms
license="LGPL-2.0-or-later-WITH-linking-exception"
depends="ocaml"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="ocamlbuild"
replaces="camlp4" # for backward compatibility
provides="camlp4=$pkgver-r$pkgrel" # for backward compatibility
+subpackages="$pkgname-dev"
source="$_pkgname-$_pkgver.tar.gz::https://github.com/ocaml/$_pkgname/archive/$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-${_pkgver/+/-}"
@@ -34,4 +37,22 @@ package() {
install install-META
}
+dev() {
+ default_dev
+ replaces="camlp4" # for backward compatibility
+ local sitelib="usr/lib/ocaml/$_pkgname"
+
+ cd "$pkgdir"
+
+ mkdir -p "$subpkgdir"/usr
+ mv usr/bin "$subpkgdir"/usr/
+
+ local path
+ for path in $(find $sitelib/ -name '*.cmx' -o -name '*.cmxa'); do
+ mkdir -p "$subpkgdir"/${path%/*}
+ mv "$path" "$subpkgdir"/${path%/*}/
+ done
+ rmdir "$subpkgdir"/$sitelib 2>/dev/null || true
+}
+
sha512sums="7db8eebcf3d230f60650ba62d9cb630c069394237e97b678a40b61d3dcaded752a2b7e089a50ff528f1ea0740d0291b722df123a072f2cee489cadc5201c6776 camlp4-4.04+1.tar.gz"