From 9ed5dad1e5143bfeedc2c312f83c3de442935d30 Mon Sep 17 00:00:00 2001 From: Xyven1 Date: Thu, 25 Jan 2024 13:48:56 -0500 Subject: [PATCH] sioyek: 2.0.0 -> 2.0.0-unstable-2024-09-29 Gives access to many new configuration options, bug fixes, accessibility improvements, and features. --- pkgs/applications/misc/sioyek/default.nix | 95 ----------------------- pkgs/by-name/si/sioyek/package.nix | 94 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 - 3 files changed, 94 insertions(+), 97 deletions(-) delete mode 100644 pkgs/applications/misc/sioyek/default.nix create mode 100644 pkgs/by-name/si/sioyek/package.nix diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix deleted file mode 100644 index 64faccf6811c5..0000000000000 --- a/pkgs/applications/misc/sioyek/default.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ lib -, stdenv -, installShellFiles -, fetchFromGitHub -, fetchurl -, freetype -, gumbo -, harfbuzz -, jbig2dec -, mujs -, mupdf -, openjpeg -, qt3d -, qtbase -, qmake -, wrapQtAppsHook -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "sioyek"; - version = "2.0.0"; - - src = fetchFromGitHub { - owner = "ahrm"; - repo = "sioyek"; - rev = "v${finalAttrs.version}"; - sha256 = "sha256-GFZaTXJhoBB+rSe7Qk6H6FZJVXr3nO9XgM+LAbS4te4="; - }; - - patches = [ - # Fixed compatibility with mupdf-0.23.0 - # https://github.com/ahrm/sioyek/issues/804 - (fetchurl { - url = "https://git.alpinelinux.org/aports/plain/community/sioyek/mupdf-0.23.0.patch?id=86e913eccf19b97a16f25d9b6cdf0f50232f1226"; - hash = "sha256-sEqhpk7/h6g/fIhbu5LgpKKnbnIFLInrTP1k+/GhrXE="; - }) - ]; - - buildInputs = [ - gumbo - harfbuzz - jbig2dec - mujs - mupdf - openjpeg - qt3d - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ freetype ]; - - nativeBuildInputs = [ - installShellFiles - qmake - wrapQtAppsHook - ]; - - qmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "CONFIG+=non_portable" ]; - - postPatch = '' - substituteInPlace pdf_viewer_build_config.pro \ - --replace "-lmupdf-threads" "-lgumbo -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lopenjp2" \ - --replace "-lmupdf-third" "" - substituteInPlace pdf_viewer/main.cpp \ - --replace "/usr/share/sioyek" "$out/share" \ - --replace "/etc/sioyek" "$out/etc" - ''; - - postInstall = if stdenv.hostPlatform.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 $out/bin - cp -r sioyek.app $out/Applications - ln -s $out/Applications/sioyek.app/Contents/MacOS/sioyek $out/bin/sioyek - '' 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 - installManPage resources/sioyek.1 - ''; - - meta = with lib; { - homepage = "https://sioyek.info/"; - description = "PDF viewer designed for research papers and technical books"; - mainProgram = "sioyek"; - changelog = "https://github.com/ahrm/sioyek/releases/tag/v${finalAttrs.version}"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ podocarp ]; - platforms = platforms.unix; - }; -}) diff --git a/pkgs/by-name/si/sioyek/package.nix b/pkgs/by-name/si/sioyek/package.nix new file mode 100644 index 0000000000000..954e7ef197e0b --- /dev/null +++ b/pkgs/by-name/si/sioyek/package.nix @@ -0,0 +1,94 @@ +{ + lib, + stdenv, + installShellFiles, + fetchFromGitHub, + freetype, + nix-update-script, + gumbo, + harfbuzz, + jbig2dec, + mujs, + mupdf, + openjpeg, + qt6, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "sioyek"; + version = "2.0.0-unstable-2024-09-29"; + + src = fetchFromGitHub { + owner = "ahrm"; + repo = "sioyek"; + rev = "965499f0acbb1faf4b443b6bca30e7078f944b52"; + hash = "sha256-MOqWitXnYn8efk2LSeAOhmpcxGn6hbvjXbNTXEDdxIM="; + }; + + buildInputs = [ + gumbo + harfbuzz + jbig2dec + mujs + mupdf + openjpeg + qt6.qt3d + qt6.qtbase + qt6.qtspeech + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ freetype ]; + + nativeBuildInputs = [ + installShellFiles + qt6.qmake + qt6.wrapQtAppsHook + ]; + + qmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "CONFIG+=non_portable" ]; + + postPatch = '' + substituteInPlace pdf_viewer_build_config.pro \ + --replace-fail "-lmupdf-threads" "-lgumbo -lharfbuzz -lfreetype -ljbig2dec -ljpeg -lopenjp2" \ + --replace-fail "-lmupdf-third" "" + substituteInPlace pdf_viewer/main.cpp \ + --replace-fail "/usr/share/sioyek" "$out/share" \ + --replace-fail "/etc/sioyek" "$out/etc" + ''; + + postInstall = + if stdenv.isDarwin then + '' + cp -r pdf_viewer/shaders sioyek.app/Contents/MacOS/shaders + cp pdf_viewer/{prefs,prefs_user,keys,key_user}.config tutorial.pdf sioyek.app/Contents/MacOS/ + + mkdir -p $out/Applications $out/bin + cp -r sioyek.app $out/Applications + ln -s $out/Applications/sioyek.app/Contents/MacOS/sioyek $out/bin/sioyek + '' + 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 + installManPage resources/sioyek.1 + ''; + + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version" + "branch=development" + ]; + }; + + meta = with lib; { + homepage = "https://sioyek.info/"; + description = "PDF viewer designed for research papers and technical books"; + mainProgram = "sioyek"; + changelog = "https://github.com/ahrm/sioyek/releases/tag/v${finalAttrs.version}"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ + podocarp + stephen-huan + xyven1 + ]; + platforms = platforms.unix; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1083d5f78b97a..565cada966aeb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32697,8 +32697,6 @@ with pkgs; sic-image-cli = callPackage ../tools/graphics/sic-image-cli { }; - sioyek = libsForQt5.callPackage ../applications/misc/sioyek { }; - siproxd = callPackage ../applications/networking/siproxd { }; sish = callPackage ../tools/networking/sish { };