2023-11-23 04:20:00 +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
|
|
|
|
}:
|
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 {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "llpp";
|
2023-11-15 04:20:00 +00:00
|
|
|
version = "42";
|
2014-05-26 18:31:53 +00:00
|
|
|
|
2023-03-06 19:14:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "criticic";
|
|
|
|
repo = pname;
|
2018-12-01 12:14:24 +00:00
|
|
|
rev = "v${version}";
|
2023-11-15 04:20:00 +00:00
|
|
|
hash = "sha256-B/jKvBtBwMOErUVmGFGXXIT8FzMl1DFidfDCHIH41TU=";
|
2014-05-26 18:31:53 +00:00
|
|
|
};
|
|
|
|
|
2023-03-06 19:14:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "2d;s/ver=.*/ver=${version}/" build.bash
|
|
|
|
'';
|
2018-12-01 12:14:24 +00:00
|
|
|
|
2022-04-04 11:57:15 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-03-06 19:14:57 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ocaml pkg-config ];
|
2023-11-15 04:20:00 +00:00
|
|
|
buildInputs = [ mupdf libX11 freetype zlib gumbo jbig2dec openjpeg libjpeg lcms2 harfbuzz ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ libGLU libGL ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.Cocoa ];
|
2016-06-12 06:39:59 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
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 = ''
|
2019-02-26 18:37:41 +00:00
|
|
|
install -d $out/bin
|
2014-11-29 13:17:19 +00:00
|
|
|
install build/llpp $out/bin
|
2019-02-26 18:38:01 +00:00
|
|
|
install misc/llpp.inotify $out/bin/llpp.inotify
|
2023-12-01 21:17:20 +00:00
|
|
|
install -Dm444 misc/llpp.desktop -t $out/share/applications
|
2023-11-15 04:20:00 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
|
2014-11-29 13:17:19 +00:00
|
|
|
wrapProgram $out/bin/llpp \
|
2018-12-01 12:14:24 +00:00
|
|
|
--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"
|
2014-05-26 18:31:53 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2023-11-23 04:20:00 +00:00
|
|
|
homepage = "https://github.com/criticic/llpp";
|
2014-05-26 18:31:53 +00:00
|
|
|
description = "MuPDF based PDF pager written in OCaml";
|
2023-11-15 04:20:00 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-01-06 06:06:03 +00:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
2023-11-23 04:20:00 +00:00
|
|
|
license = [ licenses.publicDomain licenses.bsd3 ];
|
2014-05-26 18:31:53 +00:00
|
|
|
};
|
|
|
|
}
|