www-client/google-chrome-beta: automated update (84.0.4147.30)
[gentoo.git] / net-libs / quiche / quiche-0.3.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 CRATES="
7 anyhow-1.0.26
8 aho-corasick-0.7.6
9 arrayvec-0.4.11
10 atty-0.2.14
11 autocfg-1.0.0
12 backtrace-0.3.37
13 backtrace-sys-0.1.31
14 bitflags-1.2.1
15 bstr-0.2.12
16 bumpalo-3.2.0
17 byteorder-1.3.4
18 cast-0.2.3
19 cc-1.0.50
20 cfg-if-0.1.10
21 clap-2.33.0
22 cmake-0.1.42
23 criterion-0.3.1
24 criterion-plot-0.4.1
25 crossbeam-deque-0.7.3
26 crossbeam-epoch-0.8.2
27 crossbeam-queue-0.2.1
28 crossbeam-utils-0.7.2
29 csv-1.1.3
30 csv-core-0.1.10
31 either-1.5.3
32 fuchsia-zircon-0.3.3
33 fuchsia-zircon-sys-0.3.3
34 hermit-abi-0.1.8
35 idna-0.1.5
36 iovec-0.1.4
37 itertools-0.8.2
38 itoa-0.4.5
39 js-sys-0.3.36
40 kernel32-sys-0.2.2
41 lazy_static-1.4.0
42 libc-0.2.67
43 log-0.4.8
44 matches-0.1.8
45 maybe-uninit-2.0.0
46 memchr-2.3.3
47 memoffset-0.5.3
48 mio-0.6.21
49 miow-0.2.1
50 net2-0.2.33
51 num-traits-0.2.11
52 num_cpus-1.12.0
53 oorandom-11.1.0
54 percent-encoding-1.0.1
55 plotters-0.2.12
56 proc-macro2-1.0.9
57 quote-1.0.3
58 rayon-1.3.0
59 rayon-core-1.7.0
60 regex-1.3.5
61 regex-automata-0.1.9
62 regex-syntax-0.6.17
63 ring-0.16.11
64 rustc_version-0.2.3
65 ryu-1.0.3
66 same-file-1.0.6
67 scopeguard-1.1.0
68 semver-0.9.0
69 semver-parser-0.7.0
70 serde-1.0.104
71 serde_derive-1.0.104
72 serde_json-1.0.48
73 slab-0.4.2
74 smallvec-1.2.0
75 spin-0.5.2
76 syn-1.0.16
77 textwrap-0.11.0
78 tinytemplate-1.0.3
79 unicode-bidi-0.3.4
80 unicode-normalization-0.1.12
81 unicode-width-0.1.7
82 unicode-xid-0.1.0
83 unicode-xid-0.2.0
84 untrusted-0.7.0
85 url-1.7.2
86 walkdir-2.3.1
87 wasm-bindgen-0.2.59
88 wasm-bindgen-backend-0.2.59
89 wasm-bindgen-macro-0.2.59
90 wasm-bindgen-macro-support-0.2.59
91 wasm-bindgen-shared-0.2.59
92 wasm-bindgen-webidl-0.2.59
93 web-sys-0.3.36
94 winapi-0.2.8
95 winapi-0.3.8
96 winapi-build-0.1.1
97 winapi-i686-pc-windows-gnu-0.4.0
98 winapi-util-0.1.3
99 winapi-x86_64-pc-windows-gnu-0.4.0
100 ws2_32-sys-0.2.1
101 "
102
103 inherit cargo cmake-utils flag-o-matic multilib-minimal rust-toolchain
104
105 DESCRIPTION="Implementation of the QUIC transport protocol and HTTP/3"
106 HOMEPAGE="https://github.com/cloudflare/quiche"
107
108 if [[ ${PV} == *9999 ]] ; then
109         EGIT_REPO_URI="https://github.com/cloudflare/${PN}.git"
110         inherit git-r3
111 else
112         CRATES+=" ${P//_/-}"
113         SRC_URI="$(cargo_crate_uris ${CRATES})"
114         KEYWORDS="~amd64 ~arm64 ~x86"
115         S="${WORKDIR}/${P//_/-}"
116 fi
117
118 LICENSE="|| ( Apache-2.0 Boost-1.0 )
119         || ( Apache-2.0 MIT )
120         || ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT )
121         BSD-2
122         BSD
123         ISC
124         MIT
125         || ( Unlicense MIT )
126         openssl"
127 SLOT="0/0"
128 IUSE=""
129 DOCS=( CODEOWNERS  COPYING README.md )
130
131 BDEPEND="
132         >=virtual/rust-1.39.0[${MULTILIB_USEDEP}]
133         dev-util/cmake
134         dev-lang/go
135         dev-lang/perl
136 "
137 DEPEND=""
138 RDEPEND=""
139
140 CMAKE_USE_DIR="${S}/deps/boringssl"
141
142 src_unpack() {
143         if [[ "${PV}" == *9999* ]]; then
144                 git-r3_src_unpack
145                 cargo_live_src_unpack
146         else
147                 cargo_src_unpack
148                 tar -xf "${DISTDIR}/${P//_/-}.crate" -C "${WORKDIR}" || die
149         fi
150 }
151
152 src_prepare() {
153         default
154         cmake-utils_src_prepare
155         multilib_copy_sources
156 }
157
158 multilib_src_configure() {
159         append-flags "-fPIC"
160         local mycmakeargs=(
161                 -DOPENSSL_NO_ASM=ON
162                 -DBUILD_SHARED_LIBS=OFF
163         )
164         BUILD_DIR="${BUILD_DIR}/deps/boringssl/build" cmake-utils_src_configure
165 }
166
167 multilib_src_compile() {
168         BUILD_DIR="${BUILD_DIR}/deps/boringssl/build" cmake-utils_src_compile bssl
169         QUICHE_BSSL_PATH="${BUILD_DIR}/deps/boringssl" cargo_src_compile --features pkg-config-meta --target="$(rust_abi)"
170 }
171
172 multilib_src_test() {
173         QUICHE_BSSL_PATH="${BUILD_DIR}/deps/boringssl" cargo_src_test  --target="$(rust_abi)"
174 }
175
176 multilib_src_install() {
177         sed -i -e "s:libdir=.\+:libdir=${EPREFIX}/usr/$(get_libdir):" -e "s:includedir=.\+:includedir=${EPREFIX}/usr/include:" target/release/quiche.pc || die
178         insinto "/usr/$(get_libdir)/pkgconfig"
179         doins target/release/quiche.pc
180         doheader -r include/*
181         dolib.so "target/$(rust_abi)/release/libquiche.so"
182 }