From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id n4WQCmjyGl87DAAA0tVLHw (envelope-from ) for ; Fri, 24 Jul 2020 14:38:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SGryBWjyGl+KKAAAB5/wlQ (envelope-from ) for ; Fri, 24 Jul 2020 14:38:32 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 994C194062F for ; Fri, 24 Jul 2020 14:38:31 +0000 (UTC) Received: from localhost ([::1]:56006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyyqD-0003Cp-EH for larch@yhetil.org; Fri, 24 Jul 2020 10:38:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyyq4-0003BM-U1 for help-guix@gnu.org; Fri, 24 Jul 2020 10:38:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53629) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyyq2-0005a6-TK; Fri, 24 Jul 2020 10:38:18 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50210 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jyyq2-00057U-7Y; Fri, 24 Jul 2020 10:38:18 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: Building packages in REPL References: <86wo3u9mfi.fsf@gmail.com> <86tuyy9kdu.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Thermidor an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 24 Jul 2020 16:38:16 +0200 In-Reply-To: <86tuyy9kdu.fsf@gmail.com> (zimoun's message of "Fri, 26 Jun 2020 12:44:29 +0200") Message-ID: <87h7tx6krr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Quizon , help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: cf+qwlo7pA09 Hi, zimoun skribis: > On Fri, 26 Jun 2020 at 06:17, Julien Lepiller wrote: > >> One way to do this with the guix API is to get the derivation, then buil= d it: >> >> (use-modules (guix derivations) (guix store) (gnu packages bash)) >> (define package bash-minimal) >> (define store (open-connection)) >> (define der (package-derivation store package)) >> (build-derivations store (list der)) >> >> Is that what you want? > > Yes, but provides something like: > > (use-modules > (guix store) > (guix derivations) > (guix packages)) >=20=20 > (define (build-packages packages) > (with-store store > (let ((builds (map (lambda (package) > (package-derivation store package)) > packages))) > (build-derivations store builds)))) > > (define (build-package package) > (build-packages (list package))) (guix scripts) has a high-level =E2=80=98build-package=E2=80=99 procedure (= initially written for Emacs-Guix) that can be used like this: --8<---------------cut here---------------start------------->8--- $ guix repl GNU Guile 3.0.4 Copyright (C) 1995-2020 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guix-user)> ,use(guix) scheme@(guix-user)> ,use(guix scripts) scheme@(guix-user)> ,use(gnu packages base) scheme@(guix-user)> (build-package coreutils) $1 =3D # scheme@(guix-user)> ,run-in-store (build-package coreutils) /gnu/store/yvsd53rkbvy9q8ak6681hai62nm6rf31-coreutils-8.32-debug /gnu/store/n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32 $2 =3D #t --8<---------------cut here---------------end--------------->8--- HTH! Ludo=E2=80=99.