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/development/python-modules/breezy/default.nix b/pkgs/development/python-modules/breezy/default.nix index 5fb4dd913e60..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 @@ -8,6 +9,7 @@ , dulwich , fastbencode , fastimport +, pygithub , libiconv , merge3 , patiencediff @@ -37,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; }; @@ -66,7 +76,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 +120,9 @@ buildPythonPackage rec { fastimport = [ fastimport ]; + github = [ + pygithub + ]; }; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fba319f6f644..475afd0427e2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2527,6 +2527,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 { };