nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchYarnDeps,
6 git,
7 yarn-berry,
8 yarnConfigHook,
9 nodejs,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "element-call";
14 version = "0.11.1";
15
16 src = fetchFromGitHub {
17 owner = "element-hq";
18 repo = "element-call";
19 tag = "v${finalAttrs.version}";
20 hash = "sha256-SNwNo3v2HydNXtb3H3Xh2mYBIagMkWjitlKWTfraeVU=";
21 };
22
23 matrixJsSdkRevision = "19b1b901f575755d29d1fe03ca48cbf7c1cae05c";
24 matrixJsSdkOfflineCache = fetchYarnDeps {
25 yarnLock = "${finalAttrs.offlineCache}/checkouts/${finalAttrs.matrixJsSdkRevision}/yarn.lock";
26 hash = "sha256-pi2MW+58DCkHJDOxMWeXzF+v+5JhJFGQcUgsRsYjNvw=";
27 };
28
29 dontYarnInstallDeps = true;
30 preConfigure = ''
31 cp -r $offlineCache writable
32 chmod u+w -R writable
33 pushd writable/checkouts/${finalAttrs.matrixJsSdkRevision}/
34 mkdir -p .git/{refs,objects}
35 echo ${finalAttrs.matrixJsSdkRevision} > .git/HEAD
36 SKIP_YARN_COREPACK_CHECK=1 offlineCache=$matrixJsSdkOfflineCache yarnConfigHook
37 popd
38 offlineCache=writable
39 '';
40
41 missingHashes = ./missing-hashes.json;
42 offlineCache = yarn-berry.fetchYarnBerryDeps {
43 inherit (finalAttrs) src missingHashes;
44 hash = "sha256-Z8gTt4W78w2DdkRhnaPLG2RIwfT64RFs5+UobARDG4c=";
45 };
46
47 nativeBuildInputs = [
48 git
49 yarn-berry.yarnBerryConfigHook
50 yarnConfigHook
51 nodejs
52 ];
53
54 buildPhase = ''
55 runHook preBuild
56 ${lib.getExe yarn-berry} build
57 runHook postBuild
58 '';
59
60 installPhase = ''
61 runHook preInstall
62
63 mkdir $out
64 cp -r dist/* $out
65
66 runHook postInstall
67 '';
68
69 meta = {
70 changelog = "https://github.com/element-hq/element-call/releases/tag/${finalAttrs.src.tag}";
71 homepage = "https://github.com/element-hq/element-call";
72 description = "Group calls powered by Matrix";
73 license = lib.licenses.asl20;
74 maintainers = with lib.maintainers; [ kilimnik ];
75 };
76})