From 7811b310b6cdbf5bcd204892a55c7e393c940f72 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Sat, 9 Dec 2023 18:45:00 +0100 Subject: [PATCH 1/3] swayimg: move to by-name --- .../swayimg/default.nix => by-name/sw/swayimg/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/wayland/swayimg/default.nix => by-name/sw/swayimg/package.nix} (100%) diff --git a/pkgs/tools/wayland/swayimg/default.nix b/pkgs/by-name/sw/swayimg/package.nix similarity index 100% rename from pkgs/tools/wayland/swayimg/default.nix rename to pkgs/by-name/sw/swayimg/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c72fc1749793..2f2e7e8ce466 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4814,8 +4814,6 @@ with pkgs; swaysome = callPackage ../tools/wayland/swaysome { }; - swayimg = callPackage ../tools/wayland/swayimg { }; - swaytools = python3Packages.callPackage ../tools/wayland/swaytools { }; swww = callPackage ../tools/wayland/swww { }; From 31f223904d9aa30f0c052b301557775243a03278 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Sat, 9 Dec 2023 19:00:00 +0100 Subject: [PATCH 2/3] swayimg: 1.11 -> 1.12 --- pkgs/by-name/sw/swayimg/package.nix | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/sw/swayimg/package.nix b/pkgs/by-name/sw/swayimg/package.nix index 78a7ab67bad9..7134a1bab8df 100644 --- a/pkgs/by-name/sw/swayimg/package.nix +++ b/pkgs/by-name/sw/swayimg/package.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , meson , ninja , pkg-config @@ -20,27 +19,20 @@ , libpng , libjxl , libexif +, openexr_3 , bash-completion }: stdenv.mkDerivation rec { pname = "swayimg"; - version = "1.11"; + version = "1.12"; src = fetchFromGitHub { owner = "artemsen"; repo = pname; rev = "v${version}"; - sha256 = "sha256-UwIufR3EwbpNVHD1GypV3qNgiqDRllwtxAM0CZPodn0="; + sha256 = "sha256-aKDt4lPh4w0AOucN7VrA7mo8SHI9eJqdrpJF+hG93gI="; }; - patches = [ - (fetchpatch { - name = "link-libwebp-1.3.1.patch"; - url = "https://github.com/artemsen/swayimg/commit/bd3d6c838c699b876fd8c19b408c475eb47e17b6.patch"; - hash = "sha256-2aMq/GTqyKw+CQr8o8ij4P4yNjBXYKXShQUknStUb5c="; - }) - ]; - strictDeps = true; depsBuildBuild = [ @@ -65,6 +57,7 @@ stdenv.mkDerivation rec { libpng libjxl libexif + openexr_3 ]; meta = with lib; { From ba94c68eb0fe7660e0c4d6109e1afc832737b772 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Sat, 9 Dec 2023 19:00:00 +0100 Subject: [PATCH 3/3] swayimg: add version tester --- pkgs/by-name/sw/swayimg/package.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sw/swayimg/package.nix b/pkgs/by-name/sw/swayimg/package.nix index 7134a1bab8df..9b0cc438976f 100644 --- a/pkgs/by-name/sw/swayimg/package.nix +++ b/pkgs/by-name/sw/swayimg/package.nix @@ -21,15 +21,16 @@ , libexif , openexr_3 , bash-completion +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "swayimg"; version = "1.12"; src = fetchFromGitHub { owner = "artemsen"; - repo = pname; - rev = "v${version}"; + repo = "swayimg"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-aKDt4lPh4w0AOucN7VrA7mo8SHI9eJqdrpJF+hG93gI="; }; @@ -41,6 +42,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config wayland-scanner ]; + mesonFlags = [ + (lib.mesonOption "version" finalAttrs.version) + ]; + buildInputs = [ bash-completion wayland @@ -60,6 +65,10 @@ stdenv.mkDerivation rec { openexr_3 ]; + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + meta = with lib; { homepage = "https://github.com/artemsen/swayimg"; description = "Image viewer for Sway/Wayland"; @@ -69,4 +78,4 @@ stdenv.mkDerivation rec { platforms = platforms.linux; mainProgram = "swayimg"; }; -} +})