1 # Maintainer: Jürgen Hötzel <juergen@archlinux.org>
4 pkgname=('ocaml' 'ocaml-compiler-libs')
7 pkgdesc="A functional language with OO extensions"
9 license=('LGPL2.1' 'custom: QPL-1.0')
10 url="https://caml.inria.fr/"
11 makedepends=('ncurses>=5.6-7')
12 optdepends=('ncurses: advanced ncurses features' 'tk: advanced tk features')
13 source=(https://caml.inria.fr/distrib/ocaml-${pkgver%.*}/${pkgname}-${pkgver}.tar.xz)
14 sha512sums=('0fae5b8752ce900bc69f71ebdc82faa588272fd3dce6795aa03467e89e1e376f127a288221761e353191fb5941b563e183098c0c74b18374aa0ca1c8e0715e97')
15 options=('!makeflags' '!emptydirs' 'staticlibs')
20 cd "${srcdir}/${pkgname}-${pkgver}"
21 CFLAGS+=' -ffat-lto-objects'
22 CXXFLAGS+=' -ffat-lto-objects'
23 ./configure --prefix /usr --mandir /usr/share/man --disable-force-safe-string --enable-frame-pointers
24 make --debug=v world.opt
28 cd "${srcdir}/${pkgbase}-${pkgver}"
29 make DESTDIR="${pkgdir}" install
31 # Save >10MB with this one, makepkg only strips debug symbols.
32 #find "${pkgdir}/usr/lib" -type f -name '*.so.*' -exec strip --strip-unneeded {} \;
35 install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
36 install -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/"
38 # remove compiler libs
39 rm -rf "${pkgdir}/usr/lib/ocaml/compiler-libs"
42 package_ocaml-compiler-libs() {
43 pkgdesc="Several modules used internally by the OCaml compiler"
44 license=('custom: QPL-1.0')
48 cd "${srcdir}/${pkgbase}-${pkgver}"
49 make DESTDIR="${pkgdir}" install
50 # Remove non-compiler-libs
51 rm -rf "${pkgdir}/usr/bin" "${pkgdir}/usr/lib/ocaml/caml" \
52 "${pkgdir}/usr/lib/ocaml/ocamldoc" "${pkgdir}/usr/lib/ocaml/stublibs" \
53 "${pkgdir}/usr/lib/ocaml/threads" "${pkgdir}/usr/share"
54 find "${pkgdir}/usr/lib/ocaml/" -maxdepth 1 -type f -delete
56 install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
57 install -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/"