[Top][All Lists]

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

Re: How do I make a manifest file that installs a specific version of a

From: Chris Marusich
Subject: Re: How do I make a manifest file that installs a specific version of a dependency?
Date: Mon, 13 Mar 2017 01:17:36 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hello,
> Zachary Kanfer <address@hidden> skribis:
>> Running `guix package -m` on a file with this line `(list icedtea-2.6
>> "jdk")` gives an error "In procedure module-lookup: Unbound variable:
>> icedtea-2.6".
>> I get the same error for the following lines:
>> `(list icedtea-2.6.6 "jdk")`
>> `(list address@hidden "jdk")`
>> `guix package -s icedtea` reports that there is a version 2.6.6. How do I
>> specify this in a manifest file? Thanks.
> You should use ‘specification->package’ as discussed at
> <>.
> The ‘specification->package’ procedure takes a spec like those you’d
> write on the ‘guix package -i’ command line, and returns the
> corresponding package.  ‘specification->package+output’ works similarly
> but also returns the specified output (the part that comes after the
> colon).
> So your manifest would look something like:
>   (use-modules (gnu))
>   (packages->manifest
>    (map (compose list specification->package+output)
>         '("address@hidden:jdk" "emacs" "vim" …)))
> HTH!
> Ludo’.

Just for fun, I tried running some commands in a REPL.  I wanted to find
out why the "list" procedure was being used here.  What I saw was this:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (specification->package+output "address@hidden:jdk")
$6 = #<package address@hidden gnu/packages/java.scm:347 39a6000>
$7 = "jdk"
scheme@(guile-user)> (list (specification->package+output "address@hidden:jdk"))
$8 = (#<package address@hidden gnu/packages/java.scm:347 39a6000>)
scheme@(guile-user)> (map (compose list specification->package+output) 
$9 = ((#<package address@hidden gnu/packages/java.scm:347 39a6000> "jdk"))
--8<---------------cut here---------------end--------------->8---

Why does the string "jdk" appear in $9 but not in $8?  It looks like the
list procedure ignored the second value (the "jdk" string) when
producing $8, but not when producing $9.  Is that true?  Why?


Attachment: signature.asc
Description: PGP signature

reply via email to

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