From 3ed419cd2f01117facf2b97c5fba31e55511b781 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 23 Sep 2023 15:39:02 +0000 Subject: [PATCH 1/3] breezy: add github support Breezy offers Github support as a `forge` which is used by [`silver-platter`](https://github.com/jelmer/silver-platter), which I'm currently importing into nixpkgs. --- pkgs/development/python-modules/breezy/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/breezy/default.nix b/pkgs/development/python-modules/breezy/default.nix index 5fb4dd913e60..c7e938465507 100644 --- a/pkgs/development/python-modules/breezy/default.nix +++ b/pkgs/development/python-modules/breezy/default.nix @@ -8,6 +8,7 @@ , dulwich , fastbencode , fastimport +, pygithub , libiconv , merge3 , patiencediff @@ -66,7 +67,8 @@ buildPythonPackage rec { pyyaml urllib3 ] ++ passthru.optional-dependencies.launchpad - ++ passthru.optional-dependencies.fastimport; + ++ passthru.optional-dependencies.fastimport + ++ passthru.optional-dependencies.github; nativeCheckInputs = [ testtools @@ -109,6 +111,9 @@ buildPythonPackage rec { fastimport = [ fastimport ]; + github = [ + pygithub + ]; }; }; From 8ca1a9e376ec8f22bdf8fb537c735f2dc8b2c85e Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 14 Oct 2023 01:44:44 +0000 Subject: [PATCH 2/3] breezy: add patch for differentiating GitLab forges properly --- pkgs/development/python-modules/breezy/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/breezy/default.nix b/pkgs/development/python-modules/breezy/default.nix index c7e938465507..505137993b08 100644 --- a/pkgs/development/python-modules/breezy/default.nix +++ b/pkgs/development/python-modules/breezy/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , buildPythonPackage +, fetchpatch , fetchPypi , cargo , configobj @@ -38,6 +39,14 @@ buildPythonPackage rec { hash = "sha256-fEEvOfo8YWhx+xuiqD/KNstlso5/K1XJnGY64tkLIwE="; }; + patches = [ + # Explicitly track which URLs are used for GitLab + (fetchpatch { + url = "https://github.com/breezy-team/breezy/commit/cc9fdf3774253183f726127c2ee191c24640d898.patch"; + hash = "sha256-HTDAW3CPEZ1YBe0wnv6ncWEd0QRHwHawfTplbVDiOGc="; + }) + ]; + cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; From 0c702bd8af9a0351ad1279817b525810383999e2 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 23 Sep 2023 15:42:12 +0000 Subject: [PATCH 3/3] silver-platter: init at 0.5.12 --- .../silver-platter/default.nix | 44 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/applications/version-management/silver-platter/default.nix diff --git a/pkgs/applications/version-management/silver-platter/default.nix b/pkgs/applications/version-management/silver-platter/default.nix new file mode 100644 index 000000000000..1e5720f0d0ab --- /dev/null +++ b/pkgs/applications/version-management/silver-platter/default.nix @@ -0,0 +1,44 @@ +{ buildPythonApplication +, lib +, fetchFromGitHub +, setuptools +, setuptools-rust +, rustPlatform +, cargo +, rustc +, breezy +, dulwich +, jinja2 +, pyyaml +, ruamel-yaml +}: + +buildPythonApplication rec { + pname = "silver-platter"; + version = "0.5.12"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jelmer"; + repo = "silver-platter"; + rev = version; + hash = "sha256-QkTT9UcJuGDAwpp/CtXobPvfTYQzFakBR72MhF//Bpo="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-QLnKu9D23FVp1jCSuxN3odPZ1ToAZ6i/FNS8BkmNuQw="; + }; + + propagatedBuildInputs = [ setuptools breezy dulwich jinja2 pyyaml ruamel-yaml ]; + nativeBuildInputs = [ setuptools-rust rustPlatform.cargoSetupHook cargo rustc ]; + + meta = with lib; { + description = "Automate the creation of merge proposals for scriptable changes"; + homepage = "https://jelmer.uk/code/silver-platter"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ lukegb ]; + mainProgram = "svp"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02586f3ba116..83574a17cf89 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2513,6 +2513,8 @@ with pkgs; scmpuff = callPackage ../applications/version-management/scmpuff { }; + silver-platter = python3Packages.callPackage ../applications/version-management/silver-platter { }; + stgit = callPackage ../applications/version-management/stgit { }; subgit = callPackage ../applications/version-management/subgit { };