2023-11-24 18:32:21 +00:00
|
|
|
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
2024-09-27 21:32:59 +00:00
|
|
|
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
|
|
|
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
2023-01-11 13:23:51 +00:00
|
|
|
pkgname=signal-desktop
|
2024-12-06 21:33:28 +00:00
|
|
|
pkgver=7.35.1
|
2024-11-30 18:20:23 +00:00
|
|
|
pkgrel=0
|
2023-01-11 13:23:51 +00:00
|
|
|
pkgdesc="A messaging app for simple private communication with friends"
|
|
|
|
url="https://github.com/signalapp/Signal-Desktop/"
|
|
|
|
# same as electron
|
2024-06-03 14:26:59 +00:00
|
|
|
arch="aarch64 x86_64"
|
2023-01-11 13:23:51 +00:00
|
|
|
license="AGPL-3.0-only"
|
2024-10-16 13:13:40 +00:00
|
|
|
_llvmver=18
|
2023-01-11 13:23:51 +00:00
|
|
|
depends="
|
|
|
|
electron
|
|
|
|
font-barlow
|
|
|
|
font-eb-garamond
|
|
|
|
font-inter
|
|
|
|
font-parisienne
|
|
|
|
"
|
|
|
|
makedepends="
|
|
|
|
alsa-lib-dev
|
2023-11-24 18:32:21 +00:00
|
|
|
aom-dev
|
|
|
|
brotli-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
bsd-compat-headers
|
|
|
|
cargo
|
2023-07-19 18:27:37 +00:00
|
|
|
cargo-auditable
|
2023-04-15 01:05:50 +00:00
|
|
|
cbindgen
|
2024-10-16 13:13:40 +00:00
|
|
|
clang$_llvmver-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
cmake
|
2023-11-24 18:32:21 +00:00
|
|
|
crc32c-dev
|
|
|
|
dav1d-dev
|
2024-04-13 20:53:49 +00:00
|
|
|
double-conversion-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
electron-dev
|
2023-04-15 01:05:50 +00:00
|
|
|
electron-tasje
|
2023-01-11 13:23:51 +00:00
|
|
|
ffmpeg-dev
|
|
|
|
git-lfs
|
|
|
|
glib-dev
|
|
|
|
gn
|
2023-11-24 18:32:21 +00:00
|
|
|
jsoncpp-dev
|
|
|
|
libavif-dev
|
|
|
|
libjpeg-turbo-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
libepoxy-dev
|
|
|
|
libevent-dev
|
2024-04-13 20:53:49 +00:00
|
|
|
libsecret-dev
|
2023-07-19 18:27:37 +00:00
|
|
|
libvpx-dev
|
2023-11-24 18:32:21 +00:00
|
|
|
libwebp-dev
|
2024-09-05 20:05:34 +00:00
|
|
|
libxml2-dev
|
2024-10-16 13:13:40 +00:00
|
|
|
lld$_llvmver
|
|
|
|
llvm$_llvmver-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
mesa-dev
|
|
|
|
nodejs
|
|
|
|
npm
|
2023-07-19 18:27:37 +00:00
|
|
|
openh264-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
openssl-dev
|
2024-04-13 20:53:49 +00:00
|
|
|
opus-dev
|
2023-01-11 13:23:51 +00:00
|
|
|
pipewire-dev
|
|
|
|
protoc
|
|
|
|
pulseaudio-dev
|
|
|
|
py3-setuptools
|
|
|
|
python3
|
|
|
|
samurai
|
|
|
|
sqlcipher-dev
|
|
|
|
vips-dev
|
|
|
|
yarn
|
|
|
|
"
|
|
|
|
options="net !check"
|
|
|
|
|
2024-10-09 22:23:19 +00:00
|
|
|
# use _check_depends to validate this
|
2024-12-06 21:33:28 +00:00
|
|
|
_libsignalver=0.62.0
|
2024-11-30 18:20:23 +00:00
|
|
|
_ringrtcver=2.48.7
|
|
|
|
_webrtcver=6723a
|
2023-04-15 01:05:50 +00:00
|
|
|
_stokenizerver=0.2.1
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
source="
|
|
|
|
https://github.com/signalapp/Signal-Desktop/archive/refs/tags/v$pkgver/Signal-Desktop-$pkgver.tar.gz
|
|
|
|
https://github.com/signalapp/libsignal/archive/refs/tags/v$_libsignalver/libsignal-$_libsignalver.tar.gz
|
|
|
|
https://github.com/signalapp/ringrtc/archive/refs/tags/v$_ringrtcver/ringrtc-$_ringrtcver.tar.gz
|
2024-09-13 00:26:08 +00:00
|
|
|
https://ayakael.net/api/packages/mirrors/generic/webrtc/$_webrtcver/webrtc-$_webrtcver.tar.zst
|
2023-04-15 01:05:50 +00:00
|
|
|
https://github.com/signalapp/Signal-FTS5-Extension/archive/refs/tags/v$_stokenizerver/stokenizer-$_stokenizerver.tar.gz
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-11-24 18:32:21 +00:00
|
|
|
libsignal-auditable.patch
|
2024-11-30 18:20:23 +00:00
|
|
|
signal-use-system-sqlcipher.patch
|
2023-01-11 13:23:51 +00:00
|
|
|
signal-disable-updates.patch
|
|
|
|
signal-update-links.patch
|
2023-05-05 05:22:13 +00:00
|
|
|
signal-show-window-please.patch
|
2023-07-19 18:27:37 +00:00
|
|
|
ringrtc-webrtc-renamed.patch
|
2024-09-05 20:05:34 +00:00
|
|
|
webrtc-shared-libs.patch
|
2024-04-13 20:53:49 +00:00
|
|
|
webrtc-compiler.patch
|
2023-07-19 18:27:37 +00:00
|
|
|
webrtc-gcc13.patch
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
signal-desktop.sh
|
2023-01-11 13:23:51 +00:00
|
|
|
"
|
2024-12-06 21:33:28 +00:00
|
|
|
builddir="$srcdir"
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2024-04-13 20:53:49 +00:00
|
|
|
# webrtc broken on clang https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
|
|
|
|
export CC=gcc
|
|
|
|
export CXX=g++
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
# required to find the tools
|
2024-04-13 20:53:49 +00:00
|
|
|
export AR=ar
|
|
|
|
export NM=nm
|
|
|
|
export LD=g++
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
# less log spam, reproducible, allow lto with rust
|
2023-04-15 01:05:50 +00:00
|
|
|
export CFLAGS="${CFLAGS/-g/} -O2 -Wno-error -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
|
|
|
export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-error -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
2023-01-11 13:23:51 +00:00
|
|
|
export CPPFLAGS="$CPPFLAGS -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
|
|
|
|
|
|
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
|
|
|
|
export CARGO_PROFILE_RELEASE_STRIP="symbols"
|
2024-04-13 20:53:49 +00:00
|
|
|
#export RUSTFLAGS="$RUSTFLAGS -C linker=clang"
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
export YARN_CACHE_FOLDER="$srcdir/.yarn"
|
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
_update_depends() {
|
|
|
|
msg "Updating extra dependencies version information in $APKBUILD..."
|
2024-10-09 22:23:19 +00:00
|
|
|
# _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
|
|
|
|
|
|
|
|
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 _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)
|
2024-11-30 18:20:23 +00:00
|
|
|
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 '"')
|
2024-10-09 22:23:19 +00:00
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
sed -i \
|
|
|
|
-e "s|^_libsignalver=.*|_libsignalver=$_libsignalver|" \
|
|
|
|
-e "s|^_ringrtcver=.*|_ringrtcver=$_ringrtcver|" \
|
|
|
|
-e "s|^_webrtcver=.*|_webrtcver=$_webrtcver|" \
|
|
|
|
-e "s|^_stokenizerver=.*|_stokenizerver=$_stokenizerver|" \
|
|
|
|
APKBUILD
|
2024-10-09 22:23:19 +00:00
|
|
|
}
|
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
# webrtc only, the other dependencies are fine with tarballs
|
2023-12-01 19:13:53 +00:00
|
|
|
_distbucket="sakamoto/lnl-aports-snapshots/"
|
2023-01-11 13:23:51 +00:00
|
|
|
snapshot() {
|
|
|
|
mkdir -p "$srcdir"
|
|
|
|
cd "$srcdir"
|
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
# cleanup if retrying
|
|
|
|
rm -rf src
|
|
|
|
rm -rf webrtc-$_webrtcver
|
|
|
|
rm -f webrtc-$_webrtcver.tar
|
2023-11-24 18:32:21 +00:00
|
|
|
rm -f webrtc-$_webrtcver.tar.zst
|
2023-04-15 01:05:50 +00:00
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
echo "
|
|
|
|
solutions = [{
|
|
|
|
'name': 'src',
|
|
|
|
'url': 'https://github.com/signalapp/webrtc.git@$_webrtcver',
|
|
|
|
}]
|
2023-04-15 01:05:50 +00:00
|
|
|
target_cpu = ['x64', 'arm64']
|
2023-01-11 13:23:51 +00:00
|
|
|
target_cpu_only = True
|
|
|
|
" > .gclient
|
|
|
|
|
|
|
|
gclient sync --no-history --nohooks --tpot-cipd-ignore-platformed
|
|
|
|
|
|
|
|
# needed DEPS hooks
|
|
|
|
python3 'src/build/landmines.py' --landmine-scripts 'src/tools_webrtc/get_landmines.py' --src-dir 'src'
|
|
|
|
python3 'src/build/util/lastchange.py' -o 'src/build/util/LASTCHANGE'
|
|
|
|
|
|
|
|
for elf in $(scanelf -RA -F "%F" src); do
|
|
|
|
rm -f "$elf"
|
|
|
|
done
|
|
|
|
|
|
|
|
mv src webrtc-$_webrtcver
|
|
|
|
|
|
|
|
msg "generating tarball.."
|
|
|
|
tar -cf webrtc-$_webrtcver.tar \
|
|
|
|
--exclude="ChangeLog*" \
|
|
|
|
--exclude="testdata/" \
|
|
|
|
--exclude="test_data/" \
|
|
|
|
--exclude="android_rust_toolchain/toolchain/" \
|
2023-04-15 01:05:50 +00:00
|
|
|
--exclude="base/" \
|
2023-01-11 13:23:51 +00:00
|
|
|
--exclude-backups \
|
|
|
|
--exclude-caches-all \
|
|
|
|
--exclude-vcs \
|
|
|
|
webrtc-$_webrtcver
|
|
|
|
|
2023-12-01 19:13:53 +00:00
|
|
|
zstd --auto-threads=logical --ultra --long -22 -T"${ZSTD_LIMIT:-0}" -vv webrtc-$_webrtcver.tar -o "$SRCDEST"/webrtc-$_webrtcver.tar.zst
|
|
|
|
mcli cp "$SRCDEST"/webrtc-$_webrtcver.tar.zst "$_distbucket"
|
2023-01-11 13:23:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
2024-11-30 18:20:23 +00:00
|
|
|
# Moves to builddir to use abuild patch logics
|
2024-12-06 21:33:28 +00:00
|
|
|
for i in Signal-Desktop-$pkgver libsignal-$_libsignalver ringrtc-$_ringrtcver webrtc-$_webrtcver Signal-FTS5-Extension-$_stokenizerver; do
|
2024-11-30 18:20:23 +00:00
|
|
|
mv "$srcdir"/$i "$builddir"/${i%-*}
|
2023-01-11 13:23:51 +00:00
|
|
|
done
|
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
cd "$builddir"/Signal-Desktop
|
2023-01-11 13:23:51 +00:00
|
|
|
msg "Installing signal-desktop JS dependencies"
|
2024-09-05 20:05:34 +00:00
|
|
|
npm ci --ignore-scripts
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
# remove shipped fonts for system-provided (part 1)
|
|
|
|
rm -rf fonts/
|
|
|
|
|
2024-11-30 18:20:23 +00:00
|
|
|
default_prepare
|
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/webrtc
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
local use_system="
|
2023-11-24 18:32:21 +00:00
|
|
|
brotli
|
|
|
|
crc32c
|
|
|
|
dav1d
|
2024-04-13 20:53:49 +00:00
|
|
|
double-conversion
|
2023-01-11 13:23:51 +00:00
|
|
|
ffmpeg
|
2024-04-13 20:53:49 +00:00
|
|
|
flatbuffers
|
2023-01-11 13:23:51 +00:00
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
harfbuzz-ng
|
2024-04-13 20:53:49 +00:00
|
|
|
highway
|
2023-01-11 13:23:51 +00:00
|
|
|
icu
|
2023-11-24 18:32:21 +00:00
|
|
|
jsoncpp
|
|
|
|
libaom
|
|
|
|
libavif
|
2023-01-11 13:23:51 +00:00
|
|
|
libdrm
|
|
|
|
libevent
|
2023-11-24 18:32:21 +00:00
|
|
|
libjpeg
|
2023-01-11 13:23:51 +00:00
|
|
|
libpng
|
2024-04-13 20:53:49 +00:00
|
|
|
libsecret
|
2023-11-24 18:32:21 +00:00
|
|
|
libvpx
|
2023-01-11 13:23:51 +00:00
|
|
|
libwebp
|
|
|
|
libxml
|
|
|
|
libxslt
|
2023-07-19 18:27:37 +00:00
|
|
|
openh264
|
2024-04-13 20:53:49 +00:00
|
|
|
opus
|
2023-01-11 13:23:51 +00:00
|
|
|
re2
|
|
|
|
snappy
|
2023-11-24 18:32:21 +00:00
|
|
|
woff2
|
2023-01-11 13:23:51 +00:00
|
|
|
zlib
|
|
|
|
"
|
2024-04-13 20:53:49 +00:00
|
|
|
for _lib in $use_system double_conversion libjpeg_turbo; do
|
2023-01-11 13:23:51 +00:00
|
|
|
msg "Removing buildscripts for system provided $_lib"
|
2023-11-24 18:32:21 +00:00
|
|
|
find . -type f -path "*{third_party,ringrtc}/$_lib/*" \
|
2023-01-11 13:23:51 +00:00
|
|
|
\! -path "*third_party/$_lib/chromium/*" \
|
|
|
|
\! -path "*third_party/$_lib/google/*" \
|
|
|
|
\! -path './base/third_party/icu/*' \
|
2024-09-27 21:32:59 +00:00
|
|
|
\! -path './third_party/libxml/*' \
|
2024-09-19 01:01:16 +00:00
|
|
|
\! -path './third_party/re2/*' \
|
2023-01-11 13:23:51 +00:00
|
|
|
\! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
|
|
|
|
\! -path './third_party/harfbuzz-ng/utils/hb_scoped.h' \
|
|
|
|
\! -path './third_party/crashpad/crashpad/third_party/zlib/zlib_crashpad.h' \
|
|
|
|
\! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
|
|
|
|
-delete
|
|
|
|
done
|
|
|
|
|
|
|
|
msg "Replacing gn files"
|
|
|
|
python3 build/linux/unbundle/replace_gn_files.py --system-libraries \
|
|
|
|
$use_system
|
|
|
|
|
|
|
|
# allow system dependencies in "official builds"
|
|
|
|
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
|
|
|
|
tools/generate_shim_headers/generate_shim_headers.py
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
mkdir path
|
|
|
|
ln -s /usr/bin/python3 path/vpython3
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/ringrtc/src/rust
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Installing ringrtc rust dependencies"
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/libsignal
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Installing libsignal rust dependencies"
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/Signal-FTS5-Extension
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Installing signal tokenizer rust dependencies"
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/ringrtc/src/node
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
msg "Installing ringrtc js dependencies"
|
2024-09-05 20:05:34 +00:00
|
|
|
npm ci --ignore-scripts
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/libsignal/node
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
# fix target
|
|
|
|
sed -i 's/unknown-linux-gnu/alpine-linux-musl/g' binding.gyp
|
|
|
|
|
|
|
|
msg "Installing libsignal js dependencies"
|
2024-09-27 21:32:59 +00:00
|
|
|
yarn --ignore-scripts --frozen-lockfile
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
chromium_arch="$(node -e 'console.log(process.arch)')"
|
|
|
|
|
|
|
|
# required dependency of ringrtc
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/webrtc
|
2023-04-15 01:05:50 +00:00
|
|
|
export PATH="$PWD/path:$PATH"
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
# shellcheck disable=2089
|
2023-01-11 13:23:51 +00:00
|
|
|
local webrtc_args="
|
|
|
|
rtc_build_examples=false
|
|
|
|
rtc_build_tools=false
|
|
|
|
rtc_enable_protobuf=false
|
|
|
|
rtc_enable_sctp=false
|
|
|
|
rtc_include_tests=false
|
|
|
|
rtc_include_ilbc=false
|
|
|
|
rtc_libvpx_build_vp9=true
|
|
|
|
rtc_use_x11=false
|
|
|
|
|
|
|
|
build_with_mozilla=false
|
|
|
|
chrome_pgo_phase=0
|
|
|
|
clang_use_chrome_plugins=false
|
2023-04-15 01:05:50 +00:00
|
|
|
clang_base_path=\"/usr\"
|
2023-01-11 13:23:51 +00:00
|
|
|
custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
|
|
|
|
is_cfi=false
|
2024-04-13 20:53:49 +00:00
|
|
|
is_clang=false
|
2023-01-11 13:23:51 +00:00
|
|
|
is_debug=false
|
|
|
|
is_official_build=true
|
|
|
|
host_toolchain=\"//build/toolchain/linux/unbundle:default\"
|
|
|
|
proprietary_codecs=true
|
|
|
|
rtc_link_pipewire=true
|
|
|
|
rtc_use_pipewire=true
|
|
|
|
symbol_level=0
|
|
|
|
use_custom_libcxx=false
|
2024-04-13 20:53:49 +00:00
|
|
|
use_lld=true
|
2023-01-11 13:23:51 +00:00
|
|
|
use_sysroot=false
|
|
|
|
"
|
2024-11-30 18:20:23 +00:00
|
|
|
mkdir -p "$builddir"/ringrtc/out/release
|
2023-01-11 13:23:51 +00:00
|
|
|
msg "Building signal's webrtc"
|
2023-04-15 01:05:50 +00:00
|
|
|
# shellcheck disable=2090,2116
|
2024-11-30 18:20:23 +00:00
|
|
|
gn gen "$builddir"/ringrtc/out/release --args="$(echo $webrtc_args)"
|
|
|
|
ninja -C "$builddir"/ringrtc/out/release signaldeswebrtc
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/ringrtc
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
msg "Building libringrtc"
|
2024-11-30 18:20:23 +00:00
|
|
|
OUTPUT_DIR="$builddir"/ringrtc/out \
|
2023-11-24 18:32:21 +00:00
|
|
|
cargo auditable build --features electron --release -p ringrtc
|
2023-07-19 18:27:37 +00:00
|
|
|
|
2023-11-24 18:32:21 +00:00
|
|
|
mkdir -p src/node/build/linux
|
|
|
|
cp -fv out/release/libsignaldeswebrtc.so src/node/build/linux/libsignaldeswebrtc.so
|
|
|
|
cp -fv target/release/libringrtc.so src/node/build/linux/libringrtc-$chromium_arch.node
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/ringrtc/src/node
|
2023-01-11 13:23:51 +00:00
|
|
|
msg "Building ringrtc JS glue code"
|
2024-09-05 20:05:34 +00:00
|
|
|
npm run build
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Cleaning dev dependencies for ringrtc"
|
2024-09-05 20:05:34 +00:00
|
|
|
npm prune --ignore-scripts --omit=dev
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# module on npm intentionally unbuildable: https://github.com/signalapp/libsignal/issues/464#issuecomment-1160665052
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/libsignal/node
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
msg "Building libsignal"
|
2024-09-05 20:05:34 +00:00
|
|
|
node-gyp configure --nodedir=/usr/include/electron/node_headers --build-from-source
|
|
|
|
node-gyp build --nodedir=/usr/include/electron/node_headers --build-from-source
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
mkdir -p prebuilds/linux-$chromium_arch
|
|
|
|
mv build/Release/libsignal_client_linux_$chromium_arch.node prebuilds/linux-$chromium_arch/node.napi.node
|
|
|
|
|
|
|
|
msg "Building libsignal glue code"
|
2024-09-05 20:05:34 +00:00
|
|
|
npm run tsc
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Cleaning dev dependencies for libsignal"
|
2024-09-05 20:05:34 +00:00
|
|
|
npm prune -ignore-scripts --omit=dev
|
2023-04-15 01:05:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2024-11-30 18:20:23 +00:00
|
|
|
cd "$builddir"/Signal-FTS5-Extension
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Building signal tokenizer"
|
2023-07-19 18:27:37 +00:00
|
|
|
cargo auditable build --features extension --release --frozen
|
2023-04-15 01:05:50 +00:00
|
|
|
cbindgen --profile release . -o target/release/signal-tokenizer.h
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
msg "Building signal-desktop"
|
|
|
|
cd "$builddir"/Signal-Desktop
|
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
# from package.json postinstall
|
2024-09-05 20:05:34 +00:00
|
|
|
npm run build:acknowledgments
|
|
|
|
npm exec patch-package
|
2023-01-11 13:23:51 +00:00
|
|
|
rm -rf node_modules/dtrace-provider
|
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
# get esbuild installed (needed for next step)
|
2024-09-27 21:32:59 +00:00
|
|
|
npm rebuild esbuild
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
# build front
|
|
|
|
NODE_ENV=production \
|
|
|
|
SIGNAL_ENV=production \
|
|
|
|
NODE_OPTIONS=--openssl-legacy-provider \
|
2024-09-05 20:05:34 +00:00
|
|
|
npm run build:dev
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
# purge non-production deps
|
2024-09-05 20:05:34 +00:00
|
|
|
npm prune --ignore-scripts --omit=dev
|
2023-04-15 01:05:50 +00:00
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
# use our libsignal
|
|
|
|
rm -rf node_modules/@signalapp/libsignal-client/
|
2024-12-06 21:33:28 +00:00
|
|
|
mv "$builddir"/libsignal/node/ node_modules/@signalapp/libsignal-client
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
# use our libringrtc
|
2023-04-15 01:05:50 +00:00
|
|
|
rm -rf node_modules/@signalapp/ringrtc/
|
2024-12-06 21:33:28 +00:00
|
|
|
mv "$builddir"/ringrtc/src/node/ node_modules/@signalapp/ringrtc
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
mkdir node_modules/@signalapp/better-sqlite3/tokenizer
|
2024-12-06 21:33:28 +00:00
|
|
|
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/
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
npm rebuild \
|
|
|
|
sharp @signalapp/better-sqlite3 spellchecker websocket \
|
|
|
|
utf-8-validate bufferutil fs-xattr \
|
|
|
|
--nodedir=/usr/include/electron/node_headers --build-from-source
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
SIGNAL_ENV=production \
|
2023-04-15 01:05:50 +00:00
|
|
|
tasje pack
|
2023-01-11 13:23:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2024-12-06 21:33:28 +00:00
|
|
|
cd "$builddir"/Signal-Desktop
|
2023-01-11 13:23:51 +00:00
|
|
|
# tests run against downloaded build of electron for glibc, probably can be patched
|
2024-09-05 20:05:34 +00:00
|
|
|
npm run test
|
2023-01-11 13:23:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2024-12-06 21:33:28 +00:00
|
|
|
cd "$builddir"/Signal-Desktop/tasje_out
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
install -Dm644 resources/app.asar "$pkgdir"/usr/lib/$pkgname/app.asar
|
|
|
|
cp -r resources/app.asar.unpacked "$pkgdir"/usr/lib/$pkgname/app.asar.unpacked
|
2023-11-24 18:32:21 +00:00
|
|
|
install -Dm644 signal.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-07-19 18:27:37 +00:00
|
|
|
# this should be in /usr/lib/signal-desktop. however, it does not simply work and I stopped to care
|
2024-11-30 18:20:23 +00:00
|
|
|
install -Dm755 "$builddir"/ringrtc/out/release/libsignaldeswebrtc.so "$pkgdir"/usr/lib/libsignaldeswebrtc.so
|
2023-07-19 18:27:37 +00:00
|
|
|
|
2024-12-06 21:33:28 +00:00
|
|
|
install -Dm755 "$srcdir"/signal-desktop.sh "$pkgdir"/usr/bin/signal-desktop
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
while read -r size; do
|
|
|
|
install -Dm644 icons/$size.png "$pkgdir"/usr/share/icons/hicolor/$size/apps/$pkgname.png
|
|
|
|
done < icons/size-list
|
2023-01-11 13:23:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sha512sums="
|
2024-12-06 21:33:28 +00:00
|
|
|
9e780149b4734c6d9834606b0e15bedc99739ce9c637e69c9d0cedf9e3f870819bba411b7f192920ab4bc8adc9bd0ddccb0ca6790933f701c06b41175e3f7dce Signal-Desktop-7.35.1.tar.gz
|
|
|
|
2a1d171a6bf9f1dfea9fc1fbc4f200c8b9e2ccb30d9d63f29007f252ff79ae7d149ab5707a8e430010da90ad1e3112475bd0eba8efb5cc011d5e3098aa1e26de libsignal-0.62.0.tar.gz
|
2024-11-30 18:20:23 +00:00
|
|
|
e5e5ab27dc3bd37ef577c248d450e70fa11e72bdfab00fef233aad84d3d8aa3434166c03267f6b95b69d593e9da2f37017b5b7a0913f68499f387354742ba50a ringrtc-2.48.7.tar.gz
|
|
|
|
64eed5c2a6f5a505d014bc4fa80e15b21103df1ea27825eaa1dfecc23c269f198a7e98472f29de7cae4ac7fa4fede6e837c27494b8ec4d03e36b85b029c64831 webrtc-6723a.tar.zst
|
2023-04-15 01:05:50 +00:00
|
|
|
84a1f2fc29262a12842e94698d124a85b823128e72a493b0be8ea92fbb72c5c268499f4a6827cdedaae06ec73cce4039a39fe5c5d536cbef330e59ba0183da28 stokenizer-0.2.1.tar.gz
|
2024-11-30 18:20:23 +00:00
|
|
|
8d2d2d82c8546c2dd1fef161b61df79918f8c22235a56a46adb375a0beb4acef12c5fe53e67242a4be97f77adc522ff79b47949c352956c742a70d50f4179f7f libsignal-auditable.patch
|
2024-12-06 21:33:28 +00:00
|
|
|
18d5a0208d75fa910b6c0d531997402bba83290dfc7d7ce903acdcd0ce1d88bd3026ace40ecd32a88c2e429e48530b4e40f207a3d15bd9c0d6ebc8c447fa8ff9 signal-use-system-sqlcipher.patch
|
|
|
|
fc2af28645364cd85c106304a26811b036f6be048c52137fbbcc112870a84132a181f532563e0569b560fde3cf8c02480666a9b01d804b0008f97c728005b1c7 signal-disable-updates.patch
|
|
|
|
853de84d636f730694f17bcec63463fa7bfbdd0a7f7a64618a8fc6bc523ce1a9854b4c651753735af735c18101295d3efbe54f83ae0bccbed83c8c1fee3e7049 signal-update-links.patch
|
|
|
|
882d6889b23a3ebc6449c8b6acec8c3853674a7e94f066d65b57bab674ba8c11d582ba2c760825cb67b9202716e6d8b7123001d1e9f9229e49a0b77e9d978265 signal-show-window-please.patch
|
2024-11-30 18:20:23 +00:00
|
|
|
10284e0d86ab88de161ae689871082194f689ce416f3ebada8991d5db707994ea1cb8b4212756dd93ba5a3469964050988220f18afc37e38f3404a6e17ec8caf ringrtc-webrtc-renamed.patch
|
|
|
|
98a7e4df27c3ed56c5968ebc3ae8e08bfb54362d0c910f9af1d414079a6d5fe0f18aa570ae3c38042f4691af6a130cb3ff689625e26a3987720dd319a5f587b1 webrtc-shared-libs.patch
|
|
|
|
fe78cdc58c18826fc4227cc8e9377980766229390544578f6a1a6f7322bc3243c066963b589323dbfe4f2bfd37f8859ad84f63cb3783317892e5ae3652270a3a webrtc-compiler.patch
|
|
|
|
48ab5c733e643eaff08ccbe839086bebbb68d397984ad7c5c5b68df8071f75d2dfe92c3f52d9fbf9b81754934bdfa8a67c69addd476ce4265b978592fb4ff9bd webrtc-gcc13.patch
|
2024-12-06 21:33:28 +00:00
|
|
|
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop.sh
|
2023-01-11 13:23:51 +00:00
|
|
|
"
|