summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7aab7220cb188c327f2ec2345c723371a0b1f319 (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
# Maintainer: justforlxz <justforlxz@gmail.com>

pkgname=qv2ray-plugin-ss-dev-git
_pkgname=qv2ray-plugin-ss
pkgver=20201214.r96.b8a497e
pkgrel=1
pkgdesc="Qv2ray Plugin: Shadowsocks (Development Build)"
arch=('x86_64')
url='https://github.com/Qv2ray/QvPlugin-SS'
license=('GPL3')
# _virtualdepends=('qv2ray-plugin-host=3')
depends=('qt5-base>5.11.0' 'openssl' 'mbedtls' 'libuv' 'libsodium')
makedepends=('git' 'make' 'qt5-tools' 'which' 'gcc' 'cmake' 'ninja' 'libffi')
provides=('qv2ray-plugin-ss')
groups=('qv2ray-plugin')
conflicts=('qv2ray-plugin-ss')
source=("$_pkgname::git+${url}#branch=dev")
sha512sums=('SKIP')
pkgver() {
    cd "$srcdir"/"$_pkgname"
    local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
    local count=$(git rev-list --count HEAD)
    local commit=$(git rev-parse --short HEAD)
    echo "$date.r${count}.$commit"
}
prepare() {
    cd "$srcdir"/"$_pkgname"
    # no recursive here. arch don't need link statically libuv and libsodium.
    git submodule update --init
}
build() {
    cd "$srcdir"/"$_pkgname"
    mkdir -p build && cd build
    cmake .. \
        -DBUILD_TESTING=OFF \
        -DCMAKE_BUILD_TYPE=Release \
        -DSSR_UVW_WITH_QT=1 \
        -DUSE_SYSTEM_SODIUM=ON \
        -DUSE_SYSTEM_LIBUV=ON \
        -DSTATIC_LINK_LIBUV=OFF \
        -DSTATIC_LINK_SODIUM=OFF \
        -GNinja
    ninja
}
package() {
    # NOTE: Working around extra-x86_64-build
    depends+=('qv2ray')

    cd "$srcdir"/"$_pkgname"/build
    install -Dm644 libQvPlugin-SS.so "$pkgdir"/usr/share/qv2ray/plugins/libQvPlugin-SS.so
    # NOTE: This virtual dependency will be introduced after Qv2ray stablize its interface.
    #     depends+=(${_virtualdepends[@]})
}