nongnu: steam: Use format for scheme string.

* nongnu/packages/steam-client.scm (steam)[arguments]: Use format to
  print manifest.
This commit is contained in:
ison 2020-09-04 09:49:14 -06:00 committed by Pierre Neidhardt
parent a7a126daff
commit f52fe58c5c
No known key found for this signature in database
GPG key ID: 9BDCF497A4BBCC7F

View file

@ -379,14 +379,17 @@ in the Guix store"
(define (move-file old new) (define (move-file old new)
(rename-file old new) (rename-file old new)
new) new)
(define (write-file path str) (define (write-file path data)
(with-output-to-file path (let ((str (if (list? data)
(lambda () (format #f "~{~y~}" data)
(let loop ((ls1 (string->list str))) data)))
(unless (null? ls1) (with-output-to-file path
(begin (lambda ()
(write-char (car ls1)) (let loop ((ls1 (string->list str)))
(loop (cdr ls1)))))))) (unless (null? ls1)
(begin
(write-char (car ls1))
(loop (cdr ls1)))))))))
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(shebang (string-append "#!" (which "bash"))) (shebang (string-append "#!" (which "bash")))
(steam-real (move-file (string-append out "/bin/steam") (steam-real (move-file (string-append out "/bin/steam")
@ -405,46 +408,46 @@ in the Guix store"
(python (assoc-ref inputs "python"))) (python (assoc-ref inputs "python")))
(mkdir-p manifest-dir) (mkdir-p manifest-dir)
(write-file manifest-path (write-file
(string-append " manifest-path
(use-package-modules `((use-package-modules
base certs compression file gawk gnome linux) base certs compression file gawk gnome linux)
(use-modules (guix utils) (use-modules (guix utils)
(guix profiles) (guix profiles)
(guix store) (guix store)
(srfi srfi-11)) (srfi srfi-11))
;;; Copied from guix/scripts/package.scm ;; Copied from guix/scripts/package.scm.
(define (store-item->manifest-entry item) (define (store-item->manifest-entry item)
\"Return a manifest entry for ITEM, a \\\"/gnu/store/...\\\" file name.\" "Return a manifest entry for ITEM, a \"/gnu/store/...\" file name."
(let-values (((name version) (let-values (((name version)
(package-name->name+version (store-path-package-name item) (package-name->name+version (store-path-package-name item)
#\\-))) #\-)))
(manifest-entry (manifest-entry
(name name) (name name)
(version version) (version version)
(output \"out\") ;XXX: wild guess (output ,out) ;XXX: wild guess
(item item)))) (item item))))
(manifest-add (manifest-add
(packages->manifest (packages->manifest
(list coreutils (list coreutils
diffutils diffutils
file file
findutils findutils
gawk gawk
glibc-locales glibc-locales
grep grep
gzip gzip
nss-certs nss-certs
sed sed
strace strace
tar tar
util-linux+udev util-linux+udev
which which
xz xz
zenity)) zenity))
`(,(store-item->manifest-entry \"" out "\")))")) `(,(store-item->manifest-entry ,out)))))
(write-file sandbox (write-file sandbox
(string-append shebang " (string-append shebang "