From patchwork Wed May 22 12:51:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 64823 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 6A69827BBEA; Wed, 22 May 2024 13:54:15 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 70FA127BBE2 for ; Wed, 22 May 2024 13:54:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9lTj-0003hb-Mr; Wed, 22 May 2024 08:54:00 -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 1s9lTh-0003gi-CZ for guix-patches@gnu.org; Wed, 22 May 2024 08:53:57 -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 1s9lTh-0001mC-3s; Wed, 22 May 2024 08:53:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9lTl-0002OR-LE; Wed, 22 May 2024 08:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71022] [PATCH v2] configure.ac: Set default value for the 'prefix' variable. References: <9ac2df37867548ae5e15e4c262458d8fc63ba9a1.1715989953.git.maxim.cournoyer@gmail.com> In-Reply-To: <9ac2df37867548ae5e15e4c262458d8fc63ba9a1.1715989953.git.maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, ludo@gnu.org, matt@excalamus.com, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Wed, 22 May 2024 12:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71022 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71022@debbugs.gnu.org Cc: Maxim Cournoyer , Simon Tournier , Vagrant Cascadian , ludo@gnu.org, Efraim Flashner , Ricardo Wurmus , Andreas Enge , Attila Lendvai , Richard Sent , Janneke Nieuwenhuizen , Florian Pelz , Ludovic =?utf-8?q?Court=C3=A8s?= , Matthew Trzcinski , Maxim Cournoyer X-Debbugs-Original-Xcc: Florian Pelz , Ludovic =?utf-8?q?Court=C3=A8s?= , Matthew Trzcinski , Maxim Cournoyer Received: via spool by 71022-submit@debbugs.gnu.org id=B71022.17163824259191 (code B ref 71022); Wed, 22 May 2024 12:54:01 +0000 Received: (at 71022) by debbugs.gnu.org; 22 May 2024 12:53:45 +0000 Received: from localhost ([127.0.0.1]:55778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9lTT-0002OB-4y for submit@debbugs.gnu.org; Wed, 22 May 2024 08:53:45 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:43143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9lTN-0002O5-Ks for 71022@debbugs.gnu.org; Wed, 22 May 2024 08:53:41 -0400 Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-43df23e034cso8179741cf.0 for <71022@debbugs.gnu.org>; Wed, 22 May 2024 05:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716382346; x=1716987146; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CZow95mWgFISkqByIXrjZNUAU2iZ/+5P205AsZ2ltX4=; b=V8sPVW1vHRxvPRlYFKAKXGQF38VhjqaWxxCJq1uxXlYzUF65BE7l7sLQiAeOVj9rES l43Fs90oUCyfgNJIZC4vRCV2/YkcyUZCCx9+6U+yKJfZFjmrgHBIoHG0v1e6RE63NVr3 DomY/yTVS/ek5DU3DrK+4i+kROWrefJ4EqMnK3CkVL1O+Jno218qWFdx1lqIwKkqneNO a9Chj1Nv/Hwst0BIhoTx1JJNbTCE0hH3oHRc7owWuYcT2Ex3mBdjxkVtdeFcAQ7Y9wCL QOeO58hfte7XnVYxXT2TcmqkCpRJ4GgcMRVZ3QTMz1YXI/Xb5V1DFp3GWSoJTx1dAP1q cfrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716382346; x=1716987146; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CZow95mWgFISkqByIXrjZNUAU2iZ/+5P205AsZ2ltX4=; b=VmhBKi4/Up2iyKSUz4e1gj5DR18llWB319n3a24L0g8tubsxtTdfooI0oQuTic+la5 hv8clMyUCKzKCqjPL5Oabl+A8f8XDageyApW0XBe/eYG26BQFl0TIM6f2h/cQ47GaaAD Gj/aqpQizOeiI/t+Hf//kRsM+mmJHbX5ing+EIX4C4iNzYqn1usp+eAAWpsX4AKmXFSZ ver5Yntq3KlNS9Fy9a0FOVoLt9W9DuZH0Pm/J0EvGzIq3l455jMeRe2jojKoW6szA94B J70zMrh5Qzap5BQeqGhauHFBBktqWgXoBDUmN80rt6U18MNWK3wA5MygbQyD4Z5iL4dc WB1w== X-Gm-Message-State: AOJu0YxHxCnBHzKu+9frNJxMg1mPxw54EZqe8+LbsMgJDtkO1sfKqwpX WTjd3fmSFtgEMC/Sbd+VNe01rz00NbtFzXt5v25pmmndNIHQ0HmrfLV3EoO8 X-Google-Smtp-Source: AGHT+IG7oV3fAsLpU0rf60+kiCVSIV/4l9AX2KyOuHLxgcDSx71FI95m5I3itLgHZ72ocAiDrAo1Ug== X-Received: by 2002:a05:622a:120d:b0:43a:bee9:ebc with SMTP id d75a77b69052e-43f9dddbe77mr35702611cf.19.1716382345703; Wed, 22 May 2024 05:52:25 -0700 (PDT) Received: from localhost.localdomain (dsl-148-133.b2b2c.ca. [66.158.148.133]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43dfa52e547sm164005411cf.10.2024.05.22.05.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 05:52:25 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 22 May 2024 08:51:57 -0400 Message-ID: <8e5c69aa6d108ce35c3124a969252227ce9ed178.1716382317.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 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 The Guix standard configuration uses a localstatedir of /var and a sysconfdir of /etc. To ease things for everyone, make the default values match that standard expected configuration. See for a related discussion. * configure.ac: Default $prefix to '' unless already set. * doc/contributing.texi (Building from Git): Streamline doc. * doc/guix-cookbook.texi (Guix environment via direnv): Likewise. Change-Id: I23cd12b58a842d246fbc9fdc740311c573eb0212 --- Changes in v2: - combine comments and default directory variables manipulation configure.ac | 8 +++++--- doc/contributing.texi | 15 +-------------- doc/guix-cookbook.texi | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) base-commit: 5a624adfd7b14c3717237d137bd0766c77f0f570 diff --git a/configure.ac b/configure.ac index 8c3a06da37..c7b61d56a7 100644 --- a/configure.ac +++ b/configure.ac @@ -73,9 +73,11 @@ AC_ARG_ENABLE([daemon], [guix_build_daemon="$enableval"], [guix_build_daemon="yes"]) -# Prepare a version of $localstatedir & co. that does not contain references -# to shell variables. -guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`" +dnl Prepare a version of $localstatedir & co. that does not contain references +dnl to shell variables. Also set some sane default directory variables for +dnl use with the Guix. This also causes localstatedir to be /var and +dnl sysconfdir to be /etc. +test "$prefix" = NONE && prefix= guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`" guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`" guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`" diff --git a/doc/contributing.texi b/doc/contributing.texi index 66f4e86d0a..539b4dd0d3 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -235,7 +235,7 @@ Building from Git Then, run: @example -./configure --localstatedir=/var --sysconfdir=/etc +./configure @end example @noindent @@ -246,19 +246,6 @@ Building from Git important to pass the right @code{localstatedir} and @code{sysconfdir} values, which get recorded in the @code{(guix config)} Guile module. -When configuring Guix on a system that already has a Guix installation, -be sure to specify the same state directory as the existing installation -using the @option{--localstatedir} option of the @command{configure} -script (@pxref{Directory Variables, @code{localstatedir},, standards, -GNU Coding Standards}). Usually, this @var{localstatedir} option is set -to the value @file{/var}. The @command{configure} script protects -against unintended misconfiguration of @var{localstatedir} so you do not -inadvertently corrupt your store (@pxref{The Store}). The configuration -directory should also be configured by setting the @option{--sysconfdir} -option to the @file{/etc} value, which is the location used by Guix to -store for example the access control list of authorized machines and the -definition of offload machines. - Finally, you can build Guix and, if you feel so inclined, run the tests (@pxref{Running the Test Suite}): diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index 3bc63cba7a..cbd088632a 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -5076,7 +5076,7 @@ Guix environment via direnv # Predefine configure flags. configure() @{ - ./configure --localstatedir=/var --prefix= + ./configure @} export_function configure