summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8acd36a19d0ca706a264e5bcef63fb00eee689e4 (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
# Maintainer: Ckat <ckat@teknik.io>
pkgname=chatterino2-git
_pkgname=chatterino2
pkgver=r2997.a6e23e24
pkgrel=1
pkgdesc='Second installment of the Twitch chat client series "Chatterino", dev/git version'
arch=('any')
url=https://chatterino.com
license=('MIT')
depends=('qt5-multimedia' 'qt5-base' 'boost-libs' 'openssl')
makedepends=('git' 'qt5-svg' 'boost')
optdepends=('streamlink: For piping streams to video players'
            'pulseaudio: For audio output'
            'gst-plugins-good: For audio output')
provides=('chatterino')
conflicts=('chatterino')
install=$pkgname.install
source=("git://github.com/Chatterino/chatterino2"
        "git://github.com/communi/libcommuni"
        "git://github.com/pajlada/humanize"
        "git://github.com/jiakuan/qBreakpad"
        "git://github.com/mohabouje/WinToast"
        "git://github.com/pajlada/settings"
        "git://github.com/pajlada/signals"
        "git://github.com/pajlada/serialize"
        "git://github.com/Tencent/rapidjson"
        "git://github.com/Chatterino/qtkeychain"
        "git://github.com/ziocleto/websocketpp")
md5sums=('SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP'
         'SKIP')

pkgver() {
    cd "$srcdir/chatterino2"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare () {
    cd "$srcdir/$_pkgname"
    git submodule init
    git config submodule.libcommuni $srcdir/$_pkgname/lib/libcommuni
    git config submodule.humanize $srcdir/$_pkgname/lib/humanize
    git config submodule.qBreakpad $srcdir/$_pkgname/lib/qBreakpad
    git config submodule.WinToast $srcdir/$_pkgname/lib/WinToast
    git config submodule.settings $srcdir/$_pkgname/lib/settings
    git config submodule.signals $srcdir/$_pkgname/lib/signals
    git config submodule.serialize $srcdir/$_pkgname/lib/serialize
    git config submodule.rapidjson $srcdir/$_pkgname/lib/rapidjson
    git config submodule.qtkeychain $srcdir/$_pkgname/lib/qtkeychain
    git config submodule.websocketpp $srcdir/$_pkgname/lib/websocketpp
    git submodule update
}

build() {
    cd "$srcdir/chatterino2"
    mkdir -p build
    cd build
    qmake ..
    if [ -z "$CCACHE_SLOPPINESS" ]; then
        # We need to set the ccache sloppiness for the chatterino build to use it properly
        # This is due to our use of precompiled headers
        # See https://ccache.dev/manual/3.3.5.html#_precompiled_headers
        CCACHE_SLOPPINESS="pch_defines,time_macros"
        export CCACHE_SLOPPINESS
    fi
    make
}

package() {
    cd "$srcdir/chatterino2"
    if [ -f "build/bin/chatterino" ] && [ -x "build/bin/chatterino" ]; then
        echo "Getting chatterino binary from bin folder"
        install -Dm755 "build/bin/chatterino" "$pkgdir/usr/bin/chatterino"
    else
        echo "Getting chatterino binary from NON-BIN folder"
        # System ccache is enabled, causing the binary file to not fall into the bin folder
        # Temporary solution until we have figured out a way to stabilize the ccache output
        install -Dm755 "build/chatterino" "$pkgdir/usr/bin/chatterino"
    fi
    install -Dm644 "resources/com.chatterino.chatterino.desktop" "$pkgdir/usr/share/applications/com.chatterino.chatterino.desktop"
    install -Dm644 "resources/icon.png" "$pkgdir/usr/share/pixmaps/chatterino.png"
}