summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a73e41594850af43b5dcff1d3a60bfd9ebaa99eb (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: Matt Quintanilla <matt @ matt quintanilla . xyz>
# shellcheck shell=bash disable=SC2034,SC2164

# A modified version of the chatterino2-7tv-git package (https://aur.archlinux.org/packages/chatterino2-7tv-git)
_pkgname=chatterino7
pkgname=chatterino2-7tv
pkgver=7.5.1
pkgrel=1
pkgdesc='Second installment of the Twitch chat client series "Chatterino"'
arch=('x86_64')
url=https://github.com/SevenTV/chatterino7
license=('MIT')
depends=('hicolor-icon-theme' 'openssl' 'qt6-5compat' 'qt6-base' 'qt6-imageformats' 'qt6-svg' 'qtkeychain-qt6')
makedepends=('boost' 'cmake' 'git' 'qt6-tools' 'rapidjson')
optdepends=('streamlink: For piping streams to video players'
            'pulseaudio: For audio output')
checkdepends=('httpbin' 'pifpaf')
provides=('chatterino')
conflicts=('chatterino')
install="${pkgname}.install"
source=("git+https://github.com/SevenTV/${_pkgname}.git#tag=v${pkgver}"
        "git+https://github.com/Chatterino/libcommuni.git#branch=chatterino-cmake"
        "git+https://github.com/pajlada/settings.git"
        "git+https://github.com/pajlada/signals.git"
        "git+https://github.com/pajlada/serialize.git"
        "git+https://github.com/zaphoyd/websocketpp.git"
        "git+https://github.com/Neargye/magic_enum.git"
        "git+https://github.com/mackron/miniaudio.git"
        "git+https://github.com/arsenm/sanitizers-cmake.git"
        "git+https://github.com/lua/lua.git"
        "git+https://github.com/Chatterino/crash-handler.git")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

# We temporarily disable LTO since we get an ICE when compiling with gcc since this commit https://github.com/Chatterino/chatterino2/commit/ed20e71db4c957d3b2a8ce9350b847f4c805cb83
# Bug report tracking https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114501
options=('!lto')

prepare() {
    cd "${_pkgname}"

    git submodule init
    for module in libcommuni settings signals serialize websocketpp magic_enum miniaudio; do
        git config "submodule.lib/${module}.url" "${srcdir}/${module}"
    done
    git config submodule.cmake/sanitizers-cmake.url "${srcdir}/sanitizers-cmake"
    git config submodule.lib/lua/src.url "${srcdir}/lua"
    git config submodule.tools/crash-handler.url "${srcdir}/crash-handler"

    git -c protocol.file.allow=always -c submodule.lib/rapidjson.update=none submodule update
}

build() {
    cmake -S "${_pkgname}" -B build --fresh \
        -DCMAKE_CXX_FLAGS="${CXXFLAGS} -DNDEBUG" \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DUSE_SYSTEM_QTKEYCHAIN=ON \
        -DBUILD_TESTS=ON \
        -DBUILD_WITH_QT6=ON \
        -DCHATTERINO_UPDATER=OFF \
        -DCHATTERINO_PLUGINS=ON \
        -DINSTALL_GTEST=OFF
    cmake --build build
}

check() {
    eval `pifpaf run httpbin --port 9051`
    ctest --test-dir build --output-on-failure || : # TODO: Pass the PubSub tests
    pifpaf_stop
}

package() {
    DESTDIR="${pkgdir}" cmake --install build
    install -Dm644 "${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}