]> git.t-rg.ws Git - slackbuilds.git/commitdiff
element-desktop: added
authorfsLeg <fsleg@t-rg.ws>
Sun, 10 Aug 2025 21:29:38 +0000 (00:29 +0300)
committerfsLeg <fsleg@t-rg.ws>
Sun, 10 Aug 2025 21:29:38 +0000 (00:29 +0300)
element-desktop/README [new file with mode: 0644]
element-desktop/autolaunch.patch [new file with mode: 0644]
element-desktop/doinst.sh [new file with mode: 0644]
element-desktop/element-desktop.SlackBuild [new file with mode: 0644]
element-desktop/element-desktop.desktop [new file with mode: 0644]
element-desktop/element-desktop.info [new file with mode: 0644]
element-desktop/element-desktop.sh [new file with mode: 0644]
element-desktop/no-fetching-hak.patch [new file with mode: 0644]
element-desktop/slack-desc [new file with mode: 0644]

diff --git a/element-desktop/README b/element-desktop/README
new file mode 100644 (file)
index 0000000..da0a185
--- /dev/null
@@ -0,0 +1,11 @@
+Secure and independent communication, connected via Matrix.
+
+Choose where your data is kept, or host it yourself, instead of being
+forced to use the app’s own server.
+
+End-to-end encrypted by default.
+
+Element is only available as a 64 bit program. 32 bit is unsupported.
+
+Warning: building requires over 5 GB of space. If you're hard-pressed
+on space, consider setting TMP to something other than /tmp.
diff --git a/element-desktop/autolaunch.patch b/element-desktop/autolaunch.patch
new file mode 100644 (file)
index 0000000..e116dca
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/electron-main.ts     2025-07-30 17:41:30.000000000 +0300
++++ b/src/electron-main.ts     2025-08-09 23:51:20.531971598 +0300
+@@ -253,6 +253,7 @@
+     global.launcher = new AutoLaunch({
+         name: global.vectorConfig.brand || "Element",
+         isHidden: true,
++        path: "/usr/bin/element-desktop",
+         mac: {
+             useLaunchAgent: true,
+         },
diff --git a/element-desktop/doinst.sh b/element-desktop/doinst.sh
new file mode 100644 (file)
index 0000000..7d010b5
--- /dev/null
@@ -0,0 +1,12 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+# If other icon themes are installed, then add to/modify this as needed
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+  if [ -x /usr/bin/gtk-update-icon-cache ]; then
+    /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
+  fi
+fi
+
+
diff --git a/element-desktop/element-desktop.SlackBuild b/element-desktop/element-desktop.SlackBuild
new file mode 100644 (file)
index 0000000..7499af3
--- /dev/null
@@ -0,0 +1,164 @@
+#!/bin/bash
+
+# Slackware build script for element-desktop
+
+# Copyright 2025 Vladislav 'fsLeg' Borisov, Moscow, Russia
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
+#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=element-desktop
+WEBNAM=element-web
+VERSION=${VERSION:-1.11.108}
+BUILD=${BUILD:-1}
+TAG=${TAG:-fsleg}
+PKGTYPE=${PKGTYPE:-txz}
+
+if [ -z "$ARCH" ]; then
+  case "$( uname -m )" in
+    i?86) ARCH=i586 ;;
+    arm*) ARCH=arm ;;
+       *) ARCH=$( uname -m ) ;;
+  esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+  exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then
+  echo
+  echo "*************************************************************"
+  echo "Element-desktop relies on Electron which doesn't support"
+  echo "x86 architecture anymore, therefore it can't be built on"
+  echo "an x86 system."
+  echo "*************************************************************"
+  echo
+  exit 1
+elif [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
+  SLKCFLAGS="-O2 -fPIC"
+  LIBDIRSUFFIX="64"
+else
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
+fi
+
+set -e
+
+RUST_PLATFORM=$(rustc -Vv | awk '/host/ {print $2}')
+
+export PATH="/opt/rust/bin:$PATH"
+if [ -z "$LD_LIBRARY_PATH" ]; then
+  export LD_LIBRARY_PATH="/opt/rust/lib$LIBDIRSUFFIX"
+else
+  export LD_LIBRARY_PATH="/opt/rust/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH"
+fi
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
+export npm_config_nodedir="/usr"
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION $WEBNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$WEBNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION-vendored-sources.tar
+
+cd $WEBNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+  -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+YARN_CACHE_FOLDER="$(pwd)/cache" \
+YARN_YARN_OFFLINE_MIRROR="$(pwd)/vendor" \
+yarn install --frozen-lockfile --ignore-engines --no-fund --update-checksums --offline
+sed -i 's|yarn |yarn --offline |g' package.json
+VERSION=$VERSION \
+YARN_CACHE_FOLDER="$(pwd)/cache" \
+npm_config_cache="$(pwd)/cache"
+  yarn --offline build
+
+cd ../$PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+  -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+export YARN_CACHE_FOLDER="$(pwd)/cache"
+export YARN_YARN_OFFLINE_MIRROR="$(pwd)/vendor"
+export npm_config_cache="$(pwd)/cache"
+export XDG_CACHE_HOME=$YARN_CACHE_FOLDER
+# https://gitlab.archlinux.org/archlinux/packaging/packages/element.io/-/blob/main/autolaunch.patch
+patch -p1 < $CWD/autolaunch.patch
+patch -p1 < $CWD/no-fetching-hak.patch
+sed -i 's|"target": "deb"|"target": "dir"|' package.json
+sed -i 's|"https://packages.element.io/desktop/update/"|null|' element.io/release/config.json
+mkdir -p deploys
+mv ../$WEBNAM-$VERSION/webapp deploys/element-v$VERSION
+yarn install --frozen-lockfile --ignore-engines --no-fund --update-checksums --offline
+sed -i 's|yarn |yarn --offline |g' package.json
+#sed -i 's|yarn \-\-offline run hak|yarn run hak|' package.json
+yarn --offline run fetch --noverify --cfgdir ""
+RUSTFLAGS="-C target-cpu=native" \
+CARGO_HOME="$TMP/$PRGNAM-$VERSION/.hak/matrix-seshat/$RUST_PLATFORM/build/.cargo" \
+YARN_YARN_OFFLINE_MIRROR="$TMP/$PRGNAM-$VERSION/.hak/matrix-seshat/$RUST_PLATFORM/build/yarn-vendor" \
+  yarn --offline run build:native
+# electron-builder fails if it can't upload the artifact to GitHub for which it requires a GitHub Token
+# all building is done by that point, so we just continue with packaging
+yarn --offline run build || true
+
+mkdir -p $PKG/usr/{bin,lib$LIBDIRSUFFIX,share/applications}
+mv dist/linux-unpacked $PKG/usr/lib$LIBDIRSUFFIX/element-desktop
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+install -Dm644 $CWD/element-desktop.desktop $PKG/usr/share/applications/io.element.Element.desktop
+install -Dm755 $CWD/element-desktop.sh $PKG/usr/bin/element-desktop
+sed -i "s|@LIBDIRSUFFIX@|$LIBDIRSUFFIX|" $PKG/usr/bin/element-desktop
+
+# 32x32 icon is missing for some reason
+magick build/icons/512x512.png -resize 32x32 build/icons/32x32.png
+for geometry in 16x16 24x24 32x32 48x48 64x64 96x96 128x128 256x256 512x512; do
+  mkdir -p $PKG/usr/share/icons/hicolor/$geometry/apps
+  install -Dm644 build/icons/$geometry.png $PKG/usr/share/icons/hicolor/$geometry/apps/$PRGNAM.png
+done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CHANGELOG.md CONTRIBUTING.md README.md LICENSE-* docs/* $PKG/usr/doc/$PRGNAM-$VERSION/
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/element-desktop/element-desktop.desktop b/element-desktop/element-desktop.desktop
new file mode 100644 (file)
index 0000000..2a3faeb
--- /dev/null
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Element
+Exec=/usr/bin/element-desktop %U
+Terminal=false
+Type=Application
+Icon=element-desktop
+StartupWMClass=Element
+Comment=Element: the future of secure communication
+MimeType=x-scheme-handler/io.element.desktop;x-scheme-handler/element;
+Categories=Network;InstantMessaging;Chat;
diff --git a/element-desktop/element-desktop.info b/element-desktop/element-desktop.info
new file mode 100644 (file)
index 0000000..ed4c345
--- /dev/null
@@ -0,0 +1,12 @@
+PRGNAM="element-desktop"
+VERSION="1.11.108"
+HOMEPAGE="https://element.io/"
+DOWNLOAD="UNSUPPORTED"
+MD5SUM=""
+DOWNLOAD_x86_64="https://github.com/element-hq/element-desktop/archive/v1.11.108/element-desktop-1.11.108.tar.gz \
+                 https://github.com/element-hq/element-web/archive/v1.11.108/element-web-1.11.108.tar.gz"
+MD5SUM_x86_64="c9f703e2983abf98cdc9172dd046da85 \
+               72560cdea08e8ab4fd1745ac8d96e1d8"
+REQUIRES="sqlcipher yarn rust-opt"
+MAINTAINER="Vladislav 'fsLeg' Borisov"
+EMAIL="fsleg@t-rg.ws"
diff --git a/element-desktop/element-desktop.sh b/element-desktop/element-desktop.sh
new file mode 100644 (file)
index 0000000..56b2d7d
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec /usr/lib@LIBDIRSUFFIX@/element-desktop/element-desktop "$@"
diff --git a/element-desktop/no-fetching-hak.patch b/element-desktop/no-fetching-hak.patch
new file mode 100644 (file)
index 0000000..9bbf4f9
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/scripts/hak/fetch.ts     2025-07-30 17:41:30.000000000 +0300
++++ b/scripts/hak/fetch.ts     2025-08-10 20:00:44.506272030 +0300
+@@ -31,7 +31,7 @@
+     });
+     console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
+-    await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], {
++    await hakEnv.spawn("yarn", ["install", "--offline", "--ignore-scripts"], {
+         cwd: moduleInfo.moduleBuildDir,
+     });
diff --git a/element-desktop/slack-desc b/element-desktop/slack-desc
new file mode 100644 (file)
index 0000000..1eb0c31
--- /dev/null
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+               |-----handy-ruler------------------------------------------------------|
+element-desktop: element-desktop (secure and independent communication via Matrix)
+element-desktop:
+element-desktop: Element lets you choose where your messages are stored, putting you
+element-desktop: in control of your data.
+element-desktop:
+element-desktop: Secure and end-to-end encrypted. Built on Matrix.
+element-desktop:
+element-desktop:
+element-desktop: Homepage: https://element.io/
+element-desktop:
+element-desktop: