From 6e60a0a3729c2e165f7504e0f227332634d0ae93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 24 Feb 2018 20:06:50 +0100 Subject: [PATCH] Pull in patch from upstream to fix build Also modernize a bit. --- fix-test-assertion-with-umockdev.patch | 42 ++++++++++++++++++++++++++ libgudev.spec | 11 +++++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 fix-test-assertion-with-umockdev.patch diff --git a/fix-test-assertion-with-umockdev.patch b/fix-test-assertion-with-umockdev.patch new file mode 100644 index 0000000..d829175 --- /dev/null +++ b/fix-test-assertion-with-umockdev.patch @@ -0,0 +1,42 @@ +From bf8664a028d8cbc55f9dbc65fef926e2119b9579 Mon Sep 17 00:00:00 2001 +From: James Clarke +Date: Tue, 23 Jan 2018 21:03:51 +0000 +Subject: tests: Fix test assertion with umockdev + +Since 0.9.4, rather than checking for libumockdev-preload being in +LD_PRELOAD, umockdev_in_mock_environment now checks whether /sys is +being redirected. This only occurs when $UMOCKDEV_DIR is set, which +happens inside umockdev_testbed_new, so the assertion must come after +this call. + +https://bugzilla.gnome.org/show_bug.cgi?id=792845 +--- + tests/test-enumerator-filter.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tests/test-enumerator-filter.c b/tests/test-enumerator-filter.c +index 9c97903..dfcdba2 100644 +--- a/tests/test-enumerator-filter.c ++++ b/tests/test-enumerator-filter.c +@@ -37,6 +37,9 @@ test_enumerator_filter (void) + /* create test bed */ + UMockdevTestbed *testbed = umockdev_testbed_new (); + ++ /* Relies on a test bed having been set up */ ++ g_assert (umockdev_in_mock_environment ()); ++ + /* Add 2 devices in the USB subsystem, and one in the DRM subsystem */ + umockdev_testbed_add_device (testbed, "usb", "dev1", NULL, + "idVendor", "0815", "idProduct", "AFFE", NULL, +@@ -74,8 +77,6 @@ int main(int argc, char **argv) + setlocale (LC_ALL, NULL); + g_test_init (&argc, &argv, NULL); + +- g_assert (umockdev_in_mock_environment ()); +- + g_test_add_func ("/gudev/enumerator_filter", test_enumerator_filter); + + return g_test_run (); +-- +cgit v0.12 + diff --git a/libgudev.spec b/libgudev.spec index bf09b1b..addb461 100644 --- a/libgudev.spec +++ b/libgudev.spec @@ -7,6 +7,8 @@ License: LGPLv2+ URL: https://wiki.gnome.org/Projects/libgudev Source0: https://download.gnome.org/sources/libgudev/%{version}/libgudev-%{version}.tar.xz +Patch1: https://git.gnome.org/browse/libgudev/patch/?id=bf8664a028d8cbc55f9dbc65fef926e2119b9579#/fix-test-assertion-with-umockdev.patch + BuildRequires: glib2-devel BuildRequires: gobject-introspection-devel BuildRequires: pkgconfig @@ -35,14 +37,14 @@ Obsoletes: libgudev1-devel < 230 This package is necessary to build programs using %{name}. %prep -%setup -q +%autosetup -p1 %build %configure --enable-gtk-doc -make %{?_smp_mflags} +%make_build V=1 %install -%makeinstall +%make_install rm %{buildroot}%{_libdir}/*.la %check @@ -68,6 +70,9 @@ make check %changelog +* Sat Feb 24 2018 Zbigniew Jędrzejewski-Szmek - 232-3 +- Pull in patch from upstream to fix build + * Wed Feb 07 2018 Fedora Release Engineering - 232-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild