Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions BUILDING
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Prerequisites for building from sources:
mupdf [https://mupdf.com]
opengl [https://en.wikipedia.org/wiki/OpenGL]
git [https://git-scm.com]
ocaml 4.14.0 [https://ocaml.org]
ocaml 5.2.0 [https://ocaml.org]
If not present will be downloaded from the network and
built/used locally without system-wide installation.
This requires either:
Expand All @@ -19,9 +19,5 @@ To download mupdf+prerequisites that llpp is known to work with:
To build llpp (binary will be in build/llpp):
- bash build.bash build

# by default llpp looks for .config/llpp.conf file
# hence .config directory should be present otherwise
# llpp will fail to start

To build man pages (will be in build/doc/[name].1)
To build man pages
- bash build.bash build doc
19 changes: 11 additions & 8 deletions build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ mudeps=('freetype2' 'gumbo' 'harfbuzz' 'libjpeg' 'libopenjp2' 'x11' 'zlib')

mkdir -p $outd/{$wsid,lablGL}

isfresh() {
test -f "$1.past" || return 1
test "$(<$1.past)" = "$2"
} 2>/dev/null

# thanks to Sebastian Rasmussen
isfresh() { test "$(cat $1.past)" = "$2"; } 2>/dev/null

mbt=${mbt:-release}
test -n "${gmk:-}" && gmk=false || gmk=true
Expand Down Expand Up @@ -72,13 +69,18 @@ oincs() {
}

oflags() {
local f=""
case "${1#$outd/}" in
lablGL/*) f="-g";;
utf8syms.cmo|confstruct.cmo|config.cmo|ffi.cmo|wsi/cocoa/wsi.cmo)
utf8syms.cmo|confstruct.cmo)
f="-g -strict-sequence -strict-formats -alert @all-missing-mli";;
wsi/x11/wsi.cm[io]) f="-g -I +unix";;
utils.cmi) f="-g -I +unix -I +str";;
config.cmo|ffi.cmo|main.cmo|utils.cmo|parser.cmo|uiutils.cmo|help.cmo)
f="-g -I +unix -I +str -strict-sequence -strict-formats -alert @all-missing-mli";;
*) f="-g -strict-sequence -strict-formats -alert @all -warn-error @A";;
esac
echo $(oincs $outd $1) -I +unix -I +str $f
echo $(oincs $outd $1) $f
}

cflags() {
Expand Down Expand Up @@ -288,7 +290,8 @@ else
bocamlc wsi/x11/xlib.o
fi

cmd="ocamlc -custom $libs -o $outd/llpp $cobjs $modules -cclib \"$clibs\" -I +unix -I +str"
cmd="ocamlc -custom $libs -o $outd/llpp $cobjs $modules -cclib \"$clibs\""
cmd="$cmd -I +unix -I +str"
keycmd="digest $outd/llpp $cobjs $modules $mulibs"
isfresh "$outd/llpp" "$cmd$(eval $keycmd)" || {
echo linking $outd/llpp
Expand Down
14 changes: 9 additions & 5 deletions config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ let multicolumns_of_string s =
try
(int_of_string s, 0, 0)
with _ ->
Scanf.sscanf s "%u,%u,%u" (fun n a b ->
if a > 1 || b > 1
then error "subtly broken";
(n, a, b)
)
try
Scanf.sscanf s "%u,%u,%u" (fun n a b ->
if a > 1 || b > 1
then error "subtly broken";
(n, a, b)
)
with End_of_file ->
(1, 0, 0)

include Confstruct

Expand Down Expand Up @@ -365,6 +368,7 @@ module S = struct
let tilelru : (tilemapkey * opaque * pixmapsize) Queue.t = Queue.create ()
let fontpath = ref E.s
let redirstderr = ref false
let loading = ref true
end

let conf = { defconf with keyhashes = copykeyhashes defconf }
Expand Down
13 changes: 7 additions & 6 deletions genconfstruct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -eu

cat<<EOF
let zs = ""
type rgb = (float * float * float)
and rgba = (float * float * float * float)
and fitmodel = | FitWidth | FitProportional | FitPage
Expand Down Expand Up @@ -105,8 +106,8 @@ g beyecolumns "columncount option" None
s selcmd "{|$clip|}"
s pastecmd "{|$paste|}"
s paxcmd '{|echo PAX "%s">&2|}'
s passcmd Utils.E.s
s savecmd Utils.E.s
s passcmd zs
s savecmd zs
b updatecurs true
K keyhashes '(string * keyhash) list' \
'(let mk n = (n, Hashtbl.create 1) in
Expand All @@ -119,15 +120,15 @@ s stcmd "{|echo SyncTex|}"
b riani false
g paxmark mark MarkWord
b leftscroll false
s title Utils.E.s
s title zs
f lastvisit 0.0
b annotinline true
b coarseprespos false
g css css Utils.E.s
g css css zs
b usedoccss true
s key Utils.E.s
s key zs
P pax
g dcf dcf Utils.E.s
g dcf dcf zs
s hcs "{|aoeuidhtns|}"
i rlw 420
i rlh 595
Expand Down
2 changes: 1 addition & 1 deletion help.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let keys =
{|-----Quitting-----
escape/q - quit
q - quit
Q - quit without saving the configuration or changes
W - save changes

Expand Down
Loading
Loading