1diff --git a/build.bash b/build.bash
2index 7c278b6..41494c5 100755
3with manual adjustments
4--- a/build.bash
5+++ b/build.bash
6@@ -30,7 +30,6 @@ srcd="$(dirname $0)"
7 mudir=$outd/mupdf
8 muinc="-I $mudir/include -I $mudir/thirdparty/freetype/include"
9
10-test -d "$mudir" || die muPDF not found, consult $(dirname $0)/BUILDING
11
12 mkdir -p $outd/{$wsid,lablGL}
13 :>$outd/ordered
14@@ -41,12 +40,6 @@ isfresh() { test -r "$1.past" && . "$1.past" && test "$k" = "$2"; }
15 mulibst="$mudir/build/$mbt/libs"
16 mulibs="$mudir/build/$mbt/libmupdf.a $mudir/build/$mbt/libmupdf-third.a"
17
18-keycmd="(cd $mudir && make -q build=$mbt libs && echo); digest $mulibs"
19-isfresh "$mulibst" "$(eval $keycmd)" || (
20- make -C "$mudir" build=$mbt -j $mjobs libs
21- eval $keycmd >${mulibst}.past
22-) && vecho "fresh mupdf"
23-
24 oincs() {
25 local i=
26 local incs1=
27@@ -100,35 +93,6 @@ mflags() {
28 }
29
30 overs="$(ocamlc -vnum 2>/dev/null)" || overs=""
31-test "$overs" = "4.11.1" || {
32- url=https://caml.inria.fr/pub/distrib/ocaml-4.11/ocaml-4.11.1.tar.xz
33- txz=$outd/$(basename $url)
34- keycmd="printf $url; digest $txz;"
35- isfresh $txz "$(eval $keycmd)" || {
36- executable_p() { command -v "$1" >/dev/null 2>&1; }
37- if executable_p wget; then dl() { wget -q "$1" -O "$2"; }
38- elif executable_p curl; then dl() { curl -L "$1" -o "$2"; }
39- else die "no program to fetch remote urls found"
40- fi
41- dl $url $txz
42- eval $keycmd >$txz.past
43- } && vecho "fresh $txz"
44- absprefix=$(cd $outd &>/dev/null; pwd -P)
45- export PATH=$absprefix/bin:$PATH
46- ocamlc=$absprefix/bin/ocamlc
47- keycmd="printf $url; digest $ocamlc;"
48- isfresh $ocamlc "$(eval $keycmd)" || (
49- tar xf $txz -C $outd
50- bn=$(basename $url)
51- cd $outd/${bn%.tar.xz}
52- ./configure --disable-ocamldoc --disable-ocamltest \
53- --enable-debugger=no --prefix=$absprefix
54- make -j $mjobs world
55- make install
56- eval $keycmd >$absprefix/bin/ocamlc.past
57- ) && vecho "fresh ocamlc"
58- overs=$(ocamlc -vnum 2>/dev/null)
59-}
60
61 ccomp=${LLPP_CC-$(ocamlc -config | grep "^c_compiler: " | \
62 { read _ c; echo $c; })}
63@@ -243,7 +208,7 @@ bobjc() {
64 } && vecho "fresh $o"
65 }
66
67-ver=$(cd $srcd && git describe --tags --dirty) || ver=unknown
68+ver=@version@
69
70 cmd="(. $srcd/genconfstr.sh >$outd/confstruct.ml)"
71 keycmd="digest $srcd/genconfstr.sh $outd/confstruct.ml"
72@@ -291,7 +256,7 @@ for m in ml_gl ml_glarray ml_raw; do
73 done
74
75 libs="str.cma unix.cma"
76-clibs="-L$mudir/build/$mbt -lmupdf -lmupdf-third -lpthread"
77+clibs="-lmupdf -lmupdf-third -lfreetype -lgumbo -ljpeg -lopenjp2 -ljbig2dec -llcms2 -lharfbuzz -lpthread -lz"
78 if $darwin; then
79 mcomp=$(ocamlc -config | grep bytecomp_c_co | { read _ c; echo $c; })
80 clibs="$clibs -framework Cocoa -framework OpenGL"