diff options
author | Jiajie Chen <c@jia.je> | 2022-08-07 10:41:04 +0800 |
---|---|---|
committer | Jiajie Chen <c@jia.je> | 2022-08-08 08:15:41 +0800 |
commit | fc497efb780802d2df568f0591674755645519a3 (patch) | |
tree | 58ec45058c4b4c7118979e381a821fe427110a65 /pkgs/applications/misc/sioyek | |
parent | 2a172dcba992f4c19c0cdafafc12cd1e559a3b93 (diff) |
sioyek: unbreak on darwin
Diffstat (limited to 'pkgs/applications/misc/sioyek')
-rw-r--r-- | pkgs/applications/misc/sioyek/default.nix | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index da66fd585ff28..49ca23ab3ded1 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -2,6 +2,7 @@ , stdenv , installShellFiles , fetchFromGitHub +, freetype , gumbo , harfbuzz , jbig2dec @@ -25,17 +26,32 @@ stdenv.mkDerivation rec { sha256 = "sha256-F71JXgYaWAye+nlSrZvGjJ4ucvHTx3tPZHRC5QI4QiU="; }; - buildInputs = [ gumbo harfbuzz jbig2dec mupdf mujs openjpeg qt3d qtbase ]; + buildInputs = [ gumbo harfbuzz jbig2dec mupdf mujs openjpeg qt3d qtbase ] + ++ lib.optionals stdenv.isDarwin [ freetype ]; nativeBuildInputs = [ installShellFiles wrapQtAppsHook qmake ]; + qmakeFlags = lib.optionals stdenv.isDarwin [ "CONFIG+=non_portable" ]; + postPatch = '' + substituteInPlace pdf_viewer_build_config.pro \ + --replace "-lmupdf-threads" "-lgumbo -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lopenjp2" substituteInPlace pdf_viewer/main.cpp \ --replace "/usr/share/sioyek" "$out/share" \ --replace "/etc/sioyek" "$out/etc" ''; - postInstall = '' + 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 + '' else '' 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 @@ -47,7 +63,7 @@ stdenv.mkDerivation rec { homepage = "https://sioyek.info/"; changelog = "https://github.com/ahrm/sioyek/releases"; license = licenses.gpl3Only; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; maintainers = [ maintainers.podocarp ]; }; } |