summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ebcf14bed886404e8bb24c74962d211e05cee642 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Maintainer: begin-theadventure <begin-thecontact.ncncb at dralias dot com>

_pkgname=audius-client
pkgname=$_pkgname-bin
pkgver=1.5.51
pkgrel=1
pkgdesc="The Decentralized Audius.co Client (binary release, system Electron)"
url="https://github.com/AudiusProject/audius-protocol/tree/main/packages/web"
arch=('x86_64')
license=('Apache2')
depends=('electron')
makedepends=('fuse2')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("https://download.audius.co/Audius-$pkgver.AppImage")
sha256sums=('f98c805a066ca0667036058853af3621ceea1c231701e5d740bde65c6d955ee9')

prepare() {
# Create an exec file
  echo -e "export ELECTRON_IS_DEV=0\n\
cd /usr/lib/$_pkgname\n\
exec electron /usr/lib/$_pkgname/app.asar \$@" > $_pkgname

# Extract the AppImage
  chmod +x "./Audius-$pkgver.AppImage"
  "./Audius-$pkgver.AppImage" --appimage-extract

# Edit the shortcut
  cd squashfs-root
  sed -i '/X-AppImage-Version/d' $_pkgname.desktop
  sed -i -E "s|Exec=AppRun --no-sandbox %U|Exec=$_pkgname %U|g" $_pkgname.desktop

# Remove the updater
  cd resources
  rm app-update.yml
}

package() {
# Create a folder
  mkdir -p "$pkgdir/usr/lib/$_pkgname"
# Install
  install -Dm755 $_pkgname -t "$pkgdir/usr/bin"
  cd squashfs-root
  mv resources/* "$pkgdir/usr/lib/$_pkgname"
  for i in 16 32 48 64 128 256 512 1024; do
    install -Dm644 usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png -t "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps"
  done
  install -Dm644 $_pkgname.desktop -t "$pkgdir/usr/share/applications"
# Fix permissions
  chmod -R 755 "$pkgdir/usr/lib/$_pkgname/app.asar.unpacked"
}