From 9f588014cb39711002b9a952d08c5551e488c82a Mon Sep 17 00:00:00 2001 From: "Julie B." Date: Sat, 18 May 2024 10:26:02 +0200 Subject: [PATCH 1/5] python3Packages.build: 1.1.1 -> 1.2.1 --- pkgs/by-name/py/python/python-modules/build/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/py/python/python-modules/build/default.nix b/pkgs/by-name/py/python/python-modules/build/default.nix index 53c9b8c..4eaace8 100644 --- a/pkgs/by-name/py/python/python-modules/build/default.nix +++ b/pkgs/by-name/py/python/python-modules/build/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { pname = "build"; - version = "1.1.1"; + version = "1.2.1"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -28,7 +28,7 @@ buildPythonPackage rec { owner = "pypa"; repo = "build"; rev = "refs/tags/${version}"; - hash = "sha256-SGWpm+AGIfqKMpDfmz2aMYmcs+XVREbHIXSuU4R7U/k="; + hash = "sha256-G0g+1v19sQMUuQlZKGELZOwwX07i7TIdEdaYzr8bKtI="; }; postPatch = '' -- 2.45.2 From 6425e3f3633452c781311c8c2112895ea4ef1e85 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 9 Mar 2024 00:10:12 +0800 Subject: [PATCH 2/5] fetchFromGitHub: force re-fetch when rev changes Prefix the default value of `name` with `rev` to force re-fetch everytime `rev` changes. --- pkgs/build-support/fetchgithub/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index 4ce3c6e..ad4d97b 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -1,7 +1,9 @@ { lib, fetchgit, fetchzip }: lib.makeOverridable ( -{ owner, repo, rev, name ? "source" +{ owner, repo, rev +, name ? null # Override with null to use the default value +, pname ? "source-${owner}-${repo}" , fetchSubmodules ? false, leaveDotGit ? null , deepClone ? false, private ? false, forceFetchGit ? false , sparseCheckout ? [] @@ -11,6 +13,8 @@ lib.makeOverridable ( }@args: let + name = if args.name or null != null then args.name + else "${pname}-${rev}"; position = (if args.meta.description or null != null then builtins.unsafeGetAttrPos "description" args.meta -- 2.45.2 From 882bdc43f288eca0d7e61fd8f8c969728464d52c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 9 Mar 2024 00:01:11 +0800 Subject: [PATCH 3/5] fetchFromGitHub: take passthru and enhance overriding Take optional argument `passthru` for custom passthru attribute set. Update the `meta` attribute via `.overrideAttrs` instead of attribute set update (`//`). Attach attributes `owner`, `repo` and `rev` via `passthru` instead of attribute set update. --- pkgs/build-support/fetchgithub/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index ad4d97b..039683e 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -8,6 +8,7 @@ lib.makeOverridable ( , deepClone ? false, private ? false, forceFetchGit ? false , sparseCheckout ? [] , githubBase ? "github.com", varPrefix ? null +, passthru ? { } , meta ? { } , ... # For hash agility }@args: @@ -21,6 +22,9 @@ let else builtins.unsafeGetAttrPos "rev" args ); baseUrl = "https://${githubBase}/${owner}/${repo}"; + newPassthru = passthru // { + inherit rev owner repo; + }; newMeta = meta // { homepage = meta.homepage or baseUrl; } // lib.optionalAttrs (position != null) { @@ -57,16 +61,19 @@ let fetcherArgs = (if useFetchGit then { inherit rev deepClone fetchSubmodules sparseCheckout; url = gitRepoUrl; + passthru = newPassthru; } // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; } else { url = "${baseUrl}/archive/${rev}.tar.gz"; - passthru = { + passthru = newPassthru // { inherit gitRepoUrl; }; } ) // privateAttrs // passthruAttrs // { inherit name; }; in -fetcher fetcherArgs // { meta = newMeta; inherit rev owner repo; } +(fetcher fetcherArgs).overrideAttrs (finalAttrs: previousAttrs: { + meta = newMeta; +}) ) -- 2.45.2 From 7494c65f9a0ae00f230935e254df8ddac44f507d Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Thu, 7 Mar 2024 17:11:29 +0000 Subject: [PATCH 4/5] fetchgit: takes passthru argument --- pkgs/build-support/fetchgit/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 66bb3b7..83811e8 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -27,6 +27,7 @@ lib.makeOverridable ( , # Impure env vars (https://nixos.org/nix/manual/#sec-advanced-attributes) # needed for netrcPhase netrcImpureEnvVars ? [] +, passthru ? {} , meta ? {} , allowedRequisites ? null }: @@ -103,7 +104,7 @@ stdenvNoCC.mkDerivation { inherit preferLocalBuild meta allowedRequisites; - passthru = { + passthru = passthru // { gitRepoUrl = url; }; } -- 2.45.2 From bbfac173443cf725dd686d6615c5e9024dc81cb8 Mon Sep 17 00:00:00 2001 From: "Julie B." Date: Sun, 19 May 2024 10:45:26 +0200 Subject: [PATCH 5/5] fetchFromGitHub: use instance URL in name --- pkgs/build-support/fetchgithub/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index 039683e..66da4d6 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -3,7 +3,7 @@ lib.makeOverridable ( { owner, repo, rev , name ? null # Override with null to use the default value -, pname ? "source-${owner}-${repo}" +, pname ? "source-${githubBase}-${owner}-${repo}" , fetchSubmodules ? false, leaveDotGit ? null , deepClone ? false, private ? false, forceFetchGit ? false , sparseCheckout ? [] -- 2.45.2