2023-11-24 18:32:21 +00:00
|
|
|
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
|
|
|
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
|
2023-01-11 13:23:51 +00:00
|
|
|
pkgname=signal-desktop
|
2024-04-13 20:53:49 +00:00
|
|
|
pkgver=7.4.0
|
2023-11-24 18:32:21 +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
|
|
|
|
# aarch64: polyval-0.5.3 crate subdep uses unstable stdsimd feature
|
|
|
|
arch="x86_64"
|
|
|
|
license="AGPL-3.0-only"
|
|
|
|
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
|
2023-01-11 13:23:51 +00:00
|
|
|
clang-dev
|
|
|
|
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
|
2023-01-11 13:23:51 +00:00
|
|
|
lld
|
|
|
|
llvm-dev
|
|
|
|
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"
|
|
|
|
|
|
|
|
# follow signal-desktop package.json -> @signalapp/libsignal-client
|
2024-04-13 20:53:49 +00:00
|
|
|
_libsignalver=0.41.2
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
# follow signal-desktop package.json -> @signalapp/ringrtc
|
2024-04-13 20:53:49 +00:00
|
|
|
_ringrtcver=2.39.2
|
2023-01-11 13:23:51 +00:00
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
# follow ringrtc (on version above) -> config/version.properties -> webrtc.version
|
2023-01-11 13:23:51 +00:00
|
|
|
# downloading tarball generated with abuild snapshot (with gclient dependencies fetched)
|
2024-04-13 20:53:49 +00:00
|
|
|
_webrtcver=6261c
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
# follow @signalapp/better-sqlite3 (on version in package.json) -> deps/download.js -> TOKENIZER_VERSION
|
2024-04-13 20:53:49 +00:00
|
|
|
# last bsqlite version: 8.7.1
|
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-04-13 20:53:49 +00:00
|
|
|
https://ab-sn.lnl.gay/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
|
|
|
|
|
|
|
bettersqlite-use-system-sqlcipher.patch
|
2023-11-24 18:32:21 +00:00
|
|
|
libsignal-auditable.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
|
|
|
|
webrtc-shared-like-my-wife.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
|
|
|
|
|
|
|
signal-desktop
|
|
|
|
"
|
|
|
|
builddir="$srcdir/Signal-Desktop-$pkgver"
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
# 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
|
|
|
}
|
|
|
|
|
2023-11-24 18:32:21 +00:00
|
|
|
# manual patches
|
|
|
|
default_prepare() { :; }
|
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
prepare() {
|
2023-11-24 18:32:21 +00:00
|
|
|
default_prepare
|
2023-01-11 13:23:51 +00:00
|
|
|
msg "Applying patches"
|
|
|
|
for x in $source; do
|
|
|
|
case "$x" in
|
|
|
|
signal-*.patch)
|
|
|
|
msg "$x"
|
|
|
|
patch -p1 -i "$srcdir"/$x -d "$srcdir"/Signal-Desktop-$pkgver
|
|
|
|
;;
|
2023-04-15 01:05:50 +00:00
|
|
|
libsignal-*.patch)
|
|
|
|
msg "$x"
|
|
|
|
patch -p1 -i "$srcdir"/$x -d "$srcdir"/libsignal-$_libsignalver
|
|
|
|
;;
|
2023-01-11 13:23:51 +00:00
|
|
|
ringrtc-*.patch)
|
|
|
|
msg "$x"
|
|
|
|
patch -p1 -i "$srcdir"/$x -d "$srcdir"/ringrtc-$_ringrtcver
|
|
|
|
;;
|
|
|
|
webrtc-*.patch)
|
|
|
|
msg "$x"
|
|
|
|
patch -p1 -i "$srcdir"/$x -d "$srcdir"/webrtc-$_webrtcver
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
msg "Installing signal-desktop JS dependencies"
|
|
|
|
echo 'ignore-engines true' > .yarnrc
|
|
|
|
yarn --ignore-scripts --frozen-lockfile
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/webrtc-$_webrtcver
|
|
|
|
|
|
|
|
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/*' \
|
|
|
|
\! -path './third_party/libxml/*' \
|
|
|
|
\! -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
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/ringrtc-$_ringrtcver/src/rust
|
|
|
|
|
|
|
|
msg "Installing ringrtc rust dependencies"
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/libsignal-$_libsignalver
|
|
|
|
|
|
|
|
msg "Installing libsignal rust dependencies"
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/Signal-FTS5-Extension-$_stokenizerver
|
|
|
|
|
|
|
|
msg "Installing signal tokenizer rust dependencies"
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/ringrtc-$_ringrtcver/src/node
|
|
|
|
|
|
|
|
msg "Installing ringrtc js dependencies"
|
|
|
|
yarn --frozen-lockfile --ignore-scripts
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/libsignal-$_libsignalver/node
|
|
|
|
|
|
|
|
# fix target
|
|
|
|
sed -i 's/unknown-linux-gnu/alpine-linux-musl/g' binding.gyp
|
|
|
|
|
|
|
|
msg "Installing libsignal js dependencies"
|
|
|
|
yarn --ignore-scripts --frozen-lockfile
|
|
|
|
)
|
|
|
|
|
|
|
|
# remove shipped fonts for system-provided (part 1)
|
|
|
|
rm -rf fonts/
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
chromium_arch="$(node -e 'console.log(process.arch)')"
|
|
|
|
|
|
|
|
# required dependency of ringrtc
|
|
|
|
(
|
|
|
|
cd "$srcdir"/webrtc-$_webrtcver
|
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
|
|
|
|
"
|
|
|
|
mkdir -p "$srcdir"/ringrtc-$_ringrtcver/out/release
|
|
|
|
msg "Building signal's webrtc"
|
2023-04-15 01:05:50 +00:00
|
|
|
# shellcheck disable=2090,2116
|
2023-01-11 13:23:51 +00:00
|
|
|
gn gen "$srcdir"/ringrtc-$_ringrtcver/out/release --args="$(echo $webrtc_args)"
|
2023-07-19 18:27:37 +00:00
|
|
|
ninja -C "$srcdir"/ringrtc-$_ringrtcver/out/release signaldeswebrtc
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(
|
2023-11-24 18:32:21 +00:00
|
|
|
cd "$srcdir"/ringrtc-$_ringrtcver
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
msg "Building libringrtc"
|
|
|
|
OUTPUT_DIR="$srcdir"/ringrtc-$_ringrtcver/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
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/ringrtc-$_ringrtcver/src/node
|
|
|
|
msg "Building ringrtc JS glue code"
|
|
|
|
yarn build
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Cleaning dev dependencies for ringrtc"
|
|
|
|
yarn --ignore-scripts --frozen-lockfile --production
|
2023-01-11 13:23:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# module on npm intentionally unbuildable: https://github.com/signalapp/libsignal/issues/464#issuecomment-1160665052
|
|
|
|
(
|
|
|
|
cd "$srcdir"/libsignal-$_libsignalver/node
|
|
|
|
|
|
|
|
msg "Building libsignal"
|
|
|
|
yarn node-gyp configure --nodedir=/usr/include/electron/node_headers --build-from-source
|
|
|
|
yarn node-gyp build --nodedir=/usr/include/electron/node_headers --build-from-source
|
|
|
|
|
|
|
|
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"
|
|
|
|
yarn tsc
|
2023-04-15 01:05:50 +00:00
|
|
|
|
|
|
|
msg "Cleaning dev dependencies for libsignal"
|
|
|
|
yarn --ignore-scripts --frozen-lockfile --production
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
cd "$srcdir"/Signal-FTS5-Extension-$_stokenizerver
|
|
|
|
|
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
# from package.json postinstall
|
|
|
|
yarn build:acknowledgments
|
|
|
|
yarn patch-package
|
|
|
|
rm -rf node_modules/dtrace-provider
|
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
# get esbuild installed (needed for next step)
|
|
|
|
npm rebuild esbuild
|
|
|
|
|
|
|
|
# build front
|
|
|
|
NODE_ENV=production \
|
|
|
|
SIGNAL_ENV=production \
|
|
|
|
NODE_OPTIONS=--openssl-legacy-provider \
|
|
|
|
yarn build:dev
|
|
|
|
|
|
|
|
# purge non-production deps
|
|
|
|
yarn install --ignore-scripts --frozen-lockfile --production
|
|
|
|
|
|
|
|
# XXX: the previous step undoes the patches. and removes the patch applier.
|
|
|
|
# please force me to just implement packaging without dev modules in tasje. -lnl
|
|
|
|
for x in patches/*.patch; do
|
|
|
|
# some of these patches are made for devDependencies
|
|
|
|
if [ -d "$(grep -Eo 'node_modules/(@[a-z\d_-]+/)?[a-z\d_-]+/' "$x" | head -n1)" ]; then
|
|
|
|
msg "$x"
|
|
|
|
patch -Np1 -i ./"$x"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
# use our libsignal
|
|
|
|
rm -rf node_modules/@signalapp/libsignal-client/
|
2023-04-15 01:05:50 +00:00
|
|
|
mv "$srcdir"/libsignal-$_libsignalver/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/
|
|
|
|
mv "$srcdir"/ringrtc-$_ringrtcver/src/node/ node_modules/@signalapp/ringrtc
|
2023-01-11 13:23:51 +00:00
|
|
|
|
|
|
|
# patch the sqlcipher module
|
|
|
|
for x in $source; do
|
|
|
|
case "$x" in
|
|
|
|
bettersqlite-*.patch)
|
|
|
|
msg "$x"
|
2023-04-15 01:05:50 +00:00
|
|
|
patch -Np1 -i "$srcdir"/$x -d "$srcdir"/Signal-Desktop-$pkgver/node_modules/@signalapp/better-sqlite3/
|
2023-01-11 13:23:51 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2023-04-15 01:05:50 +00:00
|
|
|
mkdir node_modules/@signalapp/better-sqlite3/tokenizer
|
|
|
|
mv "$srcdir"/Signal-FTS5-Extension-$_stokenizerver/target/release/libsignal_tokenizer.a node_modules/@signalapp/better-sqlite3/tokenizer/
|
|
|
|
mv "$srcdir"/Signal-FTS5-Extension-$_stokenizerver/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() {
|
|
|
|
# tests run against downloaded build of electron for glibc, probably can be patched
|
|
|
|
yarn test
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2023-04-15 01:05:50 +00:00
|
|
|
cd "$builddir"/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
|
|
|
|
install -Dm755 "$srcdir"/ringrtc-$_ringrtcver/out/release/libsignaldeswebrtc.so "$pkgdir"/usr/lib/libsignaldeswebrtc.so
|
|
|
|
|
2023-01-11 13:23:51 +00:00
|
|
|
install -Dm755 "$srcdir"/$pkgname "$pkgdir"/usr/bin/$pkgname
|
|
|
|
|
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-04-13 20:53:49 +00:00
|
|
|
51edb647832a1f9658abb7fddb4c35e8c84f5ea73c36f52bb02cf3460b871ace5bc6a86b439df738d6fbc418f0753e717962a0edefa95a0d4b2ca846fa11371e Signal-Desktop-7.4.0.tar.gz
|
|
|
|
a311dd8d61d6c072a76e247bf4e4d752f1fe9dfcf0993d1b14790dc2eeec65d3c1bf8b8288156dee5ff89cbed9e282b73a58fcdd69bda9b49441fc9c443a83ec libsignal-0.41.2.tar.gz
|
|
|
|
c36eb4f3ab02cfa341ccb42a80d5fed53bf21bf495eb3627712db912c97bd76f4fb8fa1951ecfeff1b64c36fdfe72aec59bf459b27a612da5b4e16a885c225e4 ringrtc-2.39.2.tar.gz
|
|
|
|
341144563eafbd6e263c46cca5cf4954c9d8c72ba4caea1c9342b5b5311e7f618f3e595051195f9894662928cc5015641303aae2c5d5bbc18b22fb36651ee2e8 webrtc-6261c.tar.zst
|
2023-04-15 01:05:50 +00:00
|
|
|
84a1f2fc29262a12842e94698d124a85b823128e72a493b0be8ea92fbb72c5c268499f4a6827cdedaae06ec73cce4039a39fe5c5d536cbef330e59ba0183da28 stokenizer-0.2.1.tar.gz
|
|
|
|
be5b4e823543b79175a12314f10c6326d9f0d59f470136962daed4665887006acc05b48b40dc1b67747396d8f6f7d23be298c1e110ccdd35ff9b09d5e6b80bab bettersqlite-use-system-sqlcipher.patch
|
2024-04-13 20:53:49 +00:00
|
|
|
92de6fc7cc5f2b6d65bedbd74cc733dd86dafc9cbfb9b727c3267aef63a71a07247cde9b163c68fddfeb9096dcd7f554d36d0b2de078d8905e3825645ddbd6eb libsignal-auditable.patch
|
|
|
|
f13389dd7a1360022d919fa1350210a92e5b832aa32b0ac278b63b1f41462c7807ac28c7867eecf71dac8f3ca699fd0fb0d87de8d1244c3e65cc4b78304e8ef4 signal-disable-updates.patch
|
2023-05-05 05:22:13 +00:00
|
|
|
d50eb5724502df9ea4d795db8cfc27af767c25168d7db2af512e615be7cc2ca290210a9ae78e1abb153c0198677e858ad3d74926c958099d0319295e7d9e7f1d signal-update-links.patch
|
|
|
|
646d303fe58cae3f0896ae0275a66695b902fae6ddde7c568cc9798157dee9f45ceff907bc951fadc4c511d512a73d114b4e4f7c8914e2311c63929d29e1621a signal-show-window-please.patch
|
2023-07-19 18:27:37 +00:00
|
|
|
ab51b8fdcda1d8811213d2c5d8cb5d8457b478a02e23ce40f36b38ec56d45a3bd7a2d184720c27046f98a27771551cfad93c1290fe93856cc02695d318b33e47 ringrtc-webrtc-renamed.patch
|
|
|
|
9d92389637cdda83a0a7039fa6c52516d7bc491d0b1e42d5374b9d1f4fa7b9c930642f2dca896da17a2dc3344fa1bb97434c8dddd0539a4fedfd0dec809fc875 webrtc-shared-like-my-wife.patch
|
2024-04-13 20:53:49 +00:00
|
|
|
e07ae8544988d402aaf0fbd95ea36a64c94c59566c561132578aa6dcf8ff11a34058530e64dc204e5cadc2482f1401e74b32384a144e5e08017c663d0cf7c2fc webrtc-compiler.patch
|
|
|
|
88515d8b8cc82355c9f9b0f44fac83b7ff149b13e9fb102fd46036ec5234cfb2385fa5ad58a0520ee604b93dc4ddd6ae18a7005978ef207841645724ef7a9749 webrtc-gcc13.patch
|
2023-01-11 13:23:51 +00:00
|
|
|
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop
|
|
|
|
"
|