1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{5,6} )
6 VALA_USE_DEPEND=vapigen
8 inherit gnome2 multilib-minimal python-any-r1 vala virtualx
10 DESCRIPTION="GObject library for accessing the freedesktop.org Secret Service API"
11 HOMEPAGE="https://wiki.gnome.org/Projects/Libsecret"
13 LICENSE="LGPL-2.1+ Apache-2.0" # Apache-2.0 license is used for tests only
16 IUSE="+crypt +introspection test +vala"
17 # Tests fail with USE=-introspection, https://bugs.gentoo.org/655482
18 REQUIRED_USE="test? ( introspection )
19 vala? ( introspection )"
21 KEYWORDS="alpha amd64 arm arm64 ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-fbsd"
24 >=dev-libs/glib-2.44:2[${MULTILIB_USEDEP}]
25 crypt? ( >=dev-libs/libgcrypt-1.2.2:0=[${MULTILIB_USEDEP}] )
26 introspection? ( >=dev-libs/gobject-introspection-1.29:= )
28 PDEPEND=">=gnome-base/gnome-keyring-3
30 # PDEPEND to avoid circular dep (bug #547456)
31 # gnome-keyring needed at runtime as explained at https://bugs.gentoo.org/475182#c2
32 # Add ksecrets to PDEPEND when it's added to portage
35 dev-util/gdbus-codegen
36 >=dev-util/gtk-doc-am-1.9
37 >=sys-devel/gettext-0.19.8
38 virtual/pkgconfig[${MULTILIB_USEDEP}]
40 $(python_gen_any_dep '
41 dev-python/mock[${PYTHON_USEDEP}]
42 dev-python/dbus-python[${PYTHON_USEDEP}]
43 introspection? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )')
44 introspection? ( >=dev-libs/gjs-1.32 )
46 vala? ( $(vala_depend) )
50 if use introspection; then
51 has_version --host-root "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
53 has_version --host-root "dev-python/mock[${PYTHON_USEDEP}]" &&
54 has_version --host-root "dev-python/dbus-python[${PYTHON_USEDEP}]"
58 use test && python-any-r1_pkg_setup
62 use vala && vala_src_prepare
65 # Drop unwanted CFLAGS modifications
66 sed -e 's/CFLAGS="$CFLAGS -\(g\|O0\|O2\)"//' -i configure || die
69 multilib_src_configure() {
70 local ECONF_SOURCE=${S}
71 gnome2_src_configure \
76 $(use_enable crypt gcrypt) \
77 $(multilib_native_use_enable introspection) \
78 $(multilib_native_use_enable vala) \
79 LIBGCRYPT_CONFIG="${EPREFIX}/usr/bin/${CHOST}-libgcrypt-config"
81 if multilib_is_native_abi; then
82 ln -s "${S}"/docs/reference/libsecret/html docs/reference/libsecret/html || die
87 # tests fail without gobject-introspection
88 multilib_is_native_abi && virtx emake check
91 multilib_src_install() {