1 # Copyright 1999-2025 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{10..13} )
7 inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1
9 DESCRIPTION="Provides a standard configuration setup for installing PKCS#11"
10 HOMEPAGE="https://p11-glue.github.io/p11-glue/p11-kit.html"
11 SRC_URI="https://github.com/p11-glue/p11-kit/releases/download/${PV}/${P}.tar.xz"
15 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
16 IUSE="+libffi gtk-doc nls systemd test"
17 RESTRICT="!test? ( test )"
20 app-misc/ca-certificates
21 >=dev-libs/libtasn1-3.4:=[${MULTILIB_USEDEP}]
22 libffi? ( dev-libs/libffi:=[${MULTILIB_USEDEP}] )
23 systemd? ( sys-apps/systemd:= )
28 app-text/docbook-xsl-stylesheets
31 gtk-doc? ( dev-util/gtk-doc )
32 nls? ( sys-devel/gettext )
38 # Relies on dlopen which won't work for multilib tests (bug #913971)
39 cat <<-EOF > "${S}"/p11-kit/test-server.sh || die
45 multilib_src_configure() {
46 # https://github.com/p11-glue/p11-kit/issues/664
47 append-cflags -std=gnu17
49 # Disable unsafe tests, bug#502088
52 local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local
54 # p11-kit doesn't need this to build and castxml needs Clang. To get
55 # a deterministic non-automagic build, always disable the search for
57 cat >> ${native_file} <<-EOF || die
59 castxml='castxml-falseified'
63 --native-file "${native_file}"
64 -Dbashcompdir="$(get_bashcompdir)"
65 -Dtrust_module=enabled
66 -Dtrust_paths="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt
67 $(meson_feature libffi)
70 $(meson_native_use_bool gtk-doc gtk_doc)
71 $(meson_native_true man)
72 $(meson_native_use_feature systemd)