summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b43cc082b6f3312581a79359387e828ee0765194 (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
52
53
54
55
56
57
58
# Maintainer: nissen22 <bernhardnorneslotsberg at gmail dot com>
# Package heavily inspired by the ordinary Ripcord AUR package and https://wiki.archlinux.org/index.php/Creating_packages
pkgname='ripcord-arch-libs'
pkgver=0.4.28
pkgrel=1
pkgdesc='Qt-based Discord and Slack client. Modified to run on system libraries for Wayland support.'
arch=('x86_64')
depends=('harfbuzz' 'libgl' 'qt5-base' 'qt5-imageformats' 'qt5-multimedia' 'qt5-svg' 'qt5-websockets' 'libxss' 'libsodium')
url='https://cancel.fm/ripcord/'
license=('custom')
validpgpkeys=('ABBAD1CB484F53024CF5868B69332F9203F21F5C')
conflicts=('ripcord')

_file="Ripcord-$pkgver-x86_64.AppImage"
source=("https://cancel.fm/dl/$_file"{,.asc} LICENSE)
sha256sums=('db6913119af830ac3899d7c8065042ef840e5e0f701167c0a5f2783bc9c59f2d' 'SKIP' 'd7b2d483acceaebebfa068223efd8fb5e0f5d66f642fa234484ca50974c9fa2c')

# !! AppImage is emptied if symbols are stripped away !!
# But beyond that, the program is deployed with symbols on purpose
options=('!strip')

# AppImage is already compressed, no reason to compress it again
# Kept as reminder
#PKGEXT='.pkg.tar'

prepare() {
  # Extract AppImage contents so we install bypassing every and all AppImage
  # desktop integration/deployment mechanisms
  chmod +x "$_file"
  "./$_file" --appimage-extract &>/dev/null
}

package() {
  # directories
  rm squashfs-root/lib/*
  ln -s /usr/lib/libsodium.so squashfs-root/lib/libsodium.so.18
  rm -rf squashfs-root/plugins
  install -d "$pkgdir"/usr/bin/
  install -d "$pkgdir"/usr/lib/ripcord/
  install -d "$pkgdir"/usr/share/applications/
  install -d "$pkgdir"/usr/share/icons/
  install -d "$pkgdir"/usr/share/licenses/"$pkgname"

  # icon
  install -m644 squashfs-root/Ripcord_Icon.png "$pkgdir"/usr/share/icons/

  # .desktop file
  sed -i 's/Exec=Ripcord/Exec=env\ QT_QPA_PLATFORM_PLUGIN_PATH=\/usr\/lib\/qt\/plugins\ ripcord/g' squashfs-root/Ripcord.desktop
  install -m644 squashfs-root/Ripcord.desktop "$pkgdir"/usr/share/applications

  # license
  install -m644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE

  # application
  chmod 755 -R squashfs-root
  mv squashfs-root/* "$pkgdir"/usr/lib/ripcord/
  ln -s /usr/lib/ripcord/Ripcord "$pkgdir"/usr/bin/ripcord
}