From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: [PATCHES] Mesa dlopen() calls & more optional features Date: Tue, 17 Mar 2015 17:26:55 +0100 Message-ID: <87h9tj614g.fsf@taylan.uni.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXuKa-0007zh-CC for guix-devel@gnu.org; Tue, 17 Mar 2015 12:27:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXuKZ-0001VZ-4h for guix-devel@gnu.org; Tue, 17 Mar 2015 12:27:00 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:36622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXuKY-0001VF-Qu for guix-devel@gnu.org; Tue, 17 Mar 2015 12:26:59 -0400 Received: by wgra20 with SMTP id a20so12859051wgr.3 for ; Tue, 17 Mar 2015 09:26:58 -0700 (PDT) Received: from taylan.uni.cx (p200300514A4A864E0213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a4a:864e:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id hd10sm3327891wib.7.2015.03.17.09.26.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 09:26:57 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain 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...) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0005-gnu-mesa-Fix-file-names-passed-to-dlopen-3.patch Content-Description: patch1 >From 8e3324c0b5d63aa3d53341b7dea090c9a64d3c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0006-gnu-mesa-Enable-more-optional-features.patch Content-Description: patch2 >From 5deb64affa47dfa9a9521dc20fbbc58e90f1f7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= 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 --=-=-=--