summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6dd8fca97a4271f1ba340837cd5b61e4595a185 (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
# Marco Rubin <marco.rubin@protonmail.com>

pkgname=discord-rpc
pkgver=20200921
_commit=963aa9f3e5ce81a4682c6ca3d136cddda614db33
pkgrel=3
pkgdesc="Discord Rich Presence library"
arch=('aarch64' 'armv7h' 'i486' 'i686' 'pentium4' 'x86_64')
url="https://github.com/discord/discord-rpc"
license=('MIT')
depends=('gcc-libs')
makedepends=('cmake' 'git' 'rapidjson>=1.1')
provides=('libdiscord-rpc.so')
source=(git+$url#commit=$_commit)
b2sums=('SKIP')

pkgver() {
    cd $pkgname
    git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d' $_commit
}

build() {
    cd $pkgname
    cmake -B build \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
        -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -Wno-dev
    sed -i '48d' .clang-format # remove duplicate line, otherwise it does not compile
    cmake --build build
}

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