2014-11-29 14:17:19 +01:00
|
|
|
{ stdenv, makeWrapper, fetchgit, pkgconfig, ninja, ocaml, findlib, mupdf, lablgl
|
2014-12-13 15:49:19 +01:00
|
|
|
, gtk3, openjpeg, jbig2dec, mujs, xsel }:
|
2014-05-26 20:31:53 +02:00
|
|
|
|
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}";
|
2015-06-30 13:07:06 +02:00
|
|
|
version = "21-git-2015-06-27";
|
2014-05-26 20:31:53 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://repo.or.cz/llpp.git";
|
2015-06-30 13:07:06 +02:00
|
|
|
rev = "843c42ef41bb78a3b1ee995fc2bab91f8796e8ad";
|
|
|
|
sha256 = "0h8wa7f5bj5sm3sr8namcyy81s4s80hyasimyfw935lqyw2q2k60";
|
2014-05-26 20:31:53 +02:00
|
|
|
};
|
|
|
|
|
2014-11-29 14:17:19 +01:00
|
|
|
buildInputs = [ pkgconfig ninja makeWrapper ocaml findlib mupdf lablgl
|
|
|
|
gtk3 jbig2dec openjpeg mujs ];
|
2014-05-26 20:31:53 +02:00
|
|
|
|
2014-11-29 14:17:19 +01: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 20:31:53 +02:00
|
|
|
'';
|
|
|
|
|
2014-11-29 14:17:19 +01:00
|
|
|
buildPhase = "${ninja}/bin/ninja";
|
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
|
|
|
|
install link.so $out/lib
|
|
|
|
wrapProgram $out/bin/llpp \
|
|
|
|
--prefix CAML_LD_LIBRARY_PATH ":" "${lablgl}/lib/ocaml/${ocamlVersion}/site-lib/lablgl" \
|
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
|
|
|
};
|
|
|
|
}
|