backports/signal-desktop: upgrade to 7.35.1

This commit is contained in:
Antoine Martin 2024-12-06 16:33:28 -05:00 committed by Antoine Martin
parent 57f44384da
commit d26837cfc6
7 changed files with 116 additions and 41 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.34.0
pkgver=7.35.1
pkgrel=0
pkgdesc="A messaging app for simple private communication with friends"
url="https://github.com/signalapp/Signal-Desktop/"
@ -66,7 +66,7 @@ makedepends="
options="net !check"
# use _check_depends to validate this
_libsignalver=0.60.2
_libsignalver=0.62.0
_ringrtcver=2.48.7
_webrtcver=6723a
_stokenizerver=0.2.1
@ -88,9 +88,9 @@ source="
webrtc-compiler.patch
webrtc-gcc13.patch
signal-desktop
signal-desktop.sh
"
builddir="$srcdir/Signal-Desktop-$pkgver"
builddir="$srcdir"
# webrtc broken on clang https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
export CC=gcc
@ -112,7 +112,8 @@ export CARGO_PROFILE_RELEASE_STRIP="symbols"
export YARN_CACHE_FOLDER="$srcdir/.yarn"
_check_depends() {
_update_depends() {
msg "Updating extra dependencies version information in $APKBUILD..."
# _libsignalver: follow signal-desktop package.json -> @signalapp/libsignal-client
# _ringrtcver: follow signal-desktop package.json -> @signalapp/ringrtc
# _webrtcver: follow ringrtc (on version above) -> config/version.properties -> webrtc.version
@ -126,10 +127,12 @@ _check_depends() {
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 _stokenizerver=$(curl --silent https://raw.githubusercontent.com/signalapp/Signal-Sqlcipher-Extension/refs/tags/v$_extensionver/Cargo.lock | sed -n "/^name = \"signal-tokenizer\"$/,/^$/p" | awk -F ' = ' '{if($1=="version"){print $2}}' | tr -d '"')
echo _libsignalver=$_libsignalver
echo _ringrtcver=$_ringrtcver
echo _webrtcver=$_webrtcver
echo _stokenizerver=$_stokenizerver
sed -i \
-e "s|^_libsignalver=.*|_libsignalver=$_libsignalver|" \
-e "s|^_ringrtcver=.*|_ringrtcver=$_ringrtcver|" \
-e "s|^_webrtcver=.*|_webrtcver=$_webrtcver|" \
-e "s|^_stokenizerver=.*|_stokenizerver=$_stokenizerver|" \
APKBUILD
}
# webrtc only, the other dependencies are fine with tarballs
@ -183,13 +186,17 @@ target_cpu_only = True
prepare() {
# Moves to builddir to use abuild patch logics
for i in libsignal-$_libsignalver ringrtc-$_ringrtcver webrtc-$_webrtcver Signal-FTS5-Extension-$_stokenizerver; do
for i in Signal-Desktop-$pkgver libsignal-$_libsignalver ringrtc-$_ringrtcver webrtc-$_webrtcver Signal-FTS5-Extension-$_stokenizerver; do
mv "$srcdir"/$i "$builddir"/${i%-*}
done
cd "$builddir"/Signal-Desktop
msg "Installing signal-desktop JS dependencies"
npm ci --ignore-scripts
# remove shipped fonts for system-provided (part 1)
rm -rf fonts/
default_prepare
(
@ -290,9 +297,6 @@ prepare() {
msg "Installing libsignal js dependencies"
yarn --ignore-scripts --frozen-lockfile
)
# remove shipped fonts for system-provided (part 1)
rm -rf fonts/
}
build() {
@ -386,6 +390,9 @@ build() {
cbindgen --profile release . -o target/release/signal-tokenizer.h
)
msg "Building signal-desktop"
cd "$builddir"/Signal-Desktop
# from package.json postinstall
npm run build:acknowledgments
npm exec patch-package
@ -405,15 +412,15 @@ build() {
# use our libsignal
rm -rf node_modules/@signalapp/libsignal-client/
mv libsignal/node/ node_modules/@signalapp/libsignal-client
mv "$builddir"/libsignal/node/ node_modules/@signalapp/libsignal-client
# use our libringrtc
rm -rf node_modules/@signalapp/ringrtc/
mv ringrtc/src/node/ node_modules/@signalapp/ringrtc
mv "$builddir"/ringrtc/src/node/ node_modules/@signalapp/ringrtc
mkdir node_modules/@signalapp/better-sqlite3/tokenizer
mv Signal-FTS5-Extension/target/release/libsignal_tokenizer.a node_modules/@signalapp/better-sqlite3/tokenizer/
mv Signal-FTS5-Extension/target/release/signal-tokenizer.h node_modules/@signalapp/better-sqlite3/tokenizer/
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 \
sharp @signalapp/better-sqlite3 spellchecker websocket \
@ -425,12 +432,13 @@ build() {
}
check() {
cd "$builddir"/Signal-Desktop
# tests run against downloaded build of electron for glibc, probably can be patched
npm run test
}
package() {
cd "$builddir"/tasje_out
cd "$builddir"/Signal-Desktop/tasje_out
install -Dm644 resources/app.asar "$pkgdir"/usr/lib/$pkgname/app.asar
cp -r resources/app.asar.unpacked "$pkgdir"/usr/lib/$pkgname/app.asar.unpacked
@ -439,7 +447,7 @@ package() {
# this should be in /usr/lib/signal-desktop. however, it does not simply work and I stopped to care
install -Dm755 "$builddir"/ringrtc/out/release/libsignaldeswebrtc.so "$pkgdir"/usr/lib/libsignaldeswebrtc.so
install -Dm755 "$srcdir"/signal-desktop "$pkgdir"/usr/bin/signal-desktop
install -Dm755 "$srcdir"/signal-desktop.sh "$pkgdir"/usr/bin/signal-desktop
while read -r size; do
install -Dm644 icons/$size.png "$pkgdir"/usr/share/icons/hicolor/$size/apps/$pkgname.png
@ -447,19 +455,19 @@ package() {
}
sha512sums="
30e06721b01e580414c5e57b63350fc42edbe837b0a60a9cd100bc6ab1758fa6fd5744dc3a35d991db62f363eab791c45b43e1d9d5c81af9e67685114ae2e630 Signal-Desktop-7.34.0.tar.gz
26780a0a6a529cee18f5c3b58f0395c6b5b630dbc8d2bbaa345dd7dd319a0e8548575c915dc16de6ac5d421fffdbe898f2dedb1fa3b4eab5d26debdfc1da515b libsignal-0.60.2.tar.gz
9e780149b4734c6d9834606b0e15bedc99739ce9c637e69c9d0cedf9e3f870819bba411b7f192920ab4bc8adc9bd0ddccb0ca6790933f701c06b41175e3f7dce Signal-Desktop-7.35.1.tar.gz
2a1d171a6bf9f1dfea9fc1fbc4f200c8b9e2ccb30d9d63f29007f252ff79ae7d149ab5707a8e430010da90ad1e3112475bd0eba8efb5cc011d5e3098aa1e26de libsignal-0.62.0.tar.gz
e5e5ab27dc3bd37ef577c248d450e70fa11e72bdfab00fef233aad84d3d8aa3434166c03267f6b95b69d593e9da2f37017b5b7a0913f68499f387354742ba50a ringrtc-2.48.7.tar.gz
64eed5c2a6f5a505d014bc4fa80e15b21103df1ea27825eaa1dfecc23c269f198a7e98472f29de7cae4ac7fa4fede6e837c27494b8ec4d03e36b85b029c64831 webrtc-6723a.tar.zst
84a1f2fc29262a12842e94698d124a85b823128e72a493b0be8ea92fbb72c5c268499f4a6827cdedaae06ec73cce4039a39fe5c5d536cbef330e59ba0183da28 stokenizer-0.2.1.tar.gz
8d2d2d82c8546c2dd1fef161b61df79918f8c22235a56a46adb375a0beb4acef12c5fe53e67242a4be97f77adc522ff79b47949c352956c742a70d50f4179f7f libsignal-auditable.patch
cee74edb504ee5ae685e8a449ac35fabf949c33bfee5905778f850c3b18e17f9ae9bd501c89a7fd2c9c81a5bb2b0af0c0b3c72e32128603b3923c32d2a493ce9 signal-use-system-sqlcipher.patch
152435231cdcf52a17a9e24aadf95d77511258e818172941ba074a73a90a541f0136feb58868674f2bcb19191a6d12933fe6cd5baf3ee99e508915c72523163b signal-disable-updates.patch
d50eb5724502df9ea4d795db8cfc27af767c25168d7db2af512e615be7cc2ca290210a9ae78e1abb153c0198677e858ad3d74926c958099d0319295e7d9e7f1d signal-update-links.patch
bfc8acdd13aa48d29c7657311733cc9d33c4899782efbd1ef6d25ad1698be4de7cc67e829324bc0309715d69ae37ea9f782cf54887317e817213e110d73d68e7 signal-show-window-please.patch
18d5a0208d75fa910b6c0d531997402bba83290dfc7d7ce903acdcd0ce1d88bd3026ace40ecd32a88c2e429e48530b4e40f207a3d15bd9c0d6ebc8c447fa8ff9 signal-use-system-sqlcipher.patch
fc2af28645364cd85c106304a26811b036f6be048c52137fbbcc112870a84132a181f532563e0569b560fde3cf8c02480666a9b01d804b0008f97c728005b1c7 signal-disable-updates.patch
853de84d636f730694f17bcec63463fa7bfbdd0a7f7a64618a8fc6bc523ce1a9854b4c651753735af735c18101295d3efbe54f83ae0bccbed83c8c1fee3e7049 signal-update-links.patch
882d6889b23a3ebc6449c8b6acec8c3853674a7e94f066d65b57bab674ba8c11d582ba2c760825cb67b9202716e6d8b7123001d1e9f9229e49a0b77e9d978265 signal-show-window-please.patch
10284e0d86ab88de161ae689871082194f689ce416f3ebada8991d5db707994ea1cb8b4212756dd93ba5a3469964050988220f18afc37e38f3404a6e17ec8caf ringrtc-webrtc-renamed.patch
98a7e4df27c3ed56c5968ebc3ae8e08bfb54362d0c910f9af1d414079a6d5fe0f18aa570ae3c38042f4691af6a130cb3ff689625e26a3987720dd319a5f587b1 webrtc-shared-libs.patch
fe78cdc58c18826fc4227cc8e9377980766229390544578f6a1a6f7322bc3243c066963b589323dbfe4f2bfd37f8859ad84f63cb3783317892e5ae3652270a3a webrtc-compiler.patch
48ab5c733e643eaff08ccbe839086bebbb68d397984ad7c5c5b68df8071f75d2dfe92c3f52d9fbf9b81754934bdfa8a67c69addd476ce4265b978592fb4ff9bd webrtc-gcc13.patch
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop.sh
"

View file

@ -0,0 +1,61 @@
# signal-desktop
This is the `signal-desktop` package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
## Building signal-desktop
Signal-desktop is an electron application that is rather complex to build
The first layer of complexity is the use of dependencies that are themselves
rather complex to build. Some are based on nodejs, others rust. Those
dependencies are built before signal-desktop, like ringrtc, webrtc and
libsignal. The versions of those dependencies are tracked in different files,
which adds complexity when maintaining the package. Executing `abuild
_update_depends` automatically fetches the expected versions and updates
the relevant variables.
A second layer of complexity is that webrtc's source code isn't available as a
downloadable tarball. It is only fetchable using Google's `gclient` available
in `depot_tools` with a reimplemented version in the `teapot` package. By
executing, `abuild snapshot`, webrtc tarball can be fetched and packaged, as
long as `gclient` is in your path. For ease of maintenance, a workflow on
[Ayakael's Forge](https://ayakael.net/mirrors/signal-desktop) automatically
fetches and packages the source code and makes it available in a [generic
Forgejo repository](https://ayakael.net/mirrors/-/packages/generic/webrtc).
## Updating signal-desktop
In a nutshell:
1. Set `pkgver` to up-to-date version
2. Update the dependency versions using `abuild _update_depends`
3. Optional: fetch webrtc using `abuild snapshot`, making sure `client`
is in your path
4. Update source checksum using `abuild checksum`
## Finding dependency version information
Here is where the version information is stored. It is different for every
extra dependency.
* _libsignalver: follow signal-desktop package.json ->
@signalapp/libsignal-client
* _ringrtcver: follow signal-desktop package.json -> @signalapp/ringrtc
* _webrtcver: follow ringrtc (on version above) -> config/version.properties ->
webrtc.version 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
## Why is this package still in testing
As `electron` is still in testing, this package cannot yet be moved to
`community`. Until that changes, this package is also kept-to-date against the
latest release of Alpine Linux (along with `electron`) in
[Ayakael's Forge](https://ayakael.net/forge/-/packages/alpine/signal-desktop).
This is true of all Ayakael's packages still in `testing`.

View file

@ -0,0 +1,6 @@
#!/bin/sh
# app chooses config (including used endpoints) based on this
export NODE_ENV=production
exec electron /usr/lib/signal-desktop/app.asar

View file

@ -1,5 +1,5 @@
--- a/config/production.json
+++ b/config/production.json
--- a/Signal-Desktop/config/production.json
+++ b/Signal-Desktop/config/production.json
@@ -16,5 +16,5 @@
"serverTrustRoot": "BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF",
"genericServerPublicParams": "AByD873dTilmOSG0TjKrvpeaKEsUmIO8Vx9BeMmftwUs9v7ikPwM8P3OHyT0+X3EUMZrSe9VUp26Wai51Q9I8mdk0hX/yo7CeFGJyzoOqn8e/i4Ygbn5HoAyXJx5eXfIbqpc0bIxzju4H/HOQeOpt6h742qii5u/cbwOhFZCsMIbElZTaeU+BWMBQiZHIGHT5IE0qCordQKZ5iPZom0HeFa8Yq0ShuEyAl0WINBiY6xE3H/9WnvzXBbMuuk//eRxXgzO8ieCeK8FwQNxbfXqZm6Ro1cMhCOF3u7xoX83QhpN",

View file

@ -1,7 +1,7 @@
diff --git a/app/main.ts.orig b/app/main.ts
diff --git a/Signal-Desktop/app/main.ts.orig b/Signal-Desktop/app/main.ts
index aa1bec8..bd7c1d5 100644
--- a/app/main.ts.orig
+++ b/app/main.ts
--- a/Signal-Desktop/app/main.ts.orig
+++ b/Signal-Desktop/app/main.ts
@@ -690,7 +690,7 @@ async function createWindow() {
: DEFAULT_HEIGHT;

View file

@ -1,5 +1,5 @@
--- ./ts/components/DialogExpiredBuild.tsx.orig
+++ ./ts/components/DialogExpiredBuild.tsx
--- ./Signal-Desktop/ts/components/DialogExpiredBuild.tsx.orig
+++ ./Signal-Desktop/ts/components/DialogExpiredBuild.tsx
@@ -23,9 +23,9 @@
containerWidthBreakpoint={containerWidthBreakpoint}
type="error"
@ -12,8 +12,8 @@
hasAction
>
{i18n('icu:expiredWarning')}{' '}
--- ./ts/types/support.ts.orig
+++ ./ts/types/support.ts
--- ./Signal-Desktop/ts/types/support.ts.orig
+++ ./Signal-Desktop/ts/types/support.ts
@@ -1,7 +1,7 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

View file

@ -1,7 +1,7 @@
diff --git a/node_modules/@signalapp/better-sqlite3/binding.gyp.orig b/node_modules/@signalapp/better-sqlite3/binding.gyp
diff --git a/Signal-Desktop/node_modules/@signalapp/better-sqlite3/binding.gyp.orig b/Signal-Desktop/node_modules/@signalapp/better-sqlite3/binding.gyp
index c370c30b309..bf0207e6fec 100644
--- a/node_modules/@signalapp/better-sqlite3/binding.gyp.orig
+++ b/node_modules/@signalapp/better-sqlite3/binding.gyp
--- a/Signal-Desktop/node_modules/@signalapp/better-sqlite3/binding.gyp.orig
+++ b/Signal-Desktop/node_modules/@signalapp/better-sqlite3/binding.gyp
@@ -7,7 +7,16 @@
'targets': [
{
@ -28,10 +28,10 @@ index c370c30b309..bf0207e6fec 100644
],
}],
],
diff --git a/node_modules/@signalapp/better-sqlite3/package.json.orig b/node_modules/@signalapp/better-sqlite3/package.json
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/node_modules/@signalapp/better-sqlite3/package.json.orig
+++ b/node_modules/@signalapp/better-sqlite3/package.json
--- 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": {