all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 40629@debbugs.gnu.org
Subject: [bug#40629] Build and install packages from JSON definitions
Date: Fri, 17 Apr 2020 18:45:06 +0100	[thread overview]
Message-ID: <87k12e57ml.fsf@cbaines.net> (raw)
In-Reply-To: <87lfmwmlk4.fsf@elephly.net>

[-- Attachment #1: Type: text/plain, Size: 2471 bytes --]


Ricardo Wurmus <rekado@elephly.net> writes:

> Christopher Baines <mail@cbaines.net> writes:
>
>> Ricardo Wurmus <rekado@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

  parent reply	other threads:[~2020-04-17 17:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 15:44 [bug#40629] Build and install packages from JSON definitions Ricardo Wurmus
2020-04-14 17:19 ` [bug#40629] [PATCH 1/5] import/print: Return license with prefix Ricardo Wurmus
2020-04-14 17:19   ` [bug#40629] [PATCH 2/5] import/print: package->code: Wrap build system value in module reference Ricardo Wurmus
2020-04-14 17:19   ` [bug#40629] [PATCH 3/5] import/json: Add json->scheme-file Ricardo Wurmus
2020-04-14 17:19   ` [bug#40629] [PATCH 4/5] scripts/build: options->things-to-build: Handle .json files Ricardo Wurmus
2020-04-16 21:45     ` Ludovic Courtès
2020-04-16 21:53     ` Ludovic Courtès
2020-04-14 17:19   ` [bug#40629] [PATCH 5/5] scripts/package: Handle JSON files Ricardo Wurmus
2020-04-14 22:48 ` [bug#40629] [PATCH 6/9] import/json: Use json->code Ricardo Wurmus
2020-04-14 22:48   ` [bug#40629] [PATCH 7/9] import/print: package->code: Wrap S-expression in definition Ricardo Wurmus
2020-04-14 22:48   ` [bug#40629] [PATCH 8/9] import/utils: alist->package: Ignore known inputs Ricardo Wurmus
2020-04-14 22:48   ` [bug#40629] [PATCH 9/9] import/json: json->code: Handle files with more than one definition Ricardo Wurmus
2020-04-14 22:59 ` [bug#40629] [PATCH v2 8/9] import/utils: alist->package: Ignore known inputs Ricardo Wurmus
2020-04-14 22:59   ` [bug#40629] [PATCH v2 9/9] import/json: json->code: Handle files with more than one definition Ricardo Wurmus
2020-04-14 23:01     ` Ricardo Wurmus
2020-04-17  5:32       ` Jan Nieuwenhuizen
2020-04-18 20:23         ` Ricardo Wurmus
2020-04-15 18:26 ` [bug#40629] Build and install packages from JSON definitions Christopher Baines
2020-04-15 22:27   ` Ricardo Wurmus
2020-04-16 21:44     ` bug#40629: " Ricardo Wurmus
2020-04-17 17:45     ` Christopher Baines [this message]
2020-04-16 21:50 ` [bug#40629] " Ludovic Courtès
2020-04-17  8:25   ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k12e57ml.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=40629@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.