guix-commits
[Top][All Lists]
Advanced

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

01/01: build: Install .go files to $libdir/guile/X.Y.


From: Ludovic Courtès
Subject: 01/01: build: Install .go files to $libdir/guile/X.Y.
Date: Mon, 20 Mar 2017 18:30:12 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 9437fd7399425ed281e1bfc13240288ba9078caa
Author: Ludovic Courtès <address@hidden>
Date:   Mon Mar 20 22:13:27 2017 +0100

    build: Install .go files to $libdir/guile/X.Y.
    
    * configure.ac: Define and substitute 'guileobjectdir'.
    * Makefile.am (nobase_nodist_guilemodule_DATA): Remove $(GOBJECTS).
    (nobase_nodist_guileobject_DATA): New variable.
    (guix_install_go_files): Adjust accordingly.
    (install-data-hook): Likewise.
    * scripts/guix.in (config-lookup): Add 'exec_prefix' and
    'guileobjectdir'.  Add '_' in VAR-REF-REGEXP.
    (maybe-augment-load-paths!): Distinguish OBJECT-DIR from MODULE-DIR.
---
 Makefile.am     |  9 +++++----
 configure.ac    |  4 +++-
 scripts/guix.in | 11 ++++++++---
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ff37a46..cd2388a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -221,7 +221,8 @@ GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go 
$(dist_noinst_DATA:%.scm=%.go)
 nobase_dist_guilemodule_DATA =                  \
   $(MODULES) $(AUX_FILES) $(EXAMPLES)            \
   $(MISC_DISTRO_FILES)
-nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
+nobase_nodist_guilemodule_DATA = guix/config.scm
+nobase_nodist_guileobject_DATA = $(GOBJECTS)
 
 # Do we need to provide our own non-broken (srfi srfi-37) module?
 if INSTALL_SRFI_37
@@ -455,14 +456,14 @@ SUFFIXES = .go
 # files.  See
 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
 # for details.
-guix_install_go_files = install-nobase_nodist_guilemoduleDATA
+guix_install_go_files = install-nobase_nodist_guileobjectDATA
 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
 
 # The above trick doesn't work for 'config.go' because both 'config.scm' and
-# 'config.go' are listed in $(nobase_nodist_guilemodule_DATA).  Thus, give it
+# 'config.go' are listed in $(nobase_nodist_guileobject_DATA).  Thus, give it
 # special treatment.
 install-data-hook: set-bootstrap-executable-permissions
-       touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
+       touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
 
 
 SUBDIRS = po/guix po/packages
diff --git a/configure.ac b/configure.ac
index 76f52e0..2b4620c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,9 +85,11 @@ if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then
   PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.9])
 fi
 
-dnl Installation directory for .scm and .go files.
+dnl Installation directories for .scm and .go files.
 guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
+guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
 AC_SUBST([guilemoduledir])
+AC_SUBST([guileobjectdir])
 
 dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
 dnl pull', among other things.
diff --git a/scripts/guix.in b/scripts/guix.in
index 5d6921d..e20c274 100644
--- a/scripts/guix.in
+++ b/scripts/guix.in
@@ -30,10 +30,12 @@
 
   (define config-lookup
     (let ((config '(("prefix"         . "@prefix@")
+                    ("exec_prefix"    . "@exec_prefix@")
                     ("datarootdir"    . "@datarootdir@")
                     ("guilemoduledir" . "@guilemoduledir@")
+                    ("guileobjectdir" . "@guileobjectdir@")
                     ("localedir"      . "@localedir@")))
-          (var-ref-regexp (make-regexp "\\$\\{([a-z]+)\\}")))
+          (var-ref-regexp (make-regexp "\\$\\{([a-z_]+)\\}")))
       (define (expand-var-ref match)
         (lookup (match:substring match 1)))
       (define (expand str)
@@ -45,14 +47,17 @@
 
   (define (maybe-augment-load-paths!)
     (unless (getenv "GUIX_UNINSTALLED")
-      (let ((module-dir (config-lookup "guilemoduledir")))
+      (let ((module-dir (config-lookup "guilemoduledir"))
+            (object-dir (config-lookup "guileobjectdir")))
         (push! module-dir %load-path)
-        (push! module-dir %load-compiled-path))
+        (push! object-dir %load-compiled-path))
       (let ((updates-dir (and=> (or (getenv "XDG_CONFIG_HOME")
                                     (and=> (getenv "HOME")
                                            (cut string-append <> "/.config")))
                                 (cut string-append <> "/guix/latest"))))
         (when (and updates-dir (file-exists? updates-dir))
+          ;; XXX: Currently 'guix pull' puts both .scm and .go files in
+          ;; UPDATES-DIR.
           (push! updates-dir %load-path)
           (push! updates-dir %load-compiled-path)))))
 



reply via email to

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