From 92e2e96fecddcb69f0bde2558f4c08b8ee6d9ff5 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 25 Jun 2024 20:23:24 -0400 Subject: [PATCH 1/6] contrast: migrate to by-name --- .../contrast/default.nix => by-name/co/contrast/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/accessibility/contrast/default.nix => by-name/co/contrast/package.nix} (100%) diff --git a/pkgs/applications/accessibility/contrast/default.nix b/pkgs/by-name/co/contrast/package.nix similarity index 100% rename from pkgs/applications/accessibility/contrast/default.nix rename to pkgs/by-name/co/contrast/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b24e0955a7c5..a0093721bcea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4729,8 +4729,6 @@ with pkgs; clockify = callPackage ../applications/office/clockify { }; - contrast = callPackage ../applications/accessibility/contrast { }; - cplex = callPackage ../applications/science/math/cplex (config.cplex or {}); cpulimit = callPackage ../tools/misc/cpulimit { }; From a654f48e02951ec8a7b5f4afd9e2683151adf116 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 25 Jun 2024 20:23:47 -0400 Subject: [PATCH 2/6] contrast: format with nixfmt --- pkgs/by-name/co/contrast/package.nix | 35 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/co/contrast/package.nix b/pkgs/by-name/co/contrast/package.nix index cc8e21b92456..90455360a512 100644 --- a/pkgs/by-name/co/contrast/package.nix +++ b/pkgs/by-name/co/contrast/package.nix @@ -1,20 +1,21 @@ -{ stdenv -, lib -, fetchFromGitLab -, cairo -, cargo -, desktop-file-utils -, gettext -, glib -, gtk4 -, libadwaita -, meson -, ninja -, pango -, pkg-config -, rustPlatform -, rustc -, wrapGAppsHook4 +{ + stdenv, + lib, + fetchFromGitLab, + cairo, + cargo, + desktop-file-utils, + gettext, + glib, + gtk4, + libadwaita, + meson, + ninja, + pango, + pkg-config, + rustPlatform, + rustc, + wrapGAppsHook4, }: stdenv.mkDerivation rec { From 21e6566909e953ea8a199108c6b8ea8454d4653f Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 25 Jun 2024 20:25:13 -0400 Subject: [PATCH 3/6] contrast: adopt --- pkgs/by-name/co/contrast/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/co/contrast/package.nix b/pkgs/by-name/co/contrast/package.nix index 90455360a512..2554c190e6ac 100644 --- a/pkgs/by-name/co/contrast/package.nix +++ b/pkgs/by-name/co/contrast/package.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { description = "Checks whether the contrast between two colors meet the WCAG requirements"; homepage = "https://gitlab.gnome.org/World/design/contrast"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ getchoo ]; platforms = platforms.unix; # never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs broken = stdenv.isDarwin; From bd506051b9ba9847ace5e8f5d82a552112d805bd Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 25 Jun 2024 20:25:47 -0400 Subject: [PATCH 4/6] contrast: don't overuse `with lib;` https://github.com/NixOS/nixpkgs/issues/208242 --- pkgs/by-name/co/contrast/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/co/contrast/package.nix b/pkgs/by-name/co/contrast/package.nix index 2554c190e6ac..3817f130996b 100644 --- a/pkgs/by-name/co/contrast/package.nix +++ b/pkgs/by-name/co/contrast/package.nix @@ -57,12 +57,12 @@ stdenv.mkDerivation rec { pango ]; - meta = with lib; { + meta = { description = "Checks whether the contrast between two colors meet the WCAG requirements"; homepage = "https://gitlab.gnome.org/World/design/contrast"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ getchoo ]; - platforms = platforms.unix; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ getchoo ]; + platforms = lib.platforms.unix; # never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs broken = stdenv.isDarwin; mainProgram = "contrast"; From 6942f9d107afd9b18b2ba9a7c283acc75958cd72 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 25 Jun 2024 20:27:19 -0400 Subject: [PATCH 5/6] contrast: restrict platforms to linux the upstream meson project installing files and running checks specific to linux without accounting for other platforms, so it seems to be the only supported platform --- pkgs/by-name/co/contrast/package.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/by-name/co/contrast/package.nix b/pkgs/by-name/co/contrast/package.nix index 3817f130996b..17b9abadbf2b 100644 --- a/pkgs/by-name/co/contrast/package.nix +++ b/pkgs/by-name/co/contrast/package.nix @@ -62,9 +62,7 @@ stdenv.mkDerivation rec { homepage = "https://gitlab.gnome.org/World/design/contrast"; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ getchoo ]; - platforms = lib.platforms.unix; - # never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin; mainProgram = "contrast"; + platforms = lib.platforms.linux; }; } From 5759dfddf24bf1deaf6f4cce2c9bccd0b7d835f5 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 25 Jun 2024 20:30:20 -0400 Subject: [PATCH 6/6] contrast: add updateScript --- pkgs/by-name/co/contrast/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/co/contrast/package.nix b/pkgs/by-name/co/contrast/package.nix index 17b9abadbf2b..12dbc1c637a8 100644 --- a/pkgs/by-name/co/contrast/package.nix +++ b/pkgs/by-name/co/contrast/package.nix @@ -11,6 +11,7 @@ libadwaita, meson, ninja, + nix-update-script, pango, pkg-config, rustPlatform, @@ -57,6 +58,10 @@ stdenv.mkDerivation rec { pango ]; + passthru = { + updateScript = nix-update-script { }; + }; + meta = { description = "Checks whether the contrast between two colors meet the WCAG requirements"; homepage = "https://gitlab.gnome.org/World/design/contrast";