about summary refs log tree commit diff
path: root/pkgs/by-name/el/element-call/package.nix
blob: da7f41222c162fbb91560e855ef1b79e9d057f8a (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ lib
, stdenv
, mkYarnPackage
, fetchFromGitHub
, fetchYarnDeps
}:

let
  inherit (stdenv.hostPlatform) system;
  throwSystem = throw "Unsupported system: ${system}";
  offlineCacheHash = {
    x86_64-linux = "sha256-mZCnvX6hzkdi/zjPiefcmbyC2kGemjS4w7WTVkyq8W0=";
    aarch64-linux = "sha256-mZCnvX6hzkdi/zjPiefcmbyC2kGemjS4w7WTVkyq8W0=";
    x86_64-darwin = "sha256-G4doEnZORJqcl3bWaKZPuQmBeXNXud06nLO12Afr9kM=";
    aarch64-darwin = "sha256-G4doEnZORJqcl3bWaKZPuQmBeXNXud06nLO12Afr9kM=";
  }.${system} or throwSystem;
in
mkYarnPackage rec {
  pname = "element-call";
  version = "0.5.16";

  src = fetchFromGitHub {
    owner = "element-hq";
    repo = "element-call";
    rev = "v${version}";
    hash = "sha256-GTHM27i716RZk+kDELMg/lYy355/SZoQLXGPQ90M4xg=";
  };

  packageJSON = ./package.json;

  patches = [ ./name.patch ];

  offlineCache = fetchYarnDeps {
    yarnLock = "${src}/yarn.lock";
    hash = offlineCacheHash;
  };

  buildPhase = ''
    runHook preBuild
    yarn --offline run build
    runHook postBuild
  '';

  preInstall = ''
    mkdir $out
    cp -R ./deps/element-call/dist $out
  '';

  doDist = false;

  meta = with lib; {
    homepage = "https://github.com/element-hq/element-call";
    description = "Group calls powered by Matrix";
    license = licenses.asl20;
    maintainers = with maintainers; [ kilimnik ];
    mainProgram = "element-call";
  };
}