gwl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GWL 0.5 fails with plain packages


From: Olivier Dion
Subject: Re: GWL 0.5 fails with plain packages
Date: Sun, 31 Jul 2022 17:17:33 -0400

This patch should now have all outputs in _GWL_PROFILE.  There's still a
problem with the derivation though.
--8<---------------cut here---------------start------------->8---
diff --git a/gwl/packages.scm b/gwl/packages.scm
index 6a598ba..2ad3929 100644
--- a/gwl/packages.scm
+++ b/gwl/packages.scm
@@ -43,10 +43,11 @@
   #:export (current-guix
             inferior-store
 
+            add-package-output!
             lookup-package
             valid-package?
             package-name
-            package-output
+            package-outputs
 
             bash-minimal
             build-time-guix
@@ -86,7 +87,7 @@
                     (_ (raise (condition
                                (&gwl-package-error
                                 (package-spec specification))))))))
-    (set! (package-output package) output)
+    (add-package-output! package output)
     package))
 
 (define (valid-package? val)
@@ -110,7 +111,14 @@ the version.  By default, DELIMITER is \"@\"."
     ((? inferior-package? pkg)
      (inferior-package-full-name pkg))))
 
-(define package-output (make-object-property))
+(define package-outputs (make-object-property))
+
+(define (add-package-output! pkg out)
+  (let ((outs (package-outputs pkg)))
+    (set! (package-outputs pkg)
+          (if outs
+              (cons out outs)
+              (list out)))))
 
 (define bash-minimal
   (mlambda ()
diff --git a/gwl/processes.scm b/gwl/processes.scm
index 2452d1f..3616ad2 100644
--- a/gwl/processes.scm
+++ b/gwl/processes.scm
@@ -45,6 +45,7 @@
             process-name
             process-full-name
             process-version
+            process-raw-packages
             process-packages
             process-raw-inputs
             process-inputs
@@ -182,7 +183,7 @@
    #:init-keyword #:description
    #:init-value "")
   (packages
-   #:accessor process-packages
+   #:accessor process-raw-packages
    #:init-keyword #:packages
    #:init-value '()
    #:implicit-list? #t
@@ -197,12 +198,21 @@
             ((and (? string?) spec)
              (lookup-package spec))
             ((and (? valid-package?) pkg)
+             (add-package-output! pkg "out")
+             pkg)
+            (((? valid-package? pkg) (? string? output))
+             (add-package-output! pkg output)
              pkg)
             (x
              (raise
               (condition
                (&gwl-type-error
-                (expected-type (list "<package>" "<inferior-package>" 
"<string>"))
+                (expected-type
+                 (list "<package>"
+                       "<inferior-package>"
+                       "<string>"
+                       "(<package> <string>)"
+                       "(inferior-package> <string>)"))
                 (actual-value x))))))
           value)))
   (inputs
@@ -622,6 +632,9 @@ the container."
 ;;; ADDITIONAL FUNCTIONS
 ;;; ---------------------------------------------------------------------------
 
+(define (process-packages process)
+  (delete-duplicates (process-raw-packages process)))
+
 (define* (process-inputs process #:optional with-tags?)
   "Return the plain values of all inputs of PROCESS, without any
 keyword tags if WITH-TAGS? is #FALSE or missing."
@@ -688,10 +701,13 @@ PROCESS."
   (let* ((name         (process-full-name process))
          (packages     (cons (bash-minimal)
                              (process-packages process)))
-         (manifest     (packages->manifest (map
-                                            (lambda (pkg)
-                                              (list pkg (package-output pkg)))
-                                            packages)))
+         (manifest     (packages->manifest
+                        (append-map
+                         (lambda (pkg)
+                           (map (lambda (output)
+                                  (list pkg output))
+                                (package-outputs pkg)))
+                         packages)))
          (profile      (profile (content manifest)))
          (search-paths (delete-duplicates
                         (map search-path-specification->sexp
--8<---------------cut here---------------end--------------->8---

-- 
Olivier Dion
oldiob.dev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]