symbolicator: fix build on darwin
[NixPkgs.git] / pkgs / by-name / sy / symbolicator / package.nix
blob7ffaf41bb688a79e83a616bb6cb013357358e5f3
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , pkg-config
5 , bzip2
6 , openssl
7 , zstd
8 , stdenv
9 , darwin
12 rustPlatform.buildRustPackage rec {
13   pname = "symbolicator";
14   version = "23.11.0";
16   src = fetchFromGitHub {
17     owner = "getsentry";
18     repo = "symbolicator";
19     rev = version;
20     hash = "sha256-eXMMk12ZxRs5k3DaRhGADwLbE62L8e4N3R5Rw8kZMKI=";
21     fetchSubmodules = true;
22   };
24   cargoLock = {
25     lockFile = ./Cargo.lock;
26     outputHashes = {
27       "cpp_demangle-0.4.1" = "sha256-9QopX2TOJc8bZ+UlSOFdjoe8NTJLVGrykyFL732tE3A=";
28       "reqwest-0.11.18" = "sha256-t6fs2bbBfgcspCrGfWIFCYbYZ7GPcBWI0dy68YdklOQ=";
29     };
30   };
32   nativeBuildInputs = [
33     pkg-config
34     rustPlatform.bindgenHook
35   ];
37   buildInputs = [
38     bzip2
39     openssl
40     zstd
41   ] ++ lib.optionals stdenv.isDarwin [
42     darwin.apple_sdk.frameworks.Security
43   ];
45   env = {
46     SYMBOLICATOR_GIT_VERSION = src.rev;
47     SYMBOLICATOR_RELEASE = version;
48     ZSTD_SYS_USE_PKG_CONFIG = true;
49   } // lib.optionalAttrs stdenv.cc.isClang {
50     # Work around https://github.com/NixOS/nixpkgs/issues/166205.
51     NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
52   };
54   # tests require network access
55   doCheck = false;
57   meta = with lib; {
58     description = "Native Symbolication as a Service";
59     homepage = "https://getsentry.github.io/symbolicator/";
60     changelog = "https://github.com/getsentry/symbolicator/blob/${src.rev}/CHANGELOG.md";
61     license = licenses.mit;
62     maintainers = with maintainers; [ figsoda ];
63     mainProgram = "symbolicator";
64   };