Gentoo Archives: gentoo-commits

From: Julian Ospald <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/botan/
Date: Fri, 02 Oct 2015 16:16:39
Message-Id: 1443802572.6436e09d23e6cef5dd3c88589884e4bdff7bcc36.hasufell@gentoo
1 commit: 6436e09d23e6cef5dd3c88589884e4bdff7bcc36
2 Author: Julian Ospald <hasufell <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 2 16:14:58 2015 +0000
4 Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 2 16:16:12 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6436e09d
7
8 dev-libs/botan: add libressl support
9
10 dev-libs/botan/botan-1.11.20-r1.ebuild | 135 +++++++++++++++++++++++++++++++++
11 1 file changed, 135 insertions(+)
12
13 diff --git a/dev-libs/botan/botan-1.11.20-r1.ebuild b/dev-libs/botan/botan-1.11.20-r1.ebuild
14 new file mode 100644
15 index 0000000..faf7991
16 --- /dev/null
17 +++ b/dev-libs/botan/botan-1.11.20-r1.ebuild
18 @@ -0,0 +1,135 @@
19 +# Copyright 1999-2015 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +# $Id$
22 +
23 +EAPI="5"
24 +PYTHON_COMPAT=( python{2_7,3_3,3_4} )
25 +
26 +inherit eutils multilib python-r1 toolchain-funcs
27 +
28 +MY_PN="Botan"
29 +MY_P="${MY_PN}-${PV}"
30 +DESCRIPTION="A C++ crypto library"
31 +HOMEPAGE="http://botan.randombit.net/"
32 +SRC_URI="http://botan.randombit.net/releases/${MY_P}.tgz"
33 +
34 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos"
35 +SLOT="0"
36 +LICENSE="BSD"
37 +IUSE="bindist doc boost python bzip2 libressl lzma sqlite ssl static-libs zlib"
38 +
39 +S="${WORKDIR}/${MY_P}"
40 +
41 +REQUIRED_USE="python? ( boost )"
42 +
43 +RDEPEND="bzip2? ( >=app-arch/bzip2-1.0.5 )
44 + zlib? ( >=sys-libs/zlib-1.2.3 )
45 + boost? ( ${PYTHON_DEPS} >=dev-libs/boost-1.48[python?,${PYTHON_USEDEP}] )
46 + lzma? ( app-arch/xz-utils )
47 + sqlite? ( dev-db/sqlite:3 )
48 + ssl? (
49 + !libressl? ( >=dev-libs/openssl-0.9.8g:0[bindist=] )
50 + libressl? ( dev-libs/libressl )
51 + )"
52 +DEPEND="${RDEPEND}
53 + doc? ( dev-python/sphinx )"
54 +
55 +pkg_pretend() {
56 + # Botan 1.11 requires -std=c++11
57 + if [[ ${MERGE_TYPE} != binary ]]; then
58 + [[ $(gcc-major-version) -lt 4 ]] || \
59 + ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) \
60 + && die "Sorry, but gcc 4.7 or higher is required."
61 + fi
62 +}
63 +
64 +src_prepare() {
65 + epatch "${FILESDIR}/${P}-build-python.patch"
66 + sed \
67 + -e "/^install:/s/ docs//" \
68 + -i src/build-data/makefile/gmake.in || die "sed failed"
69 + use python && python_copy_sources
70 +}
71 +
72 +src_configure() {
73 + local disable_modules=( proc_walk unix_procs )
74 + use boost || disable_modules+=( "boost" )
75 + use bindist && disable_modules+=( "ecdsa" )
76 + elog "Disabling modules: ${disable_modules[@]}"
77 +
78 + # Enable v9 instructions for sparc64
79 + if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
80 + CHOSTARCH="sparc32-v9"
81 + else
82 + CHOSTARCH="${CHOST%%-*}"
83 + fi
84 +
85 + local myos=
86 + case ${CHOST} in
87 + *-darwin*) myos=darwin ;;
88 + *) myos=linux ;;
89 + esac
90 +
91 + local pythonvers=()
92 + if use python; then
93 + append() {
94 + pythonvers+=( ${EPYTHON/python/} )
95 + }
96 + python_foreach_impl append
97 + fi
98 +
99 + ./configure.py \
100 + --prefix="${EPREFIX}/usr" \
101 + --destdir="${D}/${EPREFIX}/usr" \
102 + --libdir=$(get_libdir) \
103 + --docdir=share/doc \
104 + --cc=gcc \
105 + --os=${myos} \
106 + --cpu=${CHOSTARCH} \
107 + --with-endian="$(tc-endian)" \
108 + --without-sphinx \
109 + $(use_with bzip2) \
110 + $(use_with lzma) \
111 + $(use_with sqlite sqlite3) \
112 + $(use_with ssl openssl) \
113 + $(use_with zlib) \
114 + $(use_with boost) \
115 + --with-python-version=$(IFS=","; echo "${pythonvers[*]}" ) \
116 + --disable-modules=$(IFS=","; echo "${disable_modules[*]}" ) \
117 + || die "configure.py failed"
118 +}
119 +
120 +src_compile() {
121 + emake CXX="$(tc-getCXX) -pthread" AR="$(tc-getAR) crs" LIB_OPT="-c ${CXXFLAGS}"
122 + if use doc; then
123 + einfo "Generation of documentation"
124 + sphinx-build doc doc_output
125 + fi
126 +}
127 +
128 +src_test() {
129 + LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed"
130 +}
131 +
132 +src_install() {
133 + emake install
134 +
135 + if ! use static-libs; then
136 + rm "${ED}usr/$(get_libdir)/libbotan"*.a || die 'remove of static libs failed'
137 + fi
138 +
139 + # Add compatibility symlinks.
140 + [[ -e "${ED}usr/bin/botan-config" ]] && die "Compatibility code no longer needed"
141 + [[ -e "${ED}usr/$(get_libdir)/pkgconfig/botan.pc" ]] && die "Compatibility code no longer needed"
142 + dosym botan-config-1.11 /usr/bin/botan-config
143 + dosym botan-1.11.pc /usr/$(get_libdir)/pkgconfig/botan.pc
144 +
145 + use python && python_foreach_impl python_optimize
146 +
147 + if use doc; then
148 + pushd doc_output > /dev/null
149 + insinto /usr/share/doc/${PF}/html
150 + doins -r [a-z]* _static
151 + popd > /dev/null
152 + fi
153 +}