2024-01-02 11:29:13 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, makeWrapper
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ocaml
|
|
|
|
, pkg-config
|
|
|
|
, mupdf
|
|
|
|
, libX11
|
|
|
|
, jbig2dec
|
|
|
|
, openjpeg
|
|
|
|
, libjpeg
|
|
|
|
, lcms2
|
|
|
|
, harfbuzz
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, gumbo
|
|
|
|
, freetype
|
|
|
|
, zlib
|
|
|
|
, xclip
|
|
|
|
, inotify-tools
|
|
|
|
, procps
|
|
|
|
, darwin
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "llpp";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "42";
|
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}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-B/jKvBtBwMOErUVmGFGXXIT8FzMl1DFidfDCHIH41TU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
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 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [ mupdf libX11 freetype zlib gumbo jbig2dec openjpeg libjpeg lcms2 harfbuzz ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ libGLU libGL ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.Cocoa ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
bash ./build.bash build
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -d $out/bin
|
|
|
|
install build/llpp $out/bin
|
|
|
|
install misc/llpp.inotify $out/bin/llpp.inotify
|
2024-01-02 11:29:13 +00:00
|
|
|
install -Dm444 misc/llpp.desktop -t $out/share/applications
|
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-04-24 23:36:52 +00:00
|
|
|
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; {
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/criticic/llpp";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A MuPDF based PDF pager written in OCaml";
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-01-09 10:05:03 +00:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
2024-01-02 11:29:13 +00:00
|
|
|
license = [ licenses.publicDomain licenses.bsd3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|