summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-05-22 18:53:14 +0200
committerMarius Bakke <marius@gnu.org>2020-05-26 22:36:08 +0200
commit0df5bdf81cb3b3b8aa0694ca0a20fedd65ee4723 (patch)
tree85bf25058674fc1a1c27b3bb527781aaa59f9524
parent18ac48364cb7e17da120b4b296aa06de5f159497 (diff)
downloadguix-0df5bdf81cb3b3b8aa0694ca0a20fedd65ee4723.tar.gz
gnu: Mesa: Install scripts to a separate output.
* gnu/packages/gl.scm (mesa)[outputs]: New field.
[arguments]: Add phase 'split-outputs'.
-rw-r--r--gnu/packages/gl.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 3d94ddb23f..3d8d2687c4 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -289,6 +289,7 @@ also known as DXTn or DXTC) for Mesa.")
         ("python" ,python-wrapper)
         ("python-mako" ,python-mako)
         ("which" ,(@ (gnu packages base) which))))
+    (outputs '("out" "bin"))
     (arguments
      `(#:configure-flags
        '(,@(match (%current-system)
@@ -382,6 +383,26 @@ also known as DXTn or DXTC) for Mesa.")
                  (("\"gbm_dri\\.so")
                   (string-append "\"" out "/lib/dri/gbm_dri.so")))
                #t)))
+         (add-after 'install 'split-outputs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (bin (assoc-ref outputs "bin")))
+               ,@(match (%current-system)
+                   ((or "i686-linux" "x86_64-linux")
+                    ;; Install the Vulkan overlay control script to a separate
+                    ;; output to prevent a reference on Python, saving ~70 MiB
+                    ;; on the closure size.
+                    '((copy-recursively (string-append out "/bin")
+                                        (string-append bin "/bin"))
+                      (delete-file-recursively (string-append out "/bin"))))
+                   (_
+                    ;; XXX: On architectures without the Vulkan overlay layer
+                    ;; just create an empty file because outputs can not be
+                    ;; added conditionally.
+                    '((mkdir-p (string-append bin "/bin"))
+                      (call-with-output-file (string-append bin "/bin/.empty")
+                        (const #t)))))
+               #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