From 5ce9c53cdbaf57e3b37088df16998cd1dd0a1830 Mon Sep 17 00:00:00 2001 From: aiotter Date: Sun, 17 Mar 2024 19:59:28 +0900 Subject: [PATCH 1/5] git-filter-repo: fix broken --help option --- .../python-modules/git-filter-repo/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/git-filter-repo/default.nix b/pkgs/development/python-modules/git-filter-repo/default.nix index 5f4fede287d1..3b3bb1d2e258 100644 --- a/pkgs/development/python-modules/git-filter-repo/default.nix +++ b/pkgs/development/python-modules/git-filter-repo/default.nix @@ -1,7 +1,9 @@ { lib , buildPythonPackage -, fetchpatch +, fetchFromGitHub , fetchPypi +, fetchpatch +, installShellFiles , pythonOlder , setuptools-scm }: @@ -9,6 +11,7 @@ buildPythonPackage rec { pname = "git-filter-repo"; version = "2.38.0"; + docs_version = "01ead411966a83dfcfb35f9d2e8a9f7f215eaa65"; format = "setuptools"; disabled = pythonOlder "3.5"; @@ -18,6 +21,13 @@ buildPythonPackage rec { hash = "sha256-/hdT4Y8L1tPJtXhoyAEa59BWpuurcGcGOWoV71MScl4="; }; + docs = fetchFromGitHub { + owner = "newren"; + repo = pname; + rev = docs_version; + hash = "sha256-Z/3w3Rguo8sfuc/OQ25eFbMfiOHjxQqPY6S32zuvoY4="; + }; + patches = [ # https://github.com/newren/git-filter-repo/pull/498 (fetchpatch { @@ -28,8 +38,13 @@ buildPythonPackage rec { }) ]; + postInstall = '' + installManPage ${docs}/man1/git-filter-repo.1 + ''; + nativeBuildInputs = [ setuptools-scm + installShellFiles ]; # Project has no tests From c6ad9424001b5c6531bf2c879a754499330808ba Mon Sep 17 00:00:00 2001 From: aiotter Date: Sun, 17 Mar 2024 20:01:11 +0900 Subject: [PATCH 2/5] git-filter-repo: add passthru.updateScript --- .../python-modules/git-filter-repo/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/python-modules/git-filter-repo/default.nix b/pkgs/development/python-modules/git-filter-repo/default.nix index 3b3bb1d2e258..d56ec5603566 100644 --- a/pkgs/development/python-modules/git-filter-repo/default.nix +++ b/pkgs/development/python-modules/git-filter-repo/default.nix @@ -6,6 +6,7 @@ , installShellFiles , pythonOlder , setuptools-scm +, writeScript }: buildPythonPackage rec { @@ -60,4 +61,18 @@ buildPythonPackage rec { license = with licenses; [ mit /* or */ gpl2Plus ]; maintainers = with maintainers; [ fab ]; }; + + passthru.updateScript = writeScript "update-${pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts curl jq nix-update + + set -eu -o pipefail + + # Update program + nix-update ${pname} + + # Update docs + docs_latest=$(curl -s https://api.github.com/repos/newren/git-filter-repo/commits/heads/docs/status | jq -r '.sha') + [[ "${docs_version}" = "$docs_latest" ]] || update-source-version ${pname} "$docs_latest" --version-key=docs_version --source-key=docs + ''; } From b1169e3fc6800ec4e919623c4562109b9618ee4a Mon Sep 17 00:00:00 2001 From: aiotter Date: Sun, 17 Mar 2024 20:01:28 +0900 Subject: [PATCH 3/5] git-filter-repo: add maintainer --- pkgs/development/python-modules/git-filter-repo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/git-filter-repo/default.nix b/pkgs/development/python-modules/git-filter-repo/default.nix index d56ec5603566..e19d3b05b83c 100644 --- a/pkgs/development/python-modules/git-filter-repo/default.nix +++ b/pkgs/development/python-modules/git-filter-repo/default.nix @@ -59,7 +59,7 @@ buildPythonPackage rec { description = "Quickly rewrite git repository history"; homepage = "https://github.com/newren/git-filter-repo"; license = with licenses; [ mit /* or */ gpl2Plus ]; - maintainers = with maintainers; [ fab ]; + maintainers = with maintainers; [ aiotter fab ]; }; passthru.updateScript = writeScript "update-${pname}" '' From 143d276571073a166b866716ed5a8bca888b0fb2 Mon Sep 17 00:00:00 2001 From: Yuto Oguchi Date: Tue, 19 Mar 2024 09:25:43 +0900 Subject: [PATCH 4/5] git-filter-repo: update packaging option format="setuptools" is legacy Co-authored-by: OTABI Tomoya --- pkgs/development/python-modules/git-filter-repo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/git-filter-repo/default.nix b/pkgs/development/python-modules/git-filter-repo/default.nix index e19d3b05b83c..2594781ae260 100644 --- a/pkgs/development/python-modules/git-filter-repo/default.nix +++ b/pkgs/development/python-modules/git-filter-repo/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { pname = "git-filter-repo"; version = "2.38.0"; docs_version = "01ead411966a83dfcfb35f9d2e8a9f7f215eaa65"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.5"; From f3fbb9d016f3c3a0360fc1f2d1f0a482bb19a9dd Mon Sep 17 00:00:00 2001 From: Yuto Oguchi Date: Tue, 19 Mar 2024 09:26:46 +0900 Subject: [PATCH 5/5] git-filter-repo: do not use pname as repo name Co-authored-by: OTABI Tomoya --- pkgs/development/python-modules/git-filter-repo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/git-filter-repo/default.nix b/pkgs/development/python-modules/git-filter-repo/default.nix index 2594781ae260..1cc7efe76e7b 100644 --- a/pkgs/development/python-modules/git-filter-repo/default.nix +++ b/pkgs/development/python-modules/git-filter-repo/default.nix @@ -24,7 +24,7 @@ buildPythonPackage rec { docs = fetchFromGitHub { owner = "newren"; - repo = pname; + repo = "git-filter-repo"; rev = docs_version; hash = "sha256-Z/3w3Rguo8sfuc/OQ25eFbMfiOHjxQqPY6S32zuvoY4="; };