From a3ce1b0a9c4a9ce2488f51ab7c4bd591fbff5958 Mon Sep 17 00:00:00 2001 From: J XD Date: Sun, 3 Apr 2022 19:17:31 +0800 Subject: [PATCH 1/7] sioyek: init at 1.1.0 --- pkgs/applications/misc/sioyek/default.nix | 56 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/applications/misc/sioyek/default.nix diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix new file mode 100644 index 000000000000..8b7bae60587f --- /dev/null +++ b/pkgs/applications/misc/sioyek/default.nix @@ -0,0 +1,56 @@ +{ lib +, stdenv +, fetchFromGitHub +, gumbo +, harfbuzz +, jbig2dec +, mupdf +, openjpeg +, qt3d +, qtbase +, wrapQtAppsHook +}: + +stdenv.mkDerivation rec { + pname = "sioyek"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "ahrm"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-UhZuELWfFfqj1jjCgZTD+X44i7jMpeDTbClkZarV2Zw="; + }; + + buildInputs = [ gumbo harfbuzz jbig2dec mupdf openjpeg qt3d qtbase ]; + + nativeBuildInputs = [ wrapQtAppsHook ]; + + buildPhase = '' + # Remove nonexistent lib and insert missing ones + sed -i 's/-lmupdf-threads/-lfreetype -lgumbo -ljbig2dec -lopenjp2 -ljpeg/' pdf_viewer_build_config.pro + qmake pdf_viewer_build_config.pro + make + ''; + + installPhase = '' + install -Dm755 sioyek $out/bin/sioyek + install -Dm644 tutorial.pdf $out/bin/tutorial.pdf + install -Dm644 -t $out/bin/ pdf_viewer/{keys,prefs}.config + cp -r pdf_viewer/shaders $out/bin/ + ''; + + postInstall = '' + install -Dm644 resource/sioyek-icon-linux.png $out/usr/share/icons/sioyek-icon-linux.png + install -Dm644 resource/sioyek.desktop $out/usr/share/applications/sioyek.desktop + 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 60ae4faa4391..a63ffd08b4fc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29101,6 +29101,8 @@ with pkgs; simple-scan = gnome.simple-scan; + sioyek = libsForQt5.callPackage ../applications/misc/sioyek { }; + siproxd = callPackage ../applications/networking/siproxd { }; sish = callPackage ../tools/networking/sish { }; From 4a2a7b74f05ccbc8e003490a776858f1c4c3caf1 Mon Sep 17 00:00:00 2001 From: J XD Date: Sun, 3 Apr 2022 19:23:17 +0800 Subject: [PATCH 2/7] Add myself to maintainers list --- maintainers/maintainer-list.nix | 6 ++++++ pkgs/applications/misc/sioyek/default.nix | 1 + 2 files changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 7cae29a1eefe..e0587d20c5a2 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -9910,6 +9910,12 @@ fingerprint = "2CD2 B030 BD22 32EF DF5A 008A 3618 20A4 5DB4 1E9A"; }]; }; + podocarp = { + email = "xdjiaxd@gmail.com"; + github = "podocarp"; + githubId = 10473184; + name = "Jia Xiaodong"; + }; polendri = { email = "paul@ijj.li"; github = "polendri"; diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index 8b7bae60587f..fb39f2912333 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -52,5 +52,6 @@ stdenv.mkDerivation rec { changelog = "https://github.com/ahrm/sioyek/releases"; license = licenses.gpl3Only; platforms = platforms.linux; + maintainers = [ mainterners.podocarp ]; }; } From 5c0481109c0d7fe2a19dfbdb6bd18f94b1c21a35 Mon Sep 17 00:00:00 2001 From: Jia Xiaodong Date: Fri, 8 Apr 2022 19:42:52 +0800 Subject: [PATCH 3/7] Update pkgs/applications/misc/sioyek/default.nix typo! Co-authored-by: ajs124 --- pkgs/applications/misc/sioyek/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index fb39f2912333..a62478e21e45 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -52,6 +52,6 @@ stdenv.mkDerivation rec { changelog = "https://github.com/ahrm/sioyek/releases"; license = licenses.gpl3Only; platforms = platforms.linux; - maintainers = [ mainterners.podocarp ]; + maintainers = [ maintainers.podocarp ]; }; } From 3d883a5d9be8dd3b0111d2756746fec7d4bf0066 Mon Sep 17 00:00:00 2001 From: J XD Date: Fri, 8 Apr 2022 20:04:59 +0800 Subject: [PATCH 4/7] fixes --- pkgs/applications/misc/sioyek/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index a62478e21e45..afedf9171038 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -1,5 +1,6 @@ { lib , stdenv +, installShellFiles , fetchFromGitHub , gumbo , harfbuzz @@ -24,25 +25,29 @@ stdenv.mkDerivation rec { buildInputs = [ gumbo harfbuzz jbig2dec mupdf openjpeg qt3d qtbase ]; - nativeBuildInputs = [ wrapQtAppsHook ]; + nativeBuildInputs = [ installShellFiles wrapQtAppsHook ]; buildPhase = '' + runHook prebuild # Remove nonexistent lib and insert missing ones sed -i 's/-lmupdf-threads/-lfreetype -lgumbo -ljbig2dec -lopenjp2 -ljpeg/' pdf_viewer_build_config.pro qmake pdf_viewer_build_config.pro make + runHook postBuild ''; installPhase = '' + runHook preInstall install -Dm755 sioyek $out/bin/sioyek install -Dm644 tutorial.pdf $out/bin/tutorial.pdf install -Dm644 -t $out/bin/ pdf_viewer/{keys,prefs}.config cp -r pdf_viewer/shaders $out/bin/ + runHook postInstall ''; postInstall = '' - install -Dm644 resource/sioyek-icon-linux.png $out/usr/share/icons/sioyek-icon-linux.png - install -Dm644 resource/sioyek.desktop $out/usr/share/applications/sioyek.desktop + install -Dm644 resources/sioyek-icon-linux.png $out/share/icons/sioyek-icon-linux.png + install -Dm644 resources/sioyek.desktop $out/share/applications/sioyek.desktop installManPage resources/sioyek.1 ''; From f0c8e6bf7f2b6856f9a85e85b3f216e2036b3ad7 Mon Sep 17 00:00:00 2001 From: J XD Date: Sun, 10 Apr 2022 18:48:12 +0800 Subject: [PATCH 5/7] patch paths --- pkgs/applications/misc/sioyek/default.nix | 30 +++++++++-------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index afedf9171038..a67a3afa3d97 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -9,6 +9,7 @@ , openjpeg , qt3d , qtbase +, qmake , wrapQtAppsHook }: @@ -25,29 +26,22 @@ stdenv.mkDerivation rec { buildInputs = [ gumbo harfbuzz jbig2dec mupdf openjpeg qt3d qtbase ]; - nativeBuildInputs = [ installShellFiles wrapQtAppsHook ]; + nativeBuildInputs = [ installShellFiles wrapQtAppsHook qmake ]; - buildPhase = '' - runHook prebuild - # Remove nonexistent lib and insert missing ones - sed -i 's/-lmupdf-threads/-lfreetype -lgumbo -ljbig2dec -lopenjp2 -ljpeg/' pdf_viewer_build_config.pro - qmake pdf_viewer_build_config.pro - make - runHook postBuild + 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" \ + --replace "/etc/sioyek" "$out/etc" ''; - installPhase = '' - runHook preInstall - install -Dm755 sioyek $out/bin/sioyek - install -Dm644 tutorial.pdf $out/bin/tutorial.pdf - install -Dm644 -t $out/bin/ pdf_viewer/{keys,prefs}.config - cp -r pdf_viewer/shaders $out/bin/ - runHook postInstall - ''; + qmakeFlags = "DEFINES+=\"LINUX_STANDARD_PATHS\" pdf_viewer_build_config.pro"; postInstall = '' - install -Dm644 resources/sioyek-icon-linux.png $out/share/icons/sioyek-icon-linux.png - install -Dm644 resources/sioyek.desktop $out/share/applications/sioyek.desktop + 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 ''; From 1c828908a57564c3b0fdf680527bddc05a20d5ae Mon Sep 17 00:00:00 2001 From: J XD Date: Sun, 10 Apr 2022 18:52:57 +0800 Subject: [PATCH 6/7] bump version --- pkgs/applications/misc/sioyek/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index a67a3afa3d97..76ef7bebbd56 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "sioyek"; - version = "1.1.0"; + version = "1.2.0"; src = fetchFromGitHub { owner = "ahrm"; repo = pname; rev = "v${version}"; - sha256 = "sha256-UhZuELWfFfqj1jjCgZTD+X44i7jMpeDTbClkZarV2Zw="; + sha256 = "sha256-G4iZi6xTJjWZN0T3lO0jPquxJ3p8Mc0ewmjJEKcGJ34="; }; buildInputs = [ gumbo harfbuzz jbig2dec mupdf openjpeg qt3d qtbase ]; From e420804ed7e2328806a672edfdf44e1d7bb4a240 Mon Sep 17 00:00:00 2001 From: J XD Date: Sun, 10 Apr 2022 18:58:57 +0800 Subject: [PATCH 7/7] remove whitespace --- pkgs/applications/misc/sioyek/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/sioyek/default.nix b/pkgs/applications/misc/sioyek/default.nix index 76ef7bebbd56..7ffb24cb4193 100644 --- a/pkgs/applications/misc/sioyek/default.nix +++ b/pkgs/applications/misc/sioyek/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { --replace "-lmupdf-threads" "-lfreetype -lgumbo -ljbig2dec -lopenjp2 -ljpeg" substituteInPlace pdf_viewer/main.cpp \ --replace "/usr/share/sioyek" "$out/share" \ - --replace "/etc/sioyek" "$out/etc" + --replace "/etc/sioyek" "$out/etc" ''; qmakeFlags = "DEFINES+=\"LINUX_STANDARD_PATHS\" pdf_viewer_build_config.pro";