summaryrefslogtreecommitdiff
blob: 85a385a6452ccacb522bac5ea3e8dc7f9cf7a3b5 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CRATES="
${PN}@${PV}
anyhow@1.0.26
ansi_term@0.11.0
aho-corasick@1.1.3
android-tzdata@0.1.1
android_system_properties@0.1.5
arrayvec@0.7.4
atty@0.2.14
autocfg@1.3.0
backtrace@0.3.37
backtrace@sys-0.1.31
base64@0.21.7
bindgen@0.68.1
bitflags@1.3.2
bitflags@2.6.0
boring@4.7.0
boring-sys@4.7.0
bstr@0.2.12
bumpalo@3.15.4
byteorder@1.3.4
cast@0.2.3
cc@1.0.101
cdylib-link-lines@0.1.5
cexpr@0.6.0
cfg@if-0.1.10
cfg@if-1.0.0
chrono@0.4.35
clang-sys@1.8.1
clap@2.33.3
cmake@0.1.50
core-foundation-sys@0.8.6
criterion@0.3.1
criterion@plot-0.4.1
crossbeam@deque-0.7.3
crossbeam@epoch-0.8.2
crossbeam@queue-0.2.1
crossbeam@utils-0.7.2
csv@1.1.3
csv@core-0.1.10
data-encoding@2.6.0
darling@0.20.9
darling_core@0.20.9
darling_macro@0.20.9
data@encoding-2.3.3
deranged@0.3.11
either@1.13.0
env_logger@0.8.4
equivalent@1.0.1
fnv@1.0.7
foreign-types@0.5.0
foreign-types-macros@0.2.3
foreign-types-shared@0.3.1
form_urlencoded@1.2.1
fuchsia-zircon@0.3.3
fuchsia-zircon-sys@0.3.3
fs_extra@1.3.0
fslock@0.2.1
getrandom@0.2.15
glob@0.3.1
hashbrown@0.12.3
hashbrown@0.14.5
hermit@abi-0.1.19
hex@0.4.3
humantime@2.1.0
iana-time-zone-haiku@0.1.2
iana-time-zone@0.1.60
ident_case@1.0.1
idna@0.5.0
intrusive-collections@0.9.6
iovec@0.1.4
itertools@0.8.2
itoa@1.0.11
js-sys@0.3.69
kernel32-sys@0.2.2
lazycell@1.3.0
lazy_static@1.5.0
libc@0.2.155
libloading@0.8.4
libm@0.2.8
log@0.4.21
matches@0.1.10
maybe-uninit@2.0.0
memchr@2.7.4
memoffset@0.9.1
minimal-lexical@0.2.1
mio@0.8.11
miow@0.4.0
net2@0.2.37
nom@7.1.3
num-conv@0.1.0
num-traits@0.2.19
num_cpus@1.12.0
octets@0.3.0
peeking_take_while@0.1.2
indexmap@1.9.3
indexmap@2.2.6
once_cell@1.19.0
oorandom@11.1.0
percent-encoding@2.3.1
pkg-config@0.3.30
plotters@0.2.12
powerfmt@0.2.0
proc-macro2@1.0.86
qlog@0.13.0
quote@1.0.36
rayon@1.3.0
rayon@core-1.7.0
regex@1.10.5
regex-automata@0.4.7
regex-syntax@0.8.4
ring@0.17.8
rustc_version@0.2.3
rustc@hash-1.1.0
rustversion@1.0.6
rust_decimal@1.35.0
ryu@1.0.18
same-file@1.0.6
scopeguard@1.1.0
sfv@0.9.4
semver@0.9.0
semver-parser@0.7.0
serde@1.0.203
serde_derive@1.0.203
serde_json@1.0.118
serde_with@3.8.1
serde_with_macros@3.8.1
shlex@1.3.0
slab@0.4.9
smallvec@1.13.2
spin@0.9.8
strsim@0.8.0
strsim@0.11.1
syn@1.0.109
syn@2.0.68
termcolor@1.1.2
textwrap@0.11.0
time@0.3.34
time-core@0.1.2
time-macros@0.2.17
tinytemplate@1.0.3
tinyvec@1.6.1
tinyvec_macros@0.1.1
unicode-bidi@0.3.15
unicode-ident@1.0.12
unicode-normalization@0.1.23
unicode-width@0.1.10
unicode-xid@0.2.4
unicode-xid@0.2.3
untrusted@0.9.0
url@2.5.2
vec_map@0.8.2
version_check@0.9.4
walkdir@2.3.1
wasm-bindgen@0.2.92
wasm-bindgen-backend@0.2.92
wasm-bindgen-macro@0.2.92
wasm-bindgen-macro-support@0.2.92
wasm-bindgen-shared@0.2.92
wasm-bindgen-webidl@0.2.75
wasi@0.11.0+wasi-snapshot-preview1
web-sys@0.3.65
which@3.1.1
winapi@0.2.8
winapi@0.3.9
winapi-build@0.1.1
winapi-i686-pc-windows-gnu@0.4.0
winapi-util@0.1.5
winapi-x86_64-pc-windows-gnu@0.4.0
windows-core@0.52.0
windows_aarch64_gnullvm@0.48.5
windows_aarch64_gnullvm@0.52.5
windows_aarch64_msvc@0.48.5
windows_aarch64_msvc@0.52.5
windows_i686_gnu@0.48.5
windows_i686_gnu@0.52.5
windows_i686_gnullvm@0.52.5
windows_i686_msvc@0.48.5
windows_i686_msvc@0.52.5
windows_x86_64_gnu@0.48.5
windows_x86_64_gnu@0.52.5
windows_x86_64_gnullvm@0.48.5
windows_x86_64_gnullvm@0.52.5
windows_x86_64_msvc@0.48.5
windows_x86_64_msvc@0.52.5
windows-sys@0.48.0
windows-sys@0.52.0
windows-targets@0.48.5
windows-targets@0.52.5
ws2_32-sys@0.2.1
"

inherit cargo cmake flag-o-matic rust-toolchain multilib-minimal

DESCRIPTION="Implementation of the QUIC transport protocol and HTTP/3"
HOMEPAGE="https://github.com/cloudflare/quiche"

if [[ ${PV} == *9999 ]] ; then
	EGIT_REPO_URI="https://github.com/cloudflare/${PN}.git"
	inherit git-r3
	CMAKE_USE_DIR="${S}/quiche/deps/boringssl"
else
	SRC_URI="${CARGO_CRATE_URIS}"
	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
	S="${WORKDIR}/${P//_/-}"
	CMAKE_USE_DIR="${S}/deps/boringssl"
fi

LICENSE="|| ( Apache-2.0 Boost-1.0 )
	|| ( Apache-2.0 MIT )
	|| ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT )
	BSD-2
	BSD
	ISC
	MIT
	|| ( Unlicense MIT )
	openssl"
SLOT="0/0"
IUSE=""
DOCS=( COPYING README.md )

BDEPEND="
	>=virtual/rust-1.66.0[${MULTILIB_USEDEP}]
	dev-build/cmake
"
DEPEND=""
RDEPEND=""

BUILD_DIR="${WORKDIR}/${P}"

src_unpack() {
	if [[ "${PV}" == *9999* ]]; then
		git-r3_src_unpack
		cargo_live_src_unpack
	else
		cargo_src_unpack
		tar -xf "${DISTDIR}/${P//_/-}.crate" -C "${WORKDIR}" || die
	fi
}

src_prepare() {
	cmake_src_prepare
	multilib_copy_sources
}

multilib_src_configure() {
	append-flags "-fPIC"
	local mycmakeargs=(
		-DOPENSSL_NO_ASM=ON
		-DBUILD_SHARED_LIBS=OFF
	)
	BUILD_DIR="${BUILD_DIR}/deps/boringssl/build" cmake_src_configure
}

multilib_src_compile() {
	BUILD_DIR="${BUILD_DIR}/deps/boringssl/build" cmake_src_compile bssl
	QUICHE_BSSL_PATH="${BUILD_DIR}/deps/boringssl" cargo_src_compile --features "ffi pkg-config-meta" --target="$(rust_abi)"
}

multilib_src_test() {
	QUICHE_BSSL_PATH="${BUILD_DIR}/deps/boringssl" cargo_src_test  --target="$(rust_abi)"
}

multilib_src_install() {
	sed -i -e "s:libdir=.\+:libdir=${EPREFIX}/usr/$(get_libdir):" -e "s:includedir=.\+:includedir=${EPREFIX}/usr/include:" target/$(rust_abi)/release/quiche.pc || die
	insinto "/usr/$(get_libdir)/pkgconfig"
	doins target/$(rust_abi)/release/quiche.pc
	doheader -r include/*
	dolib.so "target/$(rust_abi)/release/libquiche.so"
	QA_FLAGS_IGNORED+=" usr/$(get_libdir)/libquiche.so" # rust libraries don't use LDFLAGS
	QA_SONAME+=" usr/$(get_libdir)/libquiche.so" # https://github.com/cloudflare/quiche/issues/165
}