* [PATCHES] Mesa dlopen() calls & more optional features
@ 2015-03-17 16:26 Taylan Ulrich Bayırlı/Kammer
2015-03-19 16:04 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-03-17 16:26 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 431 bytes --]
Here's a pair of patches, the first patching all non-absolute dlopen()
uses I could detect (except for GBM), and the second enabling a few
optional features of Mesa, including GBM, and adding that last GBM
dlopen() patch. (My intent is to keep the patches stylistically
agnostic to each other; I guess it doesn't really matter much.) (And
FWIW, GBM is enabled automatically when one enables the DRM platform
support for EGL...)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch1 --]
[-- Type: text/x-diff, Size: 2758 bytes --]
From 8e3324c0b5d63aa3d53341b7dea090c9a64d3c40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
<taylanbayirli@gmail.com>
Date: Sat, 14 Mar 2015 14:57:27 +0100
Subject: [PATCH 5/6] gnu: mesa: Fix file names passed to dlopen(3).
* gnu/packages/gl.scm (mesa): Patch source files to make file names passed to
dlopen(3) absolute.
---
gnu/packages/gl.scm | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 5e2f72a..e811142 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -222,16 +222,30 @@ also known as DXTn or DXTC) for Mesa.")
(substitute* "src/glsl/tests/lower_jumps/create_test_cases.py"
(("/usr/bin/env bash") (which "bash"))))
(alist-cons-before
- 'build 'fix-dxtn-libname
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((s2tc (assoc-ref inputs "s2tc")))
+ 'build 'fix-dlopen-libnames
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((s2tc (assoc-ref inputs "s2tc"))
+ (udev (assoc-ref inputs "udev"))
+ (out (assoc-ref outputs "out")))
;; Remain agnostic to .so.X.Y.Z versions while doing
;; the substitutions so we're future-safe.
(substitute*
'("src/gallium/auxiliary/util/u_format_s3tc.c"
"src/mesa/main/texcompress_s3tc.c")
(("\"libtxc_dxtn\\.so")
- (string-append "\"" s2tc "/lib/libtxc_dxtn.so")))))
+ (string-append "\"" s2tc "/lib/libtxc_dxtn.so")))
+ (substitute* "src/gallium/targets/egl-static/egl_st.c"
+ (("\"libglapi\"")
+ (string-append "\"" out "/lib/libglapi\"")))
+ (substitute* "src/loader/loader.c"
+ (("dlopen\\(\"libudev\\.so")
+ (string-append "dlopen(\"" udev "/lib/libudev.so")))
+ (substitute* "src/glx/dri_common.c"
+ (("dlopen\\(\"libGL\\.so")
+ (string-append "dlopen(\"" out "/lib/libGL.so")))
+ (substitute* "src/egl/drivers/dri2/egl_dri2.c"
+ (("\"libglapi\\.so")
+ (string-append "\"" out "/lib/libglapi.so")))))
%standard-phases)))))
(home-page "http://mesa3d.org/")
(synopsis "OpenGL implementation")
--
2.2.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: patch2 --]
[-- Type: text/x-diff, Size: 2154 bytes --]
From 5deb64affa47dfa9a9521dc20fbbc58e90f1f7e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
<taylanbayirli@gmail.com>
Date: Tue, 17 Mar 2015 17:15:52 +0100
Subject: [PATCH 6/6] gnu: mesa: Enable more optional features.
* gnu/packages/gl.scm (mesa): Enable DRM support of EGL, thread local storage
in GLX, and off-screen rendering.
---
gnu/packages/gl.scm | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index e811142..ef0485c 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -198,6 +198,13 @@ also known as DXTn or DXTC) for Mesa.")
`(#:configure-flags
'(;; drop r300 from default gallium drivers, as it requires llvm
"--with-gallium-drivers=r600,svga,swrast"
+ ;; Enable various optional features. TODO: opencl requires libclc,
+ ;; omx requires libomxil-bellagio
+ "--with-egl-platforms=x11,drm"
+ "--enable-glx-tls" ;Thread Local Storage, improves performance
+ ;; "--enable-opencl"
+ ;; "--enable-omx"
+ "--enable-osmesa"
"--enable-xa"
;; on non-intel systems, drop i915 and i965
@@ -245,7 +252,13 @@ also known as DXTn or DXTC) for Mesa.")
(string-append "dlopen(\"" out "/lib/libGL.so")))
(substitute* "src/egl/drivers/dri2/egl_dri2.c"
(("\"libglapi\\.so")
- (string-append "\"" out "/lib/libglapi.so")))))
+ (string-append "\"" out "/lib/libglapi.so")))
+ (substitute* "src/gbm/main/backend.c"
+ ;; No need to patch the gbm_gallium_drm.so reference;
+ ;; it's never installed since Mesa removed its
+ ;; egl_gallium support.
+ (("\"gbm_dri\\.so")
+ (string-append "\"" out "/lib/dri/gbm_dri.so")))))
%standard-phases)))))
(home-page "http://mesa3d.org/")
(synopsis "OpenGL implementation")
--
2.2.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCHES] Mesa dlopen() calls & more optional features
2015-03-17 16:26 [PATCHES] Mesa dlopen() calls & more optional features Taylan Ulrich Bayırlı/Kammer
@ 2015-03-19 16:04 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-03-19 16:04 UTC (permalink / raw)
To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: guix-devel
taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:
> From 8e3324c0b5d63aa3d53341b7dea090c9a64d3c40 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
> <taylanbayirli@gmail.com>
> Date: Sat, 14 Mar 2015 14:57:27 +0100
> Subject: [PATCH 5/6] gnu: mesa: Fix file names passed to dlopen(3).
>
> * gnu/packages/gl.scm (mesa): Patch source files to make file names passed to
> dlopen(3) absolute.
LGTM.
> From 5deb64affa47dfa9a9521dc20fbbc58e90f1f7e3 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
> <taylanbayirli@gmail.com>
> Date: Tue, 17 Mar 2015 17:15:52 +0100
> Subject: [PATCH 6/6] gnu: mesa: Enable more optional features.
>
> * gnu/packages/gl.scm (mesa): Enable DRM support of EGL, thread local storage
> in GLX, and off-screen rendering.
OK!
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-19 16:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 16:26 [PATCHES] Mesa dlopen() calls & more optional features Taylan Ulrich Bayırlı/Kammer
2015-03-19 16:04 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.