From a6bdaee8a8cf403ea0cc76426e595afc36c9f559 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 31 Oct 2020 23:42:12 +0100 Subject: [PATCH] WIP: GUIX_EXTENSIONS_PATH --- gnu/packages/package-management.scm | 14 +++++++++++++- guix/ui.scm | 11 ++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 1c02c342b1..b6c03acf15 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -400,6 +400,12 @@ $(prefix)/etc/init.d\n"))) ("guile-git" ,guile-git) ("guile-zlib" ,guile-zlib) ("guile-lzlib" ,guile-lzlib))) + (native-search-paths + (list (search-path-specification + (variable "GUIX_EXTENSIONS_PATH") + (files '("share/guile/site/3.0" + "lib/guile/3.0/site-ccache" + "share/guile/site/3.0"))))) (home-page "https://www.gnu.org/software/guix/") (synopsis "Functional package manager for installed software packages and versions") @@ -496,7 +502,13 @@ the Nix package manager.") ("guile-json" ,guile2.2-json) ("guile-sqlite3" ,guile2.2-sqlite3) ("guile-ssh" ,guile2.2-ssh) - ("guile-git" ,guile2.2-git))))) + ("guile-git" ,guile2.2-git))) + (native-search-paths + (list (search-path-specification + (variable "GUIX_EXTENSIONS_PATH") + (files '("share/guile/site/2.2" + "lib/guile/2.2/site-ccache" + "share/guile/site/2.2"))))))) (define-public guile3.0-guix (deprecated-package "guile3.0-guix" guix)) diff --git a/guix/ui.scm b/guix/ui.scm index 8d7bc238bc..8dbcbe0fd6 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -10,7 +10,7 @@ ;;; Copyright © 2016 Roel Janssen ;;; Copyright © 2016 Benz Schenk ;;; Copyright © 2018 Kyle Meyer -;;; Copyright © 2018 Ricardo Wurmus +;;; Copyright © 2018, 2020 Ricardo Wurmus ;;; Copyright © 2019 Chris Marusich ;;; Copyright © 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Simon Tournier @@ -61,6 +61,7 @@ ;; Avoid "overrides core binding" warning. delete)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-2) #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-11) #:use-module (srfi srfi-19) @@ -2125,6 +2126,14 @@ Unlike 'guix-main', this procedure assumes that locale, i18n support, and signal handling have already been set up." (define option? (cut string-prefix? "-" <>)) + (and-let* ((path (getenv "GUIX_EXTENSIONS_PATH")) + (not-colon (char-set-complement (char-set #\:))) + (extensions (string-tokenize path not-colon))) + (set! %load-path + (append extensions %load-path)) + (set! %load-compiled-path + (append extensions %load-compiled-path))) + ;; The default %LOAD-EXTENSIONS includes the empty string, which doubles the ;; number of 'stat' calls per entry in %LOAD-PATH. Shamelessly remove it. (set! %load-extensions '(".scm")) -- 2.28.0