[3.21] backports/signal-desktop: upgrade to 7.47.0 #1013

Merged
forge merged 1 commit from signal-desktop/upgrade-7.47.0 into v3.21 2025-03-23 15:48:16 +00:00
3 changed files with 252 additions and 37 deletions

View file

@ -2,7 +2,7 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=signal-desktop
pkgver=7.44.0
pkgver=7.47.0
pkgrel=0
pkgdesc="A messaging app for simple private communication with friends"
url="https://github.com/signalapp/Signal-Desktop/"
@ -50,6 +50,7 @@ makedepends="
mesa-dev
nodejs
npm
pnpm
openh264-dev
openssl-dev
opus-dev
@ -67,9 +68,9 @@ makedepends="
options="net !check"
# use _check_depends to validate this
_libsignalver=0.66.2
_ringrtcver=2.49.5
_webrtcver=6834d
_libsignalver=0.67.3
_ringrtcver=2.50.2
_webrtcver=6834f
_stokenizerver=0.2.1
source="
@ -90,6 +91,7 @@ source="
webrtc-gcc13.patch
webrtc-rollback-red.patch
webrtc-rollback-3rdparty-build-gn.patch
signal-rollback-locale-changes.patch
signal-desktop.sh
"
@ -123,9 +125,9 @@ _update_depends() {
# downloading tarball generated with abuild snapshot (with gclient dependencies fetched)
# _stokenizerver: follow @signalapp/better-sqlite3 (on version in package.json) -> deps/download.js -> TOKENIZER_VERSION
local _libsignalver=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/v$pkgver/package-lock.json | grep "@signalapp/libsignal-client\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1)
local _ringrtcver=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/v$pkgver/package-lock.json | grep "@signalapp/ringrtc\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1)
local _bsqlitever=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/v$pkgver/package-lock.json | grep "@signalapp/better-sqlite3\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1)
local _libsignalver=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/v$pkgver/package.json | grep "@signalapp/libsignal-client\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1)
local _ringrtcver=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/v$pkgver/package.json | grep "@signalapp/ringrtc\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1)
local _bsqlitever=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/v$pkgver/package.json | grep "@signalapp/better-sqlite3\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1)
local _webrtcver=$(curl --silent https://raw.githubusercontent.com/signalapp/ringrtc/v$_ringrtcver/config/version.properties | awk -F '=' '{if($1 == "webrtc.version"){print $2}}' | head -n 1)
local _extensionver=$(curl --silent https://raw.githubusercontent.com/signalapp/better-sqlite3/v$_bsqlitever/deps/download.js | grep "const EXTENSION_VERSION" | awk '{print $4}' | tr -d "'" | tr -d ';' | head -n 1)
local _extensionver=${_extensionver/-*}
@ -196,7 +198,7 @@ prepare() {
cd "$builddir"/Signal-Desktop
msg "Installing signal-desktop JS dependencies"
npm ci --ignore-scripts
pnpm install --ignore-scripts
# remove shipped fonts for system-provided (part 1)
rm -rf fonts/
@ -398,21 +400,17 @@ build() {
cd "$builddir"/Signal-Desktop
# from package.json postinstall
npm run build:acknowledgments
npm exec patch-package
pnpm run build:acknowledgments
rm -rf node_modules/dtrace-provider
# get esbuild installed (needed for next step)
npm rebuild esbuild
pnpm rebuild esbuild
# build front
NODE_ENV=production \
SIGNAL_ENV=production \
NODE_OPTIONS=--openssl-legacy-provider \
npm run build:dev
# purge non-production deps
npm prune --ignore-scripts --omit=dev
pnpm run build:dev
# use our libsignal
rm -rf node_modules/@signalapp/libsignal-client/
@ -426,10 +424,14 @@ build() {
mv "$builddir"/Signal-FTS5-Extension/target/release/libsignal_tokenizer.a node_modules/@signalapp/better-sqlite3/tokenizer/
mv "$builddir"/Signal-FTS5-Extension/target/release/signal-tokenizer.h node_modules/@signalapp/better-sqlite3/tokenizer/
npm rebuild \
npm_config_nodedir=/usr/include/electron/node_headers \
npm_config_build_from_source=true \
pnpm rebuild \
sharp @signalapp/better-sqlite3 spellchecker websocket \
utf-8-validate bufferutil fs-xattr \
--nodedir=/usr/include/electron/node_headers --build-from-source
utf-8-validate bufferutil fs-xattr
# purge non-production deps
pnpm prune --ignore-scripts --prod
SIGNAL_ENV=production \
tasje pack
@ -438,7 +440,7 @@ build() {
check() {
cd "$builddir"/Signal-Desktop
# tests run against downloaded build of electron for glibc, probably can be patched
npm run test
pnpm run test
}
package() {
@ -459,13 +461,13 @@ package() {
}
sha512sums="
ee089f43ca96c3ac1bb35f469b28717760615c7448860829566ca34befec917e5a9d6137b82bfe5ae8b9d753e8df7a177f4fd6b99cf0f009944fc8c5984982a1 Signal-Desktop-7.44.0.tar.gz
776eba9bc5eb6bbb9a73f7b768e46f11bbca91f8a797e345bef2aecd583b21f4ab9c574fa6e0a239bff416502b14d1d6019ade8755964ed73e04448aab82ba48 libsignal-0.66.2.tar.gz
d5dada32132cc4742628f9ebb53c013767ac23c0dfecb70a82f6e2cbde423e08bc7caf73566f12a412d60edb1c6940fb0e8ed4ad533f4ce76189d85b8ded1f4d ringrtc-2.49.5.tar.gz
8587c3375130bedf3e995c82885fd1ffac8c61e60063734e070b3578c324bdd8cb1109bf3280c6329ba2411cc06c304e731ea11573b5b0f22880b9a9fe0d22c2 webrtc-6834d.tar.zst
9b2926c9009cff31b6ad4b6e4eb8bb997b47a4f0cc171c54ae86122cc4aef547b233655378a9091c5f7b5a413f25b761a7b28efe32eac0d5872f01cb14479ab8 Signal-Desktop-7.47.0.tar.gz
eaf5b9f69caa833df4116c354ff39a5df69b1f6f30262f9bd6ab566afd95d364718a220d3ae0b430550667bcf671ff462ef200348354d2cef56a3f76f45bb292 libsignal-0.67.3.tar.gz
18229b313dbe755fd048470405dff12d11aba02f655c46500156545c8f9621d465bd9a843c25333d2ed7a036f10f4f41ab00225cd53cae54c9deabadee4a439a ringrtc-2.50.2.tar.gz
131b5a0b190106fabbeb8903bd35546c956562a18128c92cd8bd6b046a1c7ceb5fc2e6258ced106399f24bbfeba6d8a827f39114215fc1c8941a919359f6e300 webrtc-6834f.tar.zst
84a1f2fc29262a12842e94698d124a85b823128e72a493b0be8ea92fbb72c5c268499f4a6827cdedaae06ec73cce4039a39fe5c5d536cbef330e59ba0183da28 stokenizer-0.2.1.tar.gz
8d2d2d82c8546c2dd1fef161b61df79918f8c22235a56a46adb375a0beb4acef12c5fe53e67242a4be97f77adc522ff79b47949c352956c742a70d50f4179f7f libsignal-auditable.patch
18d5a0208d75fa910b6c0d531997402bba83290dfc7d7ce903acdcd0ce1d88bd3026ace40ecd32a88c2e429e48530b4e40f207a3d15bd9c0d6ebc8c447fa8ff9 signal-use-system-sqlcipher.patch
eed8371ccf478e6bf3ade04f93ed26b53ee141b6f786e7a2ae4483b1b962329b18034ec0bc3514eb218346e100044aeaf0fcf2b31028c87c41bd7ecc7e681848 signal-use-system-sqlcipher.patch
fc2af28645364cd85c106304a26811b036f6be048c52137fbbcc112870a84132a181f532563e0569b560fde3cf8c02480666a9b01d804b0008f97c728005b1c7 signal-disable-updates.patch
853de84d636f730694f17bcec63463fa7bfbdd0a7f7a64618a8fc6bc523ce1a9854b4c651753735af735c18101295d3efbe54f83ae0bccbed83c8c1fee3e7049 signal-update-links.patch
882d6889b23a3ebc6449c8b6acec8c3853674a7e94f066d65b57bab674ba8c11d582ba2c760825cb67b9202716e6d8b7123001d1e9f9229e49a0b77e9d978265 signal-show-window-please.patch
@ -475,5 +477,6 @@ fe78cdc58c18826fc4227cc8e9377980766229390544578f6a1a6f7322bc3243c066963b589323db
3f1095861a79862ab5a55c86d7e353d272974617afba39e4d4441024bede8d7b9b8e122da90d56a9c3c0965171803d6b9e29e91d78167a08c6bcc86b3eedab18 webrtc-gcc13.patch
8f53dcf3264c5cec338f037e57a7770ec939ee06dfb0c5dfeab23967a3a64d3f861a6b5419766ac892676036b4522bce2f47279ca3658b5c0b6a31c82ac05053 webrtc-rollback-red.patch
f8bd574a0de077a643ced26e8a0e3f162e014bbf91c957bbefd113883a70e2b63e483bf400b7e2da8d09edfe76d4f6a257f194a14124f344f1625c5632d12acb webrtc-rollback-3rdparty-build-gn.patch
aca92e4de6cd005d660d7e8b99607de96ca2d7dc220e3465247d517e915e4d41a4b0eb519e85c5eca1c81cd8bac9821acd03ff57f1603918987829c6ea7757b4 signal-rollback-locale-changes.patch
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop.sh
"

View file

@ -0,0 +1,225 @@
From a094a2ca2b6d8758b4aea24389c35fc4f142b715 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Date: Mon, 3 Mar 2025 19:10:01 -0800
Subject: [PATCH] Compactify locales even more
Rollback of Compactify locales even more. For some reason, (maybe tasje?),
these new locales aren't working
---
app/locale.ts | 56 ++++++++++++++++--
package.json | 2 +-
ts/scripts/generate-compact-locales.ts | 82 +++++++++++++++++++-------
3 files changed, 112 insertions(+), 28 deletions(-)
diff --git a/Signal-Desktop/package.json.orig b/Signal-Desktop/package.json
index 04dd9f9200b..e7b69ef963f 100644
--- a/Signal-Desktop/package.json.orig
+++ b/Signal-Desktop/package.json
@@ -538,10 +538,7 @@
{
"from": "build/compact-locales",
"to": "_locales",
- "filter": [
- "**/values.json",
- "keys.json"
- ]
+ "filter": "**/messages.json"
},
"js/**",
"libtextsecure/**",
diff --git a/Signal-Desktop/app/locale.ts.orig b/Signal-Desktop/app/locale.ts
index a63eef4079d..2a959da4d0d 100644
--- a/Signal-Desktop/app/locale.ts.orig
+++ b/Signal-Desktop/app/locale.ts
@@ -1,9 +1,8 @@
// Copyright 2017 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
-import { join } from 'node:path';
-import { readFileSync } from 'node:fs';
-import { app } from 'electron';
+import { join } from 'path';
+import { readFileSync } from 'fs';
import { merge } from 'lodash';
import * as LocaleMatcher from '@formatjs/intl-localematcher';
import { z } from 'zod';
@@ -16,9 +15,6 @@ import type { LocalizerType } from '../ts/types/Util';
import * as Errors from '../ts/types/errors';
import { parseUnknown } from '../ts/util/schemas';
-type CompactLocaleMessagesType = ReadonlyArray<string | null>;
-type CompactLocaleKeysType = ReadonlyArray<string>;
-
const TextInfoSchema = z.object({
direction: z.enum(['ltr', 'rtl']),
});
@@ -29,17 +25,6 @@ function getLocaleMessages(locale: string): LocaleMessagesType {
return JSON.parse(readFileSync(targetFile, 'utf-8'));
}
-function getCompactLocaleKeys(): CompactLocaleKeysType {
- const targetFile = join(__dirname, '..', '_locales', 'keys.json');
- return JSON.parse(readFileSync(targetFile, 'utf-8'));
-}
-
-function getCompactLocaleValues(locale: string): CompactLocaleMessagesType {
- const targetFile = join(__dirname, '..', '_locales', locale, 'values.json');
-
- return JSON.parse(readFileSync(targetFile, 'utf-8'));
-}
-
export type LocaleDisplayNames = Record<string, Record<string, string>>;
export type CountryDisplayNames = Record<string, Record<string, string>>;
@@ -154,42 +139,13 @@ export function load({
logger.info(`locale: Matched locale: ${matchedLocale}`);
+ const matchedLocaleMessages = getLocaleMessages(matchedLocale);
+ const englishMessages = getLocaleMessages('en');
const localeDisplayNames = getLocaleDisplayNames();
const countryDisplayNames = getCountryDisplayNames();
- let finalMessages: LocaleMessagesType;
- if (app.isPackaged) {
- const matchedLocaleMessages = getCompactLocaleValues(matchedLocale);
- const englishMessages = getCompactLocaleValues('en');
- const keys = getCompactLocaleKeys();
- if (matchedLocaleMessages.length !== keys.length) {
- throw new Error(
- `Invalid "${matchedLocale}" entry count, ` +
- `${matchedLocaleMessages.length} != ${keys.length}`
- );
- }
- if (englishMessages.length !== keys.length) {
- throw new Error(
- `Invalid "en" entry count, ${englishMessages.length} != ${keys.length}`
- );
- }
-
- // We start with english, then overwrite that with anything present in locale
- finalMessages = Object.create(null);
- for (const [i, key] of keys.entries()) {
- finalMessages[key] = {
- messageformat:
- matchedLocaleMessages[i] ?? englishMessages[i] ?? undefined,
- };
- }
- } else {
- const matchedLocaleMessages = getLocaleMessages(matchedLocale);
- const englishMessages = getLocaleMessages('en');
-
- // We start with english, then overwrite that with anything present in locale
- finalMessages = merge(englishMessages, matchedLocaleMessages);
- }
-
+ // We start with english, then overwrite that with anything present in locale
+ const finalMessages = merge(englishMessages, matchedLocaleMessages);
const i18n = setupI18n(matchedLocale, finalMessages, {
renderEmojify: shouldNeverBeCalled,
});
diff --git a/Signal-Desktop/ts/scripts/generate-compact-locales.ts.orig b/Signal-Desktop/ts/scripts/generate-compact-locales.ts
index 7187d287acc..9a17d638f44 100644
--- a/Signal-Desktop/ts/scripts/generate-compact-locales.ts.orig
+++ b/Signal-Desktop/ts/scripts/generate-compact-locales.ts
@@ -3,49 +3,6 @@
import { readdir, mkdir, readFile, writeFile } from 'node:fs/promises';
import { join, dirname } from 'node:path';
-import pMap from 'p-map';
-import { isLocaleMessageType } from '../util/setupI18nMain';
-
-async function compact({
- sourceDir,
- targetDir,
- locale,
- keys,
-}: {
- sourceDir: string;
- targetDir: string;
- locale: string;
- keys: ReadonlyArray<string>;
-}): Promise<ReadonlyArray<string>> {
- const sourcePath = join(sourceDir, locale, 'messages.json');
- const targetPath = join(targetDir, locale, 'values.json');
-
- await mkdir(dirname(targetPath), { recursive: true });
-
- const json = JSON.parse(await readFile(sourcePath, 'utf8'));
-
- const result = new Array<string | null>();
- for (const key of keys) {
- if (json[key] == null) {
- // Pull English translation, or leave blank (string was deleted)
- result.push(null);
- continue;
- }
-
- const value = json[key];
- if (!isLocaleMessageType(value)) {
- continue;
- }
- if (value.messageformat == null) {
- continue;
- }
- result.push(value.messageformat);
- }
-
- await writeFile(targetPath, JSON.stringify(result));
-
- return keys;
-}
async function main(): Promise<void> {
const rootDir = join(__dirname, '..', '..');
@@ -54,27 +11,30 @@ async function main(): Promise<void> {
const locales = await readdir(sourceDir);
- const allKeys = await pMap(
- locales,
- async locale => {
+ await Promise.all(
+ locales.map(async locale => {
const sourcePath = join(sourceDir, locale, 'messages.json');
- const json = JSON.parse(await readFile(sourcePath, 'utf8'));
- return Object.entries(json)
- .filter(([, value]) => isLocaleMessageType(value))
- .map(([key]) => key);
- },
- { concurrency: 10 }
- );
+ const targetPath = join(targetDir, locale, 'messages.json');
- // Sort keys alphabetically for better incremental updates.
- const keys = Array.from(new Set(allKeys.flat())).sort();
- await mkdir(targetDir, { recursive: true });
- await writeFile(join(targetDir, 'keys.json'), JSON.stringify(keys));
+ await mkdir(dirname(targetPath), { recursive: true });
- await pMap(
- locales,
- locale => compact({ sourceDir, targetDir, locale, keys }),
- { concurrency: 10 }
+ const json = JSON.parse(await readFile(sourcePath, 'utf8'));
+ for (const value of Object.values(json)) {
+ const typedValue = value as { description?: string };
+ delete typedValue.description;
+ }
+ delete json.smartling;
+
+ const entries = [...Object.entries(json)];
+
+ // Sort entries alphabetically for better incremental updates.
+ entries.sort(([a], [b]) => {
+ return a < b ? -1 : 1;
+ });
+
+ const result = Object.fromEntries(entries);
+ await writeFile(targetPath, JSON.stringify(result));
+ })
);
}

View file

@ -28,16 +28,3 @@ index c370c30b309..bf0207e6fec 100644
],
}],
],
diff --git a/Signal-Desktop/node_modules/@signalapp/better-sqlite3/package.json.orig b/Signal-Desktop/node_modules/@signalapp/better-sqlite3/package.json
index fbb9d360352..a9217039c01 100644
--- a/Signal-Desktop/node_modules/@signalapp/better-sqlite3/package.json.orig
+++ b/Signal-Desktop/node_modules/@signalapp/better-sqlite3/package.json
@@ -35,7 +35,7 @@
},
"scripts": {
"format": "xcrun clang-format --style=chromium -Werror --verbose -i src/*.cpp src/*.hpp",
- "install": "npm run download && npm run build-release",
+ "install": "npm run build-release",
"build-release": "node-gyp rebuild --release",
"build-debug": "node-gyp rebuild --debug",
"test": "mocha --exit --slow=75 --timeout=5000",