signal-desktop: 6.44.0 -> 7.0.0

This commit is contained in:
2024-03-04 08:26:59 +00:00
parent 4fc2ffef56
commit 60c447b6c4

View File

@@ -116,11 +116,17 @@
, yarn , yarn
}: }:
let let
version = "7.0.0";
ringrtcPrebuild = fetchurl { ringrtcPrebuild = fetchurl {
url = "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v2.33.0.tar.gz"; # version is found in signal-desktop's package.json as "@signalapp/ringrtc"
hash = "sha256-TkMa1lCTVIvXh6ixoEXR+tOUTnTLw/Ax3FMyD7qSr34="; url = "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v2.36.0.tar.gz";
hash = "sha256-BIp+2V0PVmRqAA4mXt28utAMOAY4GrRELP8tfETf3Ns=";
}; };
sqlcipherTarball = fetchurl { sqlcipherTarball = fetchurl {
# this is a dependency of better-sqlite3.
# version/url is found in <repo:https://github.com/signalapp/better-sqlite3:deps/download.js>
# - checkout the better-sqlite3 tag which matches signal-dekstop's package.json "@signalapp/better-sqlite3" key.
url = "https://build-artifacts.signal.org/desktop/sqlcipher-4.5.5-fts5-fix--3.0.7--0.2.1-ef53ea45ed92b928ecfd33c552d8d405263e86e63dec38e1ec63e1b0193b630b.tar.gz"; url = "https://build-artifacts.signal.org/desktop/sqlcipher-4.5.5-fts5-fix--3.0.7--0.2.1-ef53ea45ed92b928ecfd33c552d8d405263e86e63dec38e1ec63e1b0193b630b.tar.gz";
hash = "sha256-71PqRe2SuSjs/TPFUtjUBSY+huY97Djh7GPhsBk7Yws="; hash = "sha256-71PqRe2SuSjs/TPFUtjUBSY+huY97Djh7GPhsBk7Yws=";
}; };
@@ -137,11 +143,18 @@ let
# signal_fts5_extension = signal-fts5-extension; # signal_fts5_extension = signal-fts5-extension;
# }; # };
src = fetchFromGitHub {
owner = "signalapp";
repo = "Signal-Desktop";
leaveDotGit = true; # signal calculates the release date via `git`
rev = "v${version}";
hash = "sha256-iIPDUMFGL2a6JKblSTY05nPSDhF4b4AvyO2k0NY9UJE=";
};
mkNodeJs = nodejs: nodejs.overrideAttrs (upstream: mkNodeJs = nodejs: nodejs.overrideAttrs (upstream:
let let
# build with the same nodejs upstream expects in package.json (it will error if the version here is incorrect) # build with the same nodejs upstream expects in package.json (it will error if the version here is incorrect)
version = "18.17.1"; version = "18.18.2";
hash = "sha256-8hXPA9DwDwesC2dMaBn4BMFULhbxUtoEmAAirsz15lo="; hash = "sha256-ckni8K+UPsOFmVBPSyor0x+5OHhykbbMymyLrfAeO1Y=";
in { in {
inherit version; inherit version;
src = fetchurl { src = fetchurl {
@@ -150,6 +163,11 @@ let
}; };
} }
); );
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-+IFzjTv3ghyFu0MRca2SO+tzeQPJGVW/KyWf7SdCmtQ=";
};
nodejs' = mkNodeJs nodejs_18; nodejs' = mkNodeJs nodejs_18;
# TODO: possibly i could instead use nodejs-slim (npm-less nodejs) # TODO: possibly i could instead use nodejs-slim (npm-less nodejs)
buildNodejs = mkNodeJs buildPackages.nodejs_18; buildNodejs = mkNodeJs buildPackages.nodejs_18;
@@ -173,14 +191,7 @@ let
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "signal-desktop-from-src"; pname = "signal-desktop-from-src";
version = "6.44.0"; inherit src version;
src = fetchFromGitHub {
owner = "signalapp";
repo = "Signal-Desktop";
leaveDotGit = true; # signal calculates the release date via `git`
rev = "v${version}";
hash = "sha256-jWQ05CJDYQSq7dc7u7hI+R0/b+8IKo174ITgUnhdSDk=";
};
patches = [ patches = [
# ./debug.patch # ./debug.patch
@@ -226,10 +237,7 @@ stdenv.mkDerivation rec {
# sqlcipher # sqlcipher
]; ];
env.yarnOfflineCache = fetchYarnDeps { env.yarnOfflineCache = yarnOfflineCache;
yarnLock = "${src}/yarn.lock";
hash = "sha256-wWwvv5xj4C/viPrpVt/EmsOZR/R2quZdxMBSmXXynYU=";
};
# env.SIGNAL_ENV = "production"; # env.SIGNAL_ENV = "production";
# env.NODE_ENV = "production"; # env.NODE_ENV = "production";
# env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; # env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
@@ -281,7 +289,9 @@ stdenv.mkDerivation rec {
# (better, perhaps, would be for these build scripts to not be included in the asar...) # (better, perhaps, would be for these build scripts to not be included in the asar...)
sed -i 's:#!.*/bin/bash:#!/bin/sh:g' node_modules/@swc/helpers/scripts/gen.sh sed -i 's:#!.*/bin/bash:#!/bin/sh:g' node_modules/@swc/helpers/scripts/gen.sh
sed -i 's:#!.*/bin/bash:#!/bin/sh:g' node_modules/@swc/helpers/scripts/generator.sh sed -i 's:#!.*/bin/bash:#!/bin/sh:g' node_modules/@swc/helpers/scripts/generator.sh
substituteInPlace node_modules/dashdash/etc/dashdash.bash_completion.in --replace '#!/bin/bash' '#!/bin/sh' substituteInPlace node_modules/dashdash/etc/dashdash.bash_completion.in --replace-fail '#!/bin/bash' '#!/bin/sh'
set -x
# provide necessecities which were skipped as part of --ignore-scripts # provide necessecities which were skipped as part of --ignore-scripts
cp ${ringrtcPrebuild} node_modules/@signalapp/ringrtc/scripts/prebuild.tar.gz cp ${ringrtcPrebuild} node_modules/@signalapp/ringrtc/scripts/prebuild.tar.gz
@@ -290,7 +300,8 @@ stdenv.mkDerivation rec {
popd popd
cp ${sqlcipherTarball} node_modules/@signalapp/better-sqlite3/deps/sqlcipher.tar.gz cp ${sqlcipherTarball} node_modules/@signalapp/better-sqlite3/deps/sqlcipher.tar.gz
pushd node_modules/@signalapp/better-sqlite3 pushd node_modules/@signalapp/better-sqlite3
yarn --offline build-release # node-gyp isn't consistently linked into better-sqlite's `node_modules` (maybe due to version mismatch with sinal-desktop's node-gyp?)
PATH="$PATH:$(pwd)/../../.bin" yarn --offline build-release
popd popd
pushd node_modules/@signalapp/libsignal-client pushd node_modules/@signalapp/libsignal-client
yarn node-gyp-build yarn node-gyp-build