guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/07: gnu: glfw: Patch dlopen calls.


From: guix-commits
Subject: 04/07: gnu: glfw: Patch dlopen calls.
Date: Tue, 26 Sep 2023 11:33:37 -0400 (EDT)

apteryx pushed a commit to branch master
in repository guix.

commit e5f27fdfb38562c19d3fa741d6f14596882b5062
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Sep 26 10:39:42 2023 -0400

    gnu: glfw: Patch dlopen calls.
    
    * gnu/packages/gl.scm (glfw) [arguments]: Add #:modules and #:phases 
argument.
    [inputs]: New field.
---
 gnu/packages/gl.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 44 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index b53b42a9ba..dfdc21abc6 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
-;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer 
<maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
 ;;; Copyright © 2021, 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
@@ -883,12 +883,50 @@ OpenGL.")
                 "1kcrpl4d6b6h23ib5j9q670d9w3knd07whgbanbmwwhbcqnc9lmv"))))
     (build-system cmake-build-system)
     (arguments
-     '(#:tests? #f ; no test target
-       #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
-    (native-inputs
-     (list doxygen unzip))
+     (list
+      #:modules '((guix build cmake-build-system)
+                  (guix build utils)
+                  (ice-9 format))
+      #:tests? #f                       ;no test target
+      #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-sonames
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let-syntax ((patch-sonames
+                            (syntax-rules ()
+                              ((_ (file ...) soname ...)
+                               (substitute* (list file ...)
+                                 (((format #f "(~@{~a~^|~})" soname ...) lib)
+                                  (search-input-file
+                                   inputs (string-append
+                                           "lib/" lib))))))))
+                ;; Avoid looking in LD_LIBRARY_PATH for dlopen calls.
+                (patch-sonames ("src/egl_context.c"
+                                "src/glx_context.c"
+                                "src/vulkan.c"
+                                "src/wl_init.c"
+                                "src/x11_init.c")
+                               "libEGL.so.1"
+                               "libGL.so"
+                               "libGL.so.1"
+                               "libGLESv1_CM.so.1"
+                               "libGLESv2.so.2"
+                               "libvulkan.so.1"
+                               "libwayland-cursor.so.0"
+                               "libwayland-egl.so.1"
+                               "libxkbcommon.so.0"
+                               "libXxf86vm.so.1"
+                               "libXi.so.6"
+                               "libXrandr.so.2"
+                               "libXcursor.so.1"
+                               "libXinerama.so.1"
+                               "libX11-xcb.so.1"
+                               "libXrender.so.1")))))))
+    (native-inputs (list doxygen unzip))
+    (inputs (list libxkbcommon wayland vulkan-loader))
     (propagated-inputs
-     (list mesa ;included in public headers
+     (list mesa              ;included in public headers
            ;; These are in 'Requires.private' of 'glfw3.pc'.
            libx11
            libxrandr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]