summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cff5b31bc39bfc4dc1dbc06e8a3caa82c230259f (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Maintainer: taotieren <admin@taotieren.com>

pkgbase=nanomq-git
pkgname=(nanomq{,-sqlite,-msquic,-full}-git)
pkgver=0.20.8.r92.g2f0a2332
pkgrel=2
pkgdesc="Nano MQTT Broker - An Ultra-light and Blazing-fast MQTT Broker for IoT Edge"
arch=('x86_64')
url="https://github.com/nanomq/nanomq"
license=('MIT')
provides=(${pkgbase%-git}
        nanonng
        nng)
conflicts=(${pkgbase%-git})
depends=(mbedtls
    python)
makedepends=(asciidoctor
            boost
            cmake
            gcc
            git
            ninja
            sqlite
            zeromq)
backup=()
options=('!strip' '!lto')
source=("${pkgname%-git}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgbase%-git}/"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "${srcdir}/${pkgbase%-git}/"
    git submodule update --init --recursive
}

package_nanomq-git() {
    pkgdesc+=" (base Broker)"
    provides+=(${pkgname%-git})

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
          -DNNG_ENABLE_TLS=ON \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -B build_nanomq \
          -G Ninja

    ninja -C build_nanomq

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq install
}

package_nanomq-sqlite-git() {
    pkgdesc+=" (sqlite Broker)"
    provides+=(${pkgname%-git})

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
          -DNNG_ENABLE_TLS=ON \
          -DNNG_ENABLE_SQLITE=ON \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -B build_nanomq-sqlite \
          -G Ninja

    ninja -C build_nanomq-sqlite

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq-sqlite install
}

package_nanomq-msquic-git() {
    pkgdesc+=" (msquic Broker)"
    provides+=(${pkgname%-git})
    conflicts=(msquic)

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
          -DNNG_ENABLE_TLS=ON \
          -DNNG_ENABLE_QUIC=ON \
          -DNNG_ENABLE_SQLITE=ON \
          -DQUIC_BUILD_SHARED=OFF \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -B build_nanomq-msquic \
          -G Ninja

    ninja -C build_nanomq-msquic

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq-msquic install
}

package_nanomq-full-git() {
    pkgdesc+=" (full Broker)"
    provides+=(${pkgname%-git}
                l8w8jwt)
    conflicts=(msquic
               mbedtls)
    depends=(mbedtls
        python)

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
          -DNNG_ENABLE_TLS=ON \
          -DNNG_ENABLE_SQLITE=ON \
          -DNNG_ENABLE_QUIC=ON \
          -DNNG_ENABLE_SQLITE=ON \
          -DQUIC_BUILD_SHARED=OFF \
          -DENABLE_JWT=ON \
          -DBUILD_ZMQ_GATEWAY=ON \
          -DBUILD_BENCH=ON \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -B build_nanomq-full \
          -G Ninja
#           -DBUILD_DDS_PROXY=ON \

    ninja -C build_nanomq-full

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq-full install
}