criticic / llpp

llpp original source code before it turned to protestware. NOTE: changes are made on the "latest" branch, master is locked and remains as it was.
Other
28 stars 7 forks source link

how can i build it for void linux #6

Open zeyadelkholyttt opened 1 year ago

zeyadelkholyttt commented 1 year ago

how can i build or compile this project for using it in void linux, i didn't know how to compile ocaml project, i tried to do it in c way (cmake, make install) but it didn't work

fstecker commented 11 months ago

This reply is a bit late, but in case anyone else is wondering: llpp is written in OCaml and uses a simple bash script as a build system. You just build it with

bash build.bash build

For more details, see the package definition used by Arch Linux: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=llpp

Sfinx commented 6 months ago

a small patch needed for the latest mupdf:

diff --git a/build.bash b/build.bash
index 7830f6c..efdb9d0 100755
--- a/build.bash
+++ b/build.bash
@@ -275,7 +275,7 @@ for m in ml_gl ml_glarray ml_raw; do
 done

 libs="str.cma unix.cma"
-clibs="-ljbig2dec $(pkg-config --libs "${mudeps[@]}") -lmupdf -lpthread"
+clibs="-ljbig2dec $(pkg-config --libs "${mudeps[@]}") -lmupdf -lz -lmupdf-third -lpthread"
 if $darwin; then
     mcomp=$ccomp
     clibs+=" -framework Cocoa -framework OpenGL"
fstecker commented 6 months ago

@Sfinx What kind of system are you on? On Arch Linux -lz -lmupdf-third are not needed, which might be related to how Arch builds libmupdf. It compiles libmupdf using

USE_SYSTEM_LIBS=yes make shared=yes build=release libs apps

and with that it looks like only -lmupdf is needed for llpp. I assume this is different for your distro? Do you know what libmupdf-third is and what it's needed for?

Sfinx commented 6 months ago

I do not think it is system dependent. I'm using the current mupdf git.

fstecker commented 6 months ago

Made this its own issue, thanks for reporting it! Would be great if we can fix it in a way which works for both of us (and everyone else).

Sfinx commented 6 months ago

BTW: this small patch switches PgUp/PgDown and Space/BackSpace so reading books by Space is now much more comfortable:

diff --git a/main.ml b/main.ml
index 7fdf5a9..9f07986 100644
--- a/main.ml
+++ b/main.ml
@@ -3372,8 +3372,8 @@ let viewkeyboard key mask =
      | [] -> ()
      | l :: _ -> gotoxy !S.x (getpagey l.pageno)
      end
-  | Ascii ' ' -> nextpage ()
-  | Delete -> prevpage ()
+  | Next -> nextpage ()
+  | Prior -> prevpage ()
   | Ascii '=' -> showtext ' ' (describe_layout !S.layout);
   | Ascii 'w' ->
      begin match !S.layout with
@@ -3481,7 +3481,7 @@ let viewkeyboard key mask =
        S.text := E.s;
        Glutils.postRedisplay "left/right"
      )
-  | Prior ->
+  | Delete ->
      let y =
        if ctrl
        then
@@ -3491,7 +3491,7 @@ let viewkeyboard key mask =
        else U.add_to_y_and_clamp (U.pgscale ~- !S.winh)
      in
      gotoxy !S.x y
-  | Next ->
+  | Ascii ' ' ->
      let y =
        if ctrl
        then