1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
9 inherit python-r1 toolchain-funcs
11 DESCRIPTION="C++ crypto library"
12 HOMEPAGE="https://botan.randombit.net/"
13 SRC_URI="https://botan.randombit.net/releases/${MY_P}.tar.xz"
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} )"
21 S="${WORKDIR}/${MY_P}"
23 DEPEND="python? ( ${PYTHON_DEPS} )"
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= )
30 !libressl? ( dev-libs/openssl:0=[bindist=] )
31 libressl? ( dev-libs/libressl:0= )
33 zlib? ( >=sys-libs/zlib-1.2.3:= )
37 doc? ( dev-python/sphinx )
41 local disable_modules=()
42 use boost || disable_modules+=( "boost" )
43 use bindist && disable_modules+=( "ecdsa" )
44 elog "Disabling modules: ${disable_modules[@]}"
46 # Enable v9 instructions for sparc64
47 if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
48 CHOSTARCH="sparc32-v9"
50 CHOSTARCH="${CHOST%%-*}"
55 *-darwin*) myos=darwin ;;
60 hppa*) CHOSTARCH=parisc ;;
66 pythonvers+=( ${EPYTHON/python/} )
68 python_foreach_impl append
71 # Don't install automatically, do it manually later in right place
72 # https://bugs.gentoo.org/723096
73 CXX="$(tc-getCXX)" AR="$(tc-getAR)" ./configure.py \
74 $(use_enable static-libs static-library) \
77 $(use_with doc documentation) \
78 $(use_with doc sphinx) \
80 $(use_with sqlite sqlite3) \
81 $(use_with ssl openssl) \
83 $(usex hppa --without-stack-protector '') \
86 --disable-modules=$(IFS=","; echo "${disable_modules[*]}" ) \
88 --libdir=$(get_libdir) \
90 --prefix="${EPREFIX}/usr" \
91 --with-endian="$(tc-endian)" \
92 --with-python-version=$(IFS=","; echo "${pythonvers[*]}" ) \
94 --no-install-python-module \
95 || die "configure.py failed"
99 LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed"
104 use python && python_foreach_impl python_domodule src/python/botan2.py