summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/dart/package-source-builders/sentry_flutter/default.nix
blob: 5e3c2de4057ff86682413a785edef9a0d760ebfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  lib,
  stdenv,
  fetchFromGitHub,
}:

{ version, src, ... }:

let
  sentry-native = fetchFromGitHub {
    owner = "getsentry";
    repo = "sentry-native";
    tag = "0.9.1";
    fetchSubmodules = true;
    hash = "sha256-1jyJGiIrX0TsRDzAeg3IuE1Vf5STAaG8JVxdbmPMXGQ=";
  };
in
stdenv.mkDerivation (finalAttrs: {
  pname = "sentry_flutter";
  inherit version src;
  inherit (src) passthru;

  postPatch = lib.optionalString (lib.versionAtLeast version "8.10.0") ''
    sed -i "s|GIT_REPOSITORY.*|SOURCE_DIR "${sentry-native}"|" sentry-native/sentry-native.cmake
    sed -i '/GIT_TAG/d' sentry-native/sentry-native.cmake
  '';

  installPhase = ''
    runHook preInstall

    cp -r . $out

    runHook postInstall
  '';
})