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 "${FILESDIR}/${P}-bindist-test-fix.patch"
45 local disable_modules=()
46 use boost || disable_modules+=( "boost" )
47 use bindist && disable_modules+=( "ecdsa" )
48 elog "Disabling modules: ${disable_modules[@]}"
50 # Enable v9 instructions for sparc64
51 if [[ "${PROFILE_ARCH}" = "sparc64" ]]; then
52 CHOSTARCH="sparc32-v9"
54 CHOSTARCH="${CHOST%%-*}"
59 *-darwin*) myos=darwin ;;
64 hppa*) CHOSTARCH=parisc ;;
70 pythonvers+=( ${EPYTHON/python/} )
72 python_foreach_impl append
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) \
81 $(use_with doc documentation) \
82 $(use_with doc sphinx) \
84 $(use_with sqlite sqlite3) \
85 $(use_with ssl openssl) \
87 $(usex hppa --without-stack-protector '') \
90 --disable-modules=$(IFS=","; echo "${disable_modules[*]}" ) \
92 --libdir=$(get_libdir) \
94 --distribution-info="Gentoo ${PVR}" \
95 --prefix="${EPREFIX}/usr" \
96 --with-endian="$(tc-endian)" \
97 --with-python-version=$(IFS=","; echo "${pythonvers[*]}" ) \
99 --no-install-python-module \
100 || die "configure.py failed"
104 LD_LIBRARY_PATH="${S}" ./botan-test || die "Validation tests failed"
109 use python && python_foreach_impl python_domodule src/python/botan2.py