diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-03-20 22:13:27 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-03-20 23:26:18 +0100 |
| commit | 9437fd7399425ed281e1bfc13240288ba9078caa (patch) | |
| tree | 35112a154d9a5281e2433e65f6ff0a60cc881b41 | |
| parent | 6809d9377b0bd2cf71811637663f2ec0cbe531e5 (diff) | |
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.
| -rw-r--r-- | Makefile.am | 9 | ||||
| -rw-r--r-- | configure.ac | 4 | ||||
| -rw-r--r-- | scripts/guix.in | 11 |
3 files changed, 16 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index ff37a46355c..cd2388ac65f 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -221,7 +221,8 @@ GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go) | |||
| 221 | nobase_dist_guilemodule_DATA = \ | 221 | nobase_dist_guilemodule_DATA = \ |
| 222 | $(MODULES) $(AUX_FILES) $(EXAMPLES) \ | 222 | $(MODULES) $(AUX_FILES) $(EXAMPLES) \ |
| 223 | $(MISC_DISTRO_FILES) | 223 | $(MISC_DISTRO_FILES) |
| 224 | nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm | 224 | nobase_nodist_guilemodule_DATA = guix/config.scm |
| 225 | nobase_nodist_guileobject_DATA = $(GOBJECTS) | ||
| 225 | 226 | ||
| 226 | # Do we need to provide our own non-broken (srfi srfi-37) module? | 227 | # Do we need to provide our own non-broken (srfi srfi-37) module? |
| 227 | if INSTALL_SRFI_37 | 228 | if INSTALL_SRFI_37 |
| @@ -455,14 +456,14 @@ SUFFIXES = .go | |||
| 455 | # files. See | 456 | # files. See |
| 456 | # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html> | 457 | # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html> |
| 457 | # for details. | 458 | # for details. |
| 458 | guix_install_go_files = install-nobase_nodist_guilemoduleDATA | 459 | guix_install_go_files = install-nobase_nodist_guileobjectDATA |
| 459 | $(guix_install_go_files): install-nobase_dist_guilemoduleDATA | 460 | $(guix_install_go_files): install-nobase_dist_guilemoduleDATA |
| 460 | 461 | ||
| 461 | # The above trick doesn't work for 'config.go' because both 'config.scm' and | 462 | # The above trick doesn't work for 'config.go' because both 'config.scm' and |
| 462 | # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it | 463 | # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it |
| 463 | # special treatment. | 464 | # special treatment. |
| 464 | install-data-hook: set-bootstrap-executable-permissions | 465 | install-data-hook: set-bootstrap-executable-permissions |
| 465 | touch "$(DESTDIR)$(guilemoduledir)/guix/config.go" | 466 | touch "$(DESTDIR)$(guileobjectdir)/guix/config.go" |
| 466 | 467 | ||
| 467 | 468 | ||
| 468 | SUBDIRS = po/guix po/packages | 469 | SUBDIRS = po/guix po/packages |
diff --git a/configure.ac b/configure.ac index 76f52e0ec3b..2b4620c44b6 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -85,9 +85,11 @@ if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then | |||
| 85 | PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.9]) | 85 | PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.9]) |
| 86 | fi | 86 | fi |
| 87 | 87 | ||
| 88 | dnl Installation directory for .scm and .go files. | 88 | dnl Installation directories for .scm and .go files. |
| 89 | guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION" | 89 | guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION" |
| 90 | guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache" | ||
| 90 | AC_SUBST([guilemoduledir]) | 91 | AC_SUBST([guilemoduledir]) |
| 92 | AC_SUBST([guileobjectdir]) | ||
| 91 | 93 | ||
| 92 | dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix | 94 | dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix |
| 93 | dnl pull', among other things. | 95 | dnl pull', among other things. |
diff --git a/scripts/guix.in b/scripts/guix.in index 5d6921dd09d..e20c274242a 100644 --- a/scripts/guix.in +++ b/scripts/guix.in | |||
| @@ -30,10 +30,12 @@ | |||
| 30 | 30 | ||
| 31 | (define config-lookup | 31 | (define config-lookup |
| 32 | (let ((config '(("prefix" . "@prefix@") | 32 | (let ((config '(("prefix" . "@prefix@") |
| 33 | ("exec_prefix" . "@exec_prefix@") | ||
| 33 | ("datarootdir" . "@datarootdir@") | 34 | ("datarootdir" . "@datarootdir@") |
| 34 | ("guilemoduledir" . "@guilemoduledir@") | 35 | ("guilemoduledir" . "@guilemoduledir@") |
| 36 | ("guileobjectdir" . "@guileobjectdir@") | ||
| 35 | ("localedir" . "@localedir@"))) | 37 | ("localedir" . "@localedir@"))) |
| 36 | (var-ref-regexp (make-regexp "\\$\\{([a-z]+)\\}"))) | 38 | (var-ref-regexp (make-regexp "\\$\\{([a-z_]+)\\}"))) |
| 37 | (define (expand-var-ref match) | 39 | (define (expand-var-ref match) |
| 38 | (lookup (match:substring match 1))) | 40 | (lookup (match:substring match 1))) |
| 39 | (define (expand str) | 41 | (define (expand str) |
| @@ -45,14 +47,17 @@ | |||
| 45 | 47 | ||
| 46 | (define (maybe-augment-load-paths!) | 48 | (define (maybe-augment-load-paths!) |
| 47 | (unless (getenv "GUIX_UNINSTALLED") | 49 | (unless (getenv "GUIX_UNINSTALLED") |
| 48 | (let ((module-dir (config-lookup "guilemoduledir"))) | 50 | (let ((module-dir (config-lookup "guilemoduledir")) |
| 51 | (object-dir (config-lookup "guileobjectdir"))) | ||
| 49 | (push! module-dir %load-path) | 52 | (push! module-dir %load-path) |
| 50 | (push! module-dir %load-compiled-path)) | 53 | (push! object-dir %load-compiled-path)) |
| 51 | (let ((updates-dir (and=> (or (getenv "XDG_CONFIG_HOME") | 54 | (let ((updates-dir (and=> (or (getenv "XDG_CONFIG_HOME") |
| 52 | (and=> (getenv "HOME") | 55 | (and=> (getenv "HOME") |
| 53 | (cut string-append <> "/.config"))) | 56 | (cut string-append <> "/.config"))) |
| 54 | (cut string-append <> "/guix/latest")))) | 57 | (cut string-append <> "/guix/latest")))) |
| 55 | (when (and updates-dir (file-exists? updates-dir)) | 58 | (when (and updates-dir (file-exists? updates-dir)) |
| 59 | ;; XXX: Currently 'guix pull' puts both .scm and .go files in | ||
| 60 | ;; UPDATES-DIR. | ||
| 56 | (push! updates-dir %load-path) | 61 | (push! updates-dir %load-path) |
| 57 | (push! updates-dir %load-compiled-path))))) | 62 | (push! updates-dir %load-compiled-path))))) |
| 58 | 63 | ||
