summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 9c23317be0d2c872ecda528edab5d6fb33642b03 (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
92
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Jiachen Yang <farseerfc@gmail.com>
# Maintainer (AUR): Vlad M. <vlad@archlinux.net>
# Contributor (Arch): Håvard Pettersson <mail@haavard.me>
# Contributor (Arch): Kevin MacMartin <prurigro at gmail dot com>

# # I maintain this because:
# Artix version uses emoticons
# Artix version uses incorrect gpg fingerprints

_offline=0

pkgname=qtox
_pkgname=qTox
pkgver=1.17.4
pkgrel=2.5
_gitver='8eed684c37bd711de2ca4bd863f5f0509edcdc2d'
pkgdesc='a chat, voice, video, and file transfer IM client using the encrypted peer-to-peer Tox protocol'
arch=('x86_64' 'aarch64')
url='https://github.com/qTox/qTox'
license=('GPL3')
options=(lto)
depends=('desktop-file-utils'
         'libxss'
         'openal'
         'ffmpeg'
         'qrencode'
         'qt5-svg'
         'sqlcipher'
         'libexif'
         'toxcore'
         'snorenotify'
         'sonnet'
         'libgl')
makedepends=('qt5-tools' 'check' 'cmake' 'mesa' 'libglvnd')

source=( 
        "$pkgname-$pkgver.tar.lz::https://github.com/$_pkgname/$_pkgname/releases/download/v$pkgver/v$pkgver.tar.lz"
        "$pkgname-$pkgver.tar.lz.asc::https://github.com/$_pkgname/$_pkgname/releases/download/v$pkgver/v$pkgver.tar.lz.asc"
        )
b2sums=('f7eb259221d832700873b5177f27c8bda0f1e309b46ceffd2a5bbc3758642f27bfe7a6123a199f8f3342a98ab2f58d975ee40979f006ba4429b817792cb66c98'
        'SKIP')

validpgpkeys=('DA262CC93C0E1E525AD21C8596775D454B8EBF44'  # - sudden6 <sudden6@gmx.at>
              '31039166FA902CA50D05D6085AF9F2E29107C727'  # - Diadlo
              '2880C860D95C909D3DA45C687E086DD661263264'  # - tux3
              '7EB339FE881747E701B7D472EBE36E66A8429B99'  # - AnthonyBilinski
              'CA9221C5389B7C50AA5F779352A50775BE13DF17'  # - noavarice
              '141C880E8BA25B198D0F850F7C132143C1A3A7D4'  # – tox-user
             )

prepare() {
  # disable -Werror for release packaging
  cd $_pkgname

  sed -e 's|-Werror||' -i CMakeLists.txt
  sed -e 's|Enable automatic update check" ON|Enable automatic update check" OFF|' -i CMakeLists.txt
}

build() {
  cd $_pkgname
  mkdir -p build
  export CXXFLAGS+=' -fpermissive'
  cd build

  # gcc 10.2 + qt 5.15 + pie = segfault
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all"
  cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
           -DDESKTOP_NOTIFICATIONS=ON \
           -DGIT_VERSION=$_gitver \
           -DGIT_DESCRIBE=v$pkgver \
           -DSMILEYS=DISABLED
  make
}

# tests require an active public internet connection
if [ "$_offline" == "0" ]; then
  check() {
    cd $_pkgname
    cd build

    make test
  }
fi

package() {
  cd $_pkgname
  cd build

  make DESTDIR="$pkgdir" install
}