From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2JUdOJzgEWD2CQAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 21:52:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EN33M5zgEWDraQAA1q6Kng (envelope-from ) for ; Wed, 27 Jan 2021 21:52:28 +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 0CEC694042C for ; Wed, 27 Jan 2021 21:52:28 +0000 (UTC) Received: from localhost ([::1]:33846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4sji-0000KP-2T for larch@yhetil.org; Wed, 27 Jan 2021 16:52:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4sjL-0000Jv-A8 for bug-guix@gnu.org; Wed, 27 Jan 2021 16:52:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4sjL-0004Cu-1S for bug-guix@gnu.org; Wed, 27 Jan 2021 16:52:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4sjK-0004NB-Vs for bug-guix@gnu.org; Wed, 27 Jan 2021 16:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45896: [PATCH 2/3] build: Add '--with-channel-commit' and related configure flags. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 27 Jan 2021 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45896 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 45896@debbugs.gnu.org Received: via spool by 45896-submit@debbugs.gnu.org id=B45896.161178431716784 (code B ref 45896); Wed, 27 Jan 2021 21:52:02 +0000 Received: (at 45896) by debbugs.gnu.org; 27 Jan 2021 21:51:57 +0000 Received: from localhost ([127.0.0.1]:46295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4sjE-0004Me-Lz for submit@debbugs.gnu.org; Wed, 27 Jan 2021 16:51:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4sj1-0004Ln-8g for 45896@debbugs.gnu.org; Wed, 27 Jan 2021 16:51:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56312) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4siv-00049i-Mk; Wed, 27 Jan 2021 16:51:37 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51252 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l4siu-0006IH-Un; Wed, 27 Jan 2021 16:51:37 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 27 Jan 2021 22:51:29 +0100 Message-Id: <20210127215130.24530-2-ludo@gnu.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210127215130.24530-1-ludo@gnu.org> References: <874kjixf59.fsf@inria.fr> <20210127215130.24530-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 0CEC694042C X-Spam-Score: -1.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: nFjlyl1Drd45 Partially fixes . * m4/guix.m4 (GUIX_CHANNEL_METADATA): New macro. * configure.ac: Use it. * guix/config.scm.in (%channel-metadata): Adjust accordingly. --- configure.ac | 1 + guix/config.scm.in | 20 +++++++++++++++++--- m4/guix.m4 | 30 +++++++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index aa97f67ebe..aa60471143 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,7 @@ AM_GNU_GETTEXT_VERSION([0.18.1]) GUIX_SYSTEM_TYPE GUIX_ASSERT_SUPPORTED_SYSTEM +GUIX_CHANNEL_METADATA AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"]) diff --git a/guix/config.scm.in b/guix/config.scm.in index 223c9eb418..d582d91d74 100644 --- a/guix/config.scm.in +++ b/guix/config.scm.in @@ -61,9 +61,23 @@ (define %channel-metadata ;; When true, this is an sexp containing metadata for the 'guix' channel ;; this file was built from. This is used by (guix describe). - - ;; TODO: Implement 'configure.ac' machinery to initialize it. - #f) + (let ((url @GUIX_CHANNEL_URL@) + (commit @GUIX_CHANNEL_COMMIT@) + (intro @GUIX_CHANNEL_INTRODUCTION@)) + (and url commit + `(repository + (version 0) + (url ,url) + (branch "master") ;XXX: doesn't really matter + (commit ,commit) + (name guix) + ,@(if intro + `((introduction + (channel-introduction + (version 0) + (commit ,(car intro)) + (signer ,(cdr intro))))) + '()))))) (define %storedir "@storedir@") diff --git a/m4/guix.m4 b/m4/guix.m4 index f8eb5aaf51..c1ce0876fa 100644 --- a/m4/guix.m4 +++ b/m4/guix.m4 @@ -1,5 +1,5 @@ dnl GNU Guix --- Functional package management for GNU -dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès +dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès dnl Copyright © 2014 Mark H Weaver dnl Copyright © 2017 Efraim Flashner dnl @@ -398,3 +398,31 @@ that of the existing installation '$guix_cv_current_localstatedir']) esac fi fi]) + +dnl GUIX_CHANNEL_METADATA +dnl +dnl Provide the channel metadata for this build. This allows 'guix describe' +dnl to return meaningful data, as it would for a 'guix pull'-provided 'guix'. +dnl The default URL and introduction are taken from (guix channels). +AC_DEFUN([GUIX_CHANNEL_METADATA], [ + AC_ARG_WITH([channel-url], [AS_HELP_STRING([--with-channel-url=URL], + [assert that this is built from the Git repository at URL])], + [guix_channel_url="\"$withval\""], + [guix_channel_url="\"https://git.savannah.gnu.org/git/guix.git\""]) + AC_ARG_WITH([channel-commit], [AS_HELP_STRING([--with-channel-commit=COMMIT], + [assert that this is built from COMMIT])], + [guix_channel_commit="\"$withval\""], + [guix_channel_commit="#f"]) + AC_ARG_WITH([channel-introduction], [AS_HELP_STRING([--with-channel-introduction=COMMIT:FINGERPRINT], + [specify COMMIT and FINGERPRINT as the introduction of this channel])], + [guix_channel_introduction="'(\"`echo $withval | cut -f1 -d:`\" \"`echo $withval | cut -f2 -d:`\")"], + [guix_channel_introduction="'(\"9edb3f66fd807b096b48283debdcddccfea34bad\" . \"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA\")"]) + + GUIX_CHANNEL_URL="$guix_channel_url" + GUIX_CHANNEL_COMMIT="$guix_channel_commit" + GUIX_CHANNEL_INTRODUCTION="$guix_channel_introduction" + + AC_SUBST([GUIX_CHANNEL_URL]) + AC_SUBST([GUIX_CHANNEL_COMMIT]) + AC_SUBST([GUIX_CHANNEL_INTRODUCTION]) +]) -- 2.30.0