aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-28 15:43:30 +0200
committerMarius Bakke <marius@gnu.org>2022-08-28 15:43:30 +0200
commitdedbaa3a69e8e4da419d62ce0022c1af02bbef5a (patch)
treea7ba03967c4765d73d8a24fc493e654ec15ac689 /gnu/packages/patches
parent5bfe389a6eb7727994b802d2aa8737c16fd78057 (diff)
parent57f8f69562e942557e3331bb81c7e4acd973d189 (diff)
downloadguix-dedbaa3a69e8e4da419d62ce0022c1af02bbef5a.tar.gz
guix-dedbaa3a69e8e4da419d62ce0022c1af02bbef5a.zip
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/gnome-shell-polkit-autocleanup.patch50
-rw-r--r--gnu/packages/patches/scons-test-environment.patch57
2 files changed, 107 insertions, 0 deletions
diff --git a/gnu/packages/patches/gnome-shell-polkit-autocleanup.patch b/gnu/packages/patches/gnome-shell-polkit-autocleanup.patch
new file mode 100644
index 0000000000..08968b83a1
--- /dev/null
+++ b/gnu/packages/patches/gnome-shell-polkit-autocleanup.patch
@@ -0,0 +1,50 @@
+Don't redefine G_DEFINE_AUTOPTR_CLEANUP_FUNC when available in polkit.
+
+Taken from upstream:
+
+ https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/1d0a08b5e25fea7b0e792ec9798e68a7c5606a75
+
+diff --git a/config.h.meson b/config.h.meson
+index b93fda8727..ff355d3062 100644
+--- a/config.h.meson
++++ b/config.h.meson
+@@ -33,3 +33,6 @@
+
+ /* Define if fdwalk is available in libc */
+ #mesondefine HAVE_FDWALK
++
++/* Define if polkit defines autocleanup functions */
++#mesondefine HAVE_POLKIT_AUTOCLEANUP
+diff --git a/meson.build b/meson.build
+index 42ec01c566..778a34c6ef 100644
+--- a/meson.build
++++ b/meson.build
+@@ -169,6 +169,13 @@ cdata.set('HAVE_FDWALK',
+ cc.has_function('fdwalk')
+ )
+
++polkit_has_autocleanup = cc.compiles(
++ '#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
++ #include <polkitagent/polkitagent.h>
++ void main(void) { g_autoptr(PolkitAgentListener) agent = NULL; }',
++ dependencies: polkit_dep)
++cdata.set('HAVE_POLKIT_AUTOCLEANUP', polkit_has_autocleanup)
++
+ buildtype = get_option('buildtype')
+ if buildtype != 'plain'
+ all_warnings = [
+diff --git a/src/shell-polkit-authentication-agent.h b/src/shell-polkit-authentication-agent.h
+index 55b46af110..4f14749563 100644
+--- a/src/shell-polkit-authentication-agent.h
++++ b/src/shell-polkit-authentication-agent.h
+@@ -14,8 +14,10 @@
+
+ G_BEGIN_DECLS
+
++#ifndef HAVE_POLKIT_AUTOCLEANUP
+ /* Polkit doesn't have g_autoptr support, thus we have to manually set the autoptr function here */
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAgentListener, g_object_unref)
++#endif
+
+ #define SHELL_TYPE_POLKIT_AUTHENTICATION_AGENT (shell_polkit_authentication_agent_get_type())
+
diff --git a/gnu/packages/patches/scons-test-environment.patch b/gnu/packages/patches/scons-test-environment.patch
new file mode 100644
index 0000000000..be5b61b2d4
--- /dev/null
+++ b/gnu/packages/patches/scons-test-environment.patch
@@ -0,0 +1,57 @@
+Inherit essential environment variables in tests.
+
+Note: it could be better to generalize this in SCons/Platform/posix.py
+instead of just patching the tests.
+
+diff --git a/SCons/ActionTests.py b/SCons/ActionTests.py
+--- a/SCons/ActionTests.py
++++ b/SCons/ActionTests.py
+@@ -98,6 +98,7 @@ outfile2 = test.workpath('outfile2')
+ pipe_file = test.workpath('pipe.out')
+
+ scons_env = SCons.Environment.Environment()
++scons_env['ENV']['PATH'] += os.environ['PATH']
+
+ # Capture all the stuff the Actions will print,
+ # so it doesn't clutter the output.
+@@ -1090,6 +1091,8 @@ class CommandActionTestCase(unittest.TestCase):
+ except AttributeError:
+ env = Environment()
+
++ env = Environment(ENV={'PATH': os.environ['PATH']})
++
+ cmd1 = r'%s %s %s xyzzy' % (_python_, act_py, outfile)
+
+ act = SCons.Action.CommandAction(cmd1)
+@@ -1884,7 +1887,7 @@ class ListActionTestCase(unittest.TestCase):
+ f.write("class2b\n")
+
+ act = SCons.Action.ListAction([cmd2, function2, class2a(), class2b])
+- r = act([], [], Environment(out=outfile))
++ r = act([], [], Environment(out=outfile, ENV={'PATH' : os.getenv('PATH')}))
+ assert isinstance(r.status, class2b), r.status
+ c = test.read(outfile, 'r')
+ assert c == "act.py: 'syzygy'\nfunction2\nclass2a\nclass2b\n", c
+@@ -1948,7 +1951,7 @@ class LazyActionTestCase(unittest.TestCase):
+ a([], [], env=Environment(BAR=f, s=self))
+ assert self.test == 1, self.test
+ cmd = r'%s %s %s lazy' % (_python_, act_py, outfile)
+- a([], [], env=Environment(BAR=cmd, s=self))
++ a([], [], env=Environment(BAR=cmd, s=self, ENV={'PATH' : os.getenv('PATH')}))
+ c = test.read(outfile, 'r')
+ assert c == "act.py: 'lazy'\n", c
+
+diff --git a/SCons/SConfTests.py b/SCons/SConfTests.py
+--- a/SCons/SConfTests.py
++++ b/SCons/SConfTests.py
+@@ -71,7 +71,9 @@ class SConfTestCase(unittest.TestCase):
+ # and we need a new environment, cause references may point to
+ # old modules (well, at least this is safe ...)
+ self.scons_env = self.Environment.Environment()
+- self.scons_env.AppendENVPath('PATH', os.environ['PATH'])
++ # Inherit the OS environment to get essential variables.
++ inherited_env = os.environ.copy()
++ self.scons_env['ENV'] = inherited_env
+
+ # we want to do some autodetection here
+ # this stuff works with