Make it work
[llpp.git] / misc / bootstrap.sh
blob3478d20752cad899a7db9e58cc555f38af32c8ca
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 mkdir -p bootstrap
13 prefix=$PWD/bootstrap
15 true && {
16 xz=http://caml.inria.fr/pub/distrib/ocaml-4.06/ocaml-4.06.1.tar.xz
17 test -e ocaml-4.06.1.tar.xz || dl $xz ocaml-4.06.0.1.xz
18 tar xf ocaml-4.06.0.1.xz
19 cd ocaml-4.06.1
20 ./configure -prefix $prefix
21 make -j4 world -s
22 make install
23 cd ..
26 true && {
27 rmudir=$HOME/x/rcs/git/mupdf
28 test -e $rmudir || ref= && ref="--reference $rmudir"
29 test -e mupdf || {
30 git clone --recursive $ref git://git.ghostscript.com/mupdf.git
31 } && {
32 cd mupdf
33 git pull
34 cd -
36 make -C mupdf build=native -j4 libs
39 test -e llpp || git clone git://repo.or.cz/llpp.git && {
40 cd llpp
41 git pull
42 cd -
44 ln -sf $PWD/mupdf llpp
45 cd llpp
46 PATH=$prefix/bin:$PATH sh ./build.sh build