nixpkgs/pkgs/applications/misc/llpp/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.8 KiB
Nix
Raw Normal View History

2023-03-06 19:14:57 +00:00
{ stdenv, lib, substituteAll, makeWrapper, fetchFromGitHub, fetchpatch, ocaml, pkg-config, mupdf, libX11, jbig2dec, openjpeg, libjpeg , lcms2, harfbuzz,
2020-10-14 05:16:08 +00:00
libGLU, libGL, gumbo, freetype, zlib, xclip, inotify-tools, procps }:
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 {
pname = "llpp";
2023-03-06 19:14:57 +00:00
version = "41";
2023-03-06 19:14:57 +00:00
src = fetchFromGitHub {
owner = "criticic";
repo = pname;
rev = "v${version}";
2023-03-06 19:14:57 +00:00
hash = "sha256-Doj0zLYI1pi7eK01+29xFLYPtc8+fWzj10292+PmToE=";
};
2023-03-06 19:14:57 +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=";
})
];
postPatch = ''
sed -i "2d;s/ver=.*/ver=${version}/" build.bash
'';
strictDeps = true;
2023-03-06 19:14:57 +00:00
nativeBuildInputs = [ makeWrapper ocaml pkg-config ];
buildInputs = [ mupdf libX11 libGLU libGL freetype zlib gumbo jbig2dec openjpeg libjpeg lcms2 harfbuzz ];
dontStrip = true;
configurePhase = ''
mkdir -p build/mupdf/thirdparty
ln -s ${freetype.dev} build/mupdf/thirdparty/freetype
'';
buildPhase = ''
bash ./build.bash build
'';
installPhase = ''
2019-02-26 18:37:41 +00:00
install -d $out/bin
install build/llpp $out/bin
2019-02-26 18:38:01 +00:00
install misc/llpp.inotify $out/bin/llpp.inotify
wrapProgram $out/bin/llpp \
--prefix PATH ":" "${xclip}/bin"
2019-02-26 18:38:01 +00:00
wrapProgram $out/bin/llpp.inotify \
--prefix PATH ":" "$out/bin" \
--prefix PATH ":" "${inotify-tools}/bin" \
--prefix PATH ":" "${procps}/bin"
'';
meta = with lib; {
homepage = "https://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;
};
}