From 3471911a0167ea98891f9691aa10f7883badefd2 Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Wed, 4 Mar 2020 14:17:46 +0000 Subject: [PATCH] runtime: Combine multiple runs of capsule-capture-libs into one Now that we have this working, there's no real reason why we need a separate run per filename/SONAME pattern; we can just do them all at once, leaving only ICDs with more complicated requirements to be done separately. Signed-off-by: Simon McVittie <smcv@collabora.com> --- src/runtime.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/runtime.c b/src/runtime.c index 576c48eea..c02b66e46 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -1218,7 +1218,7 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, g_mkdir_with_parents (libdir_on_host, 0755); g_mkdir_with_parents (this_dri_path_on_host, 0755); - g_debug ("Collecting GLX drivers from host system..."); + g_debug ("Collecting graphics drivers from host system..."); temp_bwrap = pv_bwrap_copy (self->container_access_adverb); flatpak_bwrap_add_args (temp_bwrap, @@ -1227,22 +1227,11 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, "--link-target", "/run/host", "--dest", libdir_on_host, "--provider", "/", + /* Mesa GLX, etc. */ "gl:", - NULL); - flatpak_bwrap_finish (temp_bwrap); - - if (!pv_bwrap_run_sync (temp_bwrap, NULL, error)) - return FALSE; - - g_clear_pointer (&temp_bwrap, flatpak_bwrap_free); - - temp_bwrap = pv_bwrap_copy (self->container_access_adverb); - flatpak_bwrap_add_args (temp_bwrap, - tool_path, - "--container", self->container_access, - "--link-target", "/run/host", - "--dest", libdir_on_host, - "--provider", "/", + /* Vulkan */ + "if-exists:if-same-abi:soname:libvulkan.so.1", + /* NVIDIA proprietary stack */ "if-exists:even-if-older:soname-match:libEGL.so.*", "if-exists:even-if-older:soname-match:libEGL_nvidia.so.*", "if-exists:even-if-older:soname-match:libGL.so.*", @@ -1314,22 +1303,6 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, g_debug ("Collecting %s Vulkan drivers from host system...", multiarch_tuples[i]); - temp_bwrap = pv_bwrap_copy (self->container_access_adverb); - flatpak_bwrap_add_args (temp_bwrap, - tool_path, - "--container", self->container_access, - "--link-target", "/run/host", - "--dest", libdir_on_host, - "--provider", "/", - "if-exists:if-same-abi:soname:libvulkan.so.1", - NULL); - flatpak_bwrap_finish (temp_bwrap); - - if (!pv_bwrap_run_sync (temp_bwrap, NULL, error)) - return FALSE; - - g_clear_pointer (&temp_bwrap, flatpak_bwrap_free); - for (j = 0; j < vulkan_icd_details->len; j++) { IcdDetails *details = g_ptr_array_index (vulkan_icd_details, j); -- GitLab