1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python{2_7,3_6} )
7 inherit multilib python-r1 toolchain-funcs
11 DESCRIPTION="A C++ crypto library"
12 HOMEPAGE="https://botan.randombit.net/"
13 SRC_URI="https://botan.randombit.net/releases/${MY_P}.tgz"
15 KEYWORDS="amd64 ~arm hppa ~ia64 ppc ppc64 ~sparc x86 ~ppc-macos"
16 SLOT="2/$(ver_cut 1-2)" # soname version
18 IUSE="bindist doc boost python bzip2 libressl lzma sqlite ssl static-libs zlib"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21 S="${WORKDIR}/${MY_P}"
23 DEPEND="python? ( ${PYTHON_DEPS} )"
25 bzip2? ( >=app-arch/bzip2-1.0.5:= )
26 zlib? ( >=sys-libs/zlib-1.2.3:= )
27 boost? ( >=dev-libs/boost-1.48:= )
28 lzma? ( app-arch/xz-utils:= )
29 sqlite? ( dev-db/sqlite:3= )
31 !libressl? ( dev-libs/openssl:0=[bindist=] )
32 libressl? ( dev-libs/libressl:0= )
34 BDEPEND="dev-lang/python:*
35 doc? ( dev-python/sphinx )"
38 "${FILESDIR}/${P}-build.patch"
42 local disable_modules=()
43 use boost || disable_modules+=( "boost" )
44 use bindist && disable_modules+=( "ecdsa" )
45 elog "Disabling modules: ${disable_modules[@]}"
47 # Enable v9 instructions for sparc64
48 if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
49 CHOSTARCH="sparc32-v9"
51 CHOSTARCH="${CHOST%%-*}"
56 *-darwin*) myos=darwin ;;
61 hppa*) CHOSTARCH=parisc ;;
67 pythonvers+=( ${EPYTHON/python/} )
69 python_foreach_impl append
72 CXX="$(tc-getCXX)" AR="$(tc-getAR)" ./configure.py \
73 $(use_enable static-libs static-library) \
76 $(use_with doc documentation) \
77 $(use_with doc sphinx) \
79 $(use_with sqlite sqlite3) \
80 $(use_with ssl openssl) \
82 $(usex hppa --without-stack-protector '') \
85 --disable-modules=$(IFS=","; echo "${disable_modules[*]}" ) \
87 --libdir=$(get_libdir) \
89 --prefix="${EPREFIX}/usr" \
90 --with-endian="$(tc-endian)" \
91 --with-python-version=$(IFS=","; echo "${pythonvers[*]}" ) \
93 || die "configure.py failed"
97 LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed"
102 use python && python_foreach_impl python_optimize