1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 02:20:53 +02:00
guix/gnu/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch
Abhishek Cherath 075ff9f60b
gnu: webkitgtk: Expose more paths to bubblewrap sandbox.
Provide access to system locale path and to paths from GUIX_LOCPATH, LOCPATH,
and LIBVA_DRIVERS_PATH to the Bubblewrap sandbox in order to silence GTK
locale warnings and enable hardware accelerated video.

* gnu/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch: Add @dridir@
and @localedir@ to bubblewrap gtk sandbox.  Add paths from GUIX_LOCPATH,
LOCPATH, and LIBVA_DRIVERS_PATH to bubblewrap gtk sandbox.
* gnu/packages/webkit.scm (webkitgtk) [arguments]: In the
'configure-bubblewrap-store-directory' phase, also supply system locale to
webkitgtk-adjust-bubblewrap-paths.patch template.

Change-Id: I6be0c473ebaa6c04ebb00a2b4afcae2c89396e4f
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-03-02 20:31:34 +01:00

49 lines
2.2 KiB
Diff

Share /gnu/store in the BubbleWrap container and remove FHS mounts.
Also share system locale directory and paths in LOCPATH, GUIX_LOCPATH,
and LIBVA_DRIVERS_PATH.
This is a Guix-specific patch not meant to be upstreamed.
diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
index f0a5e4b05dff..88b11f806968 100644
--- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
@@ -854,27 +854,21 @@ GRefPtr<GSubprocess> bubblewrapSpawn(GSubprocessLauncher* launcher, const Proces
"--ro-bind", "/sys/dev", "/sys/dev",
"--ro-bind", "/sys/devices", "/sys/devices",
- "--ro-bind-try", "/usr/share", "/usr/share",
- "--ro-bind-try", "/usr/local/share", "/usr/local/share",
"--ro-bind-try", DATADIR, DATADIR,
-
- // We only grant access to the libdirs webkit is built with and
- // guess system libdirs. This will always have some edge cases.
- "--ro-bind-try", "/lib", "/lib",
- "--ro-bind-try", "/usr/lib", "/usr/lib",
- "--ro-bind-try", "/usr/local/lib", "/usr/local/lib",
"--ro-bind-try", LIBDIR, LIBDIR,
-#if CPU(ADDRESS64)
- "--ro-bind-try", "/lib64", "/lib64",
- "--ro-bind-try", "/usr/lib64", "/usr/lib64",
- "--ro-bind-try", "/usr/local/lib64", "/usr/local/lib64",
-#else
- "--ro-bind-try", "/lib32", "/lib32",
- "--ro-bind-try", "/usr/lib32", "/usr/lib32",
- "--ro-bind-try", "/usr/local/lib32", "/usr/local/lib32",
-#endif
-
"--ro-bind-try", PKGLIBEXECDIR, PKGLIBEXECDIR,
+
+ // Bind mount the store inside the WebKitGTK sandbox.
+ "--ro-bind", "@storedir@", "@storedir@",
+
+ // This is needed for system locales.
+ "--ro-bind-try", "@localedir@", "@localedir@",
};
+ // User specified locale directory.
+ bindPathVar(sandboxArgs, "LOCPATH");
+ // Locales in case of foreign system.
+ bindPathVar(sandboxArgs, "GUIX_LOCPATH");
+ // Drivers for video hardware acceleration (va-api).
+ bindPathVar(sandboxArgs, "LIBVA_DRIVERS_PATH");
if (launchOptions.processType == ProcessLauncher::ProcessType::DBusProxy) {