2023-03-08 16:32:21 +00:00
|
|
|
{ stdenv, lib, substituteAll, makeWrapper, fetchFromGitHub, fetchpatch, ocaml, pkg-config, mupdf, libX11, jbig2dec, openjpeg, libjpeg , lcms2, harfbuzz,
|
2020-11-12 09:05:59 +00:00
|
|
|
libGLU, libGL, gumbo, freetype, zlib, xclip, inotify-tools, procps }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "llpp";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "41";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "criticic";
|
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2023-03-08 16:32:21 +00:00
|
|
|
hash = "sha256-Doj0zLYI1pi7eK01+29xFLYPtc8+fWzj10292+PmToE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "system-makedeps.patch";
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/system-makedeps.patch?h=llpp&id=0d2913056aaf3dbf7431e57b7b08b55568ba076c";
|
|
|
|
hash = "sha256-t9PLXsM8+exCeYqJBe0LSDK0D2rpktmozS8qNcEAcHo=";
|
|
|
|
})
|
2023-10-19 13:55:26 +00:00
|
|
|
./fix-mupdf.patch
|
2023-03-08 16:32:21 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "2d;s/ver=.*/ver=${version}/" build.bash
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ocaml pkg-config ];
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = [ mupdf libX11 libGLU libGL freetype zlib gumbo jbig2dec openjpeg libjpeg lcms2 harfbuzz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
mkdir -p build/mupdf/thirdparty
|
|
|
|
ln -s ${freetype.dev} build/mupdf/thirdparty/freetype
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
bash ./build.bash build
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -d $out/bin
|
|
|
|
install build/llpp $out/bin
|
|
|
|
install misc/llpp.inotify $out/bin/llpp.inotify
|
|
|
|
|
|
|
|
wrapProgram $out/bin/llpp \
|
|
|
|
--prefix PATH ":" "${xclip}/bin"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/llpp.inotify \
|
|
|
|
--prefix PATH ":" "$out/bin" \
|
|
|
|
--prefix PATH ":" "${inotify-tools}/bin" \
|
|
|
|
--prefix PATH ":" "${procps}/bin"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://repo.or.cz/w/llpp.git";
|
|
|
|
description = "A MuPDF based PDF pager written in OCaml";
|
|
|
|
platforms = platforms.linux;
|
2021-01-09 10:05:03 +00:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|