13 # boring-sys expects the static libraries in build/ instead of lib/
14 boringssl-wrapper = runCommand "boringssl-wrapper" { } ''
17 ln -s ${boringssl.out}/lib build
18 ln -s ${boringssl.dev}/include include
21 rustPlatform.buildRustPackage rec {
22 pname = "libsignal-ffi";
23 # must match the version used in mautrix-signal
24 # see https://github.com/mautrix/signal/issues/401
27 src = fetchFromGitHub {
28 fetchSubmodules = true;
32 hash = "sha256-36z8Tgf3w0ZDLOS7hMTeVbZLiq/M/es6+sL8rEWtps4=";
35 buildInputs = lib.optional stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
39 rustPlatform.bindgenHook
40 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ];
42 env.BORING_BSSL_PATH = "${boringssl-wrapper}";
43 env.NIX_LDFLAGS = "-lstdc++";
45 # The Cargo.lock contains git dependencies
47 lockFile = ./Cargo.lock;
49 "boring-4.13.0" = "sha256-+0LeCN4YtHe84GzkMZog8gCTvrzVNoAYXv04jQXZaUo=";
50 "intmap-2.0.0" = "sha256-PGlkaZl+DYS4QkpJFfUf+2unVKwd9vLNF0N+/YFg8qE=";
51 "curve25519-dalek-4.1.3" = "sha256-bPh7eEgcZnq9C3wmSnnYv0C4aAP+7pnwk9Io29GrI4A=";
61 description = "C ABI library which exposes Signal protocol logic";
62 homepage = "https://github.com/signalapp/libsignal";
63 license = licenses.agpl3Plus;
64 maintainers = with maintainers; [ niklaskorz ];