signal-desktop-from-src: cleanup even more
This commit is contained in:
@@ -83,6 +83,7 @@
|
|||||||
|
|
||||||
{ lib
|
{ lib
|
||||||
, alsa-lib
|
, alsa-lib
|
||||||
|
, asar
|
||||||
, at-spi2-atk
|
, at-spi2-atk
|
||||||
, at-spi2-core
|
, at-spi2-core
|
||||||
, atk
|
, atk
|
||||||
@@ -109,7 +110,6 @@
|
|||||||
, nspr
|
, nspr
|
||||||
, nss
|
, nss
|
||||||
, pango
|
, pango
|
||||||
, pkgs
|
|
||||||
, python3
|
, python3
|
||||||
# , sqlite
|
# , sqlite
|
||||||
# , sqlcipher
|
# , sqlcipher
|
||||||
@@ -132,21 +132,6 @@ let
|
|||||||
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=";
|
||||||
};
|
};
|
||||||
# TODO: possibly i could instead use nodejs-slim (npm-less nodejs)
|
|
||||||
# mkNodeJs = pkgs: pkgs.nodejs_20.overrideAttrs (upstream:
|
|
||||||
# let
|
|
||||||
# # build with the same nodejs upstream expects in package.json (it will error if the version here is incorrect)
|
|
||||||
# version = "20.9.0";
|
|
||||||
# hash = "sha256-oj2WgQq/BFVCazSdR85TEPMwlbe8BXG5zFEPSBw6RRk=";
|
|
||||||
# in {
|
|
||||||
# inherit version;
|
|
||||||
# src = fetchurl {
|
|
||||||
# url = "https://nodejs.org/dist/v${version}/node-v${version}.tar.xz";
|
|
||||||
# inherit hash;
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
# );
|
|
||||||
mkNodeJs = pkgs: pkgs.nodejs;
|
|
||||||
|
|
||||||
# signal-fts5-extension = callPackage ./fts5-extension { };
|
# signal-fts5-extension = callPackage ./fts5-extension { };
|
||||||
# bettersqlitePatch = substituteAll {
|
# bettersqlitePatch = substituteAll {
|
||||||
@@ -168,9 +153,6 @@ let
|
|||||||
hash = "sha256-HHpv+Kv7Y+653CBSpRePfWQmeRzznmdmUaU5AIxLQUw=";
|
hash = "sha256-HHpv+Kv7Y+653CBSpRePfWQmeRzznmdmUaU5AIxLQUw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nodejs' = mkNodeJs pkgs;
|
|
||||||
buildNodejs = mkNodeJs buildPackages;
|
|
||||||
|
|
||||||
# note that `package.json` locks the electron version, but we seem to not be strictly beholden to that.
|
# note that `package.json` locks the electron version, but we seem to not be strictly beholden to that.
|
||||||
# prefer to use the same electron version as everywhere else, and a `-bin` version to avoid 4hr rebuilds.
|
# prefer to use the same electron version as everywhere else, and a `-bin` version to avoid 4hr rebuilds.
|
||||||
# the non-bin varieties *seem* to ship the wrong `electron.headers` property.
|
# the non-bin varieties *seem* to ship the wrong `electron.headers` property.
|
||||||
@@ -199,11 +181,15 @@ buildNpmPackage rec {
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# unpin nodejs. i should probably *try* to keep these vaguely in sync, but it seems to work decently with these out of sync too (at least, if the major versions match?)
|
# unpin nodejs. i should probably *try* to keep these vaguely in sync, but it seems to work decently with these out of sync too (at least, if the major versions match?)
|
||||||
sed -i 's/"node": .*/"node": "${nodejs'.version}"/' package.json
|
sed -i 's/"node": .*/"node": "*"/' package.json
|
||||||
# don't populate fallback DNS mappings:
|
# don't populate fallback DNS mappings, and don't try to install electron-builder deps during build:
|
||||||
substituteInPlace package.json --replace-fail \
|
substituteInPlace package.json \
|
||||||
'"build:dns-fallback": "node ts/scripts/generate-dns-fallback.js"' \
|
--replace-fail \
|
||||||
'"build:dns-fallback": "true"'
|
'"build:dns-fallback": "node ts/scripts/generate-dns-fallback.js"' \
|
||||||
|
'"build:dns-fallback": "true"' \
|
||||||
|
--replace-fail \
|
||||||
|
'"electron:install-app-deps": "electron-builder install-app-deps"' \
|
||||||
|
'"electron:install-app-deps": "true"'
|
||||||
|
|
||||||
# fixes build failure:
|
# fixes build failure:
|
||||||
# > Fusing electron at /build/source/release/linux-unpacked/signal-desktop inspect-arguments=false
|
# > Fusing electron at /build/source/release/linux-unpacked/signal-desktop inspect-arguments=false
|
||||||
@@ -216,11 +202,11 @@ buildNpmPackage rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
asar # used during fixup
|
||||||
autoPatchelfHook
|
autoPatchelfHook
|
||||||
git # to calculate build date
|
git # to calculate build date
|
||||||
gnused
|
gnused
|
||||||
makeShellWrapper
|
makeShellWrapper
|
||||||
buildNodejs
|
|
||||||
python3
|
python3
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
];
|
];
|
||||||
@@ -239,7 +225,6 @@ buildNpmPackage rec {
|
|||||||
libwebp
|
libwebp
|
||||||
libxslt
|
libxslt
|
||||||
mesa # for libgbm
|
mesa # for libgbm
|
||||||
nodejs' # to patch in the runtime
|
|
||||||
nspr
|
nspr
|
||||||
nss
|
nss
|
||||||
pango
|
pango
|
||||||
@@ -248,14 +233,20 @@ buildNpmPackage rec {
|
|||||||
# sqlcipher
|
# sqlcipher
|
||||||
];
|
];
|
||||||
|
|
||||||
env.SIGNAL_ENV = "production";
|
strictDeps = true;
|
||||||
|
# disallowedReferences = [ buildPackages.nodejs ]; #< TODO: set when cross compiling
|
||||||
|
|
||||||
|
# env.SIGNAL_ENV = "production";
|
||||||
# env.NODE_ENV = "production"; #< XXX setting this causes `node_modules/protobufjs-cli/bin/pbjs` to not be fetched...
|
# env.NODE_ENV = "production"; #< XXX setting this causes `node_modules/protobufjs-cli/bin/pbjs` to not be fetched...
|
||||||
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
# env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||||
|
# env.npm_config_arch = buildNpmArch;
|
||||||
|
# env.npm_config_target_arch = hostNpmArch;
|
||||||
|
|
||||||
dontWrapGApps = true;
|
dontWrapGApps = true;
|
||||||
|
# dontStrip = false;
|
||||||
|
# makeCacheWritable = true;
|
||||||
|
|
||||||
npmRebuildFlags = [ "--offline" "--ignore-scripts" ];
|
npmRebuildFlags = [ "--offline" "--ignore-scripts" ];
|
||||||
makeCacheWritable = true;
|
|
||||||
|
|
||||||
# NIX_DEBUG = 6;
|
# NIX_DEBUG = 6;
|
||||||
|
|
||||||
@@ -266,28 +257,23 @@ buildNpmPackage rec {
|
|||||||
# see: Signal-Desktop/ts/scripts/get-expire-time.ts
|
# see: Signal-Desktop/ts/scripts/get-expire-time.ts
|
||||||
export SOURCE_DATE_EPOCH=
|
export SOURCE_DATE_EPOCH=
|
||||||
|
|
||||||
# prevent any attempt at downloading nodejs C headers
|
# apparently electron projects aren't "stock" node.
|
||||||
|
# so subprojects which want to use node internals (i.e. call C functions provided by node)
|
||||||
|
# need to build against electron's versions of the node headers, or something.
|
||||||
|
# without patching this, Signal can build, but will fail with `undefined symbol: ...` errors at runtime.
|
||||||
# see: <https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules>
|
# see: <https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules>
|
||||||
tar xzf ${electron'.headers}
|
tar xzf ${electron'.headers}
|
||||||
export npm_config_nodedir=$(pwd)/node_headers
|
export npm_config_nodedir=$(pwd)/node_headers
|
||||||
|
|
||||||
export npm_config_arch=${buildNpmArch}
|
# patchShebangs --build --update node_modules/{bufferutil/node_modules/node-gyp-build/,node-gyp-build,utf-8-validate/node_modules/node-gyp-build}
|
||||||
export npm_config_target_arch=${hostNpmArch}
|
|
||||||
|
|
||||||
patchShebangs --build --update node_modules/{bufferutil/node_modules/node-gyp-build/,node-gyp-build,utf-8-validate/node_modules/node-gyp-build}
|
|
||||||
# patch these out to remove a runtime reference back to the build bash
|
# patch these out to remove a runtime reference back to the build bash
|
||||||
# (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-fail '#!/bin/bash' '#!/bin/sh'
|
substituteInPlace node_modules/dashdash/etc/dashdash.bash_completion.in --replace-fail '#!/bin/bash' '#!/bin/sh'
|
||||||
|
|
||||||
set -x
|
# provide necessities which were skipped as part of --ignore-scripts
|
||||||
|
tar -xzf ${ringrtcPrebuild} --directory node_modules/@signalapp/ringrtc/
|
||||||
# provide necessecities which were skipped as part of --ignore-scripts
|
|
||||||
cp ${ringrtcPrebuild} node_modules/@signalapp/ringrtc/scripts/prebuild.tar.gz
|
|
||||||
pushd node_modules/@signalapp/ringrtc/
|
|
||||||
tar -xzf ./scripts/prebuild.tar.gz
|
|
||||||
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
|
||||||
@@ -300,10 +286,10 @@ buildNpmPackage rec {
|
|||||||
# popd
|
# popd
|
||||||
|
|
||||||
# run signal's own `postinstall`:
|
# run signal's own `postinstall`:
|
||||||
# npm run build:acknowledgments
|
# - npm run build:acknowledgments
|
||||||
# patch-package
|
# - npm exec patch-package
|
||||||
# npm run electron:install-app-deps
|
# - npm run electron:install-app-deps
|
||||||
npm run postinstall || true
|
npm run postinstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# excerpts from package.json:
|
# excerpts from package.json:
|
||||||
@@ -330,21 +316,12 @@ buildNpmPackage rec {
|
|||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
|
||||||
npm run generate
|
npm run generate
|
||||||
# npm run build-protobuf --offline --frozen-lockfile
|
|
||||||
# npm run build:esbuild --offline --frozen-lockfile
|
|
||||||
# # npm run build:dns-fallback --offline --frozen-lockfile # requires network
|
|
||||||
# npm run build:icu-types --offline --frozen-lockfile
|
|
||||||
# npm run build:compact-locales --offline --frozen-lockfile
|
|
||||||
# npm run sass
|
|
||||||
# npm run get-expire-time
|
|
||||||
# npm run copy-components
|
|
||||||
|
|
||||||
npm run build:esbuild:prod --offline --frozen-lockfile
|
npm run build:esbuild:prod --offline --frozen-lockfile
|
||||||
|
|
||||||
cp -r ${electron'}/libexec/electron electron-dist
|
|
||||||
npm run build:release -- \
|
npm run build:release -- \
|
||||||
--linux --${hostNpmArch} \
|
--linux --${hostNpmArch} \
|
||||||
-c.electronDist=electron-dist \
|
-c.electronDist=${electron'}/libexec/electron \
|
||||||
-c.electronVersion=${electron'.version} \
|
-c.electronVersion=${electron'.version} \
|
||||||
--dir
|
--dir
|
||||||
|
|
||||||
@@ -367,10 +344,10 @@ buildNpmPackage rec {
|
|||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
# fixup the app.asar to use host nodejs
|
# fixup the app.asar to use host nodejs
|
||||||
${buildPackages.asar}/bin/asar extract $out/lib/Signal/resources/app.asar unpacked
|
asar extract $out/lib/Signal/resources/app.asar unpacked
|
||||||
rm $out/lib/Signal/resources/app.asar
|
rm $out/lib/Signal/resources/app.asar
|
||||||
patchShebangs --host --update unpacked
|
patchShebangs --host --update unpacked
|
||||||
${buildPackages.asar}/bin/asar pack unpacked $out/lib/Signal/resources/app.asar
|
asar pack unpacked $out/lib/Signal/resources/app.asar
|
||||||
|
|
||||||
# XXX: add --ozone-platform-hint=auto to make it so that NIXOS_OZONE_WL isn't *needed*.
|
# XXX: add --ozone-platform-hint=auto to make it so that NIXOS_OZONE_WL isn't *needed*.
|
||||||
# electron should auto-detect x11 v.s. wayland: launching with `NIXOS_OZONE_WL=1` is an optional way to force it when debugging.
|
# electron should auto-detect x11 v.s. wayland: launching with `NIXOS_OZONE_WL=1` is an optional way to force it when debugging.
|
||||||
@@ -391,8 +368,6 @@ buildNpmPackage rec {
|
|||||||
rev-prefix = "v";
|
rev-prefix = "v";
|
||||||
ignoredVersions = "beta";
|
ignoredVersions = "beta";
|
||||||
};
|
};
|
||||||
nodejs = nodejs';
|
|
||||||
buildNodejs = buildNodejs;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
@@ -18,7 +18,7 @@ index e10fd8084..1b0bad1f1 100644
|
|||||||
"node_modules/fs-xattr/build/Release/*.node",
|
"node_modules/fs-xattr/build/Release/*.node",
|
||||||
"node_modules/@nodert-win10-rs4/windows.data.xml.dom/build/Release/*.node",
|
"node_modules/@nodert-win10-rs4/windows.data.xml.dom/build/Release/*.node",
|
||||||
"node_modules/@nodert-win10-rs4/windows.ui.notifications/build/Release/*.node",
|
"node_modules/@nodert-win10-rs4/windows.ui.notifications/build/Release/*.node",
|
||||||
diff --git scripts/esbuild.js scripts/esbuild.js
|
diff --git a/scripts/esbuild.js b/scripts/esbuild.js
|
||||||
index 5cd771718..4dfccd95c 100644
|
index 5cd771718..4dfccd95c 100644
|
||||||
--- a/scripts/esbuild.js
|
--- a/scripts/esbuild.js
|
||||||
+++ b/scripts/esbuild.js
|
+++ b/scripts/esbuild.js
|
||||||
@@ -30,7 +30,7 @@ index 5cd771718..4dfccd95c 100644
|
|||||||
'sass',
|
'sass',
|
||||||
'bufferutil',
|
'bufferutil',
|
||||||
'utf-8-validate',
|
'utf-8-validate',
|
||||||
diff --git ts/state/ducks/calling.ts ts/state/ducks/calling.ts
|
diff --git a/ts/state/ducks/calling.ts b/ts/state/ducks/calling.ts
|
||||||
index f58b9edd1..5d836b325 100644
|
index f58b9edd1..5d836b325 100644
|
||||||
--- a/ts/state/ducks/calling.ts
|
--- a/ts/state/ducks/calling.ts
|
||||||
+++ b/ts/state/ducks/calling.ts
|
+++ b/ts/state/ducks/calling.ts
|
||||||
@@ -45,3 +45,22 @@ index f58b9edd1..5d836b325 100644
|
|||||||
import { omit, pick } from 'lodash';
|
import { omit, pick } from 'lodash';
|
||||||
import type { ReadonlyDeep } from 'type-fest';
|
import type { ReadonlyDeep } from 'type-fest';
|
||||||
import {
|
import {
|
||||||
|
diff --git a/patches/mac-screen-capture-permissions+2.0.0.patch b/patches/mac-screen-capture-permissions+2.0.0.patch
|
||||||
|
deleted file mode 100644
|
||||||
|
index ac391bab4..000000000
|
||||||
|
--- a/patches/mac-screen-capture-permissions+2.0.0.patch
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,13 +0,0 @@
|
||||||
|
-diff --git a/node_modules/mac-screen-capture-permissions/screen-capture-permissions.m b/node_modules/mac-screen-capture-permissions/screen-capture-permissions.m
|
||||||
|
-index d9d6a00..78fa83f 100644
|
||||||
|
---- a/node_modules/mac-screen-capture-permissions/screen-capture-permissions.m
|
||||||
|
-+++ b/node_modules/mac-screen-capture-permissions/screen-capture-permissions.m
|
||||||
|
-@@ -2,6 +2,8 @@
|
||||||
|
- #import <Foundation/Foundation.h>
|
||||||
|
- #include <node_api.h>
|
||||||
|
-
|
||||||
|
-+CG_EXTERN bool CGPreflightScreenCaptureAccess(void) CG_AVAILABLE_STARTING(10.15);
|
||||||
|
-+
|
||||||
|
- static napi_value hasPermissions(napi_env env, napi_callback_info info) {
|
||||||
|
- napi_status status;
|
||||||
|
- bool hasPermissions;
|
||||||
|
Reference in New Issue
Block a user