From 857715074da07594307f3b728d1f491b4fb53eb9 Mon Sep 17 00:00:00 2001 From: ZHAO Jin-Xiang Date: Tue, 14 Jan 2025 00:00:18 +0800 Subject: [PATCH] rattler-build: 0.33.1 -> 0.34.1 --- pkgs/by-name/ra/rattler-build/package.nix | 46 +++++++++++++++++------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ra/rattler-build/package.nix b/pkgs/by-name/ra/rattler-build/package.nix index bd96462427419..57f9a77368fa1 100644 --- a/pkgs/by-name/ra/rattler-build/package.nix +++ b/pkgs/by-name/ra/rattler-build/package.nix @@ -1,51 +1,73 @@ { lib, + stdenv, fetchFromGitHub, rustPlatform, - versionCheckHook, openssl, pkg-config, + installShellFiles, + buildPackages, + versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "rattler-build"; - version = "0.33.1"; + version = "0.34.1"; src = fetchFromGitHub { owner = "prefix-dev"; repo = "rattler-build"; - rev = "refs/tags/v${version}"; - hash = "sha256-yceScRfZuMVnNVNVg3Xs+jU3spdFn0hPMmwMLaYzkNE="; + tag = "v${version}"; + hash = "sha256-HDRQveWOJKGBWxN7ZyIECo1HBfz+vSaLW7ueSok+d64="; }; useFetchCargoVendor = true; - cargoHash = "sha256-eJH7a+9asSPDv0gBwvLc4zssJGCY2jAfVKKOWb3oQ/Q="; + cargoHash = "sha256-b44bL/xVUwBdqwr/jawZbyV+yHsGR3hREm4nvHDMCWA="; doCheck = false; # test requires network access + buildInputs = [ + openssl + ]; + nativeBuildInputs = [ pkg-config + installShellFiles ]; - buildInputs = [ - openssl - ]; + cargoBuildFlags = [ "--bin rattler-build" ]; # other bin like `generate-cli-docs` shouldn't be distributed. - doInstallCheck = true; + postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( + let + emulator = stdenv.hostPlatform.emulator buildPackages; + in + '' + installShellCompletion --cmd rattler-build \ + --bash <(${emulator} $out/bin/rattler-build completion --shell bash) \ + --fish <(${emulator} $out/bin/rattler-build completion --shell fish) \ + --zsh <(${emulator} $out/bin/rattler-build completion --shell zsh) + '' + ); + doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; - versionCheckProgramArg = [ "-V" ]; + passthru.updateScript = nix-update-script { }; meta = { description = "Universal package builder for Windows, macOS and Linux"; - homepage = "https://github.com/prefix-dev/rattler-build"; + homepage = "https://rattler.build/"; changelog = "https://github.com/prefix-dev/rattler-build/releases/tag/v${version}"; license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ genga898 ]; + maintainers = with lib.maintainers; [ + genga898 + xiaoxiangmoe + ]; mainProgram = "rattler-build"; }; }