From fca1aca1627c0748113cd16b9e20f0c6916781cb250ce3581b3077780cfb2b15 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Thu, 17 Mar 2022 16:02:09 +0000 Subject: [PATCH] Accepting request 962471 from devel:languages:javascript - Version 1.10.4 * Improved build process: Perform actual build in OBS OBS-URL: https://build.opensuse.org/request/show/962471 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/element-desktop?expand=0&rev=10 --- dist.tar.gz | 3 -- electron-builder-offline-cache.tar.gz | 3 ++ element-desktop-1.10.4.tar.gz | 3 ++ element-desktop-1.9.9.tar.gz | 3 -- element-desktop.changes | 6 +++ element-desktop.sh | 4 +- element-desktop.spec | 47 +++++++++++++++------- element-web-1.10.4.tar.gz | 3 ++ element-web-1.9.9.tar.gz | 3 -- npm-packages-offline-cache.tar.gz | 3 ++ prepare.sh | 56 +++++++++++++++++++++++++++ prepare_tarball.sh | 34 ---------------- 12 files changed, 109 insertions(+), 59 deletions(-) delete mode 100644 dist.tar.gz create mode 100644 electron-builder-offline-cache.tar.gz create mode 100644 element-desktop-1.10.4.tar.gz delete mode 100644 element-desktop-1.9.9.tar.gz create mode 100644 element-web-1.10.4.tar.gz delete mode 100644 element-web-1.9.9.tar.gz create mode 100644 npm-packages-offline-cache.tar.gz create mode 100644 prepare.sh delete mode 100644 prepare_tarball.sh diff --git a/dist.tar.gz b/dist.tar.gz deleted file mode 100644 index 34e1d5f..0000000 --- a/dist.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:caed9f48182d74bc2b3b4da15ba4635f80d39be7dbb5459f161a4bba7fb48ca8 -size 15601868 diff --git a/electron-builder-offline-cache.tar.gz b/electron-builder-offline-cache.tar.gz new file mode 100644 index 0000000..f69d0b7 --- /dev/null +++ b/electron-builder-offline-cache.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89bb1e7a89299c701ece2751bb625569efa53d24c30dd609c2abc28da596a0d7 +size 14206703 diff --git a/element-desktop-1.10.4.tar.gz b/element-desktop-1.10.4.tar.gz new file mode 100644 index 0000000..f43fb43 --- /dev/null +++ b/element-desktop-1.10.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3e4e9cb39ef9fdcdb3b83b842853e2ed52944b3caf68dfc5cd5642ac985eeaa +size 1939488 diff --git a/element-desktop-1.9.9.tar.gz b/element-desktop-1.9.9.tar.gz deleted file mode 100644 index a639382..0000000 --- a/element-desktop-1.9.9.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ecb82883ea3ff803b155bb89a96b44feccd91ca9c873bc549cd28834a99dbe2 -size 1926733 diff --git a/element-desktop.changes b/element-desktop.changes index d5a2ac2..ca77724 100644 --- a/element-desktop.changes +++ b/element-desktop.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 17 13:00:11 UTC 2022 - Dominik Heidler + +- Version 1.10.4 + * Improved build process: Perform actual build in OBS + ------------------------------------------------------------------- Mon Jan 31 15:12:30 UTC 2022 - Dominik Heidler diff --git a/element-desktop.sh b/element-desktop.sh index a57aeb3..d52fda8 100644 --- a/element-desktop.sh +++ b/element-desktop.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/bin/sh -electron /usr/lib/element/app.asar "$@" +exec electron /usr/share/element/app.asar "$@" diff --git a/element-desktop.spec b/element-desktop.spec index cef53be..129f554 100644 --- a/element-desktop.spec +++ b/element-desktop.spec @@ -17,22 +17,28 @@ Name: element-desktop -Version: 1.9.9 +Version: 1.10.4 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 -Source2: dist.tar.gz +Source2: npm-packages-offline-cache.tar.gz Source3: io.element.Element.desktop Source4: element-desktop.sh -Source5: prepare_tarball.sh -BuildRequires: element-web +Source5: prepare.sh +Source6: electron-builder-offline-cache.tar.gz +BuildRequires: element-web = %{version} BuildRequires: hicolor-icon-theme -BuildRequires: nodejs-electron -Requires: element-web +BuildRequires: jq +BuildRequires: moreutils +BuildRequires: nodejs-electron-devel +BuildRequires: yarn +Requires: element-web = %{version} Requires: nodejs-electron + +#Element contains no native code BuildArch: noarch %description @@ -40,7 +46,8 @@ A glossy Matrix collaboration client - desktop %prep %setup -q -sed -i 's@"electronVersion": "11.2.3"@"electronVersion": "12.0.4"@g' package.json +SYSTEM_ELECTRON_VERSION=$(<%{_libdir}/electron/version) +jq -c '.build["electronVersion"]="'$SYSTEM_ELECTRON_VERSION'" | .build["electronDist"]="%{_libdir}/electron"' < package.json | sponge package.json sed -i 's@"https://packages.riot.im/desktop/update/"@null@g' element.io/release/config.json pwd cd .. @@ -50,15 +57,27 @@ tar xvf %{SOURCE1} cd element-desktop-%{version} %build -# Unpack prepared (see prepare.sh) webapp -tar xvf %{SOURCE2} +echo 'yarn-offline-mirror "./npm-packages-offline-cache"' >> .yarnrc +echo 'nodedir %{_includedir}/electron' >> .yarnrc +tar xf %{SOURCE2} +ls ./npm-packages-offline-cache | head + +export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + +yarn install --offline --pure-lockfile + +tar xf %{SOURCE6} +export PATH="$PATH:node_modules/.bin" +export ELECTRON_BUILDER_CACHE="$(pwd)/electron-builder-offline-cache/" +#yarn run build:native +yarn run build %install -install -d %{buildroot}{%{_prefix}/lib/element/,%{_sysconfdir}/webapps/element} +install -d %{buildroot}{%{_datadir}/element/,%{_sysconfdir}/webapps/element} # Install the app content, replace the webapp with a symlink to the system package -cp -r dist/linux-unpacked/resources/* "%{buildroot}%{_prefix}/lib/element/" -ln -s %{_datadir}/webapps/element "%{buildroot}%{_prefix}/lib/element/webapp" +cp -r dist/linux-unpacked/resources/* "%{buildroot}%{_datadir}/element/" +ln -s %{_datadir}/webapps/element "%{buildroot}%{_datadir}/element/webapp" # Config file ln -s %{_sysconfdir}/element/config.json "%{buildroot}%{_sysconfdir}/webapps/element/config.json" @@ -79,8 +98,8 @@ done %files %license LICENSE %{_bindir}/%{name} -%{_prefix}/lib/element/ -%{_sysconfdir}/webapps/element/config.json +%{_datadir}/element/ +%config %{_sysconfdir}/webapps/element/config.json %{_datadir}/webapps/element/config.json %{_sysconfdir}/element/ %{_datadir}/applications/io.element.Element.desktop diff --git a/element-web-1.10.4.tar.gz b/element-web-1.10.4.tar.gz new file mode 100644 index 0000000..1bc4e2d --- /dev/null +++ b/element-web-1.10.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21036274ff3a2036d07415b193e57dde60b79abda9f2dc8d5594a879c0c5f488 +size 1410632 diff --git a/element-web-1.9.9.tar.gz b/element-web-1.9.9.tar.gz deleted file mode 100644 index 31b2a51..0000000 --- a/element-web-1.9.9.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c6b7d848cae8d28cd11973f5d5f3eb81761f0044beb9b3d300bc3418e47709b -size 1402635 diff --git a/npm-packages-offline-cache.tar.gz b/npm-packages-offline-cache.tar.gz new file mode 100644 index 0000000..d7835fb --- /dev/null +++ b/npm-packages-offline-cache.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c32455d97e7ba05a6ca5cb76021cb7bf61decb523abdd49e3651f3f56dc45e6 +size 140695670 diff --git a/prepare.sh b/prepare.sh new file mode 100644 index 0000000..4bdfbb4 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +set -ex + +oldwd="$(pwd)" +tmpdir="$(mktemp -d)" + +#zypper install yarn cargo gcc-c++ sqlcipher-devel libsecret-devel + +version=$(grep "Version:" element-desktop.spec | awk '{print $2}') +wget -c https://github.com/vector-im/element-desktop/archive/v${version}.tar.gz -O element-desktop-${version}.tar.gz +wget -c https://github.com/vector-im/element-web/archive/v${version}.tar.gz -O element-web-${version}.tar.gz +#cp element-desktop.spec "$tmpdir/" +#cd "$tmpdir" + +rm -rf "element-desktop-${version}" +wget -c https://github.com/vector-im/element-desktop/archive/v${version}.tar.gz -O element-desktop-${version}.tar.gz +tar xzvf element-desktop-${version}.tar.gz +cd element-desktop-${version} + +sed -i 's@"electronVersion": "11.2.3"@"electronVersion": "13.1.2"@g' package.json +sed -i 's@"https://packages.riot.im/desktop/update/"@null@g' element.io/release/config.json + +echo 'yarn-offline-mirror "./npm-packages-offline-cache"' > .yarnrc +yarn cache clean +rm -rf node_modules/ +yarn install --pure-lockfile || : # this will download tha packages into the offline cache + +mkdir -p electron-builder-offline-cache +export ELECTRON_BUILDER_CACHE="$(pwd)/electron-builder-offline-cache/" +yarn run build + +tar czf npm-packages-offline-cache.tar.gz ./npm-packages-offline-cache +cp npm-packages-offline-cache.tar.gz "$oldwd/" + +tar czf electron-builder-offline-cache.tar.gz ./electron-builder-offline-cache/ +cp electron-builder-offline-cache.tar.gz "$oldwd/" +cd "$oldwd" +echo rm -rf "$tmpdir" +echo -e "\n\nDONE creating npm dependency offline cache file 'npm-packages-offline-cache.tar.gz'" + + + + + +#yarn install +#export PATH="$PATH:node_modules/.bin" +#yarn run build:native +#yarn run build +#tar czvf ../dist.tar.gz dist/linux-unpacked/resources/ +#cd .. +#cp dist.tar.gz "$oldwd/" +#cd "$oldwd" +#rm -rf "$tmpdir" +#rm -rf "element-desktop-${version}" +#echo -e "\n\nDONE creating output file 'dist.tar.gz'" diff --git a/prepare_tarball.sh b/prepare_tarball.sh deleted file mode 100644 index 0c62ab9..0000000 --- a/prepare_tarball.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -ex - -oldwd="$(pwd)" -tmpdir="$(mktemp -d)" - -#zypper install yarn cargo gcc-c++ sqlcipher-devel libsecret-devel - -version=$(grep "Version:" element-desktop.spec | awk '{print $2}') -wget -c https://github.com/vector-im/element-desktop/archive/v${version}.tar.gz -O element-desktop-${version}.tar.gz -wget -c https://github.com/vector-im/element-web/archive/v${version}.tar.gz -O element-web-${version}.tar.gz -cp element-desktop.spec "$tmpdir/" -cd "$tmpdir" - -rm -rf "element-desktop-${version}" -wget -c https://github.com/vector-im/element-desktop/archive/v${version}.tar.gz -O element-desktop-${version}.tar.gz -tar xzvf element-desktop-${version}.tar.gz -cd element-desktop-${version} - -sed -i 's@"electronVersion": "11.2.3"@"electronVersion": "13.1.2"@g' package.json -sed -i 's@"https://packages.riot.im/desktop/update/"@null@g' element.io/release/config.json - -yarn install -export PATH="$PATH:node_modules/.bin" -yarn run build:native -yarn run build -tar czvf ../dist.tar.gz dist/linux-unpacked/resources/ -cd .. -cp dist.tar.gz "$oldwd/" -cd "$oldwd" -rm -rf "$tmpdir" -#rm -rf "element-desktop-${version}" -echo -e "\n\nDONE creating output file 'dist.tar.gz'"