From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59486) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOOgJ-0005ti-7e for guix-patches@gnu.org; Tue, 14 Apr 2020 12:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOOgI-0007vm-2k for guix-patches@gnu.org; Tue, 14 Apr 2020 12:45:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOOgH-0007vW-QA for guix-patches@gnu.org; Tue, 14 Apr 2020 12:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jOOgH-0001YQ-O3 for guix-patches@gnu.org; Tue, 14 Apr 2020 12:45:01 -0400 Subject: [bug#40629] Build and install packages from JSON definitions Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:58853) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOOfT-0004C4-Ks for guix-patches@gnu.org; Tue, 14 Apr 2020 12:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOOfS-0007Oj-BY for guix-patches@gnu.org; Tue, 14 Apr 2020 12:44:11 -0400 Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jONjr-0004Hu-V1 for guix-patches@gnu.org; Tue, 14 Apr 2020 11:44:40 -0400 From: Ricardo Wurmus Message-ID: <87y2qym5v8.fsf@elephly.net> Date: Tue, 14 Apr 2020 17:44:31 +0200 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: 40629@debbugs.gnu.org Hi Guix, did you know that we have JSON importer? Admittedly, it=E2=80=99s not very useful because people don=E2=80=99t generally use JSON syntax to define Guix 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: --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 =E2=80=9Cguix package -f hello.json= =E2=80=9D without having to first run the JSON importer. Since the JSON importer doesn=E2=80=99t know how to work with more than one definition you can=E2=80=99t have more than one custom definition in your J= SON file, but if there=E2=80=99s interest we can easily add support for this. (My patch set does not come with documentation changes for =E2=80=9Cguix package=E2=80=9D or =E2=80=9Cguix build=E2=80=9D.) What do you think? -- Ricardo