# Contributor: Jon Ong # Contributor: Jakub Jirutka # Maintainer: Anil Madhavapeddy pkgname=ocaml-camlp4 _pkgname=camlp4 # NOTE: camlp4 version must match ocaml version! pkgver=4.07.1 _pkgver="${pkgver%.*}+${pkgver##*.}" _ocamlver=${pkgver%.*} pkgrel=1 pkgdesc="Caml preprocessor and pretty-printer" url="https://github.com/ocaml/camlp4/releases" arch="aarch64 ppc64le x86_64" # reflect ocaml aport platforms license="LGPL-2.0-or-later-WITH-linking-exception" depends="ocaml-runtime=~$_ocamlver ocaml-ocamlbuild" depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends="ocaml=~$_ocamlver ocaml-compiler-libs=~$_ocamlver ocaml-findlib ocaml-ocamlbuild-dev 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/+/-}" build() { cd "$builddir" ./configure \ --bindir="/usr/bin" \ --libdir="/usr/lib/ocaml" \ --pkgdir="/usr/lib/ocaml" make -j1 all camlp4/META } package() { cd "$builddir" make DESTDIR="$pkgdir" \ 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="330d7f7a8ea6022df2d931a67e902f2e8bbf1026fbde08e1fd216763641a33005fde51b3b785363a05aa6717180f63b349badc1c107e05d13143b0db0e7051bc ocaml-camlp4-4.07+1.tar.gz"