summaryrefslogtreecommitdiff
path: root/teams-for-linux/PKGBUILD
blob: bd9883402e9f73415505746b94556ba0d705becc (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Fredy García <frealgagu at gmail dot com>
# Contributor: Ivelin Velkov <ivelin dot velkov at gmail dot com>

pkgname=teams-for-linux
pkgver=1.11.3
pkgrel=2
pkgdesc="Unofficial Microsoft Teams client for Linux using Electron."
arch=("aarch64" "armv7h" "i686" "x86_64")
url="https://github.com/IsmaelMartinez/${pkgname}"
license=("GPL3")
_pinned_dependencies=(
  'alsa-lib=1.2.12'
  'at-spi2-core=2.54.0'
  'cairo=1.18.2'
  'dbus=1.14.10'
  'expat=2.6.4'
  'gcc-libs=14.2.1+r134+gab884fffe3fc'
  'gdk-pixbuf2=2.42.12'
  'glib2=2.82.2'
  'glibc>=2.35'
  'gtk3=1:3.24.43'
  'libcups=2:2.4.11'
  'libdrm=2.4.123'
  'libx11=1.8.10'
  'libxcb=1.17.0'
  'libxcomposite=0.4.6'
  'libxdamage=1.1.6'
  'libxext=1.3.6'
  'libxfixes=6.0.1'
  'libxkbcommon=1.7.0'
  'libxrandr=1.5.4'
  'mesa=1:24.2.6'
  'nspr=4.36'
  'nss=3.106'
  'pango=1:1.54.0'
  'systemd-libs=256.7'
)
depends=("gtk3" "libxss" "${_pinned_dependencies[@]}")
makedepends=('nodejs-lts-iron' "node-gyp" "python" "yarn")
source=(
  "${pkgname}-${pkgver}.tar.gz::https://github.com/IsmaelMartinez/${pkgname}/archive/v${pkgver}.tar.gz"
  "${pkgname}.desktop"
)
sha512sums=('da3003e05f93b5cee9249281464f498eb6cb2f124dd16682cc59911235e37d9dd7b87749f0a771921813bc8beda58bf3064a71ffc88e0c8a920303bc3d5508f4'
            '3e80d0aaefe42644265bd379f2279912c9358b2ce5c5efcd9aa7c4c67a07841da77c0fabac87eb7837f3cd7f0e620ce322c8791ff61bd3729c343108bd5d5d61')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  yarn install --non-interactive --pure-lockfile --cache-folder "${srcdir}/yarn-cache"
  if [[ ${CARCH} == "aarch64" ]]; then
    yarn electron-builder build --arm64 --linux dir
  elif [[ ${CARCH} == "armv7h" ]]; then
    yarn electron-builder build --armv7l --linux dir
  elif [[ ${CARCH} == "i686" ]]; then
    yarn electron-builder build --ia32 --linux dir
  elif [[ ${CARCH} == "x86_64" ]]; then
    yarn electron-builder build --x64 --linux dir
  fi
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  install -dm755 "${pkgdir}/opt" "${pkgdir}/usr/bin"

  if [[ ${CARCH} == "aarch64" ]]; then
    _unpacked_dirname="linux-arm64-unpacked"
  elif [[ ${CARCH} == "armv7h" ]]; then
    _unpacked_dirname="linux-armv7l-unpacked"
  elif [[ ${CARCH} == "i686" ]]; then
    _unpacked_dirname="linux-ia32-unpacked"
  elif [[ ${CARCH} == "x86_64" ]]; then
    _unpacked_dirname="linux-unpacked"
  fi

  cp -r --preserve=mode "${srcdir}/${pkgname}-${pkgver}/dist/${_unpacked_dirname}" "${pkgdir}/opt/${pkgname}"
  install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  for _file in "${srcdir}/${pkgname}-${pkgver}/build/icons/"*.png
  do
    _filename="$(basename ${_file})"
    install -Dm644 "${_file}" "${pkgdir}/usr/share/icons/hicolor/${_filename%.png}/apps/${pkgname}.png"
  done
  ln -sf "/opt/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
}