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

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

57 lines
1.4 KiB
Nix
Raw Normal View History

2022-04-03 13:17:31 +02:00
{ lib
, stdenv
2022-04-08 14:04:59 +02:00
, installShellFiles
2022-04-03 13:17:31 +02:00
, fetchFromGitHub
, gumbo
, harfbuzz
, jbig2dec
, mupdf
, openjpeg
, qt3d
, qtbase
2022-04-10 12:48:12 +02:00
, qmake
2022-04-03 13:17:31 +02:00
, wrapQtAppsHook
}:
stdenv.mkDerivation rec {
pname = "sioyek";
2022-04-10 12:52:57 +02:00
version = "1.2.0";
2022-04-03 13:17:31 +02:00
src = fetchFromGitHub {
owner = "ahrm";
repo = pname;
rev = "v${version}";
2022-04-10 12:52:57 +02:00
sha256 = "sha256-G4iZi6xTJjWZN0T3lO0jPquxJ3p8Mc0ewmjJEKcGJ34=";
2022-04-03 13:17:31 +02:00
};
buildInputs = [ gumbo harfbuzz jbig2dec mupdf openjpeg qt3d qtbase ];
2022-04-10 12:48:12 +02:00
nativeBuildInputs = [ installShellFiles wrapQtAppsHook qmake ];
2022-04-03 13:17:31 +02:00
2022-04-10 12:48:12 +02:00
postPatch = ''
substituteInPlace pdf_viewer_build_config.pro \
--replace "-lmupdf-threads" "-lfreetype -lgumbo -ljbig2dec -lopenjp2 -ljpeg"
substituteInPlace pdf_viewer/main.cpp \
--replace "/usr/share/sioyek" "$out/share" \
2022-04-10 12:58:57 +02:00
--replace "/etc/sioyek" "$out/etc"
2022-04-03 13:17:31 +02:00
'';
2022-04-10 12:48:12 +02:00
qmakeFlags = "DEFINES+=\"LINUX_STANDARD_PATHS\" pdf_viewer_build_config.pro";
2022-04-03 13:17:31 +02:00
postInstall = ''
2022-04-10 12:48:12 +02:00
install -Dm644 tutorial.pdf $out/share/tutorial.pdf
cp -r pdf_viewer/shaders $out/share/
install -Dm644 -t $out/etc/ pdf_viewer/{keys,prefs}.config
2022-04-03 13:17:31 +02:00
installManPage resources/sioyek.1
'';
meta = with lib; {
description = "Sioyek is a PDF viewer designed for reading research papers and technical books.";
homepage = "https://sioyek.info/";
changelog = "https://github.com/ahrm/sioyek/releases";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = [ maintainers.podocarp ];
2022-04-03 13:17:31 +02:00
};
}