gnu: upower: Update to 0.99.4.
[jackhill/guix/guix.git] / gnu / packages / patches / upower-builddir.patch
1 Remove explicit set of UPOWER_CONF_FILE_NAME in up-self-test.c;
2 instead the harness should set it. In Guix we set it explicitly; the
3 right thing is to use AM_TEST_ENVIRONMENT and regenerate the
4 makefiles, but we can't regenerate because current autotools carp on
5 some things, so we patch the Makefile.in instead.
6
7 Also fix to not try to create /var/lib/upower if /var isn't writable.
8
9 Patch by Andy Wingo <wingo@igalia.com>
10
11 --- upower-0.99.2.orig/src/Makefile.in 2014-12-18 10:32:01.000000000 +0100
12 +++ upower-0.99.2/src/Makefile.in 2015-04-04 19:49:28.020843678 +0200
13 @@ -780,6 +780,7 @@
14
15 @UP_BUILD_TESTS_TRUE@up_self_test_CFLAGS = $(AM_CFLAGS) $(WARNINGFLAGS_C)
16 @UP_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = $(DBUS_LAUNCH)
17 +@UP_BUILD_TESTS_TRUE@AM_TESTS_ENVIRONMENT = UPOWER_CONF_FILE_NAME=$(top_srcdir)/etc/UPower.conf
18 dbusservicedir = $(datadir)/dbus-1/system-services
19 dbusservice_in_files = org.freedesktop.UPower.service.in
20 dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
21 @@ -1789,7 +1790,7 @@
22 @HAVE_SYSTEMDSYSTEMUNITDIR_TRUE@ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
23
24 install-data-hook:
25 - if test -w $(DESTDIR)$(prefix)/; then \
26 + if test -w $(DESTDIR)$(localstatedir)/; then \
27 mkdir -p $(DESTDIR)$(historydir); \
28 fi
29
30 --- upower-0.99.2.orig/src/up-self-test.c 2014-07-17 09:46:15.000000000 +0200
31 +++ upower-0.99.2/src/up-self-test.c 2015-04-04 18:43:04.952741927 +0200
32 @@ -295,12 +295,6 @@
33 #endif
34 g_test_init (&argc, &argv, NULL);
35
36 - /* make check, vs. make distcheck */
37 - if (g_file_test ("../etc/UPower.conf", G_FILE_TEST_EXISTS))
38 - g_setenv ("UPOWER_CONF_FILE_NAME", "../etc/UPower.conf", TRUE);
39 - else
40 - g_setenv ("UPOWER_CONF_FILE_NAME", "../../../etc/UPower.conf", TRUE);
41 -
42 /* tests go here */
43 g_test_add_func ("/power/backend", up_test_backend_func);
44 g_test_add_func ("/power/device", up_test_device_func);