summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/build/julia-build-system.scm51
-rw-r--r--guix/lint.scm7
-rw-r--r--guix/self.scm7
3 files changed, 33 insertions, 32 deletions
diff --git a/guix/build/julia-build-system.scm b/guix/build/julia-build-system.scm
index ff6fcf5fe3..e8ebcf8ba0 100644
--- a/guix/build/julia-build-system.scm
+++ b/guix/build/julia-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2019, 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -37,53 +37,46 @@
;; subpath where we store the package content
(define %package-path "/share/julia/packages/")
-(define (generate-load-path inputs outputs)
- (string-append
- (string-join (map (match-lambda
- ((_ . path)
- (string-append path %package-path)))
- ;; Restrict to inputs beginning with "julia-".
- (filter (match-lambda
- ((name . _)
- (string-prefix? "julia-" name)))
- inputs))
- ":")
- (string-append ":" (assoc-ref outputs "out") %package-path)
- ;; stdlib is always required to find Julia's standard libraries.
- ;; usually there are other two paths in this variable:
- ;; "@" and "@v#.#"
- ":@stdlib"))
-
(define* (install #:key source inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(package-dir (string-append out %package-path
- (string-append
- (strip-store-file-name source)))))
- (setenv "JULIA_LOAD_PATH" (generate-load-path inputs outputs))
+ (strip-store-file-name source))))
(mkdir-p package-dir)
- (copy-recursively source package-dir))
+ (copy-recursively (getcwd) package-dir))
#t)
-;; TODO: Precompilation is working, but I don't know how to tell
-;; julia to use use it. If (on rantime) we set HOME to
-;; store path, julia tries to write files there (failing)
(define* (precompile #:key source inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(builddir (string-append out "/share/julia/"))
(package (strip-store-file-name source)))
(mkdir-p builddir)
+ ;; With a patch, SOURCE_DATE_EPOCH is honored
+ (setenv "SOURCE_DATE_EPOCH" "1")
(setenv "JULIA_DEPOT_PATH" builddir)
- (setenv "JULIA_LOAD_PATH" (generate-load-path inputs outputs))
- ;; Actual precompilation
- (invoke-julia (string-append "using " package)))
+ ;; Add new package dir to the load path.
+ (setenv "JULIA_LOAD_PATH"
+ (string-append builddir "packages/" ":"
+ (or (getenv "JULIA_LOAD_PATH")
+ "")))
+ ;; Actual precompilation:
+ (invoke-julia
+ ;; When using Julia as a user, Julia writes precompile cache to the first
+ ;; entry of the DEPOT_PATH list (by default, the home dir). We want to
+ ;; write it to the store, so let's push the store path as the first
+ ;; element of DEPOT_PATH. Once the cache file exists, this hack is not
+ ;; needed anymore (like in the check phase). If the user install new
+ ;; packages, those will be installed and precompiled in the home dir.
+ (string-append "pushfirst!(DEPOT_PATH, pop!(DEPOT_PATH)); using " package)))
#t)
(define* (check #:key source inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(package (strip-store-file-name source))
(builddir (string-append out "/share/julia/")))
+ ;; With a patch, SOURCE_DATE_EPOCH is honored
+ (setenv "SOURCE_DATE_EPOCH" "1")
(setenv "JULIA_DEPOT_PATH" builddir)
- (setenv "JULIA_LOAD_PATH" (generate-load-path inputs outputs))
+ (setenv "JULIA_LOAD_PATH" (string-append builddir "packages/"))
(invoke-julia (string-append "using Pkg;Pkg.test(\"" package "\")")))
#t)
diff --git a/guix/lint.scm b/guix/lint.scm
index 72582cfffb..e192f292a4 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -7,7 +7,7 @@
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
@@ -286,7 +286,8 @@ of a package, and INPUT-NAMES, a list of package specifications such as
(define (check-inputs-should-be-native package)
;; Emit a warning if some inputs of PACKAGE are likely to belong to its
;; native inputs.
- (let ((inputs (package-inputs package))
+ (let ((inputs (append (package-inputs package)
+ (package-propagated-inputs package)))
(input-names
'("pkg-config"
"autoconf"
@@ -685,7 +686,7 @@ patch could not be found."
;; Check whether we're reaching tar's maximum file name length.
(let ((prefix (string-length (%distro-directory)))
- (margin (string-length "guix-0.13.0-10-123456789/"))
+ (margin (string-length "guix-2.0.0rc3-10000-1234567890/"))
(max 99))
(filter-map (match-lambda
((? string? patch)
diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..1040c27a6b 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -489,6 +489,13 @@ TRANSLATIONS, an alist of msgid and msgstr."
(computed-file "guix-manual" build))
+(define-syntax-rule (prevent-inlining! identifier ...)
+ (begin (set! identifier identifier) ...))
+
+;; XXX: These procedures are actually used by 'doc/build.scm'. Protect them
+;; from inlining on Guile 3.
+(prevent-inlining! file-append* translate-texi-manuals info-manual)
+
(define* (guile-module-union things #:key (name "guix-module-union"))
"Return the union of the subset of THINGS (packages, computed files, etc.)
that provide Guile modules."