From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:56093) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPJcd-0000ig-B5 for guix-patches@gnu.org; Fri, 17 Apr 2020 01:33:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPJcc-0002VZ-5w for guix-patches@gnu.org; Fri, 17 Apr 2020 01:33:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPJcc-0002VQ-2c for guix-patches@gnu.org; Fri, 17 Apr 2020 01:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPJcb-0002Zy-Uz for guix-patches@gnu.org; Fri, 17 Apr 2020 01:33:01 -0400 Subject: [bug#40629] [PATCH v2 9/9] import/json: json->code: Handle files with more than one definition. Resent-Message-ID: From: Jan Nieuwenhuizen References: <20200414225903.10862-1-rekado@elephly.net> <20200414225903.10862-2-rekado@elephly.net> <87tv1ln03s.fsf@elephly.net> Date: Fri, 17 Apr 2020 07:32:17 +0200 In-Reply-To: <87tv1ln03s.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 15 Apr 2020 01:01:11 +0200") Message-ID: <87tv1ivfry.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 Ricardo Wurmus writes: > With these last few changes it=E2=80=99s 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"] > } > ] > > =E2=80=9Chello2=E2=80=9D has =E2=80=9Cmyhello=E2=80=9D as an input. When= this file is passed to =E2=80=9Cguix > install -f=E2=80=9D both packages will be built and =E2=80=9Chello2=E2=80= =9D 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 --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com