summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0504f6bc38216d0cb640a8d11f0480be30afcefe (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
95
# Maintainer: zneix <zneix@zneix.eu>

pkgname=chatterino2-7tv-git
_pkgname=chatterino7
pkgver=r3610.d2e9c105
pkgrel=1
pkgdesc='A fork of Chatterino2 with built-in support for 7tv emotes'
arch=('any')
url=https://github.com/SevenTV/chatterino7
license=('MIT')
depends=('qt5-multimedia' 'qt5-base' 'qt5-tools' 'qt5-imageformats' 'boost-libs' 'openssl')
makedepends=('git' 'qt5-svg' 'boost' 'cmake')
optdepends=('streamlink: For piping streams to video players'
            'pulseaudio: For audio output'
            'gst-plugins-good: For audio output')
provides=('chatterino')
conflicts=('chatterino2-git' 'chatterino2-appimage' 'chatterino2-nightly-appimage')
install=$pkgname.install
source=("git+https://github.com/SevenTV/chatterino7"
        "git+https://github.com/Chatterino/libcommuni#branch=chatterino-cmake"
        "git+https://github.com/jiakuan/qBreakpad"
        "git+https://github.com/mohabouje/WinToast"
        "git+https://github.com/pajlada/settings"
        "git+https://github.com/pajlada/signals"
        "git+https://github.com/pajlada/serialize"
        "git+https://github.com/Tencent/rapidjson"
        "git+https://github.com/Chatterino/qtkeychain"
        "git+https://github.com/zaphoyd/websocketpp"
        "git+https://github.com/arsenm/sanitizers-cmake"
        "git+https://github.com/Neargye/magic_enum")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

pkgver() {
    cd "$srcdir/$_pkgname"
    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.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 config submodule.sanitizers-cmake $srcdir/$_pkgname/lib/sanitizers-cmake
    # We can't set the local directory of this submodule as we have no way of accessing the config name `submodule.magic_enum` because underscores are actually not allowed.
    #git config submodule.magic_enum $srcdir/$_pkgname/lib/magic_enum
    git submodule update
}

build() {
    cd "$srcdir/$_pkgname"
    mkdir -p build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    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/$_pkgname"
    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"
}