From: Daniel Ziltener via Guix-patches via <guix-patches@gnu.org>
To: 70005@debbugs.gnu.org
Cc: dziltener@lyrion.ch
Subject: [bug#70005] [PATCH 1/1] guix: chicken-build-system: fix the build system
Date: Tue, 26 Mar 2024 14:48:06 +0100 [thread overview]
Message-ID: <87a293d63099d7121384ebd12a1274c0@lyrion.ch> (raw)
In-Reply-To: <b02bfd541ff907a8f4bb6e4f4e0bea6a@lyrion.ch>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7431 bytes --]
---
guix/build-system/chicken.scm | 42 +++++++++++++++++++++--------
guix/build/chicken-build-system.scm | 24 +++++++----------
2 files changed, 41 insertions(+), 25 deletions(-)
diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index 9f518e66e6..e2b512446a 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2020 raingloom <raingloom@riseup.net>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -23,9 +24,12 @@ (define-module (guix build-system chicken)
#:use-module (guix gexp)
#:use-module (guix store)
#:use-module (guix monads)
+ #:use-module (guix download)
#:use-module (guix search-paths)
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-1)
#:use-module (guix packages)
#:export (%chicken-build-system-modules
chicken-build
@@ -40,15 +44,15 @@ (define* (egg-uri name version #:optional (extension ".tar.gz"))
(define %chicken-build-system-modules
;; Build-side modules imported and used by default.
- `((guix build chicken-build-system)
+ `((zilti build chicken-build-system)
(guix build union)
,@%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)))
+ (module-ref chicken 'chicken)))
(define* (lower name
#:key source inputs native-inputs outputs system target
@@ -57,7 +61,7 @@ (define* (lower name
#:rest arguments)
"Return a bag for NAME."
(define private-keywords
- '(#:target #:chicken #:inputs #:native-inputs))
+ '(#:target #:chicken #:inputs #:native-inputs #:outputs))
;; TODO: cross-compilation support
(and (not target)
@@ -77,22 +81,35 @@ (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
+ #:key source
+ (tests? #t)
+ (parallel-build? #f)
+ (build-flags ''())
+ (configure-flags ''())
+ (extra-directories ''())
(phases '%standard-phases)
- (outputs '("out"))
+ (outputs '("out" "static"))
(search-paths '())
(egg-name "")
(unpack-path "")
- (build-flags ''())
- (tests? #t)
(system (%current-system))
(guile #f)
(imported-modules %chicken-build-system-modules)
- (modules '((guix build chicken-build-system)
+ (modules '((zilti build chicken-build-system)
(guix build union)
(guix build utils))))
(define builder
@@ -103,6 +120,9 @@ (define builder
#: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
diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index 8f9f59cc25..0c250e9376 100644
--- a/guix/build/chicken-build-system.scm
+++ b/guix/build/chicken-build-system.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 raingloom <raingloom@riseup.net>
+;;; Copyright © 2024 Daniel Ziltener <dziltener@lyrion.ch>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,13 +43,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"
+ (assoc-ref outputs "out"))
+ (setenv "CHICKEN_REPOSITORY_PATH"
+ (string-append (getenv "CHICKEN_REPOSITORY_PATH")
+ ":" (getenv "CHICKEN_INSTALL_REPOSITORY")))
(setenv "CHICKEN_EGG_CACHE" (getcwd))
#t)
@@ -58,9 +58,9 @@ (define* (setup-chicken-environment #:key inputs outputs #:allow-other-keys)
(define* (unpack #:key source egg-name unpack-path #:allow-other-keys)
"Relative to $CHICKEN_EGG_CACHE, unpack SOURCE in UNPACK-PATH, or EGG-NAME
when UNPACK-PATH is unset. If the SOURCE archive has a single top level
-directory, it is stripped so that the sources appear directly under UNPACK-PATH.
-When SOURCE is a directory, copy its content into UNPACK-PATH instead of
-unpacking."
+directory, it is stripped so that the sources appear directly under
+UNPACK-PATH. When SOURCE is a directory, copy its content into UNPACK-PATH
+instead of unpacking."
(define (unpack-maybe-strip source dest)
(let* ((scratch-dir (string-append (or (getenv "TMPDIR") "/tmp")
"/scratch-dir"))
@@ -104,10 +104,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.41.0
prev parent reply other threads:[~2024-03-26 15:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 13:55 [bug#70005] [PATCH 0/1] guix: chicken-build-system: fix the build system Daniel Ziltener via Guix-patches via
2024-03-26 13:48 ` Daniel Ziltener via Guix-patches via [this message]
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a293d63099d7121384ebd12a1274c0@lyrion.ch \
--to=guix-patches@gnu.org \
--cc=70005@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 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).