2014-11-29 13:17:19 +00:00
|
|
|
{ stdenv, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf, lablgl
|
2015-08-04 11:59:34 +01:00
|
|
|
, gtk3, openjpeg, jbig2dec, mujs, xsel, openssl }:
|
2014-05-26 19:31:53 +01:00
|
|
|
|
2014-11-29 13:17:19 +00:00
|
|
|
let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version;
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-01-14 12:42:44 +00:00
|
|
|
name = "llpp-${version}";
|
2015-08-04 11:59:34 +01:00
|
|
|
version = "21-git-2015-07-30";
|
2014-05-26 19:31:53 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://repo.or.cz/llpp.git";
|
2015-08-04 11:59:34 +01:00
|
|
|
rev = "e9fe06d684b145a104cc319673076e069e853cac";
|
|
|
|
sha256 = "0x3hgn6sfjln2sqdw40ylcj943rn732a6mlfwz01llx8ykiyvsvq";
|
|
|
|
fetchSubmodules = false;
|
2014-05-26 19:31:53 +01:00
|
|
|
};
|
|
|
|
|
2014-11-29 13:17:19 +00:00
|
|
|
buildInputs = [ pkgconfig ninja makeWrapper ocaml findlib mupdf lablgl
|
2015-08-04 11:59:34 +01:00
|
|
|
gtk3 jbig2dec openjpeg mujs openssl ];
|
2014-05-26 19:31:53 +01:00
|
|
|
|
2014-11-29 13:17:19 +00:00
|
|
|
configurePhase = ''
|
|
|
|
sh configure.sh -O -F ${mupdf}
|
|
|
|
sed -i 's;-lopenjpeg;-lopenjp2;g' .config
|
|
|
|
sed -i 's;$builddir/link\.so;link.so;g' build.ninja
|
2014-05-26 19:31:53 +01:00
|
|
|
'';
|
|
|
|
|
2014-11-29 13:17:19 +00:00
|
|
|
buildPhase = "${ninja}/bin/ninja";
|
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
|
|
|
|
install link.so $out/lib
|
|
|
|
wrapProgram $out/bin/llpp \
|
|
|
|
--prefix CAML_LD_LIBRARY_PATH ":" "${lablgl}/lib/ocaml/${ocamlVersion}/site-lib/lablgl" \
|
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; {
|
2014-05-26 19:31:53 +01:00
|
|
|
homepage = http://repo.or.cz/w/llpp.git;
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|