Paper over
[llpp.git] / misc / bootstrap.sh
blob85bb7ecaba7b35e701ed71885b015e16e84c18a0
1 #!/bin/sh
2 set -e
4 executable_p() { command -v "$1" >/dev/null 2>&1; }
5 die() { echo "$1" >&2; exit 1; }
7 if executable_p wget; then dl() { wget -q $1 -O $2; }
8 elif executable_p curl; then dl() { curl $1 -o $2; }
9 else die "no program to fetch remote urls found"
12 cd "$(dirname $0)"
13 mkdir -p bootstrap
14 prefix=$PWD/bootstrap
16 true && {
17 url=http://caml.inria.fr/pub/distrib/ocaml-4.06/ocaml-4.06.1.tar.xz
18 xz=$(basename $url)
19 test -e $xz || dl $url $xz
20 tar xf $xz
21 cd ${xz%.tar.xz}
22 ./configure -prefix $prefix
23 make -j4 world -s
24 make install
25 cd ..
28 cd ..
29 test -d mupdf || {
30 rmudir=$HOME/x/rcs/git/mupdf
31 if test -d $rmudir ; then
32 ref="--reference $rmudir"
33 else
34 ref=""
36 git clone --recursive $ref git://git.ghostscript.com/mupdf.git
37 cd mupdf
38 git checkout db4e21fea6c156f8b2b710937cbee1e7e8d7b7c2
39 git submodule update --recursive
40 cd -
41 make -C mupdf build=native -j4 libs
43 PATH=$prefix/bin:$PATH bash ./build.bash build-strap