signal-desktop-source: build ringrtc & webrtc from source (#397112)
This commit is contained in:
@@ -107,7 +107,7 @@ class Repo:
|
||||
)
|
||||
|
||||
def flatten_repr(self) -> dict:
|
||||
return {"fetcher": self.fetcher, "attrs": {**({"hash": self.hash} if hasattr(self, "hash") else {}), **self.args}}
|
||||
return {"fetcher": self.fetcher, "args": {**({"hash": self.hash} if hasattr(self, "hash") else {}), **self.args}}
|
||||
|
||||
def flatten(self, path: str) -> dict:
|
||||
out = {path: self.flatten_repr()}
|
||||
|
||||
@@ -22,6 +22,23 @@ let
|
||||
pnpm = pnpm_10;
|
||||
electron = electron_35;
|
||||
|
||||
nodeOS =
|
||||
{
|
||||
"linux" = "linux";
|
||||
"darwin" = "darwin";
|
||||
}
|
||||
.${stdenv.hostPlatform.parsed.kernel.name}
|
||||
or (throw "unsupported platform ${stdenv.hostPlatform.parsed.kernel.name}");
|
||||
|
||||
nodeArch =
|
||||
{
|
||||
# https://nodejs.org/api/os.html#osarch
|
||||
"x86_64" = "x64";
|
||||
"aarch64" = "arm64";
|
||||
}
|
||||
.${stdenv.hostPlatform.parsed.cpu.name}
|
||||
or (throw "unsupported platform ${stdenv.hostPlatform.parsed.cpu.name}");
|
||||
|
||||
electron-headers = runCommand "electron-headers" { } ''
|
||||
mkdir -p $out
|
||||
tar -C $out --strip-components=1 -xvf ${electron.headers}
|
||||
@@ -29,7 +46,8 @@ let
|
||||
|
||||
libsignal-node = callPackage ./libsignal-node.nix { inherit nodejs; };
|
||||
|
||||
ringrtc-bin = callPackage ./ringrtc-bin.nix { };
|
||||
webrtc = callPackage ./webrtc.nix { };
|
||||
ringrtc = callPackage ./ringrtc.nix { inherit webrtc; };
|
||||
|
||||
# Noto Color Emoji PNG files for emoji replacement; see below.
|
||||
noto-fonts-color-emoji-png = noto-fonts-color-emoji.overrideAttrs (prevAttrs: {
|
||||
@@ -145,12 +163,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
die "libsignal-client version mismatch"
|
||||
fi
|
||||
|
||||
if [ "`jq -r '.dependencies."@signalapp/ringrtc"' < package.json`" != "${ringrtc-bin.version}" ]
|
||||
if [ "`jq -r '.dependencies."@signalapp/ringrtc"' < package.json`" != "${ringrtc.version}" ]
|
||||
then
|
||||
die "ringrtc version mismatch"
|
||||
fi
|
||||
|
||||
cp -r ${ringrtc-bin} node_modules/@signalapp/ringrtc/build
|
||||
mkdir -p node_modules/@signalapp/ringrtc/build
|
||||
install -D ${ringrtc}/lib/libringrtc${stdenv.hostPlatform.extensions.library} \
|
||||
node_modules/@signalapp/ringrtc/build/${nodeOS}/libringrtc-${nodeArch}.node
|
||||
|
||||
rm -fr node_modules/@signalapp/libsignal-client/prebuilds
|
||||
cp -r ${libsignal-node}/lib node_modules/@signalapp/libsignal-client/prebuilds
|
||||
@@ -218,7 +238,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
passthru = {
|
||||
inherit
|
||||
libsignal-node
|
||||
ringrtc-bin
|
||||
ringrtc
|
||||
webrtc
|
||||
sticker-creator
|
||||
;
|
||||
tests.application-launch = nixosTests.signal-desktop;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchzip,
|
||||
autoPatchelfHook,
|
||||
libpulseaudio,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "ringrtc-bin";
|
||||
version = "2.50.3";
|
||||
src = fetchzip {
|
||||
url = "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${finalAttrs.version}.tar.gz";
|
||||
hash = "sha256-UJqH/UiT9j36r6fr673CP/Z4lGaSPXIzAkf72YZfExo=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
cp -r . $out
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
buildInputs = [ libpulseaudio ];
|
||||
meta = {
|
||||
homepage = "https://github.com/signalapp/ringrtc";
|
||||
license = lib.licenses.agpl3Only;
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
rustPlatform,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
protobuf,
|
||||
webrtc,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "ringrtc";
|
||||
version = "2.50.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "signalapp";
|
||||
repo = "ringrtc";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-EuryWZMMTkrDPheVv0wBsH+zL3LylxSSPS+nNnn3cmM=";
|
||||
};
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-/c+tpTh5X05HLqAHsA/YvWxqy7TSUy49g6OtIQg+rMs=";
|
||||
|
||||
cargoBuildFlags = [
|
||||
"-p"
|
||||
"ringrtc"
|
||||
"--features"
|
||||
"electron"
|
||||
];
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs = [
|
||||
protobuf
|
||||
cmake
|
||||
];
|
||||
buildInputs = [
|
||||
webrtc
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/signalapp/ringrtc";
|
||||
description = "RingRTC library used by Signal";
|
||||
license = lib.licenses.agpl3Only;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash nix-update common-updater-scripts curl coreutils jq
|
||||
#!nix-shell -i bash -p bash nix-update common-updater-scripts curl coreutils jq gclient2nix
|
||||
|
||||
set -ex
|
||||
|
||||
@@ -19,10 +19,12 @@ releaseEpoch=`date -d $releaseDate +%s`
|
||||
packageJson="`curl_github "https://raw.githubusercontent.com/signalapp/Signal-Desktop/refs/tags/$releaseTag/package.json"`"
|
||||
|
||||
latestVersion="`jq -r '.version' <<< $packageJson`"
|
||||
nodeVersion="`jq -r '.engines.node' <<< $packageJson | head -c2`"
|
||||
electronVersion="`jq -r '.devDependencies.electron' <<< $packageJson | head -c2`"
|
||||
nodeVersion="`jq -r '.engines.node' <<< $packageJson | cut -d. -f1`"
|
||||
electronVersion="`jq -r '.devDependencies.electron' <<< $packageJson | cut -d. -f1`"
|
||||
libsignalClientVersion=`jq -r '.dependencies."@signalapp/libsignal-client"' <<< $packageJson`
|
||||
ringrtcVersion=`jq -r '.dependencies."@signalapp/ringrtc"' <<< $packageJson`
|
||||
ringrtcVersionProperties="`curl_github "https://raw.githubusercontent.com/signalapp/ringrtc/refs/tags/v$ringrtcVersion/config/version.properties"`"
|
||||
webrtcVersion="`grep --only-matching "^webrtc.version=.*$" <<< $ringrtcVersionProperties | sed "s/webrtc.version=//g"`"
|
||||
|
||||
sed -E -i "s/(nodejs_)../\1$nodeVersion/" $SCRIPT_DIR/package.nix
|
||||
sed -E -i "s/(electron_)../\1$electronVersion/" $SCRIPT_DIR/package.nix
|
||||
@@ -44,4 +46,9 @@ update-source-version signal-desktop-source.libsignal-node \
|
||||
--ignore-same-version \
|
||||
--source-key=npmDeps
|
||||
|
||||
update-source-version signal-desktop-source.ringrtc-bin "$ringrtcVersion"
|
||||
update-source-version signal-desktop-source.ringrtc "$ringrtcVersion"
|
||||
update-source-version signal-desktop-source.ringrtc \
|
||||
--ignore-same-version \
|
||||
--source-key=cargoDeps.vendorStaging
|
||||
|
||||
gclient2nix generate "https://github.com/signalapp/webrtc@$webrtcVersion" > $SCRIPT_DIR/webrtc-sources.json
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
{
|
||||
"src": {
|
||||
"args": {
|
||||
"hash": "sha256-xKv606lqGgC27sf5WVPxkVRI5wixmRxQvOs1+pgORxc=",
|
||||
"owner": "signalapp",
|
||||
"repo": "webrtc",
|
||||
"rev": "6834g"
|
||||
},
|
||||
"fetcher": "fetchFromGitHub"
|
||||
},
|
||||
"src/base": {
|
||||
"args": {
|
||||
"hash": "sha256-1e9jieGg8q0jrVkxN5chnslHTVkuul6ZAkaNrphF75s=",
|
||||
"rev": "69f3676cdbd05660c136a6cc3b23383cbabe53d8",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/base"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/build": {
|
||||
"args": {
|
||||
"hash": "sha256-Si7wgZ895XWALVdMLiKoACB8w6H5IUvpKIOdtasfbCs=",
|
||||
"rev": "05874e6c9429039f1747034af61de1fe2ea1ed06",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/build"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/buildtools": {
|
||||
"args": {
|
||||
"hash": "sha256-XbY2NHW5twzMpACa689F0n3Pie2RJOFeu2JNOM1yERM=",
|
||||
"rev": "db0eae9640184fb132061f248f6108771a6ea2d4",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/buildtools"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/ringrtc/opus/src": {
|
||||
"args": {
|
||||
"hash": "sha256-Vztq+Z388Welj2cfChumimfEXtVn4zCcrGBedZFoTmM=",
|
||||
"owner": "xiph",
|
||||
"repo": "opus",
|
||||
"rev": "0e30966b198ad28943799eaf5b3b08100b6f70c3"
|
||||
},
|
||||
"fetcher": "fetchFromGitHub"
|
||||
},
|
||||
"src/testing": {
|
||||
"args": {
|
||||
"hash": "sha256-P8zXemUOv6dpElAW7zmiy6L26nPeQk7R08zqz3Iatls=",
|
||||
"rev": "eac4c18f749488d7232af275405e0e1b67d84cb3",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/testing"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party": {
|
||||
"args": {
|
||||
"hash": "sha256-6Hhx+aLqZgs8/Ykn5YilzsRlqbh48Uj5W5rY5CBMwf8=",
|
||||
"rev": "9d80a193fbfe8e2f2a29be2efeee93de9a826dcb",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/third_party"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/boringssl/src": {
|
||||
"args": {
|
||||
"hash": "sha256-glHy/C18/oHy77IUC9uHaMA9IhbcaO0X/Ek+RoFwZFg=",
|
||||
"rev": "0fa9014d861f024e28fb491ed7b1cfd44103dee7",
|
||||
"url": "https://boringssl.googlesource.com/boringssl.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/breakpad/breakpad": {
|
||||
"args": {
|
||||
"hash": "sha256-kTkwRfaqw5ZCHEvu2YPZ+1vCfekHkY5pY3m9snDN64g=",
|
||||
"rev": "6b0c5b7ee1988a14a4af94564e8ae8bba8a94374",
|
||||
"url": "https://chromium.googlesource.com/breakpad/breakpad.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/catapult": {
|
||||
"args": {
|
||||
"hash": "sha256-SkF+RIIlU8Vl3AmN6kARkLuVz/X5vygNOtGN2K3Sr+M=",
|
||||
"rev": "44791916611acec1cd74c492c7453e46d9b0dbd2",
|
||||
"url": "https://chromium.googlesource.com/catapult.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/ced/src": {
|
||||
"args": {
|
||||
"hash": "sha256-ySG74Rj2i2c/PltEgHVEDq+N8yd9gZmxNktc56zIUiY=",
|
||||
"rev": "ba412eaaacd3186085babcd901679a48863c7dd5",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/clang-format/script": {
|
||||
"args": {
|
||||
"hash": "sha256-whD8isX2ZhLrFzdxHhFP1S/sZDRgyrzLFaVd7OEFqYo=",
|
||||
"rev": "3c0acd2d4e73dd911309d9e970ba09d58bf23a62",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/colorama/src": {
|
||||
"args": {
|
||||
"hash": "sha256-6ZTdPYSHdQOLYMSnE+Tp7PgsVTs3U2awGu9Qb4Rg/tk=",
|
||||
"rev": "3de9f013df4b470069d03d250224062e8cf15c49",
|
||||
"url": "https://chromium.googlesource.com/external/colorama.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/crc32c/src": {
|
||||
"args": {
|
||||
"hash": "sha256-KBraGaO5LmmPP+p8RuDogGldbTWdNDK+WzF4Q09keuE=",
|
||||
"rev": "d3d60ac6e0f16780bcfcc825385e1d338801a558",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/crc32c.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/dav1d/libdav1d": {
|
||||
"args": {
|
||||
"hash": "sha256-FK3tOLq5NcKQuStY5o8Lv2CXpjYHJm7n+NnyLFMOCxo=",
|
||||
"rev": "389450f61ea0b2057fc9ea393d3065859c4ba7f2",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/videolan/dav1d.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/depot_tools": {
|
||||
"args": {
|
||||
"hash": "sha256-vlBENaVTtbwDJtSswuszcUlx+icZYJeP6ew6MO1cAv0=",
|
||||
"rev": "20b9bdcace7ed561d6a75728c85373503473cb6b",
|
||||
"url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/ffmpeg": {
|
||||
"args": {
|
||||
"hash": "sha256-j5mpWn4j+U4rRlXbq8okUUXrRKycZkiV+UntiS90ChM=",
|
||||
"rev": "686d6944501a6ee9c849581e3fe343273d4af3f6",
|
||||
"url": "https://chromium.googlesource.com/chromium/third_party/ffmpeg.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/flatbuffers/src": {
|
||||
"args": {
|
||||
"hash": "sha256-tbc45o0MbMvK5XqRUJt5Eg8BU6+TJqlmwFgQhHq6wRM=",
|
||||
"rev": "8db59321d9f02cdffa30126654059c7d02f70c32",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/flatbuffers.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/fontconfig/src": {
|
||||
"args": {
|
||||
"hash": "sha256-W5WIgC6A52kY4fNkbsDEa0o+dfd97Rl5NKfgnIRpI00=",
|
||||
"rev": "14d466b30a8ab4a9d789977ed94f2c30e7209267",
|
||||
"url": "https://chromium.googlesource.com/external/fontconfig.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/freetype/src": {
|
||||
"args": {
|
||||
"hash": "sha256-Lc2hbmZnnXQa0vzlJCizNBQ5WCOI5sJglTTe5gWVYUA=",
|
||||
"rev": "f02bffad0fd57f3acfa835c3f2899c5b71ff8be0",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/third_party/freetype2.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/fuzztest/src": {
|
||||
"args": {
|
||||
"hash": "sha256-UYmzjOX8k+CWL+xOIF3NiEL3TRUjS8JflortB2RUT4o=",
|
||||
"rev": "0021f30508bc7f73fa5270962d022acb480d242f",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/fuzztest.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/google_benchmark/src": {
|
||||
"args": {
|
||||
"hash": "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME=",
|
||||
"rev": "344117638c8ff7e239044fd0fa7085839fc03021",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/benchmark.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/googletest/src": {
|
||||
"args": {
|
||||
"hash": "sha256-Iv/7r79cKC1pFkxPPHK/IHv/HFx18XZ4YVr+C2CX8+M=",
|
||||
"rev": "62df7bdbc10887e094661e07ec2595b7920376fd",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/googletest.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/grpc/src": {
|
||||
"args": {
|
||||
"hash": "sha256-64JEVCx/PCM0dvv7kAQvSjLc0QbRAZVBDzwD/FAV6T8=",
|
||||
"rev": "822dab21d9995c5cf942476b35ca12a1aa9d2737",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/grpc/grpc.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/gtest-parallel": {
|
||||
"args": {
|
||||
"hash": "sha256-VUuk5tBTh+aU2dxVWUF1FePWlKUJaWSiGSXk/J5zgHw=",
|
||||
"rev": "96f4f904922f9bf66689e749c40f314845baaac8",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/gtest-parallel"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/harfbuzz-ng/src": {
|
||||
"args": {
|
||||
"hash": "sha256-iR49rfGDKxPObCff1/30hYHpP5FpZ28ROgMZhNk9eFY=",
|
||||
"rev": "1da053e87f0487382404656edca98b85fe51f2fd",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/icu": {
|
||||
"args": {
|
||||
"hash": "sha256-7568UHNDOzyTCLy3TAwxZLUrKfB6A1yKA0wVZQJjKoI=",
|
||||
"rev": "4239b1559d11d4fa66c100543eda4161e060311e",
|
||||
"url": "https://chromium.googlesource.com/chromium/deps/icu.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/instrumented_libs": {
|
||||
"args": {
|
||||
"hash": "sha256-kHKGADAgzlaeckXFbpU1GhJK+zkiRd9XvdtPF6qrQFY=",
|
||||
"rev": "bb6dbcf2df7a9beb34c3773ef4df161800e3aed9",
|
||||
"url": "https://chromium.googlesource.com/chromium/third_party/instrumented_libraries.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/jsoncpp/source": {
|
||||
"args": {
|
||||
"hash": "sha256-bSLNcoYBz3QCt5VuTR056V9mU2PmBuYBa0W6hFg2m8Q=",
|
||||
"rev": "42e892d96e47b1f6e29844cc705e148ec4856448",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libaom/source/libaom": {
|
||||
"args": {
|
||||
"hash": "sha256-2XHqNAmv2L3TEFXu4Q6rnASLmuE93QplSVKNqyhlKUk=",
|
||||
"rev": "840f8797871cc587f7113ea9d2483a1156d57c0e",
|
||||
"url": "https://aomedia.googlesource.com/aom.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libc++/src": {
|
||||
"args": {
|
||||
"hash": "sha256-7skqaen0XqbRvAGXQ0/3kea3vRInktdP3DOBeIBiGlQ=",
|
||||
"rev": "6a68fd412b9aecd515a20a7cf84d11b598bfaf96",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libc++abi/src": {
|
||||
"args": {
|
||||
"hash": "sha256-zPm+Rif9fITazDvvm6SvLq8gwcPzPbuaXlRbyYqv7JA=",
|
||||
"rev": "9a1d90c3b412d5ebeb97a6e33d98e1d0dd923221",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libjpeg_turbo": {
|
||||
"args": {
|
||||
"hash": "sha256-qgHXAjCDFxQ+QqJ8pSmI1NUvHvKKTi4MkIe1I/+hUAI=",
|
||||
"rev": "927aabfcd26897abb9776ecf2a6c38ea5bb52ab6",
|
||||
"url": "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libsrtp": {
|
||||
"args": {
|
||||
"hash": "sha256-4qEZ9MD97MoqCUlZtbEhIKy+fDO1iIWqyrBsKwkjXTg=",
|
||||
"rev": "000edd791434c8738455f10e0dd6b268a4852c0b",
|
||||
"url": "https://chromium.googlesource.com/chromium/deps/libsrtp.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libunwind/src": {
|
||||
"args": {
|
||||
"hash": "sha256-0OBelaxkKdajYXrGgz08nyPZhxqpsnFXiF3m8DGQkDo=",
|
||||
"rev": "efc3baa2d1ece3630fcfa72bef93ed831bcaec4c",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libvpx/source/libvpx": {
|
||||
"args": {
|
||||
"hash": "sha256-7GInV/uHuK6bUa1dSBuxJn6adyjfoOqSqfmfTvQbAoc=",
|
||||
"rev": "906334ac1de2b0afa666472dce5545b82c1251fb",
|
||||
"url": "https://chromium.googlesource.com/webm/libvpx.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/libyuv": {
|
||||
"args": {
|
||||
"hash": "sha256-gTNmhYuYmt/JmWSAVbcE4PqG3kW/JaL7XEWXbiNVfMM=",
|
||||
"rev": "a8e59d207483f75b87dd5fc670e937672cdf5776",
|
||||
"url": "https://chromium.googlesource.com/libyuv/libyuv.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/llvm-libc/src": {
|
||||
"args": {
|
||||
"hash": "sha256-Q0Y/jvAOovOGYTgdDivVQD0CJciuEAt91DCBNNQHwnE=",
|
||||
"rev": "98ed09318387deb45282ca1c92a384499860b76a",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libc.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/lss": {
|
||||
"args": {
|
||||
"hash": "sha256-hE8uZf9Fst66qJkoVYChiB8G41ie+k9M4X0W+5JUSdw=",
|
||||
"rev": "ce877209e11aa69dcfffbd53ef90ea1d07136521",
|
||||
"url": "https://chromium.googlesource.com/linux-syscall-support.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/nasm": {
|
||||
"args": {
|
||||
"hash": "sha256-SiRXHsUlWXtH6dbDjDjqNAm105ibEB3jOfNtQAM4CaY=",
|
||||
"rev": "f477acb1049f5e043904b87b825c5915084a9a29",
|
||||
"url": "https://chromium.googlesource.com/chromium/deps/nasm.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/openh264/src": {
|
||||
"args": {
|
||||
"hash": "sha256-S7dS2IZwt4p4ZrF6K7E5HnwKuI3owU2I7vwtu95uTkE=",
|
||||
"rev": "478e5ab3eca30e600006d5a0a08b176fd34d3bd1",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/cisco/openh264"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/perfetto": {
|
||||
"args": {
|
||||
"hash": "sha256-WXBjGcWZQWrfSQRVv7NfxVv483cf04rNfmXzqyuy9bk=",
|
||||
"rev": "e57316a6ae4e85e9bc8ba82a6c6a93eb5d9a72aa",
|
||||
"url": "https://android.googlesource.com/platform/external/perfetto.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/protobuf-javascript/src": {
|
||||
"args": {
|
||||
"hash": "sha256-TmP6xftUVTD7yML7UEM/DB8bcsL5RFlKPyCpcboD86U=",
|
||||
"rev": "e34549db516f8712f678fcd4bc411613b5cc5295",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/protocolbuffers/protobuf-javascript"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/third_party/re2/src": {
|
||||
"args": {
|
||||
"hash": "sha256-IeANwJlJl45yf8iu/AZNDoiyIvTCZIeK1b74sdCfAIc=",
|
||||
"rev": "6dcd83d60f7944926bfd308cc13979fc53dd69ca",
|
||||
"url": "https://chromium.googlesource.com/external/github.com/google/re2.git"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
},
|
||||
"src/tools": {
|
||||
"args": {
|
||||
"hash": "sha256-o4Q+uDF+TUDlu/bcjBEn3o3UuF5q9h1Vf/gx16bnlYs=",
|
||||
"rev": "c809c4133185094fbd75508202221ff14fc92f7c",
|
||||
"url": "https://chromium.googlesource.com/chromium/src/tools"
|
||||
},
|
||||
"fetcher": "fetchFromGitiles"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
ninja,
|
||||
gn,
|
||||
python3,
|
||||
pkg-config,
|
||||
glib,
|
||||
alsa-lib,
|
||||
pulseaudio,
|
||||
writeShellScriptBin,
|
||||
gclient2nix,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "signal-webrtc";
|
||||
version = finalAttrs.gclientDeps."src".path.rev;
|
||||
|
||||
gclientDeps = gclient2nix.importGclientDeps ./webrtc-sources.json;
|
||||
sourceRoot = "src";
|
||||
|
||||
preConfigure = ''
|
||||
echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime
|
||||
echo "generate_location_tags = true" >> build/config/gclient_args.gni
|
||||
substituteInPlace build/toolchain/linux/BUILD.gn \
|
||||
--replace-fail 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
|
||||
patchShebangs build/mac/should_use_hermetic_xcode.py
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
gn
|
||||
ninja
|
||||
(writeShellScriptBin "vpython3" ''
|
||||
exec python3 "$@"
|
||||
'')
|
||||
python3
|
||||
pkg-config
|
||||
gclient2nix.gclientUnpackHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
glib
|
||||
alsa-lib
|
||||
pulseaudio
|
||||
];
|
||||
|
||||
gnFlags = [
|
||||
''target_os="linux"''
|
||||
"use_sysroot=false"
|
||||
"is_clang=false"
|
||||
"treat_warnings_as_errors=false"
|
||||
|
||||
# https://github.com/signalapp/ringrtc/blob/main/bin/build-electron
|
||||
"rtc_build_examples=false"
|
||||
"rtc_build_tools=false"
|
||||
"rtc_use_x11=false"
|
||||
"rtc_enable_sctp=false"
|
||||
"rtc_libvpx_build_vp9=true"
|
||||
"rtc_disable_metrics=true"
|
||||
"rtc_disable_trace_events=true"
|
||||
"is_debug=false"
|
||||
"symbol_level=1"
|
||||
"rtc_include_tests=false"
|
||||
"rtc_enable_protobuf=false"
|
||||
];
|
||||
ninjaFlags = [ "webrtc" ];
|
||||
|
||||
installPhase = ''
|
||||
install -D obj/libwebrtc${stdenv.hostPlatform.extensions.staticLibrary} $out/lib/libwebrtc${stdenv.hostPlatform.extensions.staticLibrary}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "WebRTC library used by Signal";
|
||||
homepage = "https://github.com/SignalApp/webrtc";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user