Add slack-desktop for aarch64 on a native Electron runtime

Slack only publishes an x86_64 Linux build, so the AUR recipe produces an
aarch64 package full of x86_64 binaries that cannot start. Run Slack's
application code on the AArch64 build of the Electron release it ships
with, replace the three native addons Slack requires at boot with
JavaScript equivalents, and drop the x86_64 addons it can do without.
This commit is contained in:
Ryan Hughes committed 2026-10-05 12:26:23 -04:00
1 parent 049d7671e1
commit 418a48bef6
7 files changed
+278

No files matched your search

@@ -0,0 +1,53 @@
// Stand-in for Slack's closed-source native helpers, which ship no aarch64
// build. Slack's main bundle requires this module while booting, so a missing
// addon stops the window from ever opening. Every native call throws the same
// error the vendor wrapper uses for methods a platform lacks, and Slack's call
// sites already catch it and fall back.
const unavailable = () => {
throw new Error('Method not implemented');
};
const namespace = new Proxy(
{},
{
get: (_, key) =>
typeof key === 'symbol' || key === 'then' ? undefined : unavailable,
},
);
const constants = {
AppRestartFlags: { NoCrash: 1, NoHang: 2, NoPatch: 4, NoReboot: 8 },
WindowsNotifierState: {
NotificationPlatformUnavailable: -2,
Error: -1,
Enabled: 0,
DisabledForApplication: 1,
DisabledForUser: 2,
DisabledByGroupPolicy: 3,
DisabledByManifest: 4,
},
StartupTaskState: {
Error: -1,
Disabled: 0,
DisabledByUser: 1,
Enabled: 2,
DisabledByPolicy: 3,
EnabledByPolicy: 4,
},
ActivationType: { Error: -1, StartupTask: 1020 },
};
module.exports = new Proxy(constants, {
get: (target, key) => {
if (key in target) return target[key];
if (
typeof key === 'symbol' ||
key === '__esModule' ||
key === 'default' ||
key === 'then'
) {
return undefined;
}
return namespace;
},
});