2018-12-01 12:14:24 +00:00
|
|
|
{ stdenv, lib, substituteAll, makeWrapper, fetchgit, ocaml, mupdf, libX11,
|
|
|
|
libGLU_combined, freetype, xclip }:
|
2014-05-26 18:31:53 +00:00
|
|
|
|
2018-12-01 12:14:24 +00:00
|
|
|
assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
|
2016-09-19 17:00:42 +00:00
|
|
|
|
2018-07-20 17:56:59 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-01-14 12:42:44 +00:00
|
|
|
name = "llpp-${version}";
|
2018-12-01 12:14:24 +00:00
|
|
|
version = "30";
|
2014-05-26 18:31:53 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://repo.or.cz/llpp.git";
|
2018-12-01 12:14:24 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0iilpzf12hs0zky58j55l4y5dvzv7fc53nsrg324n9vka92mppvd";
|
2015-08-04 10:59:34 +00:00
|
|
|
fetchSubmodules = false;
|
2014-05-26 18:31:53 +00:00
|
|
|
};
|
|
|
|
|
2018-12-01 12:14:24 +00:00
|
|
|
patches = (substituteAll {
|
|
|
|
inherit version;
|
|
|
|
src = ./fix-build-bash.patch;
|
|
|
|
});
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ ocaml mupdf libX11 libGLU_combined freetype ];
|
2016-06-12 06:39:59 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
2014-05-26 18:31:53 +00:00
|
|
|
|
2014-11-29 13:17:19 +00:00
|
|
|
configurePhase = ''
|
2018-12-01 12:14:24 +00:00
|
|
|
mkdir -p build/mupdf/thirdparty
|
|
|
|
ln -s ${freetype.dev} build/mupdf/thirdparty/freetype
|
2014-05-26 18:31:53 +00:00
|
|
|
'';
|
|
|
|
|
2016-06-12 06:39:59 +00:00
|
|
|
buildPhase = ''
|
2018-12-01 12:14:24 +00:00
|
|
|
bash ./build.bash build
|
2016-06-12 06:39:59 +00:00
|
|
|
'';
|
2014-05-26 18:31:53 +00: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" \
|
2018-12-01 12:14:24 +00:00
|
|
|
--prefix PATH ":" "${xclip}/bin"
|
2014-05-26 18:31:53 +00: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 18:31:53 +00:00
|
|
|
description = "A MuPDF based PDF pager written in OCaml";
|
2014-11-29 13:17:19 +00:00
|
|
|
platforms = platforms.linux;
|
2018-12-01 12:14:24 +00:00
|
|
|
maintainers = with maintainers; [ pSub enzime ];
|
2014-11-29 13:17:19 +00:00
|
|
|
license = licenses.gpl3;
|
2014-05-26 18:31:53 +00:00
|
|
|
};
|
|
|
|
}
|