Merge pull request #816 from omacom/slack-desktop-x86_64

Build slack-desktop for x86_64 too
This commit is contained in:
Ryan Hughes authored and GitHub committed 2026-10-05 19:15:47 -04:00
commit 69c8193e2a
2 files changed
+55 -26

No files matched your search

+53 -24
View File
@@ -2,13 +2,14 @@
pkgname=slack-desktop pkgname=slack-desktop
pkgver=4.52.171 pkgver=4.52.171
pkgrel=1 pkgrel=2
# Slack publishes Linux builds for x86_64 only. Its application code runs # Slack publishes Linux builds for x86_64 only, which this package installs
# unchanged on the AArch64 build of the Electron release it ships with; see # unchanged. On AArch64 the same application code runs on the AArch64 build
# README.md for the native modules that are replaced or dropped. # of the Electron release Slack ships with; see README.md for the native
# modules that are replaced or dropped there.
_electronver=44.4.5 _electronver=44.4.5
pkgdesc='Slack Desktop for Linux on a native AArch64 Electron runtime' pkgdesc='Slack Desktop for Linux'
arch=('aarch64') arch=('x86_64' 'aarch64')
url='https://slack.com/downloads' url='https://slack.com/downloads'
license=('custom') license=('custom')
depends=( depends=(
@@ -44,12 +45,14 @@ optdepends=(
'libappindicator-gtk3: Systray indicator support' 'libappindicator-gtk3: Systray indicator support'
'org.freedesktop.secrets: Keyring password store support' 'org.freedesktop.secrets: Keyring password store support'
) )
makedepends=('asar') makedepends_aarch64=('asar')
options=('!debug' '!strip') options=('!debug' '!strip')
source=( source=(
"slack-desktop-${pkgver}-amd64.deb::https://downloads.slack-edge.com/desktop-releases/linux/x64/${pkgver}/slack-desktop-${pkgver}-amd64.deb" "slack-desktop-${pkgver}-amd64.deb::https://downloads.slack-edge.com/desktop-releases/linux/x64/${pkgver}/slack-desktop-${pkgver}-amd64.deb"
"electron-v${_electronver}-linux-arm64.zip::https://github.com/electron/electron/releases/download/v${_electronver}/electron-v${_electronver}-linux-arm64.zip"
'slack.desktop' 'slack.desktop'
)
source_aarch64=(
"electron-v${_electronver}-linux-arm64.zip::https://github.com/electron/electron/releases/download/v${_electronver}/electron-v${_electronver}-linux-arm64.zip"
'slack-desktop-utils.js' 'slack-desktop-utils.js'
'file-handler-info.js' 'file-handler-info.js'
'electron-native-auth.js' 'electron-native-auth.js'
@@ -59,11 +62,11 @@ noextract=(
"electron-v${_electronver}-linux-arm64.zip" "electron-v${_electronver}-linux-arm64.zip"
) )
sha256sums=('c6199816e6d842289869a9e84a05042af6e0de68959df7a15e7273873b86dc36' sha256sums=('c6199816e6d842289869a9e84a05042af6e0de68959df7a15e7273873b86dc36'
'3bf0acab49c4ea3c9283cdb86bf3dd7204bd52a6fba6c8ae51101bdba2adae0e' 'e438e78265f3e566990300946afb4ea5d09bcd8c426738ab8f486ae9ddb86c0f')
'e438e78265f3e566990300946afb4ea5d09bcd8c426738ab8f486ae9ddb86c0f' sha256sums_aarch64=('3bf0acab49c4ea3c9283cdb86bf3dd7204bd52a6fba6c8ae51101bdba2adae0e'
'6de40409af5a04605c3287cb3c661132eb55a4f636f7cd9bbfd456f4adf41971' '6de40409af5a04605c3287cb3c661132eb55a4f636f7cd9bbfd456f4adf41971'
'a2a8fd45daa4f493ad4487da9f01477233feecfef360ed366bfb0a58f804890a' 'a2a8fd45daa4f493ad4487da9f01477233feecfef360ed366bfb0a58f804890a'
'9cd53c84fdc407c83f2ca6e9485916296f3712b2742dcc0acf22fda5195ead50') '9cd53c84fdc407c83f2ca6e9485916296f3712b2742dcc0acf22fda5195ead50')
# x86_64 addons in Slack's app that can never load on AArch64. The three that # x86_64 addons in Slack's app that can never load on AArch64. The three that
# Slack requires on Linux are replaced by the JavaScript files above; the rest # Slack requires on Linux are replaced by the JavaScript files above; the rest
@@ -82,9 +85,10 @@ _x86_addons=(
prepare() { prepare() {
rm -rf slack electron app rm -rf slack electron app
mkdir slack electron mkdir slack
bsdtar -O -xf "slack-desktop-${pkgver}-amd64.deb" 'data.tar.*' | bsdtar -C slack -xf - bsdtar -O -xf "slack-desktop-${pkgver}-amd64.deb" 'data.tar.*' | bsdtar -C slack -xf -
bsdtar -C electron -xf "electron-v${_electronver}-linux-arm64.zip"
[[ $CARCH == aarch64 ]] || return 0
local slack_electron local slack_electron
slack_electron=$(<slack/usr/lib/slack/version) slack_electron=$(<slack/usr/lib/slack/version)
@@ -94,16 +98,17 @@ prepare() {
return 1 return 1
fi fi
mkdir electron
bsdtar -C electron -xf "electron-v${_electronver}-linux-arm64.zip"
# Electron loads resources/app ahead of app.asar, so the extracted tree can # Electron loads resources/app ahead of app.asar, so the extracted tree can
# carry the replacement modules without repacking the archive. # carry the replacement modules without repacking the archive.
asar extract slack/usr/lib/slack/resources/app.asar app asar extract slack/usr/lib/slack/resources/app.asar app
} }
package() { _install_aarch64_runtime() {
local lib="$pkgdir/usr/lib/slack" local lib=$1
local app="$lib/resources/app" local app="$lib/resources/app"
install -d "$lib"
cp -a --no-preserve=ownership electron/. "$lib/" cp -a --no-preserve=ownership electron/. "$lib/"
mv "$lib/electron" "$lib/slack" mv "$lib/electron" "$lib/slack"
rm -f "$lib/resources/default_app.asar" "$lib/LICENSE" rm -f "$lib/resources/default_app.asar" "$lib/LICENSE"
@@ -128,15 +133,34 @@ package() {
for addon in "${_x86_addons[@]}"; do for addon in "${_x86_addons[@]}"; do
rm -f "$app/node_modules/$addon" rm -f "$app/node_modules/$addon"
done done
}
package() {
local lib="$pkgdir/usr/lib/slack"
local expected_machine
install -d "$lib"
case "$CARCH" in
x86_64)
cp -a --no-preserve=ownership slack/usr/lib/slack/. "$lib/"
rm -f "$lib/LICENSE"
rm -rf "$lib/src"
expected_machine='Advanced Micro Devices X86-64'
;;
aarch64)
_install_aarch64_runtime "$lib" || return 1
expected_machine=AArch64
;;
esac
local file machine local file machine
while IFS= read -r -d '' file; do while IFS= read -r -d '' file; do
machine=$(readelf -h "$file" 2>/dev/null | machine=$(readelf -h "$file" 2>/dev/null |
sed -n 's/^[[:space:]]*Machine:[[:space:]]*//p') sed -n 's/^[[:space:]]*Machine:[[:space:]]*//p')
case "$machine" in if [[ -n $machine && $machine != "$expected_machine" ]]; then
'' | AArch64) ;; error "Unexpected ${machine} binary: ${file#"$pkgdir"}"
*) error "Unexpected ${machine} binary: ${file#"$pkgdir"}"; return 1 ;; return 1
esac fi
done < <(find "$lib" -type f -print0) done < <(find "$lib" -type f -print0)
find "$lib" -type d -exec chmod 755 {} + find "$lib" -type d -exec chmod 755 {} +
@@ -155,6 +179,11 @@ package() {
install -Dm644 slack/usr/lib/slack/LICENSE "$licenses/LICENSE" install -Dm644 slack/usr/lib/slack/LICENSE "$licenses/LICENSE"
install -Dm644 slack/usr/share/doc/slack-desktop/OPEN_SOURCE_LICENSE_ATTRIBUTIONS \ install -Dm644 slack/usr/share/doc/slack-desktop/OPEN_SOURCE_LICENSE_ATTRIBUTIONS \
"$licenses/OPEN_SOURCE_LICENSE_ATTRIBUTIONS" "$licenses/OPEN_SOURCE_LICENSE_ATTRIBUTIONS"
install -Dm644 electron/LICENSE "$licenses/LICENSE.electron.txt" if [[ $CARCH == aarch64 ]]; then
install -Dm644 electron/LICENSES.chromium.html "$licenses/LICENSES.chromium.html" install -Dm644 electron/LICENSE "$licenses/LICENSE.electron.txt"
install -Dm644 electron/LICENSES.chromium.html "$licenses/LICENSES.chromium.html"
else
install -Dm644 slack/usr/lib/slack/resources/LICENSES.chromium.html \
"$licenses/LICENSES.chromium.html"
fi
} }
+2 -2
View File
@@ -1,6 +1,6 @@
# Slack on ARM # Slack Desktop
Slack publishes Linux builds for x86_64 only, and the AUR `slack-desktop` recipe repackages that `.deb`. This package runs the same application code on the AArch64 build of the Electron release Slack ships with, so `yay -S slack-desktop` on an ARM Omarchy install resolves to a working package. Slack publishes Linux builds for x86_64 only. On x86_64 this package installs that `.deb` unchanged, replacing the AUR `slack-desktop` recipe with one Omarchy controls. On AArch64 it runs the same application code on the AArch64 build of the Electron release Slack ships with, so `slack-desktop` resolves to a working package on ARM Omarchy installs too. Everything below applies to the AArch64 build only.
## Electron version ## Electron version