[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#32118] [PATCH 2/2] gexp: Allow bytevector as content of `plain-file
From: |
Ludovic Courtès |
Subject: |
[bug#32118] [PATCH 2/2] gexp: Allow bytevector as content of `plain-file'. |
Date: |
Thu, 12 Jul 2018 00:11:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Jan Nieuwenhuizen <address@hidden> skribis:
> This allows for using a package source directly from git, doing something like
>
> (define (command->bytevector command)
> (let ((port (apply open-pipe* OPEN_READ command)))
> (let ((output (get-bytevector-all port)))
> (close-port port)
> output)))
>
> (define-public hello-git
> (package
> (name "hello")
> (version "git")
> (source (let* ((commit "stable-2.0")
> (content (command->bytevector
> `("git" "archive" "--format" "tar" "--prefix"
> ,(string-append commit "/") ,commit)))
> (file-name (string-append "hello-" commit)))
> (plain-file file-name content)))
> ...
> ))
>
> * guix/gexp.scm (<plain-file>): Also allow bytevector content.
> (plain-file-compiler): Handle bytevector content.
> * doc/guix.texi (G-Expressions): Describe plain-file now also taking
> bytevectors.
LGTM, thanks!
Ludo'.