summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: acd029c0dbbdf843497c661ed2b86c7840f5c6f7 (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
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=mvfst
pkgver=2024.05.06.00
pkgrel=1
pkgdesc="An implementation of the QUIC transport protocol"
arch=(x86_64)
url="https://github.com/facebook/mvfst"
license=(MIT)
depends=(
  double-conversion
  fizz
  fmt
  folly
  gcc-libs
  gflags
  glibc
  google-glog
  gtest
  libsodium
  openssl
)
makedepends=(
  boost
  cmake
)
provides=(
  libmvfst_async_udp_socket.so
  libmvfst_batch_writer.so
  libmvfst_buf_accessor.so
  libmvfst_bufutil.so
  libmvfst_cc_algo.so
  libmvfst_client.so
  libmvfst_codec.so
  libmvfst_codec_decode.so
  libmvfst_codec_packet_number_cipher.so
  libmvfst_codec_pktbuilder.so
  libmvfst_codec_pktrebuilder.so
  libmvfst_codec_types.so
  libmvfst_constants.so
  libmvfst_dsr_frontend.so
  libmvfst_dsr_types.so
  libmvfst_events.so
  libmvfst_exception.so
  libmvfst_fizz_client.so
  libmvfst_fizz_handshake.so
  libmvfst_flowcontrol.so
  libmvfst_handshake.so
  libmvfst_happyeyeballs.so
  libmvfst_looper.so
  libmvfst_loss.so
  libmvfst_observer.so
  libmvfst_qlogger.so
  libmvfst_server.so
  libmvfst_server_async_tran.so
  libmvfst_server_state.so
  libmvfst_state_ack_handler.so
  libmvfst_state_datagram_handler.so
  libmvfst_state_functions.so
  libmvfst_state_machine.so
  libmvfst_state_pacing_functions.so
  libmvfst_state_simple_frame_functions.so
  libmvfst_state_stream.so
  libmvfst_state_stream_functions.so
  libmvfst_transport.so
  libmvfst_transport_knobs.so
  libmvfst_transport_settings_functions.so
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('9bfbdf7a73fdaf2e135050a9efccec577be1590e8ecbb262543a78fea14424b5')

_archive="$pkgname-$pkgver"

prepare() {
  cd "$_archive"

  # Remove tests that doesn't compile due to what I think is an incompatibility
  # with gtest
  sed -i '/QuicServerTest.cpp/d' quic/server/test/CMakeLists.txt

  # Use system CMake config instead of bundled module, incompatible with glog
  # v0.7.0+
  sed -i 's/find_package(Glog REQUIRED)/find_package(Glog CONFIG REQUIRED)/' \
    CMakeLists.txt
}

build() {
  cd "$_archive"

  cmake -S . -B build \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -Wno-dev \
    -DBUILD_TESTS=ON \
    -DBUILD_SHARED_LIBS=ON \
    -DPACKAGE_VERSION="$pkgver"
  cmake --build build
}

check() {
  cd "$_archive"

  # Test fails in a chroot - not sure why
  ctest --test-dir build --output-on-failure \
    -E QuicClientTransportAfterStartTest.BadStatelessResetWontCloseTransport
}

package() {
  cd "$_archive"

  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}