From 46e2a65bbf27844bde60d313836e8faad039d6cd Mon Sep 17 00:00:00 2001 From: Caleb Ristvedt Date: Thu, 12 Dec 2019 07:41:16 -0600 Subject: config: add variables for more directories, %impersonate-linux-2.6? * guix/config.scm.in: rename to guix/config.scm.in.in. * guix/config.scm.in.in (%temp-directory, %libexecdir, %impersonate-linux-2.6?): new variables. * configure.ac: Add option impersonate-linux-2.6-default and substitute it. Adjust from config.scm.in to config.scm.in.in. * Makefile.am: Substitute libexecdir in guix/config.scm.in to produce final result, guix/config.scm. --- Makefile.am | 6 ++- configure.ac | 13 ++++- guix/config.scm.in | 106 --------------------------------------- guix/config.scm.in.in | 120 +++++++++++++++++++++++++++++++++++++++++++++ guix/store/derivations.scm | 3 +- 5 files changed, 138 insertions(+), 110 deletions(-) delete mode 100644 guix/config.scm.in create mode 100644 guix/config.scm.in.in diff --git a/Makefile.am b/Makefile.am index 344ecdbc42..0bce8ac9f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,7 +39,8 @@ do_subst = $(SED) \ -e 's,[@]GUILE[@],$(GUILE),g' \ -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \ -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \ - -e 's,[@]localedir[@],$(localedir),g' + -e 's,[@]localedir[@],$(localedir),g' \ + -e 's,[@]Libexecdir[@],$(libexecdir),g' scripts/guix: scripts/guix.in Makefile $(AM_V_at)rm -f $@ $@-t @@ -47,6 +48,9 @@ scripts/guix: scripts/guix.in Makefile $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t" $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@" +guix/config.scm: guix/config.scm.in + $(AM_V_GEN)$(do_subst) < "$@.in" > "$@" + nodist_noinst_SCRIPTS = \ pre-inst-env \ test-env diff --git a/configure.ac b/configure.ac index 6a6a020585..9125fe94ec 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,17 @@ AC_ARG_WITH([selinux-policy-dir], [selinux_policydir='${datadir}/selinux/']) AC_SUBST([selinux_policydir]) +AC_ARG_WITH(impersonate-linux-2.6-default, + AC_HELP_STRING([--with-impersonate-linux-2.6-default], + [Whether builds should should impersonate linux 2.6 by default]), + [if test "x$withval" = "xyes"; then + impersonate_linux26="#t"; + else + impersonate_linux26="#f"; + fi], + [impersonate_linux26="#f"]) +AC_SUBST(impersonate_linux26) + dnl Better be verbose. AC_MSG_CHECKING([for the store directory]) AC_MSG_RESULT([$storedir]) @@ -306,7 +317,7 @@ AC_CONFIG_FILES([Makefile po/guix/Makefile.in po/packages/Makefile.in etc/guix-daemon.cil - guix/config.scm]) + guix/config.scm.in]) AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env]) AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], diff --git a/guix/config.scm.in b/guix/config.scm.in deleted file mode 100644 index 0ada0f3c38..0000000000 --- a/guix/config.scm.in +++ /dev/null @@ -1,106 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019 Ludovic Courtès -;;; Copyright © 2017 Caleb Ristvedt -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see . - -(define-module (guix config) - #:export (%guix-package-name - %guix-version - %guix-bug-report-address - %guix-home-page-url - - %storedir - %localstatedir - %sysconfdir - - %store-directory - %state-directory - %store-database-directory - %config-directory - - %system - %libz - %liblz - %gzip - %bzip2 - %xz)) - -;;; Commentary: -;;; -;;; Compile-time configuration of Guix. When adding a substitution variable -;;; here, make sure to equip (guix scripts pull) to substitute it. -;;; -;;; Code: - -(define %guix-package-name - "@PACKAGE_NAME@") - -(define %guix-version - "@PACKAGE_VERSION@") - -(define %guix-bug-report-address - "@PACKAGE_BUGREPORT@") - -(define %guix-home-page-url - "@PACKAGE_URL@") - -(define %storedir - "@storedir@") - -(define %localstatedir - "@guix_localstatedir@") - -(define %sysconfdir - "@guix_sysconfdir@") - -(define %store-directory - (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path) - %storedir)) - -(define %state-directory - ;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'. - (or (getenv "GUIX_STATE_DIRECTORY") - (string-append %localstatedir "/guix"))) - -(define %store-database-directory - (or (getenv "GUIX_DATABASE_DIRECTORY") - (string-append %state-directory "/db"))) - -(define %config-directory - ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as defined in `nix/local.mk'. - (or (getenv "GUIX_CONFIGURATION_DIRECTORY") - (string-append %sysconfdir "/guix"))) - -(define %system - "@guix_system@") - -(define %libz - "@LIBZ@") - -(define %liblz - "@LIBLZ@") - -(define %gzip - "@GZIP@") - -(define %bzip2 - "@BZIP2@") - -(define %xz - "@XZ@") - -;;; config.scm ends here diff --git a/guix/config.scm.in.in b/guix/config.scm.in.in new file mode 100644 index 0000000000..1f1e41924a --- /dev/null +++ b/guix/config.scm.in.in @@ -0,0 +1,120 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019 Ludovic Courtès +;;; Copyright © 2017 Caleb Ristvedt +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix config) + #:export (%guix-package-name + %guix-version + %guix-bug-report-address + %guix-home-page-url + + %storedir + %localstatedir + %sysconfdir + %temp-directory + %libexecdir + + %store-directory + %state-directory + %store-database-directory + %config-directory + + %system + %libz + %liblz + %gzip + %bzip2 + %xz + %impersonate-linux-2.6?)) + +;;; Commentary: +;;; +;;; Compile-time configuration of Guix. When adding a substitution variable +;;; here, make sure to equip (guix scripts pull) to substitute it. +;;; +;;; Code: + +(define %guix-package-name + "@PACKAGE_NAME@") + +(define %guix-version + "@PACKAGE_VERSION@") + +(define %guix-bug-report-address + "@PACKAGE_BUGREPORT@") + +(define %guix-home-page-url + "@PACKAGE_URL@") + +(define %storedir + "@storedir@") + +(define %localstatedir + "@guix_localstatedir@") + +(define %temp-directory + (or (getenv "TMPDIR") + "/tmp")) + +(define %impersonate-linux-2.6? + (make-parameter @impersonate_linux26@)) + +(define %sysconfdir + "@guix_sysconfdir@") + +(define %libexecdir + (or (getenv "NIX_LIBEXEC_DIR") + "@Libexecdir@/guix")) + +(define %store-directory + (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path) + %storedir)) + +(define %state-directory + ;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'. + (or (getenv "GUIX_STATE_DIRECTORY") + (string-append %localstatedir "/guix"))) + +(define %store-database-directory + (or (getenv "GUIX_DATABASE_DIRECTORY") + (string-append %state-directory "/db"))) + +(define %config-directory + ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as defined in `nix/local.mk'. + (or (getenv "GUIX_CONFIGURATION_DIRECTORY") + (string-append %sysconfdir "/guix"))) + +(define %system + "@guix_system@") + +(define %libz + "@LIBZ@") + +(define %liblz + "@LIBLZ@") + +(define %gzip + "@GZIP@") + +(define %bzip2 + "@BZIP2@") + +(define %xz + "@XZ@") + +;;; config.scm ends here diff --git a/guix/store/derivations.scm b/guix/store/derivations.scm index 188396953d..b65f68efb6 100644 --- a/guix/store/derivations.scm +++ b/guix/store/derivations.scm @@ -317,7 +317,7 @@ (define (derivation/masked-inputs drv) (make-derivation-input hash sub-drvs)))) inputs))) (make-derivation outputs - (sort inputs + (sort (delete-duplicates inputs) (lambda (drv1 drv2) (stringbytevector) - (invalidate-memoization! derivation-base16-hash) ;; FIXME: Comment out to work around . ;; (hash-clear! %derivation-cache) -- cgit v1.2.3