|
root / lang / ocaml-findlib / build.sh
build.sh Bash 34 lines 868 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/zsh
# Build script for OCaml findlib library

set -e

cd "$SRCDIR"

export PATH="$PREFIX/bin:$PATH"

# libatomic is at /usr/lib (hammerhead BSD layout)
export LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH:-}"
export LIBRARY_PATH="/usr/lib:${LIBRARY_PATH:-}"

# Configure findlib
./configure \
    -bindir $PREFIX/bin \
    -sitelib $PREFIX/lib/ocaml \
    -mandir $PREFIX/man \
    -config $PREFIX/lib/ocaml/findlib.conf \
    -no-custom

# Hammerhead's /usr/sbin/install (SVR4) resets PATH internally and breaks.
# Override INSTALLDIR and INSTALLFILE with simple alternatives as documented
# in findlib's configure output.
sed -i 's|^INSTALLDIR = install -d|INSTALLDIR = mkdir -p|' Makefile.config
sed -i 's|^INSTALLFILE = install -c|INSTALLFILE = cp|' Makefile.config

# Build
gmake all
gmake opt

# Install to staging directory
gmake install DESTDIR="$PKGDIR"