Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/botan/
Date: Tue, 24 Jan 2017 23:23:01
Message-Id: 1485300156.1067105771b900fca87e1fca6ef0d4579e23989d.blueness@gentoo
1 commit: 1067105771b900fca87e1fca6ef0d4579e23989d
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 24 12:10:38 2017 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 24 23:22:36 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10671057
7
8 dev-libs/botan: add libressl support to 1.10.15
9
10 Package-Manager: portage-2.3.0
11
12 dev-libs/botan/botan-1.10.15-r1.ebuild | 153 +++++++++++++++++++++++++++++++++
13 1 file changed, 153 insertions(+)
14
15 diff --git a/dev-libs/botan/botan-1.10.15-r1.ebuild b/dev-libs/botan/botan-1.10.15-r1.ebuild
16 new file mode 100644
17 index 00000000..f98f0af
18 --- /dev/null
19 +++ b/dev-libs/botan/botan-1.10.15-r1.ebuild
20 @@ -0,0 +1,153 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI="6"
26 +PYTHON_COMPAT=( python{2_7,3_4} )
27 +
28 +inherit eutils multilib python-r1 toolchain-funcs
29 +
30 +MY_PN="Botan"
31 +MY_P="${MY_PN}-${PV}"
32 +DESCRIPTION="A C++ crypto library"
33 +HOMEPAGE="http://botan.randombit.net/"
34 +SRC_URI="http://botan.randombit.net/releases/${MY_P}.tgz"
35 +
36 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos"
37 +SLOT="0"
38 +LICENSE="BSD"
39 +IUSE="bindist doc python bzip2 gmp libressl ssl static-libs threads zlib"
40 +
41 +S="${WORKDIR}/${MY_P}"
42 +
43 +RDEPEND="bzip2? ( >=app-arch/bzip2-1.0.5 )
44 + zlib? ( >=sys-libs/zlib-1.2.3 )
45 + python? ( ${PYTHON_DEPS} >=dev-libs/boost-1.48[python,${PYTHON_USEDEP}] )
46 + gmp? ( >=dev-libs/gmp-4.2.2:* )
47 + ssl? (
48 + !libressl? ( >=dev-libs/openssl-0.9.8g:0[bindist=] )
49 + libressl? ( dev-libs/libressl )
50 + )"
51 +DEPEND="${RDEPEND}
52 + doc? ( dev-python/sphinx )"
53 +
54 +src_prepare() {
55 + default
56 +
57 + sed -e "s/-Wl,-soname,\$@ //" -i src/build-data/makefile/python.in || die "sed failed"
58 + sed \
59 + -e "/DOCDIR/d" \
60 + -e "/^install:/s/ docs//" \
61 + -i src/build-data/makefile/unix_shr.in || die "sed failed"
62 +
63 + # Fix ImportError with Python 3.
64 + sed -e "s/_botan/.&/" -i src/wrap/python/__init__.py || die "sed failed"
65 +
66 + use python && python_copy_sources
67 +}
68 +
69 +src_configure() {
70 + local disable_modules="proc_walk,unix_procs"
71 + use threads || disable_modules+=",pthreads"
72 + use bindist && disable_modules+=",ecdsa"
73 + elog "Disabling modules: ${disable_modules}"
74 +
75 + # Enable v9 instructions for sparc64
76 + if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
77 + CHOSTARCH="sparc32-v9"
78 + else
79 + CHOSTARCH="${CHOST%%-*}"
80 + fi
81 +
82 + local myos=
83 + case ${CHOST} in
84 + *-darwin*) myos=darwin ;;
85 + *) myos=linux ;;
86 + esac
87 +
88 + # foobared buildsystem, --prefix translates into DESTDIR, see also make
89 + # install in src_install, we need the correct live-system prefix here on
90 + # Darwin for a shared lib with correct install_name
91 + ./configure.py \
92 + --prefix="${EPREFIX}/usr" \
93 + --libdir=$(get_libdir) \
94 + --docdir=share/doc \
95 + --cc=gcc \
96 + --os=${myos} \
97 + --cpu=${CHOSTARCH} \
98 + --with-endian="$(tc-endian)" \
99 + --without-sphinx \
100 + --with-tr1=system \
101 + $(use_with bzip2) \
102 + $(use_with gmp gnump) \
103 + $(use_with python boost-python) \
104 + $(use_with ssl openssl) \
105 + $(use_with zlib) \
106 + --disable-modules=${disable_modules} \
107 + || die "configure.py failed"
108 +}
109 +
110 +src_compile() {
111 + emake CXX="$(tc-getCXX)" AR="$(tc-getAR) crs" LIB_OPT="${CXXFLAGS}" MACH_OPT=""
112 +
113 + if use python; then
114 + building() {
115 + rm -fr build/python
116 + ln -s "${BUILD_DIR}" build/python
117 + cp Makefile.python build/python
118 + sed -i \
119 + -e "s/-lboost_python/-lboost_python-$(echo ${EPYTHON} | sed 's/python//')/" \
120 + build/python/Makefile.python
121 + emake -f build/python/Makefile.python \
122 + CXX="$(tc-getCXX)" \
123 + CFLAGS="${CXXFLAGS}" \
124 + LDFLAGS="${LDFLAGS}" \
125 + PYTHON_ROOT="/usr/$(get_libdir)" \
126 + PYTHON_INC="-I$(python_get_includedir)"
127 + }
128 + python_foreach_impl building
129 + fi
130 +
131 + if use doc; then
132 + einfo "Generation of documentation"
133 + sphinx-build doc doc_output
134 + fi
135 +}
136 +
137 +src_test() {
138 + chmod -R ugo+rX "${S}"
139 + emake CXX="$(tc-getCXX)" CHECK_OPT="${CXXFLAGS}" check
140 + LD_LIBRARY_PATH="${S}" ./check --validate || die "Validation tests failed"
141 +}
142 +
143 +src_install() {
144 + emake DESTDIR="${ED}usr" install
145 +
146 + if ! use static-libs; then
147 + rm "${ED}usr/$(get_libdir)/libbotan"*.a || die 'remove of static libs failed'
148 + fi
149 +
150 + # Add compatibility symlinks.
151 + [[ -e "${ED}usr/bin/botan-config" ]] && die "Compatibility code no longer needed"
152 + [[ -e "${ED}usr/$(get_libdir)/pkgconfig/botan.pc" ]] && die "Compatibility code no longer needed"
153 + dosym botan-config-1.10 /usr/bin/botan-config
154 + dosym botan-1.10.pc /usr/$(get_libdir)/pkgconfig/botan.pc
155 +
156 + if use python; then
157 + installation() {
158 + rm -fr build/python
159 + ln -s "${BUILD_DIR}" build/python
160 + emake -f Makefile.python \
161 + PYTHON_SITE_PACKAGE_DIR="${ED}$(python_get_sitedir)" \
162 + install
163 + }
164 + python_foreach_impl installation
165 + fi
166 +
167 + if use doc; then
168 + pushd doc_output > /dev/null
169 + insinto /usr/share/doc/${PF}/html
170 + doins -r [a-z]* _static
171 + popd > /dev/null
172 + fi
173 +}