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

pkgname=discord-rpc
pkgver=20200921
_commit=963aa9f3e5ce81a4682c6ca3d136cddda614db33
pkgrel=4
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
}

prepare() {
    cd $pkgname
    sed -i '48d' .clang-format # remove duplicate line, otherwise it does not compile
}

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
    cmake --build build
}

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