|
1 | 1 | { |
2 | 2 | lib, |
| 3 | + stdenv, |
3 | 4 | fetchFromGitHub, |
4 | 5 | rustPlatform, |
5 | | - versionCheckHook, |
6 | 6 |
|
7 | 7 | openssl, |
8 | 8 | pkg-config, |
| 9 | + installShellFiles, |
| 10 | + buildPackages, |
| 11 | + versionCheckHook, |
| 12 | + nix-update-script, |
9 | 13 | }: |
10 | 14 |
|
11 | 15 | rustPlatform.buildRustPackage rec { |
12 | 16 | pname = "rattler-build"; |
13 | | - version = "0.33.1"; |
| 17 | + version = "0.34.1"; |
14 | 18 |
|
15 | 19 | src = fetchFromGitHub { |
16 | 20 | owner = "prefix-dev"; |
17 | 21 | repo = "rattler-build"; |
18 | | - rev = "refs/tags/v${version}"; |
19 | | - hash = "sha256-yceScRfZuMVnNVNVg3Xs+jU3spdFn0hPMmwMLaYzkNE="; |
| 22 | + tag = "v${version}"; |
| 23 | + hash = "sha256-HDRQveWOJKGBWxN7ZyIECo1HBfz+vSaLW7ueSok+d64="; |
20 | 24 | }; |
21 | 25 |
|
22 | 26 | useFetchCargoVendor = true; |
23 | | - cargoHash = "sha256-eJH7a+9asSPDv0gBwvLc4zssJGCY2jAfVKKOWb3oQ/Q="; |
| 27 | + cargoHash = "sha256-b44bL/xVUwBdqwr/jawZbyV+yHsGR3hREm4nvHDMCWA="; |
24 | 28 |
|
25 | 29 | doCheck = false; # test requires network access |
26 | 30 |
|
| 31 | + buildInputs = [ |
| 32 | + openssl |
| 33 | + ]; |
| 34 | + |
27 | 35 | nativeBuildInputs = [ |
28 | 36 | pkg-config |
| 37 | + installShellFiles |
29 | 38 | ]; |
30 | 39 |
|
31 | | - buildInputs = [ |
32 | | - openssl |
33 | | - ]; |
| 40 | + cargoBuildFlags = [ "--bin rattler-build" ]; # other bin like `generate-cli-docs` shouldn't be distributed. |
34 | 41 |
|
35 | | - doInstallCheck = true; |
| 42 | + postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( |
| 43 | + let |
| 44 | + emulator = stdenv.hostPlatform.emulator buildPackages; |
| 45 | + in |
| 46 | + '' |
| 47 | + installShellCompletion --cmd rattler-build \ |
| 48 | + --bash <(${emulator} $out/bin/rattler-build completion --shell bash) \ |
| 49 | + --fish <(${emulator} $out/bin/rattler-build completion --shell fish) \ |
| 50 | + --zsh <(${emulator} $out/bin/rattler-build completion --shell zsh) |
| 51 | + '' |
| 52 | + ); |
36 | 53 |
|
| 54 | + doInstallCheck = true; |
37 | 55 | nativeInstallCheckInputs = [ |
38 | 56 | versionCheckHook |
39 | 57 | ]; |
| 58 | + versionCheckProgramArg = [ "--version" ]; |
40 | 59 |
|
41 | | - versionCheckProgramArg = [ "-V" ]; |
| 60 | + passthru.updateScript = nix-update-script { }; |
42 | 61 |
|
43 | 62 | meta = { |
44 | 63 | description = "Universal package builder for Windows, macOS and Linux"; |
45 | | - homepage = "https://github.com/prefix-dev/rattler-build"; |
| 64 | + homepage = "https://rattler.build/"; |
46 | 65 | changelog = "https://github.com/prefix-dev/rattler-build/releases/tag/v${version}"; |
47 | 66 | license = lib.licenses.bsd3; |
48 | | - maintainers = with lib.maintainers; [ genga898 ]; |
| 67 | + maintainers = with lib.maintainers; [ |
| 68 | + genga898 |
| 69 | + xiaoxiangmoe |
| 70 | + ]; |
49 | 71 | mainProgram = "rattler-build"; |
50 | 72 | }; |
51 | 73 | } |
0 commit comments