From 2bd9b7d670d8c78ddf5ad47a6716d5199e7daa7e Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 28 Jan 2026 02:16:43 +0000 Subject: [PATCH 1/3] silver-platter: build the Rust portion rather than the Python bindings At the moment this package just builds the Python bindings, which isn't as useful as building the Rust binary. I'll package the Python bindings up separately. --- pkgs/by-name/si/silver-platter/package.nix | 71 ++++++++++++---------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/pkgs/by-name/si/silver-platter/package.nix b/pkgs/by-name/si/silver-platter/package.nix index 5e1cb6a84736..8674f0e5926c 100644 --- a/pkgs/by-name/si/silver-platter/package.nix +++ b/pkgs/by-name/si/silver-platter/package.nix @@ -1,53 +1,62 @@ { - python3Packages, lib, stdenv, - fetchFromGitHub, - pkg-config, rustPlatform, - cargo, - rustc, + fetchFromGitHub, + python3, + makeBinaryWrapper, + pkg-config, libiconv, openssl, + versionCheckHook, }: -python3Packages.buildPythonApplication rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "silver-platter"; version = "0.8.1"; - pyproject = true; src = fetchFromGitHub { owner = "jelmer"; repo = "silver-platter"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-/GFTM/VF+b0I8cDY4vkHzSxCBbvpMiLBVVEPFHcn1/Q="; }; - cargoDeps = rustPlatform.fetchCargoVendor { - inherit pname version src; - hash = "sha256-Y16OnSBC4v21NcCeWAwwGoFYJMQq/se25QqvpMyblmk="; - }; + cargoHash = "sha256-Y16OnSBC4v21NcCeWAwwGoFYJMQq/se25QqvpMyblmk="; - dependencies = with python3Packages; [ - setuptools - breezy - dulwich - jinja2 - pyyaml - ruamel-yaml - ]; - nativeBuildInputs = [ - python3Packages.setuptools-rust - rustPlatform.cargoSetupHook - cargo - rustc + buildInputs = [ + python3 ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; - buildInputs = - lib.optionals stdenv.hostPlatform.isLinux [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ++ lib.optionals stdenv.hostPlatform.isLinux [ openssl ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; - pythonImportsCheck = [ "silver_platter" ]; + nativeBuildInputs = [ + python3 + pkg-config + + python3.pkgs.wrapPython + makeBinaryWrapper + ]; + + nativeCheckInputs = [ + python3.pkgs.breezy + ]; + + pythonPath = [ + python3.pkgs.breezy + ]; + + postFixup = '' + wrapPythonPrograms + for pgm in $out/bin/svp $out/bin/debian-svp; do + wrapProgram "$pgm" \ + --set PYTHONNOUSERSITE "true" \ + --set PYTHONPATH "$program_PYTHONPATH" + done + ''; + + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; meta = { description = "Automate the creation of merge proposals for scriptable changes"; @@ -56,4 +65,4 @@ python3Packages.buildPythonApplication rec { maintainers = with lib.maintainers; [ lukegb ]; mainProgram = "svp"; }; -} +}) From 6e4f96ca6aa0102be8e60cc23510a3ee395b18dc Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 28 Jan 2026 02:25:57 +0000 Subject: [PATCH 2/3] python3Packages.silver-platter: init at 0.8.1 This adds the Python bindings that were previously in the repo as `silver-platter` at the top level. These are Python version dependent now, so they live inside the `python3Packages` subtree. --- pkgs/by-name/si/silver-platter/package.nix | 4 ++ .../python-modules/silver-platter/default.nix | 64 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/silver-platter/default.nix diff --git a/pkgs/by-name/si/silver-platter/package.nix b/pkgs/by-name/si/silver-platter/package.nix index 8674f0e5926c..2ae743478432 100644 --- a/pkgs/by-name/si/silver-platter/package.nix +++ b/pkgs/by-name/si/silver-platter/package.nix @@ -58,6 +58,10 @@ rustPlatform.buildRustPackage (finalAttrs: { doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; + passthru.tests = { + python3-bindings = python3.pkgs.silver-platter; + }; + meta = { description = "Automate the creation of merge proposals for scriptable changes"; homepage = "https://jelmer.uk/code/silver-platter"; diff --git a/pkgs/development/python-modules/silver-platter/default.nix b/pkgs/development/python-modules/silver-platter/default.nix new file mode 100644 index 000000000000..68c3dc6bf979 --- /dev/null +++ b/pkgs/development/python-modules/silver-platter/default.nix @@ -0,0 +1,64 @@ +{ + lib, + stdenv, + buildPythonPackage, + pkgs, + pkg-config, + rustPlatform, + cargo, + rustc, + libiconv, + openssl, + + setuptools, + setuptools-rust, + breezy, + dulwich, + jinja2, + pyyaml, + ruamel-yaml, +}: + +let + inherit (pkgs) silver-platter; +in +buildPythonPackage { + inherit (silver-platter) + pname + version + src + cargoDeps + ; + + pyproject = true; + + dependencies = [ + setuptools + breezy + dulwich + jinja2 + pyyaml + ruamel-yaml + ]; + nativeBuildInputs = [ + setuptools-rust + rustPlatform.cargoSetupHook + cargo + rustc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + buildInputs = + lib.optionals stdenv.hostPlatform.isLinux [ openssl ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + + pythonImportsCheck = [ "silver_platter" ]; + + meta = { + inherit (silver-platter.meta) + description + homepage + license + maintainers + ; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a00111cb5d7a..852d28ef3031 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17327,6 +17327,8 @@ self: super: with self; { sigtools = callPackage ../development/python-modules/sigtools { }; + silver-platter = callPackage ../development/python-modules/silver-platter { }; + simanneal = callPackage ../development/python-modules/simanneal { }; simber = callPackage ../development/python-modules/simber { }; From 8005fb4a15f2f5e1a323e8da4f2ed0e285d889d2 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 28 Jan 2026 02:32:08 +0000 Subject: [PATCH 3/3] silver-platter: 0.8.1 -> 0.8.2 --- pkgs/by-name/si/silver-platter/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/si/silver-platter/package.nix b/pkgs/by-name/si/silver-platter/package.nix index 2ae743478432..a668df2a33d0 100644 --- a/pkgs/by-name/si/silver-platter/package.nix +++ b/pkgs/by-name/si/silver-platter/package.nix @@ -13,16 +13,16 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "silver-platter"; - version = "0.8.1"; + version = "0.8.2"; src = fetchFromGitHub { owner = "jelmer"; repo = "silver-platter"; tag = "v${finalAttrs.version}"; - hash = "sha256-/GFTM/VF+b0I8cDY4vkHzSxCBbvpMiLBVVEPFHcn1/Q="; + hash = "sha256-CvFnmGMV46nX6d568pZPqmDEyLZkDnDPpTtf0dMJd4U="; }; - cargoHash = "sha256-Y16OnSBC4v21NcCeWAwwGoFYJMQq/se25QqvpMyblmk="; + cargoHash = "sha256-nMCOEb1WTG320ozno0H/5JeZql5TqFakO8TghjbKbiQ="; buildInputs = [ python3