app-crypt/libsecret: ppc64 stable wrt bug #685254
[gentoo.git] / app-crypt / libsecret / libsecret-0.18.8.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python3_{5,6} )
6 VALA_USE_DEPEND=vapigen
7
8 inherit gnome2 multilib-minimal python-any-r1 vala virtualx
9
10 DESCRIPTION="GObject library for accessing the freedesktop.org Secret Service API"
11 HOMEPAGE="https://wiki.gnome.org/Projects/Libsecret"
12
13 LICENSE="LGPL-2.1+ Apache-2.0" # Apache-2.0 license is used for tests only
14 SLOT="0"
15
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 )"
20
21 KEYWORDS="alpha amd64 arm arm64 ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-fbsd"
22
23 RDEPEND="
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:= )
27 "
28 PDEPEND=">=gnome-base/gnome-keyring-3
29 "
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
33 DEPEND="${RDEPEND}
34         dev-libs/libxslt
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}]
39         test? (
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 )
45         )
46         vala? ( $(vala_depend) )
47 "
48
49 python_check_deps() {
50         if use introspection; then
51                 has_version --host-root "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
52         fi
53         has_version --host-root "dev-python/mock[${PYTHON_USEDEP}]" &&
54         has_version --host-root "dev-python/dbus-python[${PYTHON_USEDEP}]"
55 }
56
57 pkg_setup() {
58         use test && python-any-r1_pkg_setup
59 }
60
61 src_prepare() {
62         use vala && vala_src_prepare
63         gnome2_src_prepare
64
65         # Drop unwanted CFLAGS modifications
66         sed -e 's/CFLAGS="$CFLAGS -\(g\|O0\|O2\)"//' -i configure || die
67 }
68
69 multilib_src_configure() {
70         local ECONF_SOURCE=${S}
71         gnome2_src_configure \
72                 --enable-manpages \
73                 --disable-strict \
74                 --disable-coverage \
75                 --disable-static \
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"
80
81         if multilib_is_native_abi; then
82                 ln -s "${S}"/docs/reference/libsecret/html docs/reference/libsecret/html || die
83         fi
84 }
85
86 multilib_src_test() {
87         # tests fail without gobject-introspection
88         multilib_is_native_abi && virtx emake check
89 }
90
91 multilib_src_install() {
92         gnome2_src_install
93 }