dev-libs/botan: stable 2.14.0-r1 for hppa, bug #722904
[gentoo.git] / dev-libs / botan / botan-2.14.0-r1.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 PYTHON_COMPAT=( python3_{6,7,8} )
7
8 MY_P="Botan-${PV}"
9 inherit python-r1 toolchain-funcs
10
11 DESCRIPTION="C++ crypto library"
12 HOMEPAGE="https://botan.randombit.net/"
13 SRC_URI="https://botan.randombit.net/releases/${MY_P}.tar.xz"
14
15 LICENSE="BSD"
16 SLOT="2/$(ver_cut 1-2)" # soname version
17 KEYWORDS="amd64 ~arm hppa ~ia64 ppc ppc64 ~sparc x86 ~ppc-macos"
18 IUSE="bindist bzip2 boost doc libressl lzma python sqlite ssl static-libs zlib"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
20
21 S="${WORKDIR}/${MY_P}"
22
23 DEPEND="python? ( ${PYTHON_DEPS} )"
24 RDEPEND="${DEPEND}
25         boost? ( >=dev-libs/boost-1.48:= )
26         bzip2? ( >=app-arch/bzip2-1.0.5:= )
27         lzma? ( app-arch/xz-utils:= )
28         sqlite? ( dev-db/sqlite:3= )
29         ssl? (
30                 !libressl? ( dev-libs/openssl:0=[bindist=] )
31                 libressl? ( dev-libs/libressl:0= )
32         )
33         zlib? ( >=sys-libs/zlib-1.2.3:= )
34 "
35 BDEPEND="
36         dev-lang/python:*
37         doc? ( dev-python/sphinx )
38 "
39
40 PATCHES=(
41         "${FILESDIR}/${P}-bindist-test-fix.patch"
42 )
43
44 src_configure() {
45         local disable_modules=()
46         use boost || disable_modules+=( "boost" )
47         use bindist && disable_modules+=( "ecdsa" )
48         elog "Disabling modules: ${disable_modules[@]}"
49
50         # Enable v9 instructions for sparc64
51         if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
52                 CHOSTARCH="sparc32-v9"
53         else
54                 CHOSTARCH="${CHOST%%-*}"
55         fi
56
57         local myos=
58         case ${CHOST} in
59                 *-darwin*) myos=darwin ;;
60                 *) myos=linux  ;;
61         esac
62
63         case ${CHOST} in
64                 hppa*) CHOSTARCH=parisc ;;
65         esac
66
67         local pythonvers=()
68         if use python; then
69                 append() {
70                         pythonvers+=( ${EPYTHON/python/} )
71                 }
72                 python_foreach_impl append
73         fi
74
75         # Don't install automatically, do it manually later in right place
76         # https://bugs.gentoo.org/723096
77         CXX="$(tc-getCXX)" AR="$(tc-getAR)" ./configure.py \
78                 $(use_enable static-libs static-library) \
79                 $(use_with boost) \
80                 $(use_with bzip2) \
81                 $(use_with doc documentation) \
82                 $(use_with doc sphinx) \
83                 $(use_with lzma) \
84                 $(use_with sqlite sqlite3) \
85                 $(use_with ssl openssl) \
86                 $(use_with zlib) \
87                 $(usex hppa --without-stack-protector '') \
88                 --cc=gcc \
89                 --cpu=${CHOSTARCH} \
90                 --disable-modules=$(IFS=","; echo "${disable_modules[*]}" ) \
91                 --docdir=share/doc \
92                 --libdir=$(get_libdir) \
93                 --os=${myos} \
94                 --distribution-info="Gentoo ${PVR}" \
95                 --prefix="${EPREFIX}/usr" \
96                 --with-endian="$(tc-endian)" \
97                 --with-python-version=$(IFS=","; echo "${pythonvers[*]}" ) \
98                 --without-doxygen \
99                 --no-install-python-module \
100                 || die "configure.py failed"
101 }
102
103 src_test() {
104         LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed"
105 }
106
107 src_install() {
108         default
109         use python && python_foreach_impl python_domodule src/python/botan2.py
110 }