2017-02-03 22:12:23 +01:00
|
|
|
{ stdenv, lib, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf
|
|
|
|
, lablgl, gtk3, openjpeg, jbig2dec, mujs, xsel, openssl, freetype, ncurses }:
|
2014-05-26 20:31:53 +02:00
|
|
|
|
2016-09-19 19:00:42 +02:00
|
|
|
assert lib.versionAtLeast (lib.getVersion ocaml) "4.02";
|
|
|
|
|
2014-11-29 14:17:19 +01:00
|
|
|
let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version;
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-01-14 13:42:44 +01:00
|
|
|
name = "llpp-${version}";
|
2017-11-10 21:33:53 +01:00
|
|
|
version = "26b";
|
2014-05-26 20:31:53 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://repo.or.cz/llpp.git";
|
2017-11-10 21:33:53 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1w8g1fp1c20sl34cx20plhnbghbsx2fwgp4vyhd1x0za29lw62nj";
|
2015-08-04 12:59:34 +02:00
|
|
|
fetchSubmodules = false;
|
2014-05-26 20:31:53 +02:00
|
|
|
};
|
|
|
|
|
2017-02-03 22:12:23 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ninja ];
|
2017-11-10 21:33:53 +01:00
|
|
|
buildInputs = [ ocaml findlib mupdf gtk3 jbig2dec openjpeg mujs openssl freetype ncurses ];
|
2016-06-12 08:39:59 +02:00
|
|
|
|
|
|
|
dontStrip = true;
|
2014-05-26 20:31:53 +02:00
|
|
|
|
2014-11-29 14:17:19 +01:00
|
|
|
configurePhase = ''
|
2017-02-03 22:12:23 +01:00
|
|
|
sed -i -e 's+fz_set_use_document_css (state.ctx, usedoccss);+/* fz_set_use_document_css (state.ctx, usedoccss); */+' link.c
|
|
|
|
sed -i -e 's+ocamlc --version+ocamlc -version+' build.sh
|
2016-08-23 02:31:24 +02:00
|
|
|
sed -i -e 's+-I \$srcdir/mupdf/include -I \$srcdir/mupdf/thirdparty/freetype/include+-I ${freetype.dev}/include+' build.sh
|
2016-06-12 08:39:59 +02:00
|
|
|
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
|
2014-05-26 20:31:53 +02:00
|
|
|
'';
|
|
|
|
|
2016-06-12 08:39:59 +02:00
|
|
|
buildPhase = ''
|
|
|
|
sh ./build.sh build
|
|
|
|
'';
|
2014-05-26 20:31:53 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-11-29 14:17:19 +01:00
|
|
|
install -d $out/bin $out/lib
|
|
|
|
install build/llpp $out/bin
|
|
|
|
wrapProgram $out/bin/llpp \
|
2014-12-13 15:49:19 +01:00
|
|
|
--prefix CAML_LD_LIBRARY_PATH ":" "$out/lib" \
|
|
|
|
--prefix PATH ":" "${xsel}/bin"
|
2014-05-26 20:31:53 +02:00
|
|
|
'';
|
|
|
|
|
2014-11-29 14:17:19 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-05-26 20:31:53 +02:00
|
|
|
homepage = http://repo.or.cz/w/llpp.git;
|
|
|
|
description = "A MuPDF based PDF pager written in OCaml";
|
2014-11-29 14:17:19 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
license = licenses.gpl3;
|
2014-05-26 20:31:53 +02:00
|
|
|
};
|
|
|
|
}
|