2022-04-15 01:41:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, installShellFiles
|
|
|
|
, fetchFromGitHub
|
2022-08-21 13:32:41 +00:00
|
|
|
, freetype
|
2022-04-15 01:41:22 +00:00
|
|
|
, gumbo
|
|
|
|
, harfbuzz
|
|
|
|
, jbig2dec
|
2022-08-12 12:06:08 +00:00
|
|
|
, mujs
|
2022-04-15 01:41:22 +00:00
|
|
|
, mupdf
|
|
|
|
, openjpeg
|
|
|
|
, qt3d
|
|
|
|
, qtbase
|
|
|
|
, qmake
|
|
|
|
, wrapQtAppsHook
|
|
|
|
}:
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-04-15 01:41:22 +00:00
|
|
|
pname = "sioyek";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "unstable-2022-08-30";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ahrm";
|
2022-09-09 14:08:57 +00:00
|
|
|
repo = "sioyek";
|
|
|
|
rev = "8d0a63484334e2cb2b0571a07a3875e6ab6c8916";
|
|
|
|
sha256 = "sha256-29Wxg/VVQPDDzzxKcvMa1+rtiP4bDkPAB/JJsj+F+WQ=";
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildInputs = [
|
|
|
|
gumbo
|
|
|
|
harfbuzz
|
|
|
|
jbig2dec
|
|
|
|
mujs
|
|
|
|
mupdf
|
|
|
|
openjpeg
|
|
|
|
qt3d
|
|
|
|
qtbase
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ freetype ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
qmake
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
qmakeFlags = lib.optionals stdenv.isDarwin [ "CONFIG+=non_portable" ];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
postPatch = ''
|
2022-08-21 13:32:41 +00:00
|
|
|
substituteInPlace pdf_viewer_build_config.pro \
|
|
|
|
--replace "-lmupdf-threads" "-lgumbo -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lopenjp2"
|
2022-04-15 01:41:22 +00:00
|
|
|
substituteInPlace pdf_viewer/main.cpp \
|
|
|
|
--replace "/usr/share/sioyek" "$out/share" \
|
|
|
|
--replace "/etc/sioyek" "$out/etc"
|
|
|
|
'';
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
postInstall = if stdenv.isDarwin then ''
|
|
|
|
cp -r pdf_viewer/shaders sioyek.app/Contents/MacOS/shaders
|
|
|
|
cp pdf_viewer/prefs.config sioyek.app/Contents/MacOS/
|
|
|
|
cp pdf_viewer/prefs_user.config sioyek.app/Contents/MacOS/
|
|
|
|
cp pdf_viewer/keys.config sioyek.app/Contents/MacOS/
|
|
|
|
cp pdf_viewer/keys_user.config sioyek.app/Contents/MacOS/
|
|
|
|
cp tutorial.pdf sioyek.app/Contents/MacOS/
|
|
|
|
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r sioyek.app $out/Applications
|
2022-09-09 14:08:57 +00:00
|
|
|
'' else ''
|
2022-04-15 01:41:22 +00: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
|
|
|
|
installManPage resources/sioyek.1
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://sioyek.info/";
|
2022-09-09 14:08:57 +00:00
|
|
|
description = "A PDF viewer designed for research papers and technical books";
|
|
|
|
changelog = "https://github.com/ahrm/sioyek/releases/tag/v1.5.0";
|
2022-04-15 01:41:22 +00:00
|
|
|
license = licenses.gpl3Only;
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ podocarp ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
2022-09-09 14:08:57 +00:00
|
|
|
})
|