summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 147785cbf425dd1e230034f6d1e90bc9961e2b90 (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
# Maintainer: DuckSoft <realducksoft@gmail.com>
# Contributor: ArielAxionL <i at axionl dot me>
# Contributor: Leroy.H.Y <me at lhy0403 dot top>
# Contributor: Neboer <rubinposter@gmail.com>
pkgname=qv2ray
pkgver=2.0.0
pkgrel=1
pkgdesc="Cross-platform V2ray Client written in Qt (Stable Release)"
arch=('x86_64')
url='https://github.com/Qv2ray/Qv2ray'
license=('GPL3')
depends=(
    'hicolor-icon-theme' 'qt5-charts>5.11.0'
)
optdepends=('v2ray' 'v2ray-domain-list-community' 'v2ray-geoip')
makedepends=('git' 'make' 'qt5-tools' 'which' 'gcc' 'qt5-declarative' 'go')
provides=('qv2ray')
conflicts=('qv2ray')

source=(
    'Qv2ray::git+https://github.com/Qv2ray/Qv2ray#tag=v2.0.0'
    'QNodeEditor::git+https://github.com/lhy0403/QNodeEditor#tag=v2.1.5'
    'SingleApplication::git+https://github.com/itay-grudev/SingleApplication#tag=v3.0.19'
    'x2struct::git+https://github.com/xyz347/x2struct#tag=v1.2'
    'qzxing::git+https://github.com/ftylitak/qzxing#commit=2a58c5032b2180f2cce95e1db106cbaa4ecaed02'
    'qhttpserver::git+https://github.com/nikhilm/qhttpserver#commit=02a6e7174b5be76e2c0e74a109817e39a141b9fd'
    'QvRPCBridge::git+https://github.com/Qv2ray/QvRPCBridge#tag=v1.1'
)

sha512sums=(
    'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
)

pkgver() {
    cd "${srcdir}/Qv2ray"
    printf "%s" $(git describe --long --tags | sed 's/v//;s/-\S*//g')
}

prepare() {
    cd "${srcdir}/Qv2ray"
    git submodule init
    submodules=('QNodeEditor' 'SingleApplication' 'x2struct' 'qzxing' 'qhttpserver')
    for module in ${submodules[@]}; do
        git config submodule."3rdparty/$module".url "${srcdir}/$module"
    done
    
    git config submodule."libs/libqvb".url "${srcdir}/QvRPCBridge"
    git config submodule."libs/gRPC-win32".active false
    git submodule update
}

build() {
    cd "${srcdir}/QvRPCBridge"
    chmod +x ./build.sh && ./build.sh
    ln -sf "${srcdir}/QvRPCBridge/build/libqvb.a" "${srcdir}/Qv2ray/libs/libqvb-linux64.a"

    cd "${srcdir}/Qv2ray"
    mkdir -p build && cd build
    qmake 'CONFIG += with_new_backend' 'DEFINES += QV2RAY_DEFAULT_VCORE_PATH=\\\"/usr/bin/v2ray\\\"' 'DEFINES += QV2RAY_DEFAULT_VASSETS_PATH=\\\"/usr/lib/v2ray\\\"' PREFIX=/usr ../
    make
}

package() {
    cd "${srcdir}/Qv2ray"
    install -Dm755 build/qv2ray "${pkgdir}/usr/bin/qv2ray"
    install -Dm644 assets/qv2ray.desktop "${pkgdir}/usr/share/applications/qv2ray.desktop"
    install -Dm644 assets/icons/qv2ray.png "${pkgdir}/usr/share/icons/hicolor/256x256/apps/qv2ray.png"
}