mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-24 18:58:08 -07:00
app-crypt/libsecret: make tests optional, workaround Vala issue
We had an issue reported in #gentoo w/ libsecret's tests failing to build when 0.21.1 is installed and upgrading to 0.21.7. There's two issues here: 1) Tests were being built unconditionally. There's an upstream MR to fix that, so pull it in. (I've added in another patch to control building the Vala tests with that same option). 2) The Vala tests use the system copy of libsecret, which the FreeBSD bug linked below works around with a sed in meson-private. We're not going to do that, so this issue remains unfixed for now, but worked around for most users via 1). Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287429 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
https://gitlab.gnome.org/GNOME/libsecret/-/merge_requests/162
|
||||
|
||||
From 219c3f3c48bd5af7ae9305a769a3b06a72929369 Mon Sep 17 00:00:00 2001
|
||||
From: Niels De Graef <nielsdegraef@gmail.com>
|
||||
Date: Sun, 26 Jan 2025 23:45:31 +0100
|
||||
Subject: [PATCH] meson: Put test setup behind a feature option
|
||||
|
||||
This should allow the following cases:
|
||||
|
||||
- In case of "auto" (the default): meson will check if the necessary
|
||||
binaries are installed (such as `dbus-run-session`) on the system and
|
||||
fall back.
|
||||
- In case of "enabled": meson will require the necessary binaries to be
|
||||
installed
|
||||
- In case of "disabled": meson will not try to mark this as the default
|
||||
test setup.
|
||||
|
||||
The first case was already the default, however, some systems have a
|
||||
preconfigured test setup which they'd like to use instead. Allow them to
|
||||
disable the default test setup in that case.
|
||||
|
||||
Fixes: https://gitlab.gnome.org/GNOME/libsecret/-/issues/101
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -102,7 +102,7 @@ test_env = environment()
|
||||
test_env.set('abs_top_builddir', meson.build_root())
|
||||
|
||||
# Most tests require a D-Bus session, so try to wrap automatically with dbus-run-session
|
||||
-dbus_run_session = find_program('dbus-run-session', required: false)
|
||||
+dbus_run_session = find_program('dbus-run-session', required: get_option('test_setup'))
|
||||
if dbus_run_session.found()
|
||||
add_test_setup('dbus',
|
||||
exe_wrapper: dbus_run_session,
|
||||
--- a/meson_options.txt
|
||||
+++ b/meson_options.txt
|
||||
@@ -61,3 +61,8 @@ option('pam',
|
||||
description: 'Build PAM module',
|
||||
)
|
||||
|
||||
+option('test_setup',
|
||||
+ type: 'feature',
|
||||
+ value: 'auto',
|
||||
+ description: 'Automatically setup a test environment when running tests',
|
||||
+)
|
||||
--
|
||||
GitLab
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/libsecret/meson.build
|
||||
+++ b/libsecret/meson.build
|
||||
@@ -306,7 +306,7 @@ if get_option('introspection')
|
||||
# Vala tests
|
||||
# FIXME: Don't add Vala tests when generating a coverage build, as this
|
||||
# will fail due to https://github.com/mesonbuild/meson/issues/7426
|
||||
- if get_option('vapi') and not get_option('b_coverage')
|
||||
+ if get_option('vapi') and not get_option('b_coverage') and get_option('test_setup').enabled()
|
||||
# FIXME: the "native" kwarg should be added once we can require meson ≥0.54
|
||||
add_languages('vala')
|
||||
valac = meson.get_compiler('vala')
|
||||
@@ -60,6 +60,8 @@ BDEPEND="
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-0.21.7-optional-tests.patch
|
||||
"${FILESDIR}"/${PN}-0.21.7-optional-vala-tests.patch
|
||||
"${FILESDIR}"/${PN}-0.21.7-fix-installing-pam-module.patch
|
||||
)
|
||||
|
||||
@@ -148,6 +150,7 @@ multilib_src_configure() {
|
||||
-Dbash_completion=enabled
|
||||
$(meson_native_use_bool tpm tpm2)
|
||||
$(meson_native_use_bool pam)
|
||||
$(meson_feature test test_setup)
|
||||
)
|
||||
|
||||
if use crypt ; then
|
||||
|
||||
@@ -59,6 +59,11 @@ BDEPEND="
|
||||
vala? ( $(vala_depend) )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-0.21.7-optional-tests.patch
|
||||
"${FILESDIR}"/${PN}-0.21.7-optional-vala-tests.patch
|
||||
)
|
||||
|
||||
dbus_run() {
|
||||
(
|
||||
# start isolated dbus session bus
|
||||
@@ -144,6 +149,7 @@ multilib_src_configure() {
|
||||
-Dbash_completion=enabled
|
||||
$(meson_native_use_bool tpm tpm2)
|
||||
$(meson_native_use_bool pam)
|
||||
$(meson_feature test test_setup)
|
||||
)
|
||||
|
||||
if use crypt ; then
|
||||
|
||||
Reference in New Issue
Block a user