3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/llpp/default.nix

53 lines
1.8 KiB
Nix
Raw Normal View History

2017-02-03 21:12:23 +00:00
{ stdenv, lib, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf
, lablgl, gtk3, openjpeg, jbig2dec, mujs, xsel, openssl, freetype, ncurses }:
2016-09-19 18:00:42 +01:00
assert lib.versionAtLeast (lib.getVersion ocaml) "4.02";
let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version;
in stdenv.mkDerivation rec {
2015-01-14 12:42:44 +00:00
name = "llpp-${version}";
2017-02-03 21:12:23 +00:00
version = "25-git-2017-01-18";
src = fetchgit {
url = "git://repo.or.cz/llpp.git";
2017-02-03 21:12:23 +00:00
rev = "22740b9bca1c60ef18cf90538994ce4981539901";
sha256 = "0yg8z2zwhg2f5il2i1clx3b7hl088ncpk686rfxlvwyjg3qs3mv4";
fetchSubmodules = false;
};
2017-02-03 21:12:23 +00:00
nativeBuildInputs = [ pkgconfig makeWrapper ninja ];
buildInputs = [ ocaml findlib mupdf gtk3 jbig2dec # lablgl
openjpeg mujs openssl freetype ncurses ];
dontStrip = true;
configurePhase = ''
2017-02-03 21:12:23 +00: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
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
'';
buildPhase = ''
sh ./build.sh build
'';
2017-02-03 21:12:23 +00:00
# --prefix CAML_LD_LIBRARY_PATH ":" "${lablgl}/lib/ocaml/${ocamlVersion}/site-lib/lablgl" \
installPhase = ''
install -d $out/bin $out/lib
install build/llpp $out/bin
wrapProgram $out/bin/llpp \
--prefix CAML_LD_LIBRARY_PATH ":" "$out/lib" \
--prefix PATH ":" "${xsel}/bin"
'';
meta = with stdenv.lib; {
homepage = http://repo.or.cz/w/llpp.git;
description = "A MuPDF based PDF pager written in OCaml";
platforms = platforms.linux;
maintainers = with maintainers; [ pSub ];
license = licenses.gpl3;
};
}