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 #70 received at 40629 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 40629 <at> debbugs.gnu.org
Subject: Re: [bug#40629] Build and install packages from JSON definitions
Date: Fri, 17 Apr 2020 18:45:06 +0100
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> Ricardo Wurmus <rekado <at> elephly.net> writes:
>>
>>> did you know that we have JSON importer?  Admittedly, it’s not very
>>> useful because people don’t generally use JSON syntax to define Guix
>>> packages.  Not even Guix lets you build and install packages from JSON
>>> definitions, so what’s the point really?
>>>
>>> Well, fret not!  This patch set adds support for JSON package
>>> definitions to “guix package -f” and “guix build -f”.  You can now dump
>>> this into a file “hello.json”:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> {
>>>   "name": "hello",
>>>   "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"]
>>> }
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> and then install the hello package with “guix package -f hello.json”
>>> without having to first run the JSON importer.
>>>
>>> Since the JSON importer doesn’t know how to work with more than one
>>> definition you can’t have more than one custom definition in your JSON
>>> file, but if there’s interest we can easily add support for this.
>>>
>>> (My patch set does not come with documentation changes for “guix
>>> package” or “guix build”.)
>>>
>>> What do you think?
>>
>> I haven't played with the JSON importer, but this sounds cool. Did you
>> have any ideas for using this in mind?
>
> When I added the JSON importer long ago I also had a commit to extend
> “guix build” to install packages from JSON descriptions, but that never
> actually made it into the repository.
>
> Even then I didn’t have a grand plan; I just wanted to be able to tell
> the Scheme-averse that they could use JSON instead, e.g. for environment
> definitions or simple custom packages.
>
> It can be a sneaky way to get people to use Guix even though they are
> initially uncomfortable with Scheme.

Cool, I think it's nice to be able to use a more "data" format if that's
useful. I'm sure there will be some useful applications eventually!

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

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.