summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d0422d739f3245c8812c8ea053e83debd4bd91bd (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
# Maintainer: insmtr <insmtr@insmtr.cn>
pkgname=p4lang-pi
pkgver=0.1.2
pkgrel=2
pkgdesc="An implementation framework for a P4Runtime server"
arch=('x86_64')
url="https://github.com/p4lang/PI"
license=('Apache-2.0')
depends=(
    'grpc'
    'protobuf'
    'python-grpcio'
    'python-protobuf'
    'boost-libs'
    'readline'
)
makedepends=(
    'boost'
    'git'
)
source=("git+https://github.com/p4lang/PI.git#tag=v${pkgver}"
        "remove-boost-system.patch")
sha256sums=('c1b8938022d662d4311852cfce8bc79bd9e02b8cd42533374c339c435b36967b'
            '06a9a967e663eb56d91a8cdfc43f5f94a9985bce74eb6948a4d63744f4a4c458')
options=(!debug)

prepare() {
    cd PI
    git submodule update --init
    sed -i 's/this->allocate(new_capacity, FMT_NULL)/std::allocator_traits<Allocator>::allocate(*this, new_capacity)/' proto/third_party/fmt/format.h
    patch -p1 -i "$srcdir/"remove-boost-system.patch
}

build() {
    cd PI
    sed -i 's/with_proto_demo=yes/with_proto_demo=no/' proto/configure.ac
    ./autogen.sh
    ./configure --prefix=/usr --with-proto
    make -j$(nproc)
}

package() {
    cd PI
    make DESTDIR="$pkgdir" install
}