From ff585410544889b6f864c04f10c4619f3193689e Mon Sep 17 00:00:00 2001 From: Jonas Fierlings Date: Thu, 23 Jan 2025 16:22:30 +0100 Subject: [PATCH] committed: 1.1.2 -> 1.1.5 --- pkgs/by-name/co/committed/package.nix | 40 +++++++++++++++++++++------ 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/co/committed/package.nix b/pkgs/by-name/co/committed/package.nix index e8b54bb2f08f..8cde17a8e4f3 100644 --- a/pkgs/by-name/co/committed/package.nix +++ b/pkgs/by-name/co/committed/package.nix @@ -3,13 +3,13 @@ stdenv, fetchFromGitHub, rustPlatform, - darwin, - testers, + versionCheckHook, nix-update-script, - committed, + git, + libz, }: let - version = "1.1.2"; + version = "1.1.5"; in rustPlatform.buildRustPackage { pname = "committed"; @@ -19,15 +19,37 @@ rustPlatform.buildRustPackage { owner = "crate-ci"; repo = "committed"; tag = "v${version}"; - hash = "sha256-dBNtzKqaaqJrKMNwamUY0DO9VCVqDyf45lT82nOn8UM="; + hash = "sha256-puv64/btSEkxGNhGGkh2A08gI+EIHWjC+s+QQDKj/ZQ="; }; - useFetchCargoVendor = true; - cargoHash = "sha256-gWMS14945qa6pCe+Olg89gOaoZwRKsqJtG0jKe5/7e0="; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + useFetchCargoVendor = true; + cargoHash = "sha256-fW3TqI26xggUKfzI11YCO8bpotd3aO6pdu1CHhtiShs="; + + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ + # Until upstream bumps the libz-sys dependency to >= 1.1.15 the build fails on unstable + # nixpkgs with macOS, because the following commit is not part of libz-sys < 1.1.15: + # https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9 + # Instead, use the nixpkgs libz so that libz-sys does not have to be built. + libz + ]; + + nativeCheckInputs = [ + git + ]; + + # Ensure libgit2 can read user.name and user.email for `git_signature_default`. + # https://github.com/crate-ci/committed/blob/v1.1.5/crates/committed/tests/cmd.rs#L126 + preCheck = '' + export HOME=$(mktemp -d) + git config --global user.name nobody + git config --global user.email no@where + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; passthru = { - tests.version = testers.testVersion { package = committed; }; updateScript = nix-update-script { }; };