guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

12/16: config: add variables for more directories, %impersonate-linux-2.


From: guix-commits
Subject: 12/16: config: add variables for more directories, %impersonate-linux-2.6?
Date: Sat, 20 Apr 2019 17:25:29 -0400 (EDT)

reepca pushed a commit to branch guile-daemon
in repository guix.

commit baf38965aaddd5cf6c3ce40902c2321d74463e67
Author: Caleb Ristvedt <address@hidden>
Date:   Fri Apr 19 12:48:55 2019 -0500

    config: add variables for more directories, %impersonate-linux-2.6?
    
    * guix/config.scm.in: renamed to guix/config.scm.in.in
    
    * guix/config.scm.in.in (%temp-directory, %libexecdir, 
%impersonate-linux-2.6?):
      new variables.
    
    * configure.ac: Add options impersonate-linux-2.6-default and tmpdir and
      substitute them. 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.
    
    * guix/store/build-derivations.scm (%temp-directory): removed, no longer
      needed.
---
 Makefile.am                              |  6 +++++-
 configure.ac                             | 19 ++++++++++++++++++-
 guix/{config.scm.in => config.scm.in.in} | 16 +++++++++++++++-
 guix/store/build-derivations.scm         |  3 ---
 4 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4cdbcbd..1fbbaa9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,8 @@ do_subst = $(SED)                                     \
   -e 's,address@hidden@],$(GUILE),g'                           \
   -e 's,address@hidden@],$(guilemoduledir),g'  \
   -e 's,address@hidden@],$(guileobjectdir),g'  \
-  -e 's,address@hidden@],$(localedir),g'
+  -e 's,address@hidden@],$(localedir),g'               \
+  -e 's,address@hidden@],$(libexecdir),g'
 
 scripts/guix: scripts/guix.in Makefile
        $(AM_V_at)rm -f $@ address@hidden
@@ -47,6 +48,9 @@ scripts/guix: scripts/guix.in Makefile
        $(AM_V_GEN)$(do_subst) < "$(srcdir)/address@hidden" > "address@hidden"
        $(AM_V_at)chmod a+x,a-w "address@hidden" && mv -f "address@hidden" "$@"
 
+guix/config.scm: guix/config.scm.in
+       $(AM_V_GEN)$(do_subst) < "address@hidden" > "$@"
+
 nodist_noinst_SCRIPTS =                                \
   pre-inst-env                                 \
   test-env
diff --git a/configure.ac b/configure.ac
index 7e7ae02..c311b4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,23 @@ 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)
+
+AC_ARG_WITH(tmpdir,
+  AC_HELP_STRING([--with-tmpdir],
+    [Directory temporary files should be put in at runtime (defaults to 
/tmp)]),
+  [guix_tmpdir="$withval"],
+  [guix_tmpdir="/tmp"])
+AC_SUBST(guix_tmpdir)
 dnl Better be verbose.
 AC_MSG_CHECKING([for the store directory])
 AC_MSG_RESULT([$storedir])
@@ -287,7 +304,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.in
similarity index 89%
rename from guix/config.scm.in
rename to guix/config.scm.in.in
index 247b15e..985187e 100644
--- a/guix/config.scm.in
+++ b/guix/config.scm.in.in
@@ -26,6 +26,8 @@
             %storedir
             %localstatedir
             %sysconfdir
+            %temp-directory
+            %libexecdir
 
             %store-directory
             %state-directory
@@ -36,7 +38,8 @@
             %libz
             %gzip
             %bzip2
-            %xz))
+            %xz
+            %impersonate-linux-2.6?))
 
 ;;; Commentary:
 ;;;
@@ -63,9 +66,20 @@
 (define %localstatedir
   "@guix_localstatedir@")
 
+(define %temp-directory
+  (or (getenv "TMPDIR")
+      "@guix_tmpdir@"))
+
+(define %impersonate-linux-2.6?
+  @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))
diff --git a/guix/store/build-derivations.scm b/guix/store/build-derivations.scm
index 6d8b22a..beade05 100644
--- a/guix/store/build-derivations.scm
+++ b/guix/store/build-derivations.scm
@@ -78,9 +78,6 @@
 ;;; "impureEnvVars".
 ;;; 6. Run the builder in a chroot where the build directory is the root.
 
-;; Add this to (guix config) later
-(define %temp-directory "/tmp")
-
 
 (define (output-paths drv)
   "Returns all store output paths produced by DRV."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]