Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
60 lines
1.4 KiB
Nix
60 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
rustPlatform,
|
|
runCommand,
|
|
xcodebuild,
|
|
protobuf,
|
|
boringssl,
|
|
}:
|
|
let
|
|
# boring-sys expects the static libraries in build/ instead of lib/
|
|
boringssl-wrapper = runCommand "boringssl-wrapper" { } ''
|
|
mkdir $out
|
|
cd $out
|
|
ln -s ${boringssl.out}/lib build
|
|
ln -s ${boringssl.dev}/include include
|
|
'';
|
|
in
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "libsignal-ffi";
|
|
# must match the version used in mautrix-signal
|
|
# see https://github.com/mautrix/signal/issues/401
|
|
version = "0.80.3";
|
|
|
|
src = fetchFromGitHub {
|
|
fetchSubmodules = true;
|
|
owner = "signalapp";
|
|
repo = "libsignal";
|
|
tag = "v${version}";
|
|
hash = "sha256-8iJQ7MpsR0aaNHGUTFGIlLzKP+njsQK/XY/FyDpWu7c=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
protobuf
|
|
rustPlatform.bindgenHook
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ];
|
|
|
|
env.BORING_BSSL_PATH = "${boringssl-wrapper}";
|
|
env.NIX_LDFLAGS = if stdenv.hostPlatform.isDarwin then "-lc++" else "-lstdc++";
|
|
|
|
cargoHash = "sha256-iKYkZ2iG825hTsB5vH110+uNRTsSocRXyXAVy3eTRJE=";
|
|
|
|
cargoBuildFlags = [
|
|
"-p"
|
|
"libsignal-ffi"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "C ABI library which exposes Signal protocol logic";
|
|
homepage = "https://github.com/signalapp/libsignal";
|
|
license = licenses.agpl3Plus;
|
|
maintainers = with maintainers; [
|
|
pentane
|
|
SchweGELBin
|
|
];
|
|
};
|
|
}
|