summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 22d1408068693a36f8f2ba124466ae26eb778a60 (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
93
94
# 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.6
pkgrel=4.3
_gitver='8eed684c37bd711de2ca4bd863f5f0509edcdc2d'
pkgdesc='A Qt5 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'
         'sonnet5'
         '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"
        )
sha512sums=('2dc761248bf937044d3135c196a2e7b6986846369d493ecc831fd8519cfac22a7b5472f452482c2afccbe2ad73b7a36c174408f75ab142789dc06613b9e8c9f3'
            'SKIP')
b2sums=('057756959ce9e896dc9315a0f62ae28221d97960fc631e461c6b340cd5895db6a85af5e35da866c6503c67d1cbb37cde3e46db0de16473cac515ff79c4c95702'
        '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
}