diff options
Diffstat (limited to 'gnu/packages/gl.scm')
-rw-r--r-- | gnu/packages/gl.scm | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 5f96ab3038..90ba81c37f 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -217,7 +217,7 @@ also known as DXTn or DXTC) for Mesa.") (define-public mesa (package (name "mesa") - (version "17.2.1") + (version "17.2.5") (source (origin (method url-fetch) @@ -229,7 +229,7 @@ also known as DXTn or DXTC) for Mesa.") version "/mesa-" version ".tar.xz"))) (sha256 (base32 - "07msr6xismw2jq87irwhz7vygvzj6hi38d71paij9zvwh8bmsf3p")) + "03q7n4g6ks3wlvlbi0snwn80w6ribqvs80cx5mgv384ygd5r2zvz")) (patches (search-patches "mesa-wayland-egl-symbols-check-mips.patch" "mesa-skip-disk-cache-test.patch")))) @@ -305,6 +305,10 @@ also known as DXTn or DXTC) for Mesa.") "--enable-llvm")) ; default is x86/x86_64 only (_ '("--with-dri-drivers=nouveau,r200,radeon,swrast")))) + #:modules ((ice-9 match) + (srfi srfi-1) + (guix build utils) + (guix build gnu-build-system)) #:phases (modify-phases %standard-phases (add-after @@ -339,6 +343,41 @@ also known as DXTn or DXTC) for Mesa.") ;; egl_gallium support. (("\"gbm_dri\\.so") (string-append "\"" out "/lib/dri/gbm_dri.so"))) + #t))) + (add-after 'install 'symlinks-instead-of-hard-links + (lambda* (#:key outputs #:allow-other-keys) + ;; All the drivers and gallium targets create hard links upon + ;; installation (search for "hardlink each megadriver instance" + ;; in the makefiles). This is no good for us since we'd produce + ;; nars that contain several copies of these files. Thus, turn + ;; them into symlinks, which saves ~124 MiB. + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (files (find-files lib + (lambda (file stat) + (and (string-contains file ".so") + (eq? 'regular + (stat:type stat)))))) + (inodes (map (compose stat:ino stat) files))) + (for-each (lambda (inode) + (match (filter-map (match-lambda + ((file ino) + (and (= ino inode) file))) + (zip files inodes)) + ((_) + #f) + ((reference others ..1) + (format #t "creating ~a symlinks to '~a'~%" + (length others) reference) + (for-each delete-file others) + (for-each (lambda (file) + (if (string=? (dirname file) + (dirname reference)) + (symlink (basename reference) + file) + (symlink reference file))) + others)))) + (delete-duplicates inodes)) #t)))))) (home-page "https://mesa3d.org/") (synopsis "OpenGL implementation") |