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