*/*: Discontinue Gentoo SuperH port
[gentoo.git] / app-crypt / p11-kit / p11-kit-0.23.20-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 inherit multilib-minimal
7
8 DESCRIPTION="Provides a standard configuration setup for installing PKCS#11"
9 HOMEPAGE="https://p11-glue.github.io/p11-glue/p11-kit.html"
10 SRC_URI="https://github.com/p11-glue/p11-kit/releases/download/${PV}/${P}.tar.xz"
11
12 LICENSE="MIT"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="+asn1 debug +libffi +trust"
16 REQUIRED_USE="trust? ( asn1 )"
17
18 RDEPEND="asn1? ( >=dev-libs/libtasn1-3.4:=[${MULTILIB_USEDEP}] )
19         libffi? ( dev-libs/libffi:=[${MULTILIB_USEDEP}] )
20         trust? ( app-misc/ca-certificates )"
21 DEPEND="${RDEPEND}"
22 BDEPEND="virtual/pkgconfig"
23
24 pkg_setup() {
25         # disable unsafe tests, bug#502088
26         export FAKED_MODE=1
27 }
28
29 src_prepare() {
30         if [[ ${CHOST} == *-solaris2.* && ${CHOST##*-solaris2.} -lt 11 ]] ; then
31                 # Solaris 10 and before doesn't know about XPG7 (XOPEN_SOURCE=700)
32                 # drop to XPG6 to make feature_tests.h happy
33                 sed -i -e '/define _XOPEN_SOURCE/s/700/600/' common/compat.c || die
34                 # paths.h isn't available, oddly enough also not used albeit included
35                 sed -i -e '/#include <paths.h>/d' trust/test-trust.c || die
36                 # we don't have SUN_LEN here
37                 sed -i -e 's/SUN_LEN \(([^)]\+)\)/strlen (\1->sun_path)/' \
38                         p11-kit/server.c || die
39         fi
40         default
41 }
42
43 multilib_src_configure() {
44         ECONF_SOURCE="${S}" econf \
45                 $(use_enable trust trust-module) \
46                 $(use_with trust trust-paths ${EPREFIX}/etc/ssl/certs/ca-certificates.crt) \
47                 $(use_enable debug) \
48                 $(use_with libffi) \
49                 $(use_with asn1 libtasn1)
50
51         if multilib_is_native_abi; then
52                 # re-use provided documentation
53                 ln -s "${S}"/doc/manual/html doc/manual/html || die
54         fi
55 }
56
57 multilib_src_install_all() {
58         einstalldocs
59         find "${D}" -name '*.la' -delete || die
60 }