SHA256
1
0
forked from pool/element-web

Accepting request 1061550 from home:gladiac:branches:devel:languages:nodejs

- Fixed webpack with OpenSSL3
  * Added webpack-fix-openssl3.patch
- Fixed building for Fedora
- Some spec file cleanup

OBS-URL: https://build.opensuse.org/request/show/1061550
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-web?expand=0&rev=33
This commit is contained in:
Dominik Heidler 2023-01-30 14:51:29 +00:00 committed by Git OBS Bridge
parent dd37ba99b2
commit 84fdcba352
4 changed files with 50 additions and 20 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Jan 27 12:21:26 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
- Fixed webpack with OpenSSL3
* Added webpack-fix-openssl3.patch
- Fixed building for Fedora
- Some spec file cleanup
-------------------------------------------------------------------
Fri Jan 20 13:12:45 UTC 2023 - Dominik Heidler <dheidler@suse.de>

View File

@ -27,26 +27,27 @@ Source1: npm-packages-offline-cache.tar.gz
Source2: jitsi_external_api.min.js
Source3: prepare.sh
Patch0: fix-webpack-oom.patch
Patch1: webpack-fix-openssl3.patch
BuildRequires: yarn
BuildRequires: nodejs18
BuildRequires: nodejs-packaging
BuildRequires: fdupes
BuildArch: noarch
%description
A glossy Matrix collaboration client - web files
%prep
%autosetup -n element-web-%{version} -p0
%autosetup -n element-web-%{version} -a1 -p1
%build
echo 'yarn-offline-mirror "./npm-packages-offline-cache"' > .yarnrc
tar xf %{SOURCE1}
ls ./npm-packages-offline-cache | head
ls -l ./npm-packages-offline-cache | head
# fix some strange dependency
cd ./npm-packages-offline-cache
cp matrix-analytics-events-0.0.1.tgz @matrix-analytics-events-0.0.1.tgz
cd ..
ls ./npm-packages-offline-cache | grep matrix-analytics-events
cp npm-packages-offline-cache/matrix-analytics-events-0.0.1.tgz \
npm-packages-offline-cache/@matrix-analytics-events-0.0.1.tgz
ls -l ./npm-packages-offline-cache/*matrix-analytics-events*
sed -i -e 's| matrix-analytics-events "github:matrix-org/matrix-analytics-events.git#[^"]*"| matrix-analytics-events "^0.0.1"|' yarn.lock
sed -i -e 's|"matrix-analytics-events@github:matrix-org/matrix-analytics-events#[^"]*"|matrix-analytics-events@^0.0.1|' yarn.lock
@ -58,24 +59,27 @@ echo 'return;' > scripts/build-jitsi.js
DIST_VERSION=%{version} ./scripts/package.sh
cd dist
pushd dist || exit 1
tar xf element-%{version}.tar.gz
cd element-%{version}
cp ../../LICENSE ./
popd
cp LICENSE dist/element-%{version}/LICENSE
%install
cd dist
cd element-%{version}
install -d %{buildroot}/{usr/share/webapps,etc/webapps}/element
install -d -m 0755 %{buildroot}/usr/share/webapps/element
cp -r * "%{buildroot}%{_datadir}/webapps/element/"
install -Dm644 config.sample.json -t "%{buildroot}%{_sysconfdir}/webapps/element/"
cp -av dist/element-%{version}/* "%{buildroot}%{_datadir}/webapps/element/"
install -d -m 0755 %{buildroot}%{_sysconfdir}/webapps/element/
install -m 0644 config.sample.json "%{buildroot}%{_sysconfdir}/webapps/element/config.sample.json"
%fdupes %{buildroot}%{_datadir}/webapps/element/
%files
%license LICENSE
%dir %{_datadir}/webapps
%dir %{_sysconfdir}/webapps
%{_datadir}/webapps/element
%{_sysconfdir}/webapps/element
%dir %{_sysconfdir}/webapps
%dir %{_sysconfdir}/webapps/element
%config %{_sysconfdir}/webapps/element/config.sample.json
%changelog

View File

@ -1,5 +1,7 @@
--- package.json 2022-09-28 15:22:49.000000000 +0200
+++ package.json 2022-12-23 11:10:18.838569341 +0100
Index: element-web-1.11.20/package.json
===================================================================
--- element-web-1.11.20.orig/package.json 2023-01-20 13:52:01.000000000 +0100
+++ element-web-1.11.20/package.json 2023-01-27 13:02:23.452017454 +0100
@@ -37,7 +37,7 @@
"build:res": "node scripts/copy-res.js",
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",

View File

@ -0,0 +1,16 @@
Index: element-web-1.11.20/webpack.config.js
===================================================================
--- element-web-1.11.20.orig/webpack.config.js 2023-01-20 13:52:01.000000000 +0100
+++ element-web-1.11.20/webpack.config.js 2023-01-27 13:16:14.405927597 +0100
@@ -1,5 +1,11 @@
/* eslint-disable quote-props */
+// HACK: OpenSSL 3 does not support md4 any more, but webpack hardcodes it all
+// over the place: https://github.com/webpack/webpack/issues/13572
+const crypto = require("crypto");
+const crypto_orig_createHash = crypto.createHash;
+crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
+
const dotenv = require("dotenv");
const path = require("path");
const webpack = require("webpack");