20
0

- Version 1.12.0

## 🦖 Deprecations
  * Remove remaining support for outdated .well-known settings (https://github.com/element-hq/element-web/pull/30702). Contributed by @richvdh.
  ##  Features
  * Automatically select first source for desktop capture under Wayland (https://github.com/element-hq/element-desktop/pull/2526). Contributed by @byquanton.
  * Add decline button to call notification toast (use new notification event) (https://github.com/element-hq/element-web/pull/30729). Contributed by @toger5.
  * Use the new room list by default (https://github.com/element-hq/element-web/pull/30640). Contributed by @langleyd.
  * "Verify this device" redesign (https://github.com/element-hq/element-web/pull/30596). Contributed by @uhoreg.
  * Set Element Call "intents" when starting and answering DM calls. (https://github.com/element-hq/element-web/pull/30730). Contributed by @Half-Shot.
  * Add axe compliance for new room list (https://github.com/element-hq/element-web/pull/30700). Contributed by @langleyd.
  * Stop ringing and remove toast if another device answers a RTC call. (https://github.com/element-hq/element-web/pull/30728). Contributed by @Half-Shot.
  * Automatically adjust history visibility when making a room private (https://github.com/element-hq/element-web/pull/30713). Contributed by @Half-Shot.
  * Release announcement for new room list (https://github.com/element-hq/element-web/pull/30675). Contributed by @dbkr.
  ## 🐛 Bug Fixes
  * Update Electron to v38.1.0 to fix Kernel crash on multi-GPU systems (https://github.com/element-hq/element-desktop/pull/2544). Contributed by @Arcitec.
  * Fix Confirm your identity buttons being unclickable (https://github.com/element-hq/element-desktop/pull/2554). Contributed by @dbkr.
  * Ensure dropdown is not a drag element on macOS (https://github.com/element-hq/element-desktop/pull/2540). Contributed by @t3chguy.
  * https://github.com/element-hq/element-web/pull/30795). Contributed by @RiotRobot.
  * https://github.com/element-hq/element-web/pull/30794). Contributed by @RiotRobot.
  * Don't show release announcements while toasts are displayed (https://github.com/element-hq/element-web/pull/30770). Contributed by @dbkr.
  * Fix enabling key backup not working if there is an untrusted key backup (https://github.com/element-hq/element-web/pull/30707). Contributed by @Half-Shot.
  * Force `preload` to be false when setting an intent on an Element Call. (https://github.com/element-hq/element-web/pull/30759). Contributed by @Half-Shot.
  * Fix handling of 413 server response when uploading media (https://github.com/element-hq/element-web/pull/30737). Contributed by @hughns.
  * Make landmark navigation work with new room list (https://github.com/element-hq/element-web/pull/30747). Contributed by @dbkr.
  * Prevent voice message from displaying spurious errors (https://github.com/element-hq/element-web/pull/30736). Contributed by @florianduros.
  * Align default avatar and fix colors in composer pills (https://github.com/element-hq/element-web/pull/30739). Contributed by @florianduros.
  * Use configured URL for link to desktop app in message search settings (https://github.com/element-hq/element-web/pull/30742). Contributed by @t3chguy.
  * Fix history visibility when creating space rooms (https://github.com/element-hq/element-web/pull/30745). Contributed by @dbkr.
  * Check HTML-encoded quotes when handling translations for embedded pages (such as welcome.html) (https://github.com/element-hq/element-web/pull/30743). Contributed by @Half-Shot.
  * Fix local room encryption status always not enabled (https://github.com/element-hq/element-web/pull/30461). Contributed by @BillCarsonFr.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-desktop?expand=0&rev=136
This commit is contained in:
2025-09-23 13:36:16 +00:00
committed by Git OBS Bridge
commit b65e562ecb
18 changed files with 3401 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+251
View File
@@ -0,0 +1,251 @@
#
# spec file for package element-desktop
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: element-desktop
Version: 1.12.0
Release: 0
Summary: A glossy Matrix collaboration client - desktop
License: AGPL-3.0-only OR GPL-3.0-only
URL: https://github.com/vector-im/element-desktop
Source0: https://github.com/vector-im/element-desktop/archive/v%{version}.tar.gz#/element-desktop-%{version}.tar.gz
Source2: vendor.tar.zst
Source3: io.element.Element.desktop
Source4: element-desktop.sh
Source5: prepare.sh
Patch0: hak-remove-devdependencies.patch
Patch1: 7za-path.patch
Patch2: cc-link-lib-no-static.patch
Patch3: remove-fuses.patch
Patch4: no-walrus-operator.patch
Patch5: break-esbuild-for-good.patch
Patch6: fix-oxc-resolver.patch
BuildRequires: app-builder
BuildRequires: cargo
BuildRequires: element-web = %{version}
BuildRequires: esbuild
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: jq
BuildRequires: nodejs-electron-devel
BuildRequires: zstd
BuildRequires: pkgconfig(openssl)
%if 0%{?fedora}
BuildRequires: rust-srpm-macros
%else
BuildRequires: cargo-auditable
BuildRequires: cargo-packaging >= 1.2.0+3
%endif
BuildRequires: libsecret-devel
%if 0%{?sle_version} <= 150600
BuildRequires: gcc13-c++
%else
BuildRequires: gcc-c++
%endif
Requires: element-web = %{version}
Requires: nodejs-electron%{_isa}
#x86 electron requires SSE2
%ifarch %ix86
ExclusiveArch: i586 i686
BuildArch: i686
%{expand:%%global optflags %(echo "%optflags") -march=pentium4 -mtune=generic}
%{expand:%%global build_rustflags %(echo "%build_rustflags") -C target-cpu=pentium4 -Z tune-cpu=generic}
%endif
%description
A glossy Matrix collaboration client - desktop
%prep
%setup -q -a2
%autopatch -p1
# of course this node garbage of a "programming language" is trying to copy around some windows specific stuff on linux
echo > ./node_modules/electron-winstaller/script/select-7z-arch.js
# don't run the broken postinstall script
sed -i -e 's/^.*postinstall.*$/"foo":"bar"/' package.json
# https://blogs.gnome.org/mcatanzaro/2020/05/18/patching-vendored-rust-dependencies/
for i in cc libloading libsqlite3-sys openssl-src rustix seshat vcpkg; do
pushd .hak/hakModules/matrix-seshat/vendor/$i
jq -cj '.files={}' .cargo-checksum.json >tmp && mv tmp .cargo-checksum.json && popd
done
jq -cj '.piwik=false | .update_base_url=null' < element.io/release/config.json > tmp && mv -v tmp element.io/release/config.json
%build
export CFLAGS="%{optflags} -fpic -fno-semantic-interposition -fno-fat-lto-objects -fvisibility=hidden"
export CXXFLAGS="%{optflags} -fpic -fno-semantic-interposition -fno-fat-lto-objects -fvisibility=hidden"
export LDFLAGS="%{?build_ldflags}"
export MAKEFLAGS="%{_smp_mflags}"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
export USE_SYSTEM_APP_BUILDER=true
export OPENSSL_NO_VENDOR=1
%if 0%{?sle_version} <= 150600
mkdir -p /tmp/bin
ln -sf /usr/bin/gcc-13 /tmp/bin/gcc
ln -sf /usr/bin/g++-13 /tmp/bin/g++
export PATH="/tmp/bin:$PATH"
%endif
# The `cc` crate tries to be too clever and passes some default cflags when building sqlcipher.
# Disable these and use only the ones from CFLAGS env. variable
export CRATE_CC_NO_DEFAULTS=1
%ifarch %ix86
export RUSTC_BOOTSTRAP=1
%endif
#I want to actually see the build logs for Cargo. Especially the gcc command line for dependent modules.
export RUSTC_LOG='rustc_codegen_ssa::back::link=info'
export RUSTFLAGS="%{build_rustflags} --verbose -Cstrip=none"
export CARGO_TERM_VERBOSE=true
# break esbuild for good - see https://en.opensuse.org/openSUSE:Packaging_Electron#esbuild and Patch5
export ESBUILD_BINARY_PATH=/usr/bin/esbuild
%electron_rebuild
pushd .hak/hakModules/matrix-seshat
%if 0%{?suse_version}
auditable='auditable -vv'
%endif
cargo -vv $auditable rustc --offline --release --features=bundled-sqlcipher --lib --crate-type cdylib
ln -Tv target/release/*.so index.node
popd
#Compare definition of `build:universal` in package.json
npm run build:ts
npm run build:res
npx --no-install electron-builder --linux dir --universal -c.electronDist=%{_libdir}/electron -c.asar=false -c.nodeGypRebuild=false -c.npmRebuild=false
rm -rf "/tmp/bin"
%install
#Remove sources an other files that should not be shipped
pushd dist/linux-universal-unpacked/resources/app
rm -rf node_modules/matrix-seshat/{.cargo,false,src,target,test,vendor,Cargo.lock,Cargo.toml}
find -name '*.c' -type f -print -delete
find -name '*.cc' -type f -print -delete
find -name '*.cpp' -type f -print -delete
find -name '*.h' -type f -print -delete
find -name '*.m' -type f -print -delete
find -name '*.map' -type f -print -delete
find -name '*.ts' -type f -print -delete
find -name '*.tsx' -type f -print -delete
find -name '*.gyp' -type f -print -delete
find -name '*.gypi' -type f -print -delete
find -name '*.mk' -type f -print -delete
find -name '*.Makefile' -type f -print -delete
find -name '.eslint*' -type f -print -delete
find -name .editorconfig -type f -print -delete
find -name .nvmrc -type f -print -delete
find -name .nycrc -type f -print -delete
find -name Makefile -type f -print -delete
find -name '.jscs*' -type f -print -delete
find -name obj.target -print0 |xargs -r0 -- rm -rvf --
find -name '*.d' -type f -print -delete
#Documentation
find -name '*.md' -type f -print -delete
find -name '*.markdown' -type f -print -delete
find -name '*.bnf' -type f -print -delete
find -name '*.mli' -type f -print -delete
find -name CHANGES -type f -print -delete
find -name TODO -type f -print -delete
find -name usage.txt -type f -print -delete
# Remove empty directories
find . -type d -empty -print -delete
# remove dotfiles
find -type f -name ".*" -print -delete
# fix file mode
find . -type f -exec chmod 0644 {} \;
find . -name '*.node' -exec chmod 0755 {} \;
popd
# Install the app content, replace the webapp with a symlink to the system package
install -vd -m 0755 "%{buildroot}%{_datadir}/element/"
cp -lrv dist/linux-universal-unpacked/resources/* -t "%{buildroot}%{_datadir}/element/"
rm %{buildroot}/usr/share/element/default_app.asar
ln -vs %{_datadir}/webapps/element "%{buildroot}%{_datadir}/element/webapp"
# Install binaries to /usr/lib
install -vd -m 0755 "%{buildroot}%{_prefix}/lib/element/"
mv "%{buildroot}/%{_datadir}/element/app/node_modules/keytar-forked/build/Release/keytar.node" "%{buildroot}%{_prefix}/lib/element/"
install -pvm0755 dist/linux-universal-unpacked/resources/app/node_modules/matrix-seshat/index.node "%{buildroot}%{_prefix}/lib/element/matrix-seshat.node"
ln -sfv "%{_prefix}/lib/element/keytar.node" "%{buildroot}/%{_datadir}/element/app/node_modules/keytar-forked/build/Release/keytar.node"
ln -sfv "%{_prefix}/lib/element/matrix-seshat.node" "%{buildroot}%{_datadir}/element/app/node_modules/matrix-seshat/index.node"
# Config file
install -vm 0755 -d %{buildroot}%{_sysconfdir}/element
install -pvm 0644 element.io/release/config.json "%{buildroot}%{_sysconfdir}/element/config.json"
install -pvm 0755 -d %{buildroot}%{_sysconfdir}/webapps/element
ln -vs %{_sysconfdir}/element/config.json "%{buildroot}%{_sysconfdir}/webapps/element/config.json"
install -vd -m 0755 "%{buildroot}%{_datadir}/webapps/element/"
ln -vs %{_sysconfdir}/element/config.json "%{buildroot}%{_datadir}/webapps/element/config.json" # moved here from element-web to make symlink check happy
# Required extras
install -vd -m 0755 "%{buildroot}%{_datadir}/applications/"
install -pvm 0644 %{SOURCE3} "%{buildroot}%{_datadir}/applications/io.element.Element.desktop"
install -vd -m 0755 "%{buildroot}%{_bindir}/"
install -pvm 0755 %{SOURCE4} "%{buildroot}%{_bindir}/%{name}"
# Icons
install -vd -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/"
for i in 16 24 48 64 96 128 256 512; do
install -vd -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/"
install -pvm 0644 build/icon.png "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/io.element.Element.png"
done
# Prevent error msg on element start
ln -vs de_DE.json "%{buildroot}%{_datadir}/element/app/lib/i18n/strings/de.json"
# Remove shebangs
grep -rlZ '#! \?/usr/bin/env' "%{buildroot}%{_datadir}/element/app/node_modules/" | xargs -0 sed -i -e '/#\! \?\/usr\/bin\/env.*/d'
%fdupes %{buildroot}%{_datadir}
%check
%electron_check_native
%files
%license LICENSE-AGPL-3.0 LICENSE-GPL-3.0
%{_bindir}/%{name}
%dir %{_datadir}/element/
%{_datadir}/element/webapp
%{_datadir}/element/app-update.yml
%dir %{_datadir}/element/app
%{_datadir}/element/app/lib
%{_datadir}/element/app/node_modules
%{_datadir}/element/app/package.json
%dir %{_datadir}/element/build
%{_datadir}/element/build/*
%{_prefix}/lib/element/
%config(noreplace) %{_sysconfdir}/element/config.json
%{_sysconfdir}/webapps/element/config.json
%{_datadir}/webapps/element/config.json
%dir %{_sysconfdir}/element/
%{_datadir}/applications/io.element.Element.desktop
%{_datadir}/icons/hicolor/*/apps/io.element.Element.png
%changelog
+23
View File
@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
+1
View File
@@ -0,0 +1 @@
.osc
+22
View File
@@ -0,0 +1,22 @@
7-zip is not actually used during build
--- vendor/node_modules/builder-util/out/7za.js.orig 2024-11-12 14:03:34.173010978 +0100
+++ vendor/node_modules/builder-util/out/7za.js 2024-11-12 14:05:06.720292070 +0100
@@ -6,13 +6,15 @@
const fs = require("fs");
const fs_extra_1 = require("fs-extra");
async function getPath7za() {
+ return '/bin/false';
if (fs.existsSync(_7zip_bin_1.path7za)) {
await (0, fs_extra_1.chmod)(_7zip_bin_1.path7za, 0o755);
}
return _7zip_bin_1.path7za;
}
async function getPath7x() {
+ return '/bin/false';
await (0, fs_extra_1.chmod)(_7zip_bin_1.path7x, 0o755);
return _7zip_bin_1.path7x;
}
-//# sourceMappingURL=7za.js.map
\ Kein Zeilenumbruch am Dateiende.
+//# sourceMappingURL=7za.js.map
+41
View File
@@ -0,0 +1,41 @@
diff -ru a/node_modules/esbuild/install.js b/node_modules/esbuild/install.js
--- a/node_modules/esbuild/install.js 2025-02-01 12:49:52.486000000 +0100
+++ b/node_modules/esbuild/install.js 2025-02-02 17:53:44.578575982 +0100
@@ -27,7 +27,7 @@
var os = require("os");
var path = require("path");
var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
-var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
+var isValidBinaryPath = (x) => !!x
var knownWindowsPackages = {
"win32 arm64 LE": "@esbuild/win32-arm64",
"win32 ia32 LE": "@esbuild/win32-ia32",
@@ -94,6 +94,7 @@
var toPath = path2.join(__dirname, "bin", "esbuild");
var isToPathJS = true;
function validateBinaryVersion(...command) {
+ return;
command.push("--version");
let stdout;
try {
diff -ru a/node_modules/esbuild/lib/main.js b/node_modules/esbuild/lib/main.js
--- a/node_modules/esbuild/lib/main.js 2025-02-01 12:49:52.486000000 +0100
+++ b/node_modules/esbuild/lib/main.js 2025-02-02 18:05:52.027111771 +0100
@@ -662,9 +662,6 @@
if (isFirstPacket) {
isFirstPacket = false;
let binaryVersion = String.fromCharCode(...bytes);
- if (binaryVersion !== "0.25.9") {
- throw new Error(`Cannot start service: Host version "${"0.25.9"}" does not match binary version ${quote(binaryVersion)}`);
- }
return;
}
let packet = decodePacket(bytes);
@@ -1680,6 +1677,7 @@
return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
}
function generateBinPath() {
+ return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
+18
View File
@@ -0,0 +1,18 @@
Do not make cc emit "static" to cargo, that option is broken (rustc tries to repact LTO objects and corrupts them in the process leading to missing symbols).
Make rustc believe everything foreign is a “dylib”. (It's not, but that makes it pass them to intact to GCC to do the linking)
--- vendor/.hak/hakModules/matrix-seshat/vendor/cc/src/lib.rs.orig 2024-05-16 18:44:16.828468243 +0200
+++ vendor/.hak/hakModules/matrix-seshat/vendor/cc/src/lib.rs 2024-05-16 19:04:27.036595422 +0200
@@ -1100,10 +1100,10 @@ impl Build {
}
if self.link_lib_modifiers.is_empty() {
- self.print(&format!("cargo:rustc-link-lib=static={}", lib_name));
+ self.print(&format!("cargo:rustc-link-lib={}", lib_name));
} else {
let m = self.link_lib_modifiers.join(",");
- self.print(&format!("cargo:rustc-link-lib=static:{}={}", m, lib_name));
+ self.print(&format!("cargo:rustc-link-lib:{}={}", m, lib_name));
}
self.print(&format!("cargo:rustc-link-search=native={}", dst.display()));
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce8ff4550c9b713ed6f3261e0b84bb59e4b4dc204f07013058265504c432c414
size 3174195
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75846450f859a067c70256b00c0c9c1780b8f6ff5bcd136bf9cfd1e89f439827
size 3152936
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
exec electron /usr/share/element/app "$@"
+11
View File
@@ -0,0 +1,11 @@
diff -ru a/node_modules/oxc-resolver/package.json b/node_modules/oxc-resolver/package.json
--- a/node_modules/oxc-resolver/package.json 2025-08-11 22:18:51.515000000 +0200
+++ b/node_modules/oxc-resolver/package.json 2025-08-11 22:13:37.448368507 +0200
@@ -24,7 +24,6 @@
"test": "vitest run -r ./napi",
"build:debug": "napi build --platform --manifest-path napi/Cargo.toml",
"build": "pnpm run build:debug --features allocator --release",
- "postinstall": "napi-postinstall oxc-resolver 11.6.0 check",
"postbuild:debug": "node napi/patch.mjs"
},
"dependencies": {
+20
View File
@@ -0,0 +1,20 @@
hak fetch tries to download devDependencies for two modules. Unfortunately it does so in a very non-deterministic manner (no shrinkwrap file)
Remove that step since the devDependencies are not actually needed for any of these two modules.
--- element-desktop-1.11.86/scripts/hak/fetch.ts 2024-11-19 22:43:48.895355949 +0100
+++ element-desktop-1.11.86/scripts/hak/fetch.ts 2024-11-19 22:44:02.245421312 +0100
@@ -26,14 +26,6 @@
console.log("Fetching " + moduleInfo.name + "@" + moduleInfo.version);
const packumentCache = new Map();
- await pacote.extract(`${moduleInfo.name}@${moduleInfo.version}`, moduleInfo.moduleBuildDir, {
- packumentCache,
- });
-
- console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
- await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], {
- cwd: moduleInfo.moduleBuildDir,
- });
// also extract another copy to the output directory at this point
// nb. we do not yarn install in the output copy: we could install in
+20
View File
@@ -0,0 +1,20 @@
[Desktop Entry]
Name=Element
GenericName=Matrix Client
GenericName[x-test]=xxMatrix Clientxx
GenericName[zh_CN]=Matrix 客户端
GenericName[zh_TW]=Matrix 用戶端程式
Comment=Feature-rich client for Matrix
Comment[zh_CN]=功能丰富的 Matrix 客户端
Comment[zh_TW]=功能豐富的的 Matrix 用戶端程式
Exec=/usr/bin/element-desktop %u
Terminal=false
Type=Application
Icon=io.element.Element
StartupWMClass=Element
Categories=Network;InstantMessaging;Chat;IRCClient;
MimeType=x-scheme-handler/io.element.desktop;x-scheme-handler/element;
Keywords=chat;gitter;irc;messaging;messenger;riot;voice;
Keywords[zh_CN]=聊天;沟通;消息;通信;语音;gitter;irc;riot;
Keywords[zh_TW]=聊天;溝通;消息;通信;語音;gitter;irc;riot;
X-GNOME-SingleWindow=true
+48
View File
@@ -0,0 +1,48 @@
--- foo/node_modules/node-gyp/gyp/pylib/gyp/common.py 2024-09-26 12:47:30.529999000 +0200
+++ ./common.py 2024-09-26 22:52:44.247875969 +0200
@@ -432,13 +432,17 @@
def replace_sep(s):
return s.replace(os.sep, "/") if os.sep != "/" else s
- if CC := os.environ.get("CC_target") or os.environ.get("CC"):
+ CC = os.environ.get("CC_target") or os.environ.get("CC")
+ CXX = os.environ.get("CXX_target") or os.environ.get("CXX")
+ CFLAGS = os.environ.get("CFLAGS")
+ CXXFLAGS = os.environ.get("CXXFLAGS")
+ if CC:
cmd += shlex.split(replace_sep(CC))
- if CFLAGS := os.environ.get("CFLAGS"):
+ if CFLAGS:
cmd += shlex.split(replace_sep(CFLAGS))
- elif CXX := os.environ.get("CXX_target") or os.environ.get("CXX"):
+ elif CXX:
cmd += shlex.split(replace_sep(CXX))
- if CXXFLAGS := os.environ.get("CXXFLAGS"):
+ if CXXFLAGS:
cmd += shlex.split(replace_sep(CXXFLAGS))
else:
return {}
--- foo/node_modules/@electron/node-gyp/gyp/pylib/gyp/common.py 2024-09-26 12:47:30.529999000 +0200
+++ ./common.py 2024-09-26 22:52:44.247875969 +0200
@@ -432,13 +432,17 @@
def replace_sep(s):
return s.replace(os.sep, "/") if os.sep != "/" else s
- if CC := os.environ.get("CC_target") or os.environ.get("CC"):
+ CC = os.environ.get("CC_target") or os.environ.get("CC")
+ CXX = os.environ.get("CXX_target") or os.environ.get("CXX")
+ CFLAGS = os.environ.get("CFLAGS")
+ CXXFLAGS = os.environ.get("CXXFLAGS")
+ if CC:
cmd += shlex.split(replace_sep(CC))
- if CFLAGS := os.environ.get("CFLAGS"):
+ if CFLAGS:
cmd += shlex.split(replace_sep(CFLAGS))
- elif CXX := os.environ.get("CXX_target") or os.environ.get("CXX"):
+ elif CXX:
cmd += shlex.split(replace_sep(CXX))
- if CXXFLAGS := os.environ.get("CXXFLAGS"):
+ if CXXFLAGS:
cmd += shlex.split(replace_sep(CXXFLAGS))
else:
return {}
+93
View File
@@ -0,0 +1,93 @@
#!/bin/bash
set -ex
version=$1
last_packaged_version=$(cat "element-desktop.spec" | grep "^Version:" | awk '{print $NF}')
sed -i -e "s/^\(Version: *\)[^ ]*$/\1${version}/" element-desktop.spec
oldwd="$(pwd)"
tmpdir="$(mktemp -d)"
#zypper install findutils file yarn cargo cargo-vendor-filterer moreutils jq
version=$(grep "Version:" element-desktop.spec | awk '{print $2}')
osc rm -f element-web-*.tar.gz ||:
osc rm -f element-desktop-*.tar.gz ||:
wget -c https://github.com/vector-im/element-desktop/archive/v${version}.tar.gz -O element-desktop-${version}.tar.gz
osc add -f element-desktop-*.tar.gz
cp element-desktop.spec "$tmpdir/"
cd "$tmpdir"
#dziobian: yarn has completely broken caching policy which first compiles the module and then caches the result.
#additionally, --ignore-scripts seems to be evaluated during caching, and not during install to node_modules.
#Mitigate this by resetting ~ to an empty directory
mkdir -pv "$tmpdir/home"
oldhome="$HOME"
export HOME="$tmpdir/home"
ln -s "$oldhome/.rustup" "$HOME"
tar -xzvvf "${oldwd}/element-desktop-${version}.tar.gz"
cd element-desktop-${version}
#These patches change results of things we want to execute below
patch -p1 --verbose < "${oldwd}/hak-remove-devdependencies.patch"
changes=$(grep "^Changes in \[$last_packaged_version\]" -B10000 CHANGELOG.md | head -n -2 | sed -e '/^==*$/d' -e 's/Changes in \[\([^\[]*\)\].*/Version \1/' -e 's/^\([^-].*\)$/ \1/' -e 's/\[.*\](\(.*\))/\1/g' -e 's/^ *Version /Version /g')
# This will vendor the packages but not execute any build scripts (but see caveat about caching above)
yarn install --frozen-lockfile --ignore-engines --ignore-platform --ignore-scripts --link-duplicates
export PATH="$PATH:node_modules/.bin"
#hak does not have version pinning, which is terrible.
#Therefore we manually pin the minimum versions specified in package.json
jq '.hakDependencies[]|= sub("^\\^";"";"i")' <package.json > package.json.new
diff --color=always -bup package.json{,.new} || true
mv package.json{.new,}
yarn run hak fetch
# prefetch cargo crates
pushd .hak/hakModules/matrix-seshat
mkdir -pv .cargo
cargo vendor-filterer --platform='*-unknown-linux-gnu' --platform='*-unknown-linux-gnueabihf' --all-features > .cargo/config
#remove vendored libraries
rm -rf vendor/openssl-src/openssl
popd
#Remove non-free binaries, starting with a few common file extensions
find . -name '*.node' -print -delete
find . -name '*.jar' -print -delete
find . -name '*.dll' -print -delete
find . -name '*.exe' -print -delete
find . -name '*.dylib' -print -delete
find . -name '*.so' -print -delete
find . -name '*.o' -print -delete
find . -name '*.a' -print -delete
find . -name '*.wasm' -print -delete
#now detect the rest. This should catch all ELFs that may be executed. We use sponge to avoid a race condition between find and rm
find . -type f| sponge |\
xargs -P"$(nproc)" -- sh -c 'file -S "$@" | grep -v '\'': .*script'\'' | grep '\'': .*executable'\'' | tee /dev/stderr | sed '\''s/: .*//'\'' | xargs rm -fv'
rm -f "${oldwd}/vendor.tar.zst"
ZSTD_CLEVEL=19 ZSTD_NBTHREADS=$(nproc) tar --zstd --sort=name -Scf "${oldwd}/vendor.tar.zst" .hak node_modules
cd "$oldwd"
echo rm -rf "$tmpdir"
echo -e "\n\nDONE creating npm offline dependencies archive 'vendor.tar.zst'"
read -p "Write changes?"
export HOME="$oldhome"
osc vc -m "${changes}" element-desktop.changes
dos2unix element-desktop.changes
+27
View File
@@ -0,0 +1,27 @@
It is impossible to monkeypatch a shared copy of Electron, and in current versions of the nodejs-electron package
we intentionally fail the build of any app which tries to do this to alert the packager.
One problematic fuse which may break user data compatibility with upstream binaries is cookie encryption.
If a user runs an app with fused electron and then with unfused one, their cookies will get deleted.
OBSERVATION(dziobian):
Element creates a cookies sqlite database on startup but seems to never write anything to it.
Deleting the database manually seemed to have no effect.
--- a/node_modules/app-builder-lib/out/platformPackager.js 2025-03-04 14:50:55.947549645 +0000
+++ b/node_modules/app-builder-lib/out/platformPackager.js 2025-03-04 14:51:16.443755655 +0000
@@ -261,7 +261,6 @@
const isAsar = asarOptions != null;
await this.sanityCheckPackage(appOutDir, isAsar, framework, !!this.config.disableSanityCheckAsar);
if (!(options === null || options === void 0 ? void 0 : options.disableFuses)) {
- await this.doAddElectronFuses(packContext);
}
if ((_a = options === null || options === void 0 ? void 0 : options.sign) !== null && _a !== void 0 ? _a : true) {
await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets);
@@ -696,4 +695,4 @@
function capitalizeFirstLetter(text) {
return text.charAt(0).toUpperCase() + text.slice(1);
}
-//# sourceMappingURL=platformPackager.js.map
\ No newline at end of file
+//# sourceMappingURL=platformPackager.js.map
BIN
View File
Binary file not shown.