From patchwork Mon Sep 11 14:25:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 53730 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CD70527BBEA; Mon, 11 Sep 2023 15:27:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D739827BBE2 for ; Mon, 11 Sep 2023 15:27:06 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhsS-0004wT-RL; Mon, 11 Sep 2023 10:27:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfhsR-0004vw-Hz for guix-patches@gnu.org; Mon, 11 Sep 2023 10:26:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhsR-0003DZ-9V; Mon, 11 Sep 2023 10:26:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfhsU-0006jf-Fk; Mon, 11 Sep 2023 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65866] [PATCH 5/8] build: Add dependency on Git. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 11 Sep 2023 14:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65866 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65866@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 65866-submit@debbugs.gnu.org id=B65866.169444236625819 (code B ref 65866); Mon, 11 Sep 2023 14:27:02 +0000 Received: (at 65866) by debbugs.gnu.org; 11 Sep 2023 14:26:06 +0000 Received: from localhost ([127.0.0.1]:54310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhrZ-0006iE-Ea for submit@debbugs.gnu.org; Mon, 11 Sep 2023 10:26:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhrM-0006fE-Nl for 65866@debbugs.gnu.org; Mon, 11 Sep 2023 10:25:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfhrD-000312-BV; Mon, 11 Sep 2023 10:25:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=kdp9llTbF8+3aSxiW2tzTYl/MmzrtCqW5SxqJyuizdM=; b=d+aomIVl1LJSbNczrvGW UQj43n9l5aVNFvL6AtcDLyJEFBi80mjkZio1zbGYuMqSOttlIU0LvZ4tKPwukb0UpmRmYS/0whxHt ZM3yyz54PxzpkbPd/7Oe25qx1HFWMsTP6MbPkEiIsJS7ukZgF39SH/XEK6TdoSZVeLp+PQBw5MyR9 M+lVLxuSYv6M01hKDkAy4SG87iiLc0jhcwH/e/leVuEswr3UIC2o45f6TYTTb8b87Pq0Ila07X2cC MXN4YIM5p4GMM0u+JnEV7Ai0TO0U3lYZgmfOqA4wlpteXvmd0bBywPlJcT3lXQ4OiyEggCaZGd69M gbHb4AFHsd7ZWg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 11 Sep 2023 16:25:23 +0200 Message-ID: <4eca94501c2c1e9986e1f718eeccb3eb9276dcd4.1694441831.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * configure.ac: Check for ‘git’ and substitute ‘GIT’. * guix/config.scm.in (%git): New variable. * guix/self.scm (compiled-guix): Define ‘git’ and pass it to ‘make-config.scm’. (make-config.scm): Add #:git; emit a ‘%git’ variable. * doc/guix.texi (Requirements): Add it. --- configure.ac | 7 +++++++ doc/guix.texi | 1 + guix/config.scm.in | 6 +++++- guix/self.scm | 10 +++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 92dede8014..d817f620cf 100644 --- a/configure.ac +++ b/configure.ac @@ -201,6 +201,13 @@ AC_SUBST([GZIP]) AC_SUBST([BZIP2]) AC_SUBST([XZ]) +dnl Git is now required for the "builtin:git-download" derivation builder. +AC_PATH_PROG([GIT], [git]) +if test "x$GIT" = "x"; then + AC_MSG_ERROR([Git is missing; please install it.]) +fi +AC_SUBST([GIT]) + LIBGCRYPT_LIBDIR="no" LIBGCRYPT_PREFIX="no" diff --git a/doc/guix.texi b/doc/guix.texi index 339dcb2a41..a2520ce89d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1011,6 +1011,7 @@ Requirements @item @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, version 0.5.0 or later; +@item @uref{https://git-scm.com, Git} (yes, both!); @item @uref{https://savannah.nongnu.org/projects/guile-json/, Guile-JSON} 4.3.0 or later; @item @url{https://www.gnu.org/software/make/, GNU Make}. diff --git a/guix/config.scm.in b/guix/config.scm.in index d582d91d74..62e15dd713 100644 --- a/guix/config.scm.in +++ b/guix/config.scm.in @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2021 Ludovic Courtès +;;; Copyright © 2012-2016, 2018-2019, 2021, 2023 Ludovic Courtès ;;; Copyright © 2017 Caleb Ristvedt ;;; ;;; This file is part of GNU Guix. @@ -35,6 +35,7 @@ (define-module (guix config) %config-directory %system + %git %gzip %bzip2 %xz)) @@ -109,6 +110,9 @@ (define %config-directory (define %system "@guix_system@") +(define %git + "@GIT@") + (define %gzip "@GZIP@") diff --git a/guix/self.scm b/guix/self.scm index 81a36e007f..41c5f40786 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -68,6 +68,7 @@ (define %packages ("gzip" . ,(ref 'compression 'gzip)) ("bzip2" . ,(ref 'compression 'bzip2)) ("xz" . ,(ref 'compression 'xz)) + ("git-minimal" . ,(ref 'version-control 'git-minimal)) ("po4a" . ,(ref 'gettext 'po4a)) ("gettext-minimal" . ,(ref 'gettext 'gettext-minimal)) ("gcc-toolchain" . ,(ref 'commencement 'gcc-toolchain)) @@ -825,6 +826,9 @@ (define* (compiled-guix source #:key (define guile-lzma (specification->package "guile-lzma")) + (define git + (specification->package "git-minimal")) + (define dependencies (append-map transitive-package-dependencies (list guile-gcrypt guile-gnutls guile-git guile-avahi @@ -998,6 +1002,7 @@ (define* (compiled-guix source #:key => ,(make-config.scm #:gzip gzip #:bzip2 bzip2 #:xz xz + #:git git #:package-name %guix-package-name #:package-version @@ -1103,7 +1108,7 @@ (define %default-config-variables (%storedir . "/gnu/store") (%sysconfdir . "/etc"))) -(define* (make-config.scm #:key gzip xz bzip2 +(define* (make-config.scm #:key gzip xz bzip2 git (package-name "GNU Guix") (package-version "0") (channel-metadata #f) @@ -1133,6 +1138,7 @@ (define* (make-config.scm #:key gzip xz bzip2 %state-directory %store-database-directory %config-directory + %git %gzip %bzip2 %xz)) @@ -1175,6 +1181,8 @@ (define* (make-config.scm #:key gzip xz bzip2 ;; information is used by (guix describe). '#$channel-metadata) + (define %git + #+(and git (file-append git "/bin/git"))) (define %gzip #+(and gzip (file-append gzip "/bin/gzip"))) (define %bzip2