GNU bug report logs - #40629
Build and install packages from JSON definitions

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Tue, 14 Apr 2020 16:45:01 UTC

Severity: normal

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

Full log


Message #64 received at 40629 <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 40629 <at> debbugs.gnu.org
Subject: Re: [bug#40629] [PATCH v2 9/9] import/json: json->code: Handle files
 with more than one definition.
Date: Fri, 17 Apr 2020 07:32:17 +0200
Ricardo Wurmus writes:

> With these last few changes it’s now possible to have multiple
> definitions in a JSON array:
>
> [
>   {
>     "name": "myhello",
>     "version": "2.10",
>     "source": "mirror://gnu/hello/hello-2.10.tar.gz",
>     "build-system": "gnu",
>     "home-page": "https://www.gnu.org/software/hello/",
>     "synopsis": "Hello, GNU world: An example GNU package",
>     "description": "GNU Hello prints a greeting.",
>     "license": "GPL-3.0+",
>     "native-inputs": ["gettext"]
>   },
>   {
>     "name": "hello2",
>     "version": "2.10",
>     "source": "mirror://gnu/hello/hello-2.10.tar.gz",
>     "build-system": "gnu",
>     "home-page": "https://www.gnu.org/software/hello/",
>     "synopsis": "Hello, GNU world: An example GNU package",
>     "description": "GNU Hello prints a greeting.",
>     "license": "GPL-3.0+",
>     "inputs": ["myhello"],
>     "native-inputs": ["gettext"]
>   }
> ]
>
> “hello2” has “myhello” as an input.  When this file is passed to “guix
> install -f” both packages will be built and “hello2” will be installed
> into the profile as it is the last package in the list.

Great!  I am imagining this as an s-expression, maybe something like

--8<---------------cut here---------------start------------->8---
(define-package
  (alist->package
   '((name          "hello")
     (version       "2.10")
     (build-system  "gnu")
     (home-page     "https://www.gnu.org/software/hello/")
     (synopsis      "Hello, GNU world: An example GNU package")
     (description   "GNU Hello prints a greeting.")
     (license       "GPL-3.0+")
     (native-inputs "gettext"))))
--8<---------------cut here---------------end--------------->8---

We may need some dots, or (native-inputs #("gettext")) if we are using
json->scm in the process; just dreaming out loud here.

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




This bug report was last modified 5 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.