unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41135] [PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages.
@ 2020-05-08  6:48 Pierre Neidhardt
  2020-05-08  6:58 ` [bug#41135] [PATCH 2/3] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08  6:48 UTC (permalink / raw)
  To: 41135

* guix/build/asdf-build-system.scm (copy-files-to-output): Don't attempt to
  reset timestamps on files without write access.
  (install): When parent SBCL package is in the inputs, use its source.  This
  way we get possibly patched sources in CL packages as well (e.g. for FFI).
  This is also useful for sources that generate files on load-op, like cl-unicode.

* guix/build-system/asdf.scm (package-with-build-system): Forward the SBCL
  parent as a native input so that it can be used in the install phase above.
---
 guix/build-system/asdf.scm       |  5 ++++-
 guix/build/asdf-build-system.scm | 34 ++++++++++++++++++++++++++------
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index f794bf006b..630b99e2bf 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -230,7 +230,10 @@ set up using CL source package conventions."
              ((#:phases phases) (list phases-transformer phases))))
           (inputs (new-inputs package-inputs))
           (propagated-inputs (new-propagated-inputs))
-          (native-inputs (new-inputs package-native-inputs))
+          (native-inputs (append (if target-is-source?
+                                     (list (list (package-name pkg) pkg))
+                                     '())
+                                 (new-inputs package-native-inputs)))
           (outputs (if target-is-source?
                        '("out")
                        (package-outputs pkg)))))
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index f3f4b49bcf..5a512d5332 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -85,7 +85,8 @@ valid."
     ;; files before compiling.
     (for-each (lambda (file)
                 (let ((s (lstat file)))
-                  (unless (eq? (stat:type s) 'symlink)
+                  (unless (or (eq? (stat:type s) 'symlink)
+                              (not (access? file W_OK)))
                     (utime file 0 0 0 0))))
               (find-files source #:directories? #t))
     (copy-recursively source target #:keep-mtime? #t)
@@ -97,12 +98,33 @@ valid."
      (find-files target "\\.asd$"))
     #t))
 
-(define* (install #:key outputs #:allow-other-keys)
-  "Copy and symlink all the source files."
+(define* (install #:key inputs outputs #:allow-other-keys)
+  "Copy and symlink all the source files.
+The source files are taken from the corresponding SBCL package if it's present
+in the native-inputs."
   (define output (assoc-ref outputs "out"))
-  (copy-files-to-output output
-                        (package-name->name+version
-                         (strip-store-file-name output))))
+  (define package-name
+    (package-name->name+version
+     (strip-store-file-name output)))
+  (define no-prefix-name (string-drop package-name (string-length "cl-")))
+  (define sbcl-source (or (assoc-ref inputs (string-append "sbcl-" no-prefix-name))
+                          (assoc-ref inputs (string-append "sbcl-" package-name))))
+
+  (define source-directory
+    (if sbcl-source
+        (find file-exists?
+              (list (string-append sbcl-source
+                                   "/share/common-lisp/sbcl-source/"
+                                   no-prefix-name)
+                    (string-append sbcl-source
+                                   "/share/common-lisp/sbcl-source/"
+                                   package-name)
+                    "."))
+        "."))
+  (with-directory-excursion source-directory
+    (copy-files-to-output output
+                          (package-name->name+version
+                           (strip-store-file-name output)))))
 
 (define* (copy-source #:key outputs asd-system-name #:allow-other-keys)
   "Copy the source to the library output."
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [PATCH 2/3] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function.
  2020-05-08  6:48 [bug#41135] [PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
@ 2020-05-08  6:58 ` Pierre Neidhardt
  2020-05-08  6:58   ` [bug#41135] [PATCH 3/3] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
  2020-05-08 10:37 ` [bug#41135] [Patch v2 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08  6:58 UTC (permalink / raw)
  To: 41135; +Cc: glv, cox.katherine.e

* gnu/packages/lisp-xyz.scm (cl-dexador)[arguments]: Remove
  'reset-gzip-timestamps phase.
---
 gnu/packages/lisp-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4f406ded66..6a199c32f9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5861,8 +5861,8 @@ neat APIs and connection-pooling.  It is meant to supersede Drakma.")
        ;; asdf-build-system/source has its own phases and does not inherit
        ;; from asdf-build-system/sbcl phases.
        (modify-phases %standard-phases/source
-         (add-after 'unpack 'fix-permissions
-           (lambda _ (make-file-writable "t/data/test.gz") #t)))))))
+         ;; Already done in SBCL package.
+         (delete 'reset-gzip-timestamps))))))
 
 (define-public ecl-dexador
   (sbcl-package->ecl-package sbcl-dexador))
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [PATCH 3/3] gnu: cl-iolib: Propagate libfixposix or else it won't compile.
  2020-05-08  6:58 ` [bug#41135] [PATCH 2/3] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
@ 2020-05-08  6:58   ` Pierre Neidhardt
  0 siblings, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08  6:58 UTC (permalink / raw)
  To: 41135; +Cc: glv, cox.katherine.e

* gnu/packages/lisp-xyz.scm (cl-iolib)[propagated-inputs]: Add libfixposix.
---
 gnu/packages/lisp-xyz.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 6a199c32f9..f8685f8ce1 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5562,7 +5562,13 @@ and @code{kqueue(2)}), a pathname library and file-system utilities.")
        ((#:asd-system-name _) "iolib")))))
 
 (define-public cl-iolib
-  (sbcl-package->cl-source-package sbcl-iolib))
+  (let ((parent (sbcl-package->cl-source-package sbcl-iolib)))
+    (package
+      (inherit parent)
+      (propagated-inputs
+       ;; Need header to compile.
+       `(("libfixposix" ,libfixposix)
+         ,@(package-propagated-inputs parent))))))
 
 (define-public sbcl-ieee-floats
   (let ((commit "566b51a005e81ff618554b9b2f0b795d3b29398d")
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v2 1/4] build: asdf-build-system: Use SBCL source in CL packages.
  2020-05-08  6:48 [bug#41135] [PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
  2020-05-08  6:58 ` [bug#41135] [PATCH 2/3] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
@ 2020-05-08 10:37 ` Pierre Neidhardt
  2020-05-08 10:37   ` [bug#41135] [Patch v2 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
  2020-05-08 10:37   ` [bug#41135] [Patch v2 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
       [not found] ` <handler.41135.B.158892052723318.ack@debbugs.gnu.org>
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 10:37 UTC (permalink / raw)
  To: 41135

* guix/build/asdf-build-system.scm (copy-files-to-output): Don't attempt to
  reset timestamps on files without write access.
  (install): When parent SBCL package is in the inputs, use its source.  This
  way we get possibly patched sources in CL packages as well (e.g. for FFI).
  This is also useful for sources that generate files on load-op, like cl-unicode.

* guix/build-system/asdf.scm (package-with-build-system): Forward the SBCL
  parent as a native input so that it can be used in the install phase above.
---
 guix/build-system/asdf.scm       |  5 +++-
 guix/build/asdf-build-system.scm | 40 +++++++++++++++++++++++++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index f794bf006b..630b99e2bf 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -230,7 +230,10 @@ set up using CL source package conventions."
              ((#:phases phases) (list phases-transformer phases))))
           (inputs (new-inputs package-inputs))
           (propagated-inputs (new-propagated-inputs))
-          (native-inputs (new-inputs package-native-inputs))
+          (native-inputs (append (if target-is-source?
+                                     (list (list (package-name pkg) pkg))
+                                     '())
+                                 (new-inputs package-native-inputs)))
           (outputs (if target-is-source?
                        '("out")
                        (package-outputs pkg)))))
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index f3f4b49bcf..158d351d1a 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -85,7 +85,8 @@ valid."
     ;; files before compiling.
     (for-each (lambda (file)
                 (let ((s (lstat file)))
-                  (unless (eq? (stat:type s) 'symlink)
+                  (unless (or (eq? (stat:type s) 'symlink)
+                              (not (access? file W_OK)))
                     (utime file 0 0 0 0))))
               (find-files source #:directories? #t))
     (copy-recursively source target #:keep-mtime? #t)
@@ -97,12 +98,39 @@ valid."
      (find-files target "\\.asd$"))
     #t))
 
-(define* (install #:key outputs #:allow-other-keys)
-  "Copy and symlink all the source files."
+(define* (install #:key inputs outputs #:allow-other-keys)
+  "Copy and symlink all the source files.
+The source files are taken from the corresponding SBCL package if it's present
+in the native-inputs."
+  ;; TODO: Use lisp-type instead of hardcoding SBCL.
   (define output (assoc-ref outputs "out"))
-  (copy-files-to-output output
-                        (package-name->name+version
-                         (strip-store-file-name output))))
+  (define package-name
+    (package-name->name+version
+     (strip-store-file-name output)))
+  (define no-prefix-name (string-drop package-name (string-length "cl-")))
+  (define sbcl-source (or (assoc-ref inputs (string-append "sbcl-" no-prefix-name))
+                          (assoc-ref inputs (string-append "sbcl-" package-name))))
+
+  (define (first-subdirectory directory) ; From gnu-build-system.
+    "Return the file name of the first sub-directory of DIRECTORY."
+    (match (scandir directory
+                    (lambda (file)
+                      (and (not (member file '("." "..")))
+                           (file-is-directory? (string-append directory "/"
+                                                              file)))))
+      ((first . _) first)))
+
+  (define source-directory
+    (if (and sbcl-source
+             (file-exists?
+              (string-append sbcl-source "/share/common-lisp/sbcl-source/")))
+        (let ((source (string-append sbcl-source "/share/common-lisp/sbcl-source/")))
+          (string-append source (first-subdirectory source)))
+        "."))
+  (with-directory-excursion source-directory
+    (copy-files-to-output output
+                          (package-name->name+version
+                           (strip-store-file-name output)))))
 
 (define* (copy-source #:key outputs asd-system-name #:allow-other-keys)
   "Copy the source to the library output."
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v2 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function.
  2020-05-08 10:37 ` [bug#41135] [Patch v2 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
@ 2020-05-08 10:37   ` Pierre Neidhardt
  2020-05-08 10:37   ` [bug#41135] [Patch v2 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
  1 sibling, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 10:37 UTC (permalink / raw)
  To: 41135

* gnu/packages/lisp-xyz.scm (cl-dexador)[arguments]: Remove
  'reset-gzip-timestamps phase.
---
 gnu/packages/lisp-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4f406ded66..6a199c32f9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5861,8 +5861,8 @@ neat APIs and connection-pooling.  It is meant to supersede Drakma.")
        ;; asdf-build-system/source has its own phases and does not inherit
        ;; from asdf-build-system/sbcl phases.
        (modify-phases %standard-phases/source
-         (add-after 'unpack 'fix-permissions
-           (lambda _ (make-file-writable "t/data/test.gz") #t)))))))
+         ;; Already done in SBCL package.
+         (delete 'reset-gzip-timestamps))))))
 
 (define-public ecl-dexador
   (sbcl-package->ecl-package sbcl-dexador))
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v2 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile.
  2020-05-08 10:37 ` [bug#41135] [Patch v2 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
  2020-05-08 10:37   ` [bug#41135] [Patch v2 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
@ 2020-05-08 10:37   ` Pierre Neidhardt
  1 sibling, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 10:37 UTC (permalink / raw)
  To: 41135

* gnu/packages/lisp-xyz.scm (cl-iolib)[propagated-inputs]: Add libfixposix.
---
 gnu/packages/lisp-xyz.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 6a199c32f9..f8685f8ce1 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5562,7 +5562,13 @@ and @code{kqueue(2)}), a pathname library and file-system utilities.")
        ((#:asd-system-name _) "iolib")))))
 
 (define-public cl-iolib
-  (sbcl-package->cl-source-package sbcl-iolib))
+  (let ((parent (sbcl-package->cl-source-package sbcl-iolib)))
+    (package
+      (inherit parent)
+      (propagated-inputs
+       ;; Need header to compile.
+       `(("libfixposix" ,libfixposix)
+         ,@(package-propagated-inputs parent))))))
 
 (define-public sbcl-ieee-floats
   (let ((commit "566b51a005e81ff618554b9b2f0b795d3b29398d")
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] Acknowledgement ([PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages.)
       [not found] ` <handler.41135.B.158892052723318.ack@debbugs.gnu.org>
@ 2020-05-08 16:36   ` Pierre Neidhardt
  2020-05-21  9:54     ` Pierre Neidhardt
  0 siblings, 1 reply; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 16:36 UTC (permalink / raw)
  To: 41135


[-- Attachment #1.1: Type: text/plain, Size: 119 bytes --]

Attaching [Patch v2 4/4] since "git send-email" won't let me send it.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-gnu-cl-cffi-gtk-gobject-Fix-build-with-new-sbcl-pack.patch --]
[-- Type: text/x-patch, Size: 23444 bytes --]

From da8b35adcd392b6c4bb0394f624ac86b9c61e4b7 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Fri, 8 May 2020 11:14:02 +0200
Subject: [Patch v2 4/4] gnu: cl-cffi-gtk-gobject: Fix build with new
 sbcl-package->cl-source-package function.

* gnu/packages/lisp-xyz.scm (sbcl-cl-cffi-gtk-boot0)[inputs]: Add all inputs.
[arguments]: Patch whole source.
(sbcl-cl-cffi-gtk-glib)[inputs]: Remove glib.
(sbcl-cl-cffi-gtk-glib)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gobject)[inputs]: Remove glib.
(sbcl-cl-cffi-gtk-gobject)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gio)[inputs]: Remove glib.
(sbcl-cl-cffi-gtk-gio)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-cairo)[inputs]: Remove cairo.
(sbcl-cl-cffi-gtk-cairo)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-pango)[inputs]: Remove pango.
(sbcl-cl-cffi-gtk-pango)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gdk-pixbuf)[inputs]: Remove gdk-pixbuf.
(sbcl-cl-cffi-gtk-gdk-pixbuf)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gdk-gdk)[inputs]: Remove gtk+.
(sbcl-cl-cffi-gtk-gdk-gdk)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk)[arguments]: Reuse boot0 source.
---
 gnu/packages/lisp-xyz.scm | 341 ++++++++++++++++++--------------------
 1 file changed, 165 insertions(+), 176 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index f8685f8ce1..a5e5548fbf 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -2876,7 +2876,41 @@ Lisp implementations.")
       (inputs
        `(("iterate" ,sbcl-iterate)
          ("cffi" ,sbcl-cffi)
-         ("trivial-features" ,sbcl-trivial-features)))
+         ("trivial-features" ,sbcl-trivial-features)
+         ("glib" ,glib)
+         ("cairo" ,cairo)
+         ("pango" ,pango)
+         ("gdk-pixbuf" ,gdk-pixbuf)
+         ("gtk" ,gtk+)))
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-paths
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "glib/glib.init.lisp"
+                 (("libglib|libgthread" all)
+                  (string-append (assoc-ref inputs "glib") "/lib/" all)))
+               (substitute* "gobject/gobject.init.lisp"
+                 (("libgobject" all)
+                  (string-append (assoc-ref inputs "glib") "/lib/" all)))
+               (substitute* "gio/gio.init.lisp"
+                 (("libgio" all)
+                  (string-append (assoc-ref inputs "glib") "/lib/" all)))
+               (substitute* "cairo/cairo.init.lisp"
+                 (("libcairo" all)
+                  (string-append (assoc-ref inputs "cairo") "/lib/" all)))
+               (substitute* "pango/pango.init.lisp"
+                 (("libpango" all)
+                  (string-append (assoc-ref inputs "pango") "/lib/" all)))
+               (substitute* "gdk-pixbuf/gdk-pixbuf.init.lisp"
+                 (("libgdk_pixbuf" all)
+                  (string-append (assoc-ref inputs "gdk-pixbuf") "/lib/" all)))
+               (substitute* "gdk/gdk.init.lisp"
+                 (("libgdk" all)
+                  (string-append (assoc-ref inputs "gtk") "/lib/" all)))
+               (substitute* "gdk/gdk.package.lisp"
+                 (("libgtk" all)
+                  (string-append (assoc-ref inputs "gtk") "/lib/" all))))))))
       (home-page "https://github.com/Ferada/cl-cffi-gtk/")
       (synopsis "Common Lisp binding for GTK+3")
       (description
@@ -2889,192 +2923,155 @@ is a library for creating graphical user interfaces.")
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-glib")
     (inputs
-     `(("glib" ,glib)
-       ("bordeaux-threads" ,sbcl-bordeaux-threads)
+     `(("bordeaux-threads" ,sbcl-bordeaux-threads)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "glib/cl-cffi-gtk-glib.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "glib/glib.init.lisp"
-               (("libglib|libgthread" all)
-                (string-append (assoc-ref inputs "glib") "/lib/" all))))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "glib/cl-cffi-gtk-glib.asd")))))
 
 (define-public sbcl-cl-cffi-gtk-gobject
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gobject")
     (inputs
-     `(("glib" ,glib)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("trivial-garbage" ,sbcl-trivial-garbage)
        ("bordeaux-threads" ,sbcl-bordeaux-threads)
        ("closer-mop" ,sbcl-closer-mop)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gobject/cl-cffi-gtk-gobject.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gobject/gobject.init.lisp"
-               (("libgobject" all) (string-append
-                                    (assoc-ref inputs "glib") "/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-gobject")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gobject/cl-cffi-gtk-gobject.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-gobject")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-gio
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gio")
     (inputs
-     `(("glib" ,glib)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gio/cl-cffi-gtk-gio.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gio/gio.init.lisp"
-               (("libgio" all)
-                (string-append
-                 (assoc-ref inputs "glib") "/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-gio")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gio/cl-cffi-gtk-gio.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-gio")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-cairo
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-cairo")
     (inputs
-     `(("cairo" ,cairo)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "cairo/cl-cffi-gtk-cairo.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "cairo/cairo.init.lisp"
-               (("libcairo" all)
-                (string-append
-                 (assoc-ref inputs "cairo") "/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-cairo")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "cairo/cl-cffi-gtk-cairo.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-cairo")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-pango
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-pango")
     (inputs
-     `(("pango" ,pango)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ("cl-cffi-gtk-cairo" ,sbcl-cl-cffi-gtk-cairo)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "pango/cl-cffi-gtk-pango.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "pango/pango.init.lisp"
-               (("libpango" all)
-                (string-append
-                 (assoc-ref inputs "pango") "/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-pango")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "pango/cl-cffi-gtk-pango.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-pango")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-gdk-pixbuf
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gdk-pixbuf")
     (inputs
-     `(("gdk-pixbuf" ,gdk-pixbuf)
-       ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
+     `(("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gdk-pixbuf/cl-cffi-gtk-gdk-pixbuf.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gdk-pixbuf/gdk-pixbuf.init.lisp"
-               (("libgdk_pixbuf" all)
-                (string-append
-                 (assoc-ref inputs "gdk-pixbuf") "/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-pixbuf")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gdk-pixbuf/cl-cffi-gtk-gdk-pixbuf.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-pixbuf")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-gdk
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gdk")
     (inputs
-     `(("gtk" ,gtk+)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("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)
@@ -3082,32 +3079,23 @@ is a library for creating graphical user interfaces.")
        ("cl-cffi-gtk-pango" ,sbcl-cl-cffi-gtk-pango)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gdk/cl-cffi-gtk-gdk.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gdk/gdk.init.lisp"
-               (("libgdk" all)
-                (string-append
-                 (assoc-ref inputs "gtk") "/lib/" all)))
-             (substitute* "gdk/gdk.package.lisp"
-               (("libgtk" all)
-                (string-append
-                 (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))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gdk/cl-cffi-gtk-gdk.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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
@@ -3122,26 +3110,27 @@ is a library for creating graphical user interfaces.")
     (native-inputs
      `(("fiveam" ,sbcl-fiveam)))
     (arguments
-     `(#:asd-file "gtk/cl-cffi-gtk.asd"
-       #:test-asd-file "test/cl-cffi-gtk-test.asd"
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gtk/cl-cffi-gtk.asd")
+       ((#:test-asd-file _ "") "test/cl-cffi-gtk-test.asd")
        ;; TODO: Tests fail with memory fault.
        ;; See https://github.com/Ferada/cl-cffi-gtk/issues/24.
-       #:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (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")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+       ((#:tests? _ #f) #f)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public cl-cffi-gtk
   (sbcl-package->cl-source-package sbcl-cl-cffi-gtk))
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [PATCH 1/4] build: asdf-build-system: Use SBCL source in CL packages.
  2020-05-08  6:48 [bug#41135] [PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
                   ` (2 preceding siblings ...)
       [not found] ` <handler.41135.B.158892052723318.ack@debbugs.gnu.org>
@ 2020-05-08 17:39 ` Pierre Neidhardt
  2020-05-08 17:39   ` [bug#41135] [PATCH 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
  2020-05-08 17:39   ` [bug#41135] [PATCH 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
  2020-05-08 17:42 ` [bug#41135] [Patch v3 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
  4 siblings, 2 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 17:39 UTC (permalink / raw)
  To: 41135

* guix/build/asdf-build-system.scm (copy-files-to-output): Don't attempt to
  reset timestamps on files without write access.
  (install): When parent SBCL package is in the inputs, use its source.  This
  way we get possibly patched sources in CL packages as well (e.g. for FFI).
  This is also useful for sources that generate files on load-op, like cl-unicode.

* guix/build-system/asdf.scm (package-with-build-system): Forward the SBCL
  parent as a native input so that it can be used in the install phase above.
---
 guix/build-system/asdf.scm       |  5 ++-
 guix/build/asdf-build-system.scm | 54 ++++++++++++++++++++++++++++----
 2 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index f794bf006b..630b99e2bf 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -230,7 +230,10 @@ set up using CL source package conventions."
              ((#:phases phases) (list phases-transformer phases))))
           (inputs (new-inputs package-inputs))
           (propagated-inputs (new-propagated-inputs))
-          (native-inputs (new-inputs package-native-inputs))
+          (native-inputs (append (if target-is-source?
+                                     (list (list (package-name pkg) pkg))
+                                     '())
+                                 (new-inputs package-native-inputs)))
           (outputs (if target-is-source?
                        '("out")
                        (package-outputs pkg)))))
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index f3f4b49bcf..25dd031962 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -85,7 +85,8 @@ valid."
     ;; files before compiling.
     (for-each (lambda (file)
                 (let ((s (lstat file)))
-                  (unless (eq? (stat:type s) 'symlink)
+                  (unless (or (eq? (stat:type s) 'symlink)
+                              (not (access? file W_OK)))
                     (utime file 0 0 0 0))))
               (find-files source #:directories? #t))
     (copy-recursively source target #:keep-mtime? #t)
@@ -97,12 +98,53 @@ valid."
      (find-files target "\\.asd$"))
     #t))
 
-(define* (install #:key outputs #:allow-other-keys)
-  "Copy and symlink all the source files."
+(define* (install #:key inputs outputs #:allow-other-keys)
+  "Copy and symlink all the source files.
+The source files are taken from the corresponding compile package (e.g. SBCL)
+if it's present in the native-inputs."
   (define output (assoc-ref outputs "out"))
-  (copy-files-to-output output
-                        (package-name->name+version
-                         (strip-store-file-name output))))
+  (define package-name
+    (package-name->name+version
+     (strip-store-file-name output)))
+  (define (no-prefix pkgname)
+    (if (string-index pkgname #\-)
+        (string-drop pkgname (1+ (string-index pkgname #\-)))
+        pkgname))
+  (define parent
+    (match (assoc package-name inputs
+                  (lambda (key alist-car)
+                    (let* ((alt-key (no-prefix key))
+                           (alist-car (no-prefix alist-car)))
+                      (or (string=? alist-car key)
+                          (string=? alist-car alt-key)))))
+      (#f #f)
+      (p (cdr p))))
+  (define parent-name
+    (and parent
+         (package-name->name+version (strip-store-file-name parent))))
+  (define parent-source
+    (and parent
+         (string-append parent "/share/common-lisp/"
+                        (string-take parent-name
+                                     (string-index parent-name #\-))
+                        "-source")))
+
+  (define (first-subdirectory directory) ; From gnu-build-system.
+    "Return the file name of the first sub-directory of DIRECTORY."
+    (match (scandir directory
+                    (lambda (file)
+                      (and (not (member file '("." "..")))
+                           (file-is-directory? (string-append directory "/"
+                                                              file)))))
+      ((first . _) first)))
+  (define source-directory
+    (if (and parent-source
+             (file-exists? parent-source))
+        (string-append parent-source "/" (first-subdirectory parent-source))
+        "."))
+
+  (with-directory-excursion source-directory
+    (copy-files-to-output output package-name)))
 
 (define* (copy-source #:key outputs asd-system-name #:allow-other-keys)
   "Copy the source to the library output."
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [PATCH 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function.
  2020-05-08 17:39 ` [bug#41135] [PATCH 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
@ 2020-05-08 17:39   ` Pierre Neidhardt
  2020-05-08 17:39   ` [bug#41135] [PATCH 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
  1 sibling, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 17:39 UTC (permalink / raw)
  To: 41135

* gnu/packages/lisp-xyz.scm (cl-dexador)[arguments]: Remove
  'reset-gzip-timestamps phase.
---
 gnu/packages/lisp-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4f406ded66..6a199c32f9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5861,8 +5861,8 @@ neat APIs and connection-pooling.  It is meant to supersede Drakma.")
        ;; asdf-build-system/source has its own phases and does not inherit
        ;; from asdf-build-system/sbcl phases.
        (modify-phases %standard-phases/source
-         (add-after 'unpack 'fix-permissions
-           (lambda _ (make-file-writable "t/data/test.gz") #t)))))))
+         ;; Already done in SBCL package.
+         (delete 'reset-gzip-timestamps))))))
 
 (define-public ecl-dexador
   (sbcl-package->ecl-package sbcl-dexador))
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [PATCH 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile.
  2020-05-08 17:39 ` [bug#41135] [PATCH 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
  2020-05-08 17:39   ` [bug#41135] [PATCH 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
@ 2020-05-08 17:39   ` Pierre Neidhardt
  1 sibling, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 17:39 UTC (permalink / raw)
  To: 41135

* gnu/packages/lisp-xyz.scm (cl-iolib)[propagated-inputs]: Add libfixposix.
---
 gnu/packages/lisp-xyz.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 6a199c32f9..f8685f8ce1 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5562,7 +5562,13 @@ and @code{kqueue(2)}), a pathname library and file-system utilities.")
        ((#:asd-system-name _) "iolib")))))
 
 (define-public cl-iolib
-  (sbcl-package->cl-source-package sbcl-iolib))
+  (let ((parent (sbcl-package->cl-source-package sbcl-iolib)))
+    (package
+      (inherit parent)
+      (propagated-inputs
+       ;; Need header to compile.
+       `(("libfixposix" ,libfixposix)
+         ,@(package-propagated-inputs parent))))))
 
 (define-public sbcl-ieee-floats
   (let ((commit "566b51a005e81ff618554b9b2f0b795d3b29398d")
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v3 1/4] build: asdf-build-system: Use SBCL source in CL packages.
  2020-05-08  6:48 [bug#41135] [PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
                   ` (3 preceding siblings ...)
  2020-05-08 17:39 ` [bug#41135] [PATCH 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
@ 2020-05-08 17:42 ` Pierre Neidhardt
  2020-05-08 17:43   ` [bug#41135] [Patch v3 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
                     ` (2 more replies)
  4 siblings, 3 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 17:42 UTC (permalink / raw)
  To: 41135

* guix/build/asdf-build-system.scm (copy-files-to-output): Don't attempt to
  reset timestamps on files without write access.
  (install): When parent SBCL package is in the inputs, use its source.  This
  way we get possibly patched sources in CL packages as well (e.g. for FFI).
  This is also useful for sources that generate files on load-op, like cl-unicode.

* guix/build-system/asdf.scm (package-with-build-system): Forward the SBCL
  parent as a native input so that it can be used in the install phase above.
---
 guix/build-system/asdf.scm       |  5 ++-
 guix/build/asdf-build-system.scm | 54 ++++++++++++++++++++++++++++----
 2 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index f794bf006b..630b99e2bf 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -230,7 +230,10 @@ set up using CL source package conventions."
              ((#:phases phases) (list phases-transformer phases))))
           (inputs (new-inputs package-inputs))
           (propagated-inputs (new-propagated-inputs))
-          (native-inputs (new-inputs package-native-inputs))
+          (native-inputs (append (if target-is-source?
+                                     (list (list (package-name pkg) pkg))
+                                     '())
+                                 (new-inputs package-native-inputs)))
           (outputs (if target-is-source?
                        '("out")
                        (package-outputs pkg)))))
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index f3f4b49bcf..25dd031962 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -85,7 +85,8 @@ valid."
     ;; files before compiling.
     (for-each (lambda (file)
                 (let ((s (lstat file)))
-                  (unless (eq? (stat:type s) 'symlink)
+                  (unless (or (eq? (stat:type s) 'symlink)
+                              (not (access? file W_OK)))
                     (utime file 0 0 0 0))))
               (find-files source #:directories? #t))
     (copy-recursively source target #:keep-mtime? #t)
@@ -97,12 +98,53 @@ valid."
      (find-files target "\\.asd$"))
     #t))
 
-(define* (install #:key outputs #:allow-other-keys)
-  "Copy and symlink all the source files."
+(define* (install #:key inputs outputs #:allow-other-keys)
+  "Copy and symlink all the source files.
+The source files are taken from the corresponding compile package (e.g. SBCL)
+if it's present in the native-inputs."
   (define output (assoc-ref outputs "out"))
-  (copy-files-to-output output
-                        (package-name->name+version
-                         (strip-store-file-name output))))
+  (define package-name
+    (package-name->name+version
+     (strip-store-file-name output)))
+  (define (no-prefix pkgname)
+    (if (string-index pkgname #\-)
+        (string-drop pkgname (1+ (string-index pkgname #\-)))
+        pkgname))
+  (define parent
+    (match (assoc package-name inputs
+                  (lambda (key alist-car)
+                    (let* ((alt-key (no-prefix key))
+                           (alist-car (no-prefix alist-car)))
+                      (or (string=? alist-car key)
+                          (string=? alist-car alt-key)))))
+      (#f #f)
+      (p (cdr p))))
+  (define parent-name
+    (and parent
+         (package-name->name+version (strip-store-file-name parent))))
+  (define parent-source
+    (and parent
+         (string-append parent "/share/common-lisp/"
+                        (string-take parent-name
+                                     (string-index parent-name #\-))
+                        "-source")))
+
+  (define (first-subdirectory directory) ; From gnu-build-system.
+    "Return the file name of the first sub-directory of DIRECTORY."
+    (match (scandir directory
+                    (lambda (file)
+                      (and (not (member file '("." "..")))
+                           (file-is-directory? (string-append directory "/"
+                                                              file)))))
+      ((first . _) first)))
+  (define source-directory
+    (if (and parent-source
+             (file-exists? parent-source))
+        (string-append parent-source "/" (first-subdirectory parent-source))
+        "."))
+
+  (with-directory-excursion source-directory
+    (copy-files-to-output output package-name)))
 
 (define* (copy-source #:key outputs asd-system-name #:allow-other-keys)
   "Copy the source to the library output."
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v3 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function.
  2020-05-08 17:42 ` [bug#41135] [Patch v3 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
@ 2020-05-08 17:43   ` Pierre Neidhardt
  2020-05-08 17:43   ` [bug#41135] [Patch v3 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
  2020-05-09  8:50   ` [bug#41135] [Patch v3 4/4] gnu: cl-cffi-gtk-gobject: Fix build with new Pierre Neidhardt
  2 siblings, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 17:43 UTC (permalink / raw)
  To: 41135

* gnu/packages/lisp-xyz.scm (cl-dexador)[arguments]: Remove
  'reset-gzip-timestamps phase.
---
 gnu/packages/lisp-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4f406ded66..6a199c32f9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5861,8 +5861,8 @@ neat APIs and connection-pooling.  It is meant to supersede Drakma.")
        ;; asdf-build-system/source has its own phases and does not inherit
        ;; from asdf-build-system/sbcl phases.
        (modify-phases %standard-phases/source
-         (add-after 'unpack 'fix-permissions
-           (lambda _ (make-file-writable "t/data/test.gz") #t)))))))
+         ;; Already done in SBCL package.
+         (delete 'reset-gzip-timestamps))))))
 
 (define-public ecl-dexador
   (sbcl-package->ecl-package sbcl-dexador))
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v3 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile.
  2020-05-08 17:42 ` [bug#41135] [Patch v3 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
  2020-05-08 17:43   ` [bug#41135] [Patch v3 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
@ 2020-05-08 17:43   ` Pierre Neidhardt
  2020-05-09  8:50   ` [bug#41135] [Patch v3 4/4] gnu: cl-cffi-gtk-gobject: Fix build with new Pierre Neidhardt
  2 siblings, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-08 17:43 UTC (permalink / raw)
  To: 41135

* gnu/packages/lisp-xyz.scm (cl-iolib)[propagated-inputs]: Add libfixposix.
---
 gnu/packages/lisp-xyz.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 6a199c32f9..f8685f8ce1 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5562,7 +5562,13 @@ and @code{kqueue(2)}), a pathname library and file-system utilities.")
        ((#:asd-system-name _) "iolib")))))
 
 (define-public cl-iolib
-  (sbcl-package->cl-source-package sbcl-iolib))
+  (let ((parent (sbcl-package->cl-source-package sbcl-iolib)))
+    (package
+      (inherit parent)
+      (propagated-inputs
+       ;; Need header to compile.
+       `(("libfixposix" ,libfixposix)
+         ,@(package-propagated-inputs parent))))))
 
 (define-public sbcl-ieee-floats
   (let ((commit "566b51a005e81ff618554b9b2f0b795d3b29398d")
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] [Patch v3 4/4] gnu: cl-cffi-gtk-gobject: Fix build with new
  2020-05-08 17:42 ` [bug#41135] [Patch v3 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
  2020-05-08 17:43   ` [bug#41135] [Patch v3 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
  2020-05-08 17:43   ` [bug#41135] [Patch v3 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
@ 2020-05-09  8:50   ` Pierre Neidhardt
  2 siblings, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-09  8:50 UTC (permalink / raw)
  To: 41135

[-- Attachment #1: Type: text/plain, Size: 23636 bytes --]


* gnu/packages/lisp-xyz.scm (sbcl-cl-cffi-gtk-boot0)[inputs]: Add all inputs.
[arguments]: Patch whole source.
(sbcl-cl-cffi-gtk-glib)[inputs]: Remove glib.
(sbcl-cl-cffi-gtk-glib)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gobject)[inputs]: Remove glib.
(sbcl-cl-cffi-gtk-gobject)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gio)[inputs]: Remove glib.
(sbcl-cl-cffi-gtk-gio)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-cairo)[inputs]: Remove cairo.
(sbcl-cl-cffi-gtk-cairo)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-pango)[inputs]: Remove pango.
(sbcl-cl-cffi-gtk-pango)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gdk-pixbuf)[inputs]: Remove gdk-pixbuf.
(sbcl-cl-cffi-gtk-gdk-pixbuf)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk-gdk-gdk)[inputs]: Remove gtk+.
(sbcl-cl-cffi-gtk-gdk-gdk)[arguments]: Reuse boot0 source.
(sbcl-cl-cffi-gtk)[arguments]: Reuse boot0 source.
---
 gnu/packages/lisp-xyz.scm | 341 ++++++++++++++++++--------------------
 1 file changed, 165 insertions(+), 176 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index f8685f8ce1..a5e5548fbf 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -2876,7 +2876,41 @@ Lisp implementations.")
       (inputs
        `(("iterate" ,sbcl-iterate)
          ("cffi" ,sbcl-cffi)
-         ("trivial-features" ,sbcl-trivial-features)))
+         ("trivial-features" ,sbcl-trivial-features)
+         ("glib" ,glib)
+         ("cairo" ,cairo)
+         ("pango" ,pango)
+         ("gdk-pixbuf" ,gdk-pixbuf)
+         ("gtk" ,gtk+)))
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-paths
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "glib/glib.init.lisp"
+                 (("libglib|libgthread" all)
+                  (string-append (assoc-ref inputs "glib") "/lib/" all)))
+               (substitute* "gobject/gobject.init.lisp"
+                 (("libgobject" all)
+                  (string-append (assoc-ref inputs "glib") "/lib/" all)))
+               (substitute* "gio/gio.init.lisp"
+                 (("libgio" all)
+                  (string-append (assoc-ref inputs "glib") "/lib/" all)))
+               (substitute* "cairo/cairo.init.lisp"
+                 (("libcairo" all)
+                  (string-append (assoc-ref inputs "cairo") "/lib/" all)))
+               (substitute* "pango/pango.init.lisp"
+                 (("libpango" all)
+                  (string-append (assoc-ref inputs "pango") "/lib/" all)))
+               (substitute* "gdk-pixbuf/gdk-pixbuf.init.lisp"
+                 (("libgdk_pixbuf" all)
+                  (string-append (assoc-ref inputs "gdk-pixbuf") "/lib/" all)))
+               (substitute* "gdk/gdk.init.lisp"
+                 (("libgdk" all)
+                  (string-append (assoc-ref inputs "gtk") "/lib/" all)))
+               (substitute* "gdk/gdk.package.lisp"
+                 (("libgtk" all)
+                  (string-append (assoc-ref inputs "gtk") "/lib/" all))))))))
       (home-page "https://github.com/Ferada/cl-cffi-gtk/")
       (synopsis "Common Lisp binding for GTK+3")
       (description
@@ -2889,192 +2923,155 @@ is a library for creating graphical user interfaces.")
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-glib")
     (inputs
-     `(("glib" ,glib)
-       ("bordeaux-threads" ,sbcl-bordeaux-threads)
+     `(("bordeaux-threads" ,sbcl-bordeaux-threads)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "glib/cl-cffi-gtk-glib.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "glib/glib.init.lisp"
-               (("libglib|libgthread" all)
-                (string-append (assoc-ref inputs "glib") "/lib/" all))))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "glib/cl-cffi-gtk-glib.asd")))))
 
 (define-public sbcl-cl-cffi-gtk-gobject
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gobject")
     (inputs
-     `(("glib" ,glib)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("trivial-garbage" ,sbcl-trivial-garbage)
        ("bordeaux-threads" ,sbcl-bordeaux-threads)
        ("closer-mop" ,sbcl-closer-mop)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gobject/cl-cffi-gtk-gobject.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gobject/gobject.init.lisp"
-               (("libgobject" all) (string-append
-                                    (assoc-ref inputs "glib") "/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-gobject")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gobject/cl-cffi-gtk-gobject.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-gobject")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-gio
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gio")
     (inputs
-     `(("glib" ,glib)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gio/cl-cffi-gtk-gio.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gio/gio.init.lisp"
-               (("libgio" all)
-                (string-append
-                 (assoc-ref inputs "glib") "/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-gio")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gio/cl-cffi-gtk-gio.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-gio")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-cairo
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-cairo")
     (inputs
-     `(("cairo" ,cairo)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "cairo/cl-cffi-gtk-cairo.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "cairo/cairo.init.lisp"
-               (("libcairo" all)
-                (string-append
-                 (assoc-ref inputs "cairo") "/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-cairo")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "cairo/cl-cffi-gtk-cairo.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-cairo")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-pango
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-pango")
     (inputs
-     `(("pango" ,pango)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ("cl-cffi-gtk-cairo" ,sbcl-cl-cffi-gtk-cairo)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "pango/cl-cffi-gtk-pango.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "pango/pango.init.lisp"
-               (("libpango" all)
-                (string-append
-                 (assoc-ref inputs "pango") "/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-pango")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "pango/cl-cffi-gtk-pango.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-pango")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-gdk-pixbuf
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gdk-pixbuf")
     (inputs
-     `(("gdk-pixbuf" ,gdk-pixbuf)
-       ("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
+     `(("cl-cffi-gtk-gobject" ,sbcl-cl-cffi-gtk-gobject)
        ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gdk-pixbuf/cl-cffi-gtk-gdk-pixbuf.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gdk-pixbuf/gdk-pixbuf.init.lisp"
-               (("libgdk_pixbuf" all)
-                (string-append
-                 (assoc-ref inputs "gdk-pixbuf") "/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-pixbuf")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gdk-pixbuf/cl-cffi-gtk-gdk-pixbuf.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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-pixbuf")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public sbcl-cl-cffi-gtk-gdk
   (package
     (inherit sbcl-cl-cffi-gtk-boot0)
     (name "sbcl-cl-cffi-gtk-gdk")
     (inputs
-     `(("gtk" ,gtk+)
-       ("cl-cffi-gtk-glib" ,sbcl-cl-cffi-gtk-glib)
+     `(("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)
@@ -3082,32 +3079,23 @@ is a library for creating graphical user interfaces.")
        ("cl-cffi-gtk-pango" ,sbcl-cl-cffi-gtk-pango)
        ,@(package-inputs sbcl-cl-cffi-gtk-boot0)))
     (arguments
-     `(#:asd-file "gdk/cl-cffi-gtk-gdk.asd"
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "gdk/gdk.init.lisp"
-               (("libgdk" all)
-                (string-append
-                 (assoc-ref inputs "gtk") "/lib/" all)))
-             (substitute* "gdk/gdk.package.lisp"
-               (("libgtk" all)
-                (string-append
-                 (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))))))))
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gdk/cl-cffi-gtk-gdk.asd")
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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
@@ -3122,26 +3110,27 @@ is a library for creating graphical user interfaces.")
     (native-inputs
      `(("fiveam" ,sbcl-fiveam)))
     (arguments
-     `(#:asd-file "gtk/cl-cffi-gtk.asd"
-       #:test-asd-file "test/cl-cffi-gtk-test.asd"
+     (substitute-keyword-arguments (package-arguments sbcl-cl-cffi-gtk-boot0)
+       ((#:asd-file _ "") "gtk/cl-cffi-gtk.asd")
+       ((#:test-asd-file _ "") "test/cl-cffi-gtk-test.asd")
        ;; TODO: Tests fail with memory fault.
        ;; See https://github.com/Ferada/cl-cffi-gtk/issues/24.
-       #:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (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")))
-               (delete-file-recursively out-source)
-               (symlink glib-source out-source)
-               #t))))))))
+       ((#:tests? _ #f) #f)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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")))
+                 (delete-file-recursively out-source)
+                 (symlink glib-source out-source)
+                 #t)))))))))
 
 (define-public cl-cffi-gtk
   (sbcl-package->cl-source-package sbcl-cl-cffi-gtk))
-- 
2.25.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [bug#41135] Acknowledgement ([PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages.)
  2020-05-08 16:36   ` [bug#41135] Acknowledgement ([PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages.) Pierre Neidhardt
@ 2020-05-21  9:54     ` Pierre Neidhardt
  0 siblings, 0 replies; 15+ messages in thread
From: Pierre Neidhardt @ 2020-05-21  9:54 UTC (permalink / raw)
  To: 41135

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

Merged with 0fadc00a1a5bfbb6ca9caf1bfae06e839684843c.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-05-21  9:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  6:48 [bug#41135] [PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
2020-05-08  6:58 ` [bug#41135] [PATCH 2/3] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
2020-05-08  6:58   ` [bug#41135] [PATCH 3/3] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
2020-05-08 10:37 ` [bug#41135] [Patch v2 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
2020-05-08 10:37   ` [bug#41135] [Patch v2 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
2020-05-08 10:37   ` [bug#41135] [Patch v2 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
     [not found] ` <handler.41135.B.158892052723318.ack@debbugs.gnu.org>
2020-05-08 16:36   ` [bug#41135] Acknowledgement ([PATCH 1/3] build: asdf-build-system: Use SBCL source in CL packages.) Pierre Neidhardt
2020-05-21  9:54     ` Pierre Neidhardt
2020-05-08 17:39 ` [bug#41135] [PATCH 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
2020-05-08 17:39   ` [bug#41135] [PATCH 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
2020-05-08 17:39   ` [bug#41135] [PATCH 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
2020-05-08 17:42 ` [bug#41135] [Patch v3 1/4] build: asdf-build-system: Use SBCL source in CL packages Pierre Neidhardt
2020-05-08 17:43   ` [bug#41135] [Patch v3 2/4] gnu: cl-dexador: Fix build with new sbcl-package->cl-source-package function Pierre Neidhardt
2020-05-08 17:43   ` [bug#41135] [Patch v3 3/4] gnu: cl-iolib: Propagate libfixposix or else it won't compile Pierre Neidhardt
2020-05-09  8:50   ` [bug#41135] [Patch v3 4/4] gnu: cl-cffi-gtk-gobject: Fix build with new Pierre Neidhardt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).