summary refs log tree commit diff
path: root/gnu/packages/lisp-xyz.scm
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2020-04-28 10:45:47 +0200
committerPierre Neidhardt <mail@ambrevar.xyz>2020-04-28 11:47:45 +0200
commit80d8c00c84191206e3c1edfb7d6a9d47a15ec1bf (patch)
treed050b6de322d4c8c40257a834389d6f1ea01df77 /gnu/packages/lisp-xyz.scm
parent2666a3361ec76fefe10257da3c6eb0f854ed24db (diff)
downloadguix-80d8c00c84191206e3c1edfb7d6a9d47a15ec1bf.tar.gz
gnu: sbcl-cl-cffi-gtk-gdk: Link source to parent to reduce closure size.
* gnu/packages/lisp-xyz.scm (sbcl-cl-cffi-gtk-gdk)[arguments]: Replace source
  folder with link to the same folder in the sbcl-cl-cffi-gtk-glib dependency.
Diffstat (limited to 'gnu/packages/lisp-xyz.scm')
-rw-r--r--gnu/packages/lisp-xyz.scm16
1 files changed, 15 insertions, 1 deletions
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index fa86769872..7f78a09ece 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -3069,6 +3069,7 @@ is a library for creating graphical user interfaces.")
     (name "sbcl-cl-cffi-gtk-gdk")
     (inputs
      `(("gtk" ,gtk+)
+       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ("cl-cffi-gtk-gio" ,sbcl-cl-cffi-gtk-gio)
        ("cl-cffi-gtk-gdk-pixbuf" ,sbcl-cl-cffi-gtk-gdk-pixbuf)
@@ -3088,7 +3089,20 @@ is a library for creating graphical user interfaces.")
              (substitute* "gdk/gdk.package.lisp"
                (("libgtk" all)
                 (string-append
-                 (assoc-ref inputs "gtk") "/lib/" all))))))))))
+                 (assoc-ref inputs "gtk") "/lib/" all)))))
+         (add-after 'install 'link-source
+           ;; Since source is particularly heavy (16MiB+), let's reuse it
+           ;; across the different components of cl-ffi-gtk.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((glib-source (string-append (assoc-ref inputs "cl-cffi-gtk-glib")
+                                               "/share/common-lisp/sbcl-source/"
+                                               "cl-cffi-gtk-glib"))
+                   (out-source (string-append (assoc-ref outputs "out")
+                                              "/share/common-lisp/sbcl-source/"
+                                              "cl-cffi-gtk-gdk")))
+               (delete-file-recursively out-source)
+               (symlink glib-source out-source)
+               #t))))))))
 
 (define-public sbcl-cl-cffi-gtk
   (package