xcursor-pro: init at 2.0.2 (#335188)
[NixPkgs.git] / pkgs / development / libraries / matrix-sdk-crypto-nodejs / default.nix
blob093d3d7a2133ef76af7e1e480249e63ccc834629
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cargo,
6   rustPlatform,
7   rustc,
8   napi-rs-cli,
9   nodejs,
10   libiconv,
13 stdenv.mkDerivation rec {
14   pname = "matrix-sdk-crypto-nodejs";
15   version = "0.2.0-beta.1";
17   src = fetchFromGitHub {
18     owner = "matrix-org";
19     repo = "matrix-rust-sdk-crypto-nodejs";
20     rev = "v${version}";
21     hash = "sha256-g86RPfhF9XHpbXhHRbyhl920VazCrQyRQrYV6tVCHy4=";
22   };
24   cargoDeps = rustPlatform.importCargoLock {
25     lockFile = ./Cargo.lock;
26     outputHashes = {
27       "matrix-sdk-base-0.7.0" = "sha256-nCiG4T/MB7gvGrmadKOEbh8+54081PHee9Bm8oY/nl0=";
28       "ruma-0.10.1" = "sha256-Yc5RKk4aRjNIoQsMl30fFehTDCkRO9VvenAvLoVHzXo=";
29       "vodozemac-0.6.0" = "sha256-jJgrJJ0SFcy2oRRZ3ubuKnM2pLO8Tx6NyXordWJjz8o=";
30     };
31   };
33   nativeBuildInputs = [
34     rustPlatform.cargoSetupHook
35     cargo
36     rustc
37     napi-rs-cli
38     nodejs
39   ];
41   buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
43   buildPhase = ''
44     runHook preBuild
46     npm run release-build --offline
48     runHook postBuild
49   '';
51   installPhase = ''
52     runHook preInstall
54     local -r outPath="$out/lib/node_modules/@matrix-org/${pname}"
55     mkdir -p "$outPath"
56     cp package.json index.js index.d.ts matrix-sdk-crypto.*.node "$outPath"
58     runHook postInstall
59   '';
61   meta = with lib; {
62     description = "No-network-IO implementation of a state machine that handles E2EE for Matrix clients";
63     homepage = "https://github.com/matrix-org/matrix-rust-sdk-crypto-nodejs";
64     changelog = "https://github.com/matrix-org/matrix-rust-sdk-crypto-nodejs/blob/main/CHANGELOG.md";
65     license = licenses.asl20;
66     maintainers = with maintainers; [
67       winter
68       dandellion
69     ];
70     inherit (nodejs.meta) platforms;
71   };