archrelease: copy trunk to community-any
[ArchLinux/community.git] / dune / repos / community-x86_64 / PKGBUILD
blobfb32dfabfbba7a73e98aecd0ca8159f821656316
1 # Maintainer: Konstantin Gizdov <arch at kge dot pw>
2 # Maintainer: Bruno Pagani <archange@archlinux.org>
3 # Contributor: Jakob Gahde <j5lx@fmail.co.uk>
5 pkgname=dune
6 pkgver=3.7.1
7 pkgrel=2
8 pkgdesc="A composable build system for OCaml (formerly jbuilder)"
9 arch=(x86_64)
10 url="https://github.com/ocaml/dune"
11 license=('Apache')
12 depends=('glibc')
13 makedepends=('ocaml>=5.0.0' 'ocaml-compiler-libs>=5.0.0' 'ocaml-csexp' 'ocaml-pp' 'ocaml-findlib')
14 optdepends=('ocaml: Dune standard library')
15 source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
16 b2sums=('dd0f473a720fc65ac550a2aab64930ff472a9bd306d603f088d813817df56148f676abe2a56ff3458bb1ed887784e565154eee08988bf984585b35bc9333d929')
19 _dune_release_pkgs=('dune' 'dune-action-plugin' 'dune-build-info' 'dune-configurator' 'dune-glob' 'dune-private-libs'
20                     'dune-site' 'dune-rpc' 'dyn' 'stdune' 'ordering' 'xdg' 'chrome-trace' 'ocamlc-loc')
22 build() {
23     cd "${srcdir}/${pkgname}-${pkgver}"
25     # FS#74061
26     ./configure --libdir /usr/lib/ocaml
28     make _boot/dune.exe  # this runs `ocaml bootstrap.ml`, but keeps upstream's choice
30     # dune build needs a comma separated list of packages
31     local dune_release_pkgs='dummy'
32     for _pkg in "${_dune_release_pkgs[@]}"; do
33       dune_release_pkgs+=",${_pkg}"
34     done
35     dune_release_pkgs="${dune_release_pkgs#dummy,}"
36     echo "Building packages: ${dune_release_pkgs}"
38     ./dune.exe build -p "${dune_release_pkgs}" --profile dune-bootstrap
41 # Tests require a bunch of (currently) unpackaged dependencies
42 # check() {
43 #     cd "${srcdir}/${pkgname}-${pkgver}"
44 #     make test
45 # }
47 package() {
48     cd "${srcdir}/${pkgname}-${pkgver}"
50     # we need to install packages one by one
51         for _pkg in "${_dune_release_pkgs[@]}"; do
52       ./dune.exe install "${_pkg}" --destdir="${pkgdir}" --prefix="/usr" --libdir="$(ocamlfind printconf destdir)"
53     done
55     # Fix doc and man install
56     install -d "${pkgdir}"/usr/share
57     mv "${pkgdir}"/usr/{doc,share/}
58     mv "${pkgdir}"/usr/{man,share/}
59     install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
60     ln -s /usr/share/doc/pp/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"