2021-06-29 22:42:57 +02:00
|
|
|
#
|
|
|
|
# spec file for package element-desktop
|
|
|
|
#
|
2023-01-20 14:16:08 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2021-06-29 22:42:57 +02:00
|
|
|
#
|
|
|
|
# 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
|
2024-02-01 11:01:55 +01:00
|
|
|
Version: 1.11.57
|
2021-06-29 22:42:57 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: A glossy Matrix collaboration client - desktop
|
|
|
|
License: Apache-2.0
|
|
|
|
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
|
|
|
|
Source1: https://github.com/vector-im/element-web/archive/v%{version}.tar.gz#/element-web-%{version}.tar.gz
|
2022-03-17 17:02:09 +01:00
|
|
|
Source2: npm-packages-offline-cache.tar.gz
|
2021-06-29 22:42:57 +02:00
|
|
|
Source3: io.element.Element.desktop
|
|
|
|
Source4: element-desktop.sh
|
2022-03-17 17:02:09 +01:00
|
|
|
Source5: prepare.sh
|
2023-06-15 15:20:54 +02:00
|
|
|
Source6: hak.tar.gz
|
2022-03-17 17:02:09 +01:00
|
|
|
BuildRequires: element-web = %{version}
|
2023-06-07 11:54:36 +02:00
|
|
|
BuildRequires: fdupes
|
2021-06-29 22:42:57 +02:00
|
|
|
BuildRequires: hicolor-icon-theme
|
2022-03-17 17:02:09 +01:00
|
|
|
BuildRequires: jq
|
|
|
|
BuildRequires: moreutils
|
|
|
|
BuildRequires: nodejs-electron-devel
|
|
|
|
BuildRequires: yarn
|
2023-06-15 15:20:54 +02:00
|
|
|
BuildRequires: rust
|
|
|
|
BuildRequires: cargo
|
|
|
|
BuildRequires: python3
|
|
|
|
BuildRequires: sqlcipher-devel
|
|
|
|
BuildRequires: libsecret-devel
|
|
|
|
BuildRequires: gcc-c++
|
2024-01-18 16:32:20 +01:00
|
|
|
BuildRequires: ccache
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
BuildRequires: asar
|
2022-03-17 17:02:09 +01:00
|
|
|
Requires: element-web = %{version}
|
2021-06-29 22:42:57 +02:00
|
|
|
Requires: nodejs-electron
|
2023-06-07 11:54:36 +02:00
|
|
|
%if 0%{?suse_version} <= 1540
|
|
|
|
BuildRequires: nodejs18
|
|
|
|
%endif
|
2021-06-29 22:42:57 +02:00
|
|
|
|
2023-06-23 13:31:14 +02:00
|
|
|
# hak*.tar.gz only available for those architectures
|
|
|
|
ExclusiveArch: x86_64 aarch64
|
|
|
|
|
2021-06-29 22:42:57 +02:00
|
|
|
%description
|
|
|
|
A glossy Matrix collaboration client - desktop
|
|
|
|
|
|
|
|
%prep
|
2023-06-15 15:20:54 +02:00
|
|
|
%setup -q -a1 -a2 -a6
|
2023-02-06 16:10:15 +01:00
|
|
|
%autopatch -p1
|
2022-03-17 17:02:09 +01:00
|
|
|
SYSTEM_ELECTRON_VERSION=$(<%{_libdir}/electron/version)
|
|
|
|
jq -c '.build["electronVersion"]="'$SYSTEM_ELECTRON_VERSION'" | .build["electronDist"]="%{_libdir}/electron"' < package.json | sponge package.json
|
2022-03-18 16:42:34 +01:00
|
|
|
jq -c '.build["linux"]["target"]="dir"' < package.json | sponge package.json
|
|
|
|
cat package.json
|
|
|
|
jq '.piwik=false | .update_base_url=null' < element.io/release/config.json | sponge element.io/release/config.json
|
2021-06-29 22:42:57 +02:00
|
|
|
|
2023-06-15 15:20:54 +02:00
|
|
|
# build tools expect python3 interpreter behind "python"
|
|
|
|
mkdir -p $HOME/bin
|
|
|
|
ln -sf /usr/bin/python3 $HOME/bin/python
|
|
|
|
|
2023-06-23 13:31:14 +02:00
|
|
|
%ifarch aarch64
|
|
|
|
mv -v .hak/matrix-seshat/x86_64-unknown-linux-gnu .hak/matrix-seshat/aarch64-unknown-linux-gnu
|
|
|
|
mv -v .hak/keytar/x86_64-unknown-linux-gnu .hak/keytar/aarch64-unknown-linux-gnu
|
|
|
|
%endif
|
|
|
|
|
2021-06-29 22:42:57 +02:00
|
|
|
%build
|
2022-03-17 17:02:09 +01:00
|
|
|
echo 'yarn-offline-mirror "./npm-packages-offline-cache"' >> .yarnrc
|
|
|
|
echo 'nodedir %{_includedir}/electron' >> .yarnrc
|
|
|
|
|
|
|
|
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
|
2022-09-23 10:27:25 +02:00
|
|
|
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
2022-03-17 17:02:09 +01:00
|
|
|
|
|
|
|
yarn install --offline --pure-lockfile
|
|
|
|
|
2023-06-15 15:20:54 +02:00
|
|
|
export PATH="$(pwd)/node_modules/.bin:${HOME}/bin:${PATH}"
|
2022-03-18 16:42:34 +01:00
|
|
|
#export ELECTRON_BUILDER_CACHE="$(pwd)/electron-builder-offline-cache/"
|
2023-06-15 15:20:54 +02:00
|
|
|
|
|
|
|
yarn run hak build
|
|
|
|
yarn run hak copyandlink
|
|
|
|
|
|
|
|
yarn run build:native
|
2022-10-05 23:09:11 +02:00
|
|
|
yarn run build:universal
|
2021-06-29 22:42:57 +02:00
|
|
|
|
2024-01-18 16:32:20 +01:00
|
|
|
pushd dist/linux-universal-unpacked/resources/
|
|
|
|
# provide the app.asar.unpacked folder like pre 1.11.54
|
|
|
|
mkdir -p app.asar.unpacked/node_modules/keytar/build/Release/
|
|
|
|
asar ef app.asar .hak/hakModules/keytar/build/Release/keytar.node
|
|
|
|
mv keytar.node app.asar.unpacked/node_modules/keytar/build/Release/
|
|
|
|
|
|
|
|
mkdir -p app.asar.unpacked/node_modules/matrix-seshat/
|
|
|
|
asar ef app.asar .hak/hakModules/matrix-seshat/index.node
|
|
|
|
mv index.node app.asar.unpacked/node_modules/matrix-seshat/
|
|
|
|
|
|
|
|
# repackage the asar file with the pre 1.11.54 format
|
|
|
|
asar e app.asar app.asar.repak
|
|
|
|
cp -av app.asar.repak/.hak/hakModules/* app.asar.repak/node_modules/
|
|
|
|
asar p app.asar.repak/ app.asar
|
|
|
|
rm -r app.asar.repak/
|
|
|
|
popd
|
|
|
|
|
2021-06-29 22:42:57 +02:00
|
|
|
%install
|
|
|
|
# Install the app content, replace the webapp with a symlink to the system package
|
2023-02-06 16:10:15 +01:00
|
|
|
install -d -m 0755 "%{buildroot}%{_datadir}/element/"
|
|
|
|
cp -av dist/linux-universal-unpacked/resources/* "%{buildroot}%{_datadir}/element/"
|
2022-03-17 17:02:09 +01:00
|
|
|
ln -s %{_datadir}/webapps/element "%{buildroot}%{_datadir}/element/webapp"
|
2021-06-29 22:42:57 +02:00
|
|
|
|
2023-06-15 15:20:54 +02:00
|
|
|
# Install binaries to /usr/lib
|
|
|
|
install -d -m 0755 "%{buildroot}%{_prefix}/lib/element/"
|
|
|
|
install -m0755 dist/linux-universal-unpacked/resources/app.asar.unpacked/node_modules/keytar/build/Release/keytar.node "%{buildroot}%{_prefix}/lib/element/keytar.node"
|
|
|
|
install -m0755 dist/linux-universal-unpacked/resources/app.asar.unpacked/node_modules/matrix-seshat/index.node "%{buildroot}%{_prefix}/lib/element/matrix-seshat.node"
|
|
|
|
ln -sfv "%{_prefix}/lib/element/keytar.node" "%{buildroot}%{_datadir}/element/app.asar.unpacked/node_modules/keytar/build/Release/keytar.node"
|
|
|
|
ln -sfv "%{_prefix}/lib/element/matrix-seshat.node" "%{buildroot}%{_datadir}/element/app.asar.unpacked/node_modules/matrix-seshat/index.node"
|
|
|
|
|
2021-06-29 22:42:57 +02:00
|
|
|
# Config file
|
2023-02-06 16:10:15 +01:00
|
|
|
install -m 0755 -d %{buildroot}%{_sysconfdir}/element
|
|
|
|
install -m 0644 element.io/release/config.json "%{buildroot}%{_sysconfdir}/element/config.json"
|
|
|
|
|
|
|
|
install -m 0755 -d %{buildroot}%{_sysconfdir}/webapps/element
|
2021-06-29 22:42:57 +02:00
|
|
|
ln -s %{_sysconfdir}/element/config.json "%{buildroot}%{_sysconfdir}/webapps/element/config.json"
|
2023-02-06 16:10:15 +01:00
|
|
|
|
|
|
|
install -d -m 0755 "%{buildroot}%{_datadir}/webapps/element/"
|
|
|
|
ln -s %{_sysconfdir}/element/config.json "%{buildroot}%{_datadir}/webapps/element/config.json" # moved here from element-web to make symlink check happy
|
2021-06-29 22:42:57 +02:00
|
|
|
|
|
|
|
# Required extras
|
2023-02-06 16:10:15 +01:00
|
|
|
install -d -m 0755 "%{buildroot}%{_datadir}/applications/"
|
|
|
|
install -m 0644 %{SOURCE3} "%{buildroot}%{_datadir}/applications/io.element.Element.desktop"
|
|
|
|
install -d -m 0755 "%{buildroot}%{_bindir}/"
|
|
|
|
install -m 0755 %{SOURCE4} "%{buildroot}%{_bindir}/%{name}"
|
2021-06-29 22:42:57 +02:00
|
|
|
|
|
|
|
# Icons
|
2023-02-06 16:10:15 +01:00
|
|
|
install -d -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/"
|
|
|
|
install -m 0644 element-web-%{version}/res/themes/element/img/logos/element-logo.svg "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/io.element.Element.svg"
|
2021-06-29 22:42:57 +02:00
|
|
|
for i in 16 24 48 64 96 128 256 512; do
|
2023-02-06 16:10:15 +01:00
|
|
|
install -d -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/"
|
|
|
|
install -m 0644 build/icons/${i}x${i}.png "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/io.element.Element.png"
|
2021-06-29 22:42:57 +02:00
|
|
|
done
|
|
|
|
|
2023-02-06 16:10:15 +01:00
|
|
|
%fdupes %{buildroot}%{_datadir}
|
|
|
|
|
2021-06-29 22:42:57 +02:00
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/%{name}
|
2022-03-17 17:02:09 +01:00
|
|
|
%{_datadir}/element/
|
2023-06-15 15:20:54 +02:00
|
|
|
%{_prefix}/lib/element/
|
2023-02-06 16:10:15 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/element/config.json
|
|
|
|
%{_sysconfdir}/webapps/element/config.json
|
2021-06-29 22:42:57 +02:00
|
|
|
%{_datadir}/webapps/element/config.json
|
2023-06-16 12:02:26 +02:00
|
|
|
%dir %{_sysconfdir}/element/
|
2021-06-29 22:42:57 +02:00
|
|
|
%{_datadir}/applications/io.element.Element.desktop
|
|
|
|
%{_datadir}/icons/hicolor/scalable/apps/io.element.Element.svg
|
|
|
|
%{_datadir}/icons/hicolor/*/apps/io.element.Element.png
|
|
|
|
|
|
|
|
%changelog
|