gnu: ungoogled-chromium: Don't add absolute references to libGL and libvulkan.
Keeping track of the uses of these libraries is a lot of work and ultimately not worth the trouble -- especially since Chromium supports multiple libGL's with different ABIs. Instead we take the easy route and rely on a search path. * gnu/packages/chromium.scm (ungoogled-chromium)[arguments]: Remove patching of libGL.so and libvulkan.so. Instead wrap with LD_LIBRARY_PATH.
This commit is contained in:
		
							parent
							
								
									5834953573
								
							
						
					
					
						commit
						a03743f016
					
				
					 1 changed files with 8 additions and 29 deletions
				
			
		| 
						 | 
					@ -698,8 +698,6 @@
 | 
				
			||||||
                    (libvulkan.so.1 (search-input-file inputs
 | 
					                    (libvulkan.so.1 (search-input-file inputs
 | 
				
			||||||
                                                       "/lib/libvulkan.so.1"))
 | 
					                                                       "/lib/libvulkan.so.1"))
 | 
				
			||||||
                    (icd.d (search-input-directory inputs "share/vulkan/icd.d"))
 | 
					                    (icd.d (search-input-directory inputs "share/vulkan/icd.d"))
 | 
				
			||||||
                    (mesa-lib (dirname (search-input-file inputs
 | 
					 | 
				
			||||||
                                                          "/lib/libGL.so.1")))
 | 
					 | 
				
			||||||
                    (gtk-libs '("libgio-2.0.so.0"
 | 
					                    (gtk-libs '("libgio-2.0.so.0"
 | 
				
			||||||
                                "libgdk_pixbuf-2.0.so.0"
 | 
					                                "libgdk_pixbuf-2.0.so.0"
 | 
				
			||||||
                                "libgdk-3.so.0"
 | 
					                                "libgdk-3.so.0"
 | 
				
			||||||
| 
						 | 
					@ -717,20 +715,6 @@
 | 
				
			||||||
                (substitute* "device/udev_linux/udev1_loader.cc"
 | 
					                (substitute* "device/udev_linux/udev1_loader.cc"
 | 
				
			||||||
                  (("libudev\\.so\\.1") libudev.so.1))
 | 
					                  (("libudev\\.so\\.1") libudev.so.1))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ;; Patch libvulkan.so everywhere.
 | 
					 | 
				
			||||||
                (substitute*
 | 
					 | 
				
			||||||
                    '("third_party/swiftshader/include/vulkan/vulkan.hpp"
 | 
					 | 
				
			||||||
                      "third_party/vulkan-deps/vulkan-tools\
 | 
					 | 
				
			||||||
/src/vulkaninfo/vulkaninfo.h"
 | 
					 | 
				
			||||||
                      "third_party/vulkan-deps/vulkan-headers\
 | 
					 | 
				
			||||||
/src/include/vulkan/vulkan.hpp"
 | 
					 | 
				
			||||||
                      "content/gpu/gpu_sandbox_hook_linux.cc"
 | 
					 | 
				
			||||||
                      "ui/ozone/platform/wayland/gpu/vulkan_implementation_wayland.cc"
 | 
					 | 
				
			||||||
                      "ui/ozone/platform/drm/gpu/vulkan_implementation_gbm.cc"
 | 
					 | 
				
			||||||
                      "ui/ozone/platform/x11/vulkan_implementation_x11.cc"
 | 
					 | 
				
			||||||
                      "third_party/skia/tools/sk_app/unix\
 | 
					 | 
				
			||||||
/DawnVulkanWindowContext_unix.cpp")
 | 
					 | 
				
			||||||
                  (("libvulkan\\.so\\.1") libvulkan.so.1))
 | 
					 | 
				
			||||||
                (substitute* "content/gpu/gpu_sandbox_hook_linux.cc"
 | 
					                (substitute* "content/gpu/gpu_sandbox_hook_linux.cc"
 | 
				
			||||||
                  (("/usr/share/vulkan/icd\\.d") icd.d))
 | 
					                  (("/usr/share/vulkan/icd\\.d") icd.d))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -739,19 +723,7 @@
 | 
				
			||||||
                  (("^([[:blank:]]+)mRuntimeSearchPaths\\.push_back\\(\"\"\\);"
 | 
					                  (("^([[:blank:]]+)mRuntimeSearchPaths\\.push_back\\(\"\"\\);"
 | 
				
			||||||
                    all indent)
 | 
					                    all indent)
 | 
				
			||||||
                   (string-append indent "mRuntimeSearchPaths.push_back(\""
 | 
					                   (string-append indent "mRuntimeSearchPaths.push_back(\""
 | 
				
			||||||
                                  (dirname libvulkan.so.1) "/\");\n" all)))
 | 
					                                  (dirname libvulkan.so.1) "/\");\n" all))))))
 | 
				
			||||||
 | 
					 | 
				
			||||||
                (substitute*
 | 
					 | 
				
			||||||
                    '("ui/ozone/platform/x11/gl_ozone_glx.cc"
 | 
					 | 
				
			||||||
                      "ui/ozone/common/egl_util.cc"
 | 
					 | 
				
			||||||
                      "third_party/angle/src/libANGLE/renderer/gl/glx\
 | 
					 | 
				
			||||||
/FunctionsGLX.cpp")
 | 
					 | 
				
			||||||
                  (("libGL\\.so\\.1")
 | 
					 | 
				
			||||||
                   (string-append mesa-lib "/libGL.so.1"))
 | 
					 | 
				
			||||||
                  (("libEGL\\.so\\.1")
 | 
					 | 
				
			||||||
                   (string-append mesa-lib "/libEGL.so.1"))
 | 
					 | 
				
			||||||
                  (("libGLESv2\\.so\\.2")
 | 
					 | 
				
			||||||
                   (string-append mesa-lib "/libGLESv2.so.2"))))))
 | 
					 | 
				
			||||||
          (add-before 'configure 'prepare-build-environment
 | 
					          (add-before 'configure 'prepare-build-environment
 | 
				
			||||||
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
 | 
					            (lambda* (#:key native-inputs inputs #:allow-other-keys)
 | 
				
			||||||
              (let ((node (search-input-file (or native-inputs inputs)
 | 
					              (let ((node (search-input-file (or native-inputs inputs)
 | 
				
			||||||
| 
						 | 
					@ -833,6 +805,8 @@
 | 
				
			||||||
                          "chromium/master-preferences.json")))
 | 
					                          "chromium/master-preferences.json")))
 | 
				
			||||||
                     (gtk (dirname (dirname
 | 
					                     (gtk (dirname (dirname
 | 
				
			||||||
                                    (search-input-file inputs "lib/libgtk-3.so"))))
 | 
					                                    (search-input-file inputs "lib/libgtk-3.so"))))
 | 
				
			||||||
 | 
					                     (mesa (dirname (search-input-file inputs "lib/libGL.so")))
 | 
				
			||||||
 | 
					                     (vulkan (dirname (search-input-file inputs "lib/libvulkan.so")))
 | 
				
			||||||
                     (xdg-utils (dirname (search-input-file inputs "bin/xdg-open"))))
 | 
					                     (xdg-utils (dirname (search-input-file inputs "bin/xdg-open"))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                (substitute* '("chrome/app/resources/manpage.1.in"
 | 
					                (substitute* '("chrome/app/resources/manpage.1.in"
 | 
				
			||||||
| 
						 | 
					@ -870,6 +844,11 @@
 | 
				
			||||||
                  (wrap-program exe
 | 
					                  (wrap-program exe
 | 
				
			||||||
                    ;; Avoid file manager crash.  See <https://bugs.gnu.org/26593>.
 | 
					                    ;; Avoid file manager crash.  See <https://bugs.gnu.org/26593>.
 | 
				
			||||||
                    `("XDG_DATA_DIRS" ":" prefix (,(string-append gtk "/share")))
 | 
					                    `("XDG_DATA_DIRS" ":" prefix (,(string-append gtk "/share")))
 | 
				
			||||||
 | 
					                    ;; Provide libGL and libvulkan without patching all references.
 | 
				
			||||||
 | 
					                    ;; XXX: How to add on RUNPATH instead of this hack?
 | 
				
			||||||
 | 
					                    `("LD_LIBRARY_PATH" ":" prefix
 | 
				
			||||||
 | 
					                      (,(string-append mesa ":" vulkan)))
 | 
				
			||||||
 | 
					                    ;; Ensure xdg-open et al. is found.
 | 
				
			||||||
                    `("PATH" ":" prefix (,xdg-utils))))
 | 
					                    `("PATH" ":" prefix (,xdg-utils))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                (with-directory-excursion "chrome/app/theme/chromium"
 | 
					                (with-directory-excursion "chrome/app/theme/chromium"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue