summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 57392792c59d2af444b1b2f5698c4594c3419f6f (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Maintainer: Trustin Lee <t@motd.kr>
# Former Maintainer: Arnaud Dovi <mr.dovi@gmail.com>

pkgname=restream-chat
pkgver=2.5.4
pkgrel=2
pkgdesc='Keep your streaming chats in one place by Restream.io'
arch=('x86_64')
url='https://restream.io/chat'
license=()
provides=(
  'restream-chat'
)
conflicts=(
  'restream-chat'
)
depends=(
  # [FIXME?] libffpmeg.so is not an official library, is it necessary to bring it to AUR ? (currently only lib32-libffpmeg exists in the AUR...)
  'alsa-lib'
  'avahi'
  'gmp'
  'gnutls'
  'gtk3'
  'krb5'
  'libglvnd'
  'libnotify'
  'libxau'
  'libxdmcp'
  'libxss'
  'nss'
)
optdepends=(
  'libappindicator-gtk2' # libappindicator is shipped in the original AppImage but I'm unsure if it is necessary.
)
makedepends=(
  'coreutils'
)
_srcname="squashfs-root"
_pkgname="Restream+Chat-${pkgver}-beta.AppImage"
source=(
  "https://chat-client.restream.io/${_pkgname}"
)
sha512sums=(
  '0bab803e1904c38758816f28e4cf1146a6dd9b4344f972cf88aa537d5ca3b7d9e90e8349804b5c3d411d23c88e82c7b376eb926be163ebb0cbb8fa367b6bd594'
)
_stop='\e[m'
_color="\e[33m"
_bold='\e[1m'
_prefix=" ${_bold}${_color}==>${_stop} "

prepare() {
  #cd "$_srcname" || return
  echo -e "${_prefix}Extracting the official AppImage file"
  chmod +x "$_pkgname"
  ./"$_pkgname" --appimage-extract
}

package() {
  cd "$_srcname" || return

  echo -e "${_prefix}Creating the package base"
  install -d "$pkgdir"/{opt/"${pkgname}",usr/bin,usr/share/pixmaps}
  install -d "$pkgdir/opt/${pkgname}"/{locales,resources}

  echo -e "${_prefix}Copying the package files"
  install -Dm 644 locales/* -t "$pkgdir"/opt/"${pkgname}"/locales
  cp -r resources/* -t "$pkgdir"/opt/"${pkgname}"/resources
  install -Dm 644 icudtl.dat -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 644 snapshot_blob.bin -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 644 v8_context_snapshot.bin -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 644 natives_blob.bin -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 644 chrome_100_percent.pak -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 644 chrome_200_percent.pak -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 644 resources.pak -t "$pkgdir"/opt/"${pkgname}"
  # [FIXME?] libffpmeg.so is not an official library, is it necessary to bring it to AUR ? (currently only lib32-libffpmeg exists in the AUR...)
  install -Dm 644 libffmpeg.so -t "$pkgdir"/opt/"${pkgname}"

  echo -e "${_prefix}Copying the package binaries"
  install -Dm 755 chrome-sandbox -t "$pkgdir"/opt/"${pkgname}"
  install -Dm 755 restream-chat -t "$pkgdir"/opt/"${pkgname}"

  echo -e "${_prefix}Setting up /usr/bin launcher"
  ln -s /opt/"${pkgname}"/restream-chat "$pkgdir"/usr/bin/restream-chat

  echo -e "${_prefix}Setting up desktop icon"
  cp restream-chat.png "$pkgdir"/usr/share/pixmaps/restream-chat.png

  echo -e "${_prefix}Setting up desktop shortcuts"
  sed -e "s|Exec=AppRun|Exec=restream-chat --no-sandbox|" -i restream-chat.desktop
  install -Dm 644 restream-chat.desktop -t "$pkgdir"/usr/share/applications
}