all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Ziltener via Guix-patches via <guix-patches@gnu.org>
To: 68517@debbugs.gnu.org
Subject: [bug#68517] [PATCH] guix: chicken-build-system: fixes to make it actually work
Date: Tue, 16 Jan 2024 22:05:04 +0100	[thread overview]
Message-ID: <2d16444a-92b5-3474-3ab3-2ba4d2851766@lyrion.ch> (raw)

---
  guix/build-system/chicken.scm       | 50 ++++++++++++++++++++---------
  guix/build/chicken-build-system.scm | 17 ++++------
  2 files changed, 40 insertions(+), 27 deletions(-)

diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index 9f518e66e6..17c3b7b144 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -45,8 +45,8 @@ (define %chicken-build-system-modules
      ,@%gnu-build-system-modules))
  
  (define (default-chicken)
+  "Return the default Chicken package."
    ;; Lazily resolve the binding to avoid a circular dependency.
-  ;; TODO is this actually needed in every build system?
    (let ((chicken (resolve-interface '(gnu packages chicken))))
        (module-ref chicken 'chicken)))
  
@@ -77,18 +77,32 @@ (define private-keywords
                           ,@native-inputs))
           (outputs outputs)
           (build chicken-build)
-         (arguments (strip-keyword-arguments private-keywords arguments)))))
+         (arguments
+          (substitute-keyword-arguments
+              (strip-keyword-arguments private-keywords arguments)
+            ((#:extra-directories extra-directories)
+             `(list ,@(append-map
+                       (lambda (name)
+                         (match (assoc name inputs)
+                           ((_ pkg)
+                            (match (package-transitive-propagated-inputs pkg)
+                              (((propagated-names . _) ...)
+                               (cons name propagated-names))))))
+                       extra-directories))))))))
  
  (define* (chicken-build name inputs
                          #:key
                          source
                          (phases '%standard-phases)
-                        (outputs '("out"))
+                        (outputs '("out" "static"))
                          (search-paths '())
                          (egg-name "")
                          (unpack-path "")
                          (build-flags ''())
+                        (configure-flags ''())
+                        (extra-directories ''())
                          (tests? #t)
+                        (parallel-build? #f)
                          (system (%current-system))
                          (guile #f)
                          (imported-modules %chicken-build-system-modules)
@@ -99,19 +113,23 @@ (define builder
      (with-imported-modules imported-modules
        #~(begin
            (use-modules #$@(sexp->gexp modules))
-          (chicken-build #:name #$name
-                         #:source #+source
-                         #:system #$system
-                         #:phases #$phases
-                         #:outputs #$(outputs->gexp outputs)
-                         #:search-paths '#$(sexp->gexp
-                                            (map search-path-specification->sexp
-                                                 search-paths))
-                         #:egg-name #$egg-name
-                         #:unpack-path #$unpack-path
-                         #:build-flags #$build-flags
-                         #:tests? #$tests?
-                         #:inputs #$(input-tuples->gexp inputs)))))
+          #$(with-build-variables inputs-outputs
+                #~(chicken-build #:name #$name
+                                 #:source #+source
+                                 #:system #$system
+                                 #:phases #$phases
+                                 #:configure-flags #$configure-flags
+                                 #:extra-directories #$extra-directories
+                                 #:parallel-build? #$parallel-build?
+                                 #:outputs #$(outputs->gexp outputs)
+                                 #:search-paths '#$(sexp->gexp
+                                                    (map search-path-specification->sexp
+                                                         search-paths))
+                                 #:egg-name #$egg-name
+                                 #:unpack-path #$unpack-path
+                                 #:build-flags #$build-flags
+                                 #:tests? #$tests?
+                                 #:inputs #$(input-tuples->gexp inputs))))))
  
    (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                    system #:graft? #f)))
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index 8f9f59cc25..6a4f0c43eb 100644
--- a/guix/build/chicken-build-system.scm
+++ b/guix/build/chicken-build-system.scm
@@ -42,13 +42,12 @@ (define (chicken-package? name)
  
  (define* (setup-chicken-environment #:key inputs outputs #:allow-other-keys)
    (setenv "CHICKEN_INSTALL_REPOSITORY"
-          (string-concatenate
-           ;; see TODO item about binary version above
-           (append (list (assoc-ref outputs "out") "/var/lib/chicken/11/")
-                   (let ((oldenv (getenv "CHICKEN_INSTALL_REPOSITORY")))
-                     (if oldenv
-                         (list  ":" oldenv)
-                         '())))))
+          (string-append (assoc-ref outputs "out") "/var/lib/chicken/11/"))
+  (setenv "CHICKEN_INSTALL_PREFIX"
+          (string-append (assoc-ref outputs "out") "/bin/"))
+  (setenv "CHICKEN_REPOSITORY_PATH"
+          (string-append (getenv "CHICKEN_REPOSITORY_PATH")
+                         ":" (getenv "CHICKEN_INSTALL_REPOSITORY")))
    (setenv "CHICKEN_EGG_CACHE" (getcwd))
    #t)
  
@@ -104,10 +103,6 @@ (define* (check #:key egg-name tests? #:allow-other-keys)
    ;; there is no "-test-only" option, but we've already run install
    ;; so this just runs tests.
    ;; i think it's a fair assumption that phases won't be reordered.
-  (setenv "CHICKEN_REPOSITORY_PATH"
-          (string-append (getenv "CHICKEN_INSTALL_REPOSITORY")
-                         ":"
-                         (getenv "CHICKEN_REPOSITORY_PATH")))
    (when tests?
      (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name)))
  
-- 
2.43.0





             reply	other threads:[~2024-01-16 21:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 21:05 Daniel Ziltener via Guix-patches via [this message]
2024-01-18 10:12 ` [bug#68517] [PATCH] guix: chicken-build-system: fixes to make it actually work Daniel Ziltener via Guix-patches via
2024-01-24 15:11   ` Maxim Cournoyer
2024-01-24 20:52 ` Daniel Ziltener via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d16444a-92b5-3474-3ab3-2ba4d2851766@lyrion.ch \
    --to=guix-patches@gnu.org \
    --cc=68517@debbugs.gnu.org \
    --cc=dziltener@lyrion.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.