1 |
commit: a293a470d22418e0355c26d98e81008e25508f0f |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 4 01:16:17 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 4 01:16:56 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a293a470 |
7 |
|
8 |
dev-libs/botan: add 2.19.2 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
dev-libs/botan/Manifest | 2 + |
13 |
dev-libs/botan/botan-2.19.2.ebuild | 178 +++++++++++++++++++++++++++++++++++++ |
14 |
dev-libs/botan/metadata.xml | 3 +- |
15 |
3 files changed, 182 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/dev-libs/botan/Manifest b/dev-libs/botan/Manifest |
18 |
index ac477efafc69..a1e5500c5416 100644 |
19 |
--- a/dev-libs/botan/Manifest |
20 |
+++ b/dev-libs/botan/Manifest |
21 |
@@ -1,2 +1,4 @@ |
22 |
DIST Botan-2.19.1.tar.xz 6088380 BLAKE2B 7a2d50bb66ea4a1875857bea769bcc30f397170a10a70377c3963d92e33321a079271c1e235a7892e33ec5b1bc19e4df8336b2586548ccd849f52ebfa47d9c8f SHA512 e604be0e7e82da89e3e1949d3035a87dc63314bd9854d5fe5129ccb3ed5bc78edb0406c7f8ad1a152b59a63b6d98ba207a0851a08428c3452cce794614b5eef5 |
23 |
DIST Botan-2.19.1.tar.xz.asc 488 BLAKE2B 36f27e294fed60ea4d9ee9d919a58fc431a1bf9bdec8c12d30f2cba537a70b0e22f6a7c882cf7a80dc10aeee256f9f4a32129b55d2ab5df192d16759638feaa4 SHA512 2cd57bf97630d8f79cc0a87da79d3b338bd3b33b02ded16f6b60d5fd6cb3ea62105f577deb3b8d061f56a09ff902ff553ea3a0c603d5c3bd53a905024a2f457b |
24 |
+DIST Botan-2.19.2.tar.xz 6063336 BLAKE2B a46fa49c61846e718197ab3a8431a5bdcab0f4cc5e42aec04fd22932ecdbfa2b755cae53c125eee8248ecae237671ec6f0533f99289068ed81e6cd34886d8b88 SHA512 52b9c80a240457e46a299480338472f7d0c0b56df7b1709fdef52c5be3afca5b474fe143801c9a332ae884eaf033e60461c9d3e0b2f7b069f4fe8b4c45932abf |
25 |
+DIST Botan-2.19.2.tar.xz.asc 488 BLAKE2B 94d22dff9de02871560649b1d961f4c7ae5fa37a847141554f8da9f0a726d4497cd23e0d84197beb4d176f29aa3a478118d94cd52d2c04733d115828f85d400d SHA512 e25a03ac437a08737ecde541ead4b841ccb507d3198683a1755dab1d4f82e9ce0278473db7c7041a4b808f9dff9927106e30bbad79b1674615254ee78f0b6a06 |
26 |
|
27 |
diff --git a/dev-libs/botan/botan-2.19.2.ebuild b/dev-libs/botan/botan-2.19.2.ebuild |
28 |
new file mode 100644 |
29 |
index 000000000000..f7dd41802cb6 |
30 |
--- /dev/null |
31 |
+++ b/dev-libs/botan/botan-2.19.2.ebuild |
32 |
@@ -0,0 +1,178 @@ |
33 |
+# Copyright 1999-2022 Gentoo Authors |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI=8 |
37 |
+ |
38 |
+PYTHON_COMPAT=( python3_{8..11} ) |
39 |
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/botan.asc |
40 |
+inherit edo python-r1 toolchain-funcs verify-sig |
41 |
+ |
42 |
+MY_P="Botan-${PV}" |
43 |
+DESCRIPTION="C++ crypto library" |
44 |
+HOMEPAGE="https://botan.randombit.net/" |
45 |
+SRC_URI="https://botan.randombit.net/releases/${MY_P}.tar.xz" |
46 |
+SRC_URI+=" verify-sig? ( https://botan.randombit.net/releases/${MY_P}.tar.xz.asc )" |
47 |
+S="${WORKDIR}/${MY_P}" |
48 |
+ |
49 |
+LICENSE="BSD-2" |
50 |
+SLOT="2/$(ver_cut 1-2)" # soname version |
51 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~ppc-macos" |
52 |
+IUSE="doc boost bzip2 lzma python static-libs sqlite test tools zlib" |
53 |
+RESTRICT="!test? ( test )" |
54 |
+ |
55 |
+CPU_USE=( |
56 |
+ cpu_flags_arm_{aes,neon} |
57 |
+ cpu_flags_ppc_altivec |
58 |
+ cpu_flags_x86_{aes,avx2,popcnt,rdrand,sha,sse2,ssse3,sse4_1,sse4_2} |
59 |
+) |
60 |
+ |
61 |
+IUSE+=" ${CPU_USE[@]}" |
62 |
+ |
63 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
64 |
+ |
65 |
+# NOTE: Boost is needed at runtime too for the CLI tool. |
66 |
+DEPEND=" |
67 |
+ boost? ( >=dev-libs/boost-1.48:= ) |
68 |
+ bzip2? ( >=app-arch/bzip2-1.0.5:= ) |
69 |
+ lzma? ( app-arch/xz-utils:= ) |
70 |
+ python? ( ${PYTHON_DEPS} ) |
71 |
+ sqlite? ( dev-db/sqlite:3= ) |
72 |
+ zlib? ( >=sys-libs/zlib-1.2.3:= ) |
73 |
+" |
74 |
+RDEPEND="${DEPEND}" |
75 |
+BDEPEND=" |
76 |
+ ${PYTHON_DEPS} |
77 |
+ $(python_gen_any_dep ' |
78 |
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) |
79 |
+ ') |
80 |
+ verify-sig? ( sec-keys/openpgp-keys-botan ) |
81 |
+" |
82 |
+ |
83 |
+# NOTE: Considering patching Botan? |
84 |
+# Please see upstream's guidance: |
85 |
+# https://botan.randombit.net/handbook/packaging.html#minimize-distribution-patches |
86 |
+ |
87 |
+python_check_deps() { |
88 |
+ use doc || return 0 |
89 |
+ python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" |
90 |
+} |
91 |
+ |
92 |
+src_configure() { |
93 |
+ python_setup |
94 |
+ |
95 |
+ local disable_modules=( |
96 |
+ $(usev !boost 'boost') |
97 |
+ ) |
98 |
+ |
99 |
+ if [[ -z "${DISABLE_MODULES}" ]] ; then |
100 |
+ elog "Disabling module(s): ${disable_modules[@]}" |
101 |
+ fi |
102 |
+ |
103 |
+ local chostarch="${CHOST%%-*}" |
104 |
+ |
105 |
+ # Arch specific wrangling |
106 |
+ local myos= |
107 |
+ case ${CHOST} in |
108 |
+ *-darwin*) |
109 |
+ myos=darwin |
110 |
+ ;; |
111 |
+ *) |
112 |
+ myos=linux |
113 |
+ |
114 |
+ if [[ ${CHOST} == *hppa* ]] ; then |
115 |
+ chostarch=parisc |
116 |
+ elif [[ ${PROFILE_ARCH} == sparc64 ]] ; then |
117 |
+ chostarch="sparc32-v9" |
118 |
+ fi |
119 |
+ ;; |
120 |
+ esac |
121 |
+ |
122 |
+ local pythonvers=() |
123 |
+ if use python ; then |
124 |
+ _append() { |
125 |
+ pythonvers+=( ${EPYTHON/python/} ) |
126 |
+ } |
127 |
+ |
128 |
+ python_foreach_impl _append |
129 |
+ fi |
130 |
+ |
131 |
+ local myargs=( |
132 |
+ # Intrinsics |
133 |
+ # TODO: x86 RDSEED (new CPU_FLAGS_X86?) |
134 |
+ # TODO: POWER Crypto (new CPU_FLAGS_PPC?) |
135 |
+ $(usev !cpu_flags_arm_aes '--disable-armv8crypto') |
136 |
+ $(usev !cpu_flags_arm_neon '--disable-neon') |
137 |
+ $(usev !cpu_flags_ppc_altivec '--disable-altivec') |
138 |
+ $(usev !cpu_flags_x86_aes '--disable-aes-ni') |
139 |
+ $(usev !cpu_flags_x86_avx2 '--disable-avx2') |
140 |
+ $(usev !cpu_flags_x86_popcnt '--disable-bmi2') |
141 |
+ $(usev !cpu_flags_x86_rdrand '--disable-rdrand') |
142 |
+ $(usev !cpu_flags_x86_sha '--disable-sha-ni') |
143 |
+ $(usev !cpu_flags_x86_sse2 '--disable-sse2') |
144 |
+ $(usev !cpu_flags_x86_ssse3 '--disable-ssse3') |
145 |
+ $(usev !cpu_flags_x86_sse4_1 '--disable-sse4.1') |
146 |
+ $(usev !cpu_flags_x86_sse4_2 '--disable-sse4.2') |
147 |
+ |
148 |
+ # HPPA's GCC doesn't support SSP (presumably due to stack direction) |
149 |
+ $(usev hppa '--without-stack-protector') |
150 |
+ |
151 |
+ $(use_with boost) |
152 |
+ $(use_with bzip2) |
153 |
+ $(use_with doc documentation) |
154 |
+ $(use_with doc sphinx) |
155 |
+ $(use_with lzma) |
156 |
+ $(use_enable static-libs static-library) |
157 |
+ $(use_with sqlite sqlite3) |
158 |
+ $(use_with zlib) |
159 |
+ |
160 |
+ --cpu=${chostarch} |
161 |
+ --docdir=share/doc |
162 |
+ --disable-modules=$(IFS=","; echo "${disable_modules[*]}") |
163 |
+ --distribution-info="Gentoo ${PVR}" |
164 |
+ --libdir="$(get_libdir)" |
165 |
+ |
166 |
+ # Don't install Python bindings automatically |
167 |
+ # (do it manually later in the right place) |
168 |
+ # bug #723096 |
169 |
+ --no-install-python-module |
170 |
+ |
171 |
+ --os=${myos} |
172 |
+ --prefix="${EPREFIX}"/usr |
173 |
+ --with-endian="$(tc-endian)" |
174 |
+ --with-python-version=$(IFS=","; echo "${pythonvers[*]}") |
175 |
+ ) |
176 |
+ |
177 |
+ local build_targets=( |
178 |
+ shared |
179 |
+ $(usev static-libs static) |
180 |
+ $(usev tools cli) |
181 |
+ $(usev test tests) |
182 |
+ ) |
183 |
+ |
184 |
+ myargs+=( |
185 |
+ --build-targets=$(IFS=","; echo "${build_targets[*]}") |
186 |
+ ) |
187 |
+ |
188 |
+ if use elibc_glibc && use kernel_linux ; then |
189 |
+ myargs+=( |
190 |
+ --with-os-features=getrandom,getentropy |
191 |
+ ) |
192 |
+ fi |
193 |
+ |
194 |
+ tc-export AR CC CXX |
195 |
+ |
196 |
+ edo ${EPYTHON} configure.py --verbose "${myargs[@]}" |
197 |
+} |
198 |
+ |
199 |
+src_test() { |
200 |
+ LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed" |
201 |
+} |
202 |
+ |
203 |
+src_install() { |
204 |
+ default |
205 |
+ |
206 |
+ # Manually install the Python bindings (bug #723096) |
207 |
+ if use python ; then |
208 |
+ python_foreach_impl python_domodule src/python/botan2.py |
209 |
+ fi |
210 |
+} |
211 |
|
212 |
diff --git a/dev-libs/botan/metadata.xml b/dev-libs/botan/metadata.xml |
213 |
index c6fdbfce6159..aa26e3323953 100644 |
214 |
--- a/dev-libs/botan/metadata.xml |
215 |
+++ b/dev-libs/botan/metadata.xml |
216 |
@@ -6,7 +6,8 @@ |
217 |
<name>Sam James</name> |
218 |
</maintainer> |
219 |
<use> |
220 |
- <flag name="boost">use <pkg>dev-libs/boost</pkg></flag> |
221 |
+ <flag name="boost">Use <pkg>dev-libs/boost</pkg></flag> |
222 |
+ <flag name="tools">Install optional tools for e.g. hashing</flag> |
223 |
</use> |
224 |
<slots> |
225 |
<subslots>botan soname version</subslots> |