discord 0.0.31-2: correctly pack all files, move resources to a subdirectory

Resources are moved to a "resources" subdirectory to allow automated asar
installers to work with this package.

Reported-by: irisnk (https://aur.archlinux.org/packages/discord_arch_electron#comment-937014)
This commit is contained in:
Zoddo 2023-10-06 20:25:07 +02:00
parent 9b2c0746b7
commit 5505d9db4a
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 43E8D68722C7D376
3 changed files with 9 additions and 9 deletions

View file

@ -1,7 +1,7 @@
pkgbase = discord_arch_electron pkgbase = discord_arch_electron
pkgdesc = Discord (popular voice + video app) using the system provided electron for increased security and performance pkgdesc = Discord (popular voice + video app) using the system provided electron for increased security and performance
pkgver = 0.0.31 pkgver = 0.0.31
pkgrel = 1 pkgrel = 2
url = https://discord.com url = https://discord.com
arch = x86_64 arch = x86_64
license = custom license = custom
@ -18,7 +18,7 @@ pkgbase = discord_arch_electron
source = LICENSE.html::https://discord.com/terms source = LICENSE.html::https://discord.com/terms
source = OSS-LICENSES.html::https://discord.com/licenses source = OSS-LICENSES.html::https://discord.com/licenses
sha512sums = 596f0e2271e61798594d97a85728eea2bfa851db7f1e8b7fa65e1631dfeb347fa8d6087556854c0e775b88678a03b8ece97d0c1293b156e7ea908f6570645248 sha512sums = 596f0e2271e61798594d97a85728eea2bfa851db7f1e8b7fa65e1631dfeb347fa8d6087556854c0e775b88678a03b8ece97d0c1293b156e7ea908f6570645248
sha512sums = b246e5be3b0f25d489aa208f493cfd0adfab0ace0d7fe49444be9434f11c0ad75c3a14bea70f92f94874e2d86aafd25e60472887935ab10dfec41b43f861dffc sha512sums = dff276383dca7670d6c06fc9ba5cd34f15ee5011271b4e77704b838eeb09c842019f8ebf2cfc6f8214be20c6ea414b743d0591bbef8067a863c3eeb880a16701
sha512sums = SKIP sha512sums = SKIP
sha512sums = SKIP sha512sums = SKIP

View file

@ -7,7 +7,7 @@ _pkgname=discord
_electron=electron _electron=electron
pkgname=${_pkgname}_arch_electron pkgname=${_pkgname}_arch_electron
pkgver=0.0.31 pkgver=0.0.31
pkgrel=1 pkgrel=2
pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance" pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance"
arch=('x86_64') arch=('x86_64')
provides=("${_pkgname}") provides=("${_pkgname}")
@ -24,7 +24,7 @@ source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz"
'LICENSE.html::https://discord.com/terms' 'LICENSE.html::https://discord.com/terms'
'OSS-LICENSES.html::https://discord.com/licenses') 'OSS-LICENSES.html::https://discord.com/licenses')
sha512sums=('596f0e2271e61798594d97a85728eea2bfa851db7f1e8b7fa65e1631dfeb347fa8d6087556854c0e775b88678a03b8ece97d0c1293b156e7ea908f6570645248' sha512sums=('596f0e2271e61798594d97a85728eea2bfa851db7f1e8b7fa65e1631dfeb347fa8d6087556854c0e775b88678a03b8ece97d0c1293b156e7ea908f6570645248'
'b246e5be3b0f25d489aa208f493cfd0adfab0ace0d7fe49444be9434f11c0ad75c3a14bea70f92f94874e2d86aafd25e60472887935ab10dfec41b43f861dffc' 'dff276383dca7670d6c06fc9ba5cd34f15ee5011271b4e77704b838eeb09c842019f8ebf2cfc6f8214be20c6ea414b743d0591bbef8067a863c3eeb880a16701'
SKIP SKIP
SKIP) SKIP)
@ -35,18 +35,18 @@ prepare() {
# HACKS FOR SYSTEM ELECTRON # HACKS FOR SYSTEM ELECTRON
asar e Discord/resources/app.asar Discord/resources/app asar e Discord/resources/app.asar Discord/resources/app
rm Discord/resources/app.asar rm Discord/resources/app.asar
sed -i "s|process.resourcesPath|'/usr/lib/$_pkgname'|" Discord/resources/app/app_bootstrap/buildInfo.js sed -i "s|process.resourcesPath|'/usr/lib/${_pkgname}/resources'|" Discord/resources/app/app_bootstrap/buildInfo.js
sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js
asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**' asar p Discord/resources/app Discord/resources/app.asar
rm -rf Discord/resources/app rm -rf Discord/resources/app
} }
package() { package() {
# Install the app # Install the app
install -d "$pkgdir"/usr/lib/$_pkgname install -d "${pkgdir}/usr/lib/${_pkgname}/resources"
# Copy Relevanat data # Copy Relevanat data
cp -r Discord/resources/* "$pkgdir"/usr/lib/$_pkgname/ cp -r Discord/resources/* "${pkgdir}/usr/lib/${_pkgname}/resources/"
install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}} install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}}
install -Dm 755 "${srcdir}/discord-launcher.sh" "${pkgdir}/usr/bin/${_pkgname}" install -Dm 755 "${srcdir}/discord-launcher.sh" "${pkgdir}/usr/bin/${_pkgname}"

View file

@ -18,4 +18,4 @@ for line in "${MAPFILE[@]}"; do
fi fi
done done
exec /usr/bin/${electron} /usr/lib/${name}/app.asar "${flags[@]}" "$@" exec /usr/bin/${electron} /usr/lib/${name}/resources/app.asar "${flags[@]}" "$@"