about summary refs log tree commit diff
path: root/pkgs/applications/misc/llpp/default.nix
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2018-12-01 23:14:24 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2018-12-18 18:33:49 +1100
commit3f1e222a8b5ed268e727ba9a0a944fabd41991d6 (patch)
treebfcd13ac33b82dd76ed3c8e69e35fb4ddf8a2515 /pkgs/applications/misc/llpp/default.nix
parent61c3169a0e17d789c566d5b241bfe309ce4a6275 (diff)
downloadnixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.tar
nixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.tar.gz
nixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.tar.bz2
nixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.tar.lz
nixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.tar.xz
nixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.tar.zst
nixlib-3f1e222a8b5ed268e727ba9a0a944fabd41991d6.zip
llpp: 2018-03-02 -> 30
Remove unnecessary packages from derivation and use patches to fix
build.bash instead of sed commands.
Diffstat (limited to 'pkgs/applications/misc/llpp/default.nix')
-rw-r--r--pkgs/applications/misc/llpp/default.nix33
1 files changed, 18 insertions, 15 deletions
diff --git a/pkgs/applications/misc/llpp/default.nix b/pkgs/applications/misc/llpp/default.nix
index f32509686c09..ed3aca996e15 100644
--- a/pkgs/applications/misc/llpp/default.nix
+++ b/pkgs/applications/misc/llpp/default.nix
@@ -1,33 +1,36 @@
-{ stdenv, lib, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf
-, gtk3, openjpeg, jbig2dec, mujs, xsel, openssl, freetype, ncurses }:
+{ stdenv, lib, substituteAll, makeWrapper, fetchgit, ocaml, mupdf, libX11,
+libGLU_combined, freetype, xclip }:
 
-assert lib.versionAtLeast (lib.getVersion ocaml) "4.02";
+assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
 
 stdenv.mkDerivation rec {
   name = "llpp-${version}";
-  version = "2018-03-02";
+  version = "30";
 
   src = fetchgit {
     url = "git://repo.or.cz/llpp.git";
-    rev = "0ab1fbbf142b6df6d6bae782e3af2ec50f32dec9";
-    sha256 = "1h0hrmxwm7ripgp051788p8ad0q38dc9nvjx87mdwlkwk9qc0dis";
+    rev = "v${version}";
+    sha256 = "0iilpzf12hs0zky58j55l4y5dvzv7fc53nsrg324n9vka92mppvd";
     fetchSubmodules = false;
   };
 
-  nativeBuildInputs = [ pkgconfig makeWrapper ninja ];
-  buildInputs = [ ocaml findlib mupdf gtk3 jbig2dec openjpeg mujs openssl freetype ncurses ];
+  patches = (substituteAll {
+    inherit version;
+    src = ./fix-build-bash.patch;
+  });
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ ocaml mupdf libX11 libGLU_combined freetype ];
 
   dontStrip = true;
 
   configurePhase = ''
-    sed -i -e 's+ocamlc --version+ocamlc -version+' build.sh
-    sed -i -e 's+-I \$srcdir/mupdf/include -I \$srcdir/mupdf/thirdparty/freetype/include+-I ${freetype.dev}/include+' build.sh
-    sed -i -e 's+-lmupdf +-lfreetype -lz -lharfbuzz -ljbig2dec -lopenjp2 -ljpeg -lmupdf +' build.sh
-    sed -i -e 's+-L\$srcdir/mupdf/build/native ++' build.sh
+    mkdir -p build/mupdf/thirdparty
+    ln -s ${freetype.dev} build/mupdf/thirdparty/freetype
   '';
 
   buildPhase = ''
-    sh ./build.sh build
+    bash ./build.bash build
   '';
 
   installPhase = ''
@@ -35,14 +38,14 @@ stdenv.mkDerivation rec {
     install build/llpp $out/bin
     wrapProgram $out/bin/llpp \
         --prefix CAML_LD_LIBRARY_PATH ":" "$out/lib" \
-        --prefix PATH ":" "${xsel}/bin"
+        --prefix PATH ":" "${xclip}/bin"
   '';
 
   meta = with stdenv.lib; {
     homepage = https://repo.or.cz/w/llpp.git;
     description = "A MuPDF based PDF pager written in OCaml";
     platforms = platforms.linux;
-    maintainers = with maintainers; [ pSub ];
+    maintainers = with maintainers; [ pSub enzime ];
     license = licenses.gpl3;
   };
 }