From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:41862) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPCPX-0008JL-OD for guix-patches@gnu.org; Thu, 16 Apr 2020 17:51:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPCPW-0005Im-BR for guix-patches@gnu.org; Thu, 16 Apr 2020 17:51:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56197) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPCPW-0005Ie-89 for guix-patches@gnu.org; Thu, 16 Apr 2020 17:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPCPW-0001q7-4j for guix-patches@gnu.org; Thu, 16 Apr 2020 17:51:02 -0400 Subject: [bug#40629] Build and install packages from JSON definitions Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87y2qym5v8.fsf@elephly.net> Date: Thu, 16 Apr 2020 23:50:04 +0200 In-Reply-To: <87y2qym5v8.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 14 Apr 2020 17:44:31 +0200") Message-ID: <87o8rrdrsj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 40629@debbugs.gnu.org Hey! Ricardo Wurmus skribis: > did you know that we have JSON importer? Admittedly, it=E2=80=99s not ve= ry > useful because people don=E2=80=99t generally use JSON syntax to define G= uix > packages. Not even Guix lets you build and install packages from JSON > definitions, so what=E2=80=99s the point really? > > Well, fret not! This patch set adds support for JSON package > definitions to =E2=80=9Cguix package -f=E2=80=9D and =E2=80=9Cguix build = -f=E2=80=9D. You can now dump > this into a file =E2=80=9Chello.json=E2=80=9D: > > { > "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"] > } > > and then install the hello package with =E2=80=9Cguix package -f hello.js= on=E2=80=9D > without having to first run the JSON importer. I think that=E2=80=99s pretty cool! In a way, it also looks like a special case of the import-on-the-fly use case we discussed. Namely, if you could write: guix build json:./foo.json guix install pypi:itsdangerous =E2=80=A6 and have the relevant importer automatically invoked, that=E2=80=99d be swe= et. But=E2=80=A6 that=E2=80=99s somewhat ambitious and shouldn=E2=80=99t block = this improvement! Ludo=E2=80=99.