Gentoo Archives: gentoo-commits

From: Alon Bar-Lev <alonbl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/botan/, dev-libs/botan/files/
Date: Thu, 01 Dec 2016 20:13:28
Message-Id: 1480623192.c31efdd2b1cd740923f9d3d2c14870309df3cf20.alonbl@gentoo
1 commit: c31efdd2b1cd740923f9d3d2c14870309df3cf20
2 Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 20:11:29 2016 +0000
4 Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 20:13:12 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c31efdd2
7
8 dev-libs/botan: version bump
9
10 Package-Manager: portage-2.3.0
11
12 dev-libs/botan/Manifest | 1 +
13 dev-libs/botan/botan-1.11.34.ebuild | 140 +++++++++++++++++++++++++++
14 dev-libs/botan/files/botan-1.11.34-rng.patch | 30 ++++++
15 3 files changed, 171 insertions(+)
16
17 diff --git a/dev-libs/botan/Manifest b/dev-libs/botan/Manifest
18 index d5f8885..b9053b3 100644
19 --- a/dev-libs/botan/Manifest
20 +++ b/dev-libs/botan/Manifest
21 @@ -2,3 +2,4 @@ DIST Botan-1.10.12.tgz 2707397 SHA256 affc3a79919577943f896e64d3e4a4dcc4970c5bf8
22 DIST Botan-1.10.13.tgz 2710181 SHA256 23ec973d4b4a4fe04f490d409e08ac5638afe3aa09acd7f520daaff38ba19b90 SHA512 a09d2cb5dda21bf384b81675025f249abdfe232c95dc3383f0baebc2bf1603b2ed1e2aec9a81aae95df592ec2eeae8906c63474a6da42ad3701669a5d8f14656 WHIRLPOOL 4161d689205f02ed8b97bb371be47829d11dee744a024e24bb834264cfa6143c8a9fb7df969410975e4bf2b708063e3c05b6106c4dbe7f5566e3331ee5e901a9
23 DIST Botan-1.10.14.tgz 2710757 SHA256 10ed0b394db165733ac9557d8656356b7e9744d38c61c2b9c44cba6d84ff4c1c SHA512 ae524653a99b02d6d8d7bb2b88a446c066fe1044d8fd2708ea2a4cd5aafbe2b0d165d2ce1730669a4df18013cf5b6540bb5944bafea512b4957e3417de512e95 WHIRLPOOL 51aa1d68757ad515f65c255c585be8050efed085800340d43fa068b48647ef8c50fc9e284ac16d0cef3d874f5fa44f143210dcc004561807e1d1b307d89cff9d
24 DIST Botan-1.11.33.tgz 4329671 SHA256 d65f95399dc5710aea90d682d65e554fed4571115f1382416e9142370a47e949 SHA512 49bb4485663897dd07bb7982771befacc50bfabef5806dc802cbd4d39f5d641b08a264824b5b1b96421e810811353deea15e728c5d08ce2932cf0e4602ae099d WHIRLPOOL 86154158915e29eef7753797df037d560078bda4ecfaafffba1064a238618b1ec10e0712b85cd64537ca3dfbac5ce38bf1323456d30b2bd5a51c0dae7f81d339
25 +DIST Botan-1.11.34.tgz 4908624 SHA256 59ad548f8ddb967737f102b252bab30ca0b49f039f204502394cf506ae731f16 SHA512 c3dad24872f726c62fd302cf05e4a67985e8d6e00b6bdfc9852abe2204329f794b656e9ee89470b76ea16426371ef5b1729626c36d9a2b89e1939172382f192c WHIRLPOOL ba1db76068ae8e55169cba19597be159de1999555ff64ba95a7b80a38ed25d6170be9c2586ca680323340774784fad96b9ca83ff0b17a5b162ba11014e2641a4
26
27 diff --git a/dev-libs/botan/botan-1.11.34.ebuild b/dev-libs/botan/botan-1.11.34.ebuild
28 new file mode 100644
29 index 00000000..87dc9d5
30 --- /dev/null
31 +++ b/dev-libs/botan/botan-1.11.34.ebuild
32 @@ -0,0 +1,140 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI="6"
38 +PYTHON_COMPAT=( python{2_7,3_4,3_5} )
39 +
40 +inherit eutils multilib python-r1 toolchain-funcs
41 +
42 +MY_PN="Botan"
43 +MY_P="${MY_PN}-${PV}"
44 +DESCRIPTION="A C++ crypto library"
45 +HOMEPAGE="http://botan.randombit.net/"
46 +SRC_URI="http://botan.randombit.net/releases/${MY_P}.tgz"
47 +
48 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos"
49 +SLOT="0"
50 +LICENSE="BSD"
51 +IUSE="bindist doc boost python bzip2 libressl lzma sqlite ssl static-libs zlib"
52 +
53 +S="${WORKDIR}/${MY_P}"
54 +
55 +REQUIRED_USE="python? ( boost )"
56 +
57 +RDEPEND="bzip2? ( >=app-arch/bzip2-1.0.5 )
58 + zlib? ( >=sys-libs/zlib-1.2.3 )
59 + boost? ( ${PYTHON_DEPS} >=dev-libs/boost-1.48[python?,${PYTHON_USEDEP}] )
60 + lzma? ( app-arch/xz-utils )
61 + sqlite? ( dev-db/sqlite:3 )
62 + ssl? (
63 + !libressl? ( >=dev-libs/openssl-0.9.8g:0[bindist=] )
64 + libressl? ( dev-libs/libressl )
65 + )"
66 +DEPEND="${RDEPEND}
67 + doc? ( dev-python/sphinx )"
68 +
69 +PATCHES=(
70 + "${FILESDIR}/${P}-rng.patch"
71 +)
72 +
73 +pkg_pretend() {
74 + # Botan 1.11 requires -std=c++11
75 + if [[ ${MERGE_TYPE} != binary ]]; then
76 + [[ $(gcc-major-version) -lt 4 ]] || \
77 + ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) \
78 + && die "Sorry, but gcc 4.7 or higher is required."
79 + fi
80 +}
81 +
82 +src_prepare() {
83 + default
84 + sed \
85 + -e "/^install:/s/ docs//" \
86 + -i src/build-data/makefile/gmake.in || die "sed failed"
87 + use python && python_copy_sources
88 +}
89 +
90 +src_configure() {
91 + local disable_modules=( proc_walk unix_procs )
92 + use boost || disable_modules+=( "boost" )
93 + use bindist && disable_modules+=( "ecdsa" )
94 + use python || disable_modules+=( "ffi" )
95 + elog "Disabling modules: ${disable_modules[@]}"
96 +
97 + # Enable v9 instructions for sparc64
98 + if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
99 + CHOSTARCH="sparc32-v9"
100 + else
101 + CHOSTARCH="${CHOST%%-*}"
102 + fi
103 +
104 + local myos=
105 + case ${CHOST} in
106 + *-darwin*) myos=darwin ;;
107 + *) myos=linux ;;
108 + esac
109 +
110 + local pythonvers=()
111 + if use python; then
112 + append() {
113 + pythonvers+=( ${EPYTHON/python/} )
114 + }
115 + python_foreach_impl append
116 + fi
117 +
118 + ./configure.py \
119 + --prefix="${EPREFIX}/usr" \
120 + --destdir="${D}/${EPREFIX}/usr" \
121 + --libdir=$(get_libdir) \
122 + --docdir=share/doc \
123 + --cc=gcc \
124 + --os=${myos} \
125 + --cpu=${CHOSTARCH} \
126 + --with-endian="$(tc-endian)" \
127 + --without-sphinx \
128 + $(use_with bzip2) \
129 + $(use_with lzma) \
130 + $(use_with sqlite sqlite3) \
131 + $(use_with ssl openssl) \
132 + $(use_with zlib) \
133 + $(use_with boost) \
134 + --with-python-version=$(IFS=","; echo "${pythonvers[*]}" ) \
135 + --disable-modules=$(IFS=","; echo "${disable_modules[*]}" ) \
136 + || die "configure.py failed"
137 +}
138 +
139 +src_compile() {
140 + emake CXX="$(tc-getCXX) -pthread" AR="$(tc-getAR) crs" LIB_OPT="-c ${CXXFLAGS}"
141 + if use doc; then
142 + einfo "Generation of documentation"
143 + sphinx-build doc doc_output
144 + fi
145 +}
146 +
147 +src_test() {
148 + LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed"
149 +}
150 +
151 +src_install() {
152 + emake install
153 +
154 + if ! use static-libs; then
155 + rm "${ED}usr/$(get_libdir)/libbotan"*.a || die 'remove of static libs failed'
156 + fi
157 +
158 + # Add compatibility symlinks.
159 + [[ -e "${ED}usr/bin/botan-config" ]] && die "Compatibility code no longer needed"
160 + [[ -e "${ED}usr/$(get_libdir)/pkgconfig/botan.pc" ]] && die "Compatibility code no longer needed"
161 + dosym botan-config-1.11 /usr/bin/botan-config
162 + dosym botan-1.11.pc /usr/$(get_libdir)/pkgconfig/botan.pc
163 +
164 + use python && python_foreach_impl python_optimize
165 +
166 + if use doc; then
167 + pushd doc_output > /dev/null
168 + insinto /usr/share/doc/${PF}/html
169 + doins -r [a-z]* _static
170 + popd > /dev/null
171 + fi
172 +}
173
174 diff --git a/dev-libs/botan/files/botan-1.11.34-rng.patch b/dev-libs/botan/files/botan-1.11.34-rng.patch
175 new file mode 100644
176 index 00000000..da814f1
177 --- /dev/null
178 +++ b/dev-libs/botan/files/botan-1.11.34-rng.patch
179 @@ -0,0 +1,30 @@
180 +From 2b72637f06ad35bd5458372a964bf30a0b4f7cf9 Mon Sep 17 00:00:00 2001
181 +From: Alon Bar-Lev <alon.barlev@×××××.com>
182 +Date: Thu, 1 Dec 2016 21:55:17 +0200
183 +Subject: [PATCH] system_rng: workaround read only urandom
184 +
185 +Signed-off-by: Alon Bar-Lev <alon.barlev@×××××.com>
186 +---
187 + src/lib/rng/system_rng/system_rng.cpp | 5 ++++-
188 + 1 file changed, 4 insertions(+), 1 deletion(-)
189 +
190 +diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp
191 +index eaba382..12b0876 100644
192 +--- a/src/lib/rng/system_rng/system_rng.cpp
193 ++++ b/src/lib/rng/system_rng/system_rng.cpp
194 +@@ -135,8 +135,11 @@ void System_RNG_Impl::add_entropy(const uint8_t input[], size_t len)
195 + * by the OS or sysadmin that additional entropy is not wanted
196 + * in the system pool, so we accept that and return here,
197 + * since there is no corrective action possible.
198 ++ *
199 ++ * In Linux EBADF or EPERM is returned if m_fd is not opened for
200 ++ * writing.
201 + */
202 +- if(errno == EPERM)
203 ++ if(errno == EPERM || errno == EBADF)
204 + return;
205 +
206 + // maybe just ignore any failure here and return?
207 +--
208 +2.7.3
209 +