nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 rustPlatform,
3 fetchFromGitHub,
4 lib,
5 installShellFiles,
6 openssl,
7 pkg-config,
8 stdenv,
9 swift,
10 swiftpm,
11 replaceVars,
12 gitMinimal,
13 versionCheckHook,
14 nix-update-script,
15}:
16
17rustPlatform.buildRustPackage (finalAttrs: {
18 pname = "sentry-cli";
19 version = "2.58.2";
20
21 src = fetchFromGitHub {
22 owner = "getsentry";
23 repo = "sentry-cli";
24 tag = finalAttrs.version;
25 hash = "sha256-2dxnAwxIdmeA53PETUyDUgi1T4ZH9faBvPCMdRPUDxw=";
26 };
27
28 patches = lib.optionals stdenv.hostPlatform.isDarwin [
29 (replaceVars ./fix-swift-lib-path.patch { swiftLib = lib.getLib swift; })
30 ];
31
32 cargoHash = "sha256-CwULTOZN2TTpB8heLuegID38ub6J3XoiY7l7UW1VcGo=";
33
34 # Needed to get openssl-sys to use pkgconfig.
35 env.OPENSSL_NO_VENDOR = 1;
36
37 # By default including `swiftpm` in `nativeBuildInputs` will take over `buildPhase`
38 dontUseSwiftpmBuild = true;
39 dontUseSwiftpmCheck = true;
40
41 __darwinAllowLocalNetworking = true;
42
43 nativeBuildInputs = [
44 installShellFiles
45 pkg-config
46 ]
47 ++ lib.optionals stdenv.hostPlatform.isDarwin [
48 swift
49 swiftpm
50 ];
51
52 buildInputs = [ openssl ];
53
54 nativeCheckInputs = [ gitMinimal ];
55
56 checkFlags = [
57 "--skip=integration::send_metric::command_send_metric"
58 "--skip=integration::update::command_update"
59 ];
60
61 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
62 installShellCompletion --cmd sentry-cli \
63 --bash <($out/bin/sentry-cli completions bash) \
64 --fish <($out/bin/sentry-cli completions fish) \
65 --zsh <($out/bin/sentry-cli completions zsh)
66 '';
67
68 nativeInstallCheckInputs = [ versionCheckHook ];
69 versionCheckProgramArg = "--version";
70 doInstallCheck = true;
71
72 passthru.updateScript = nix-update-script { };
73
74 meta = {
75 homepage = "https://docs.sentry.io/cli/";
76 license = lib.licenses.bsd3;
77 description = "Command line utility to work with Sentry";
78 mainProgram = "sentry-cli";
79 changelog = "https://github.com/getsentry/sentry-cli/raw/${finalAttrs.version}/CHANGELOG.md";
80 maintainers = with lib.maintainers; [ rizary ];
81 };
82})