summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-04-30 23:47:49 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-04-30 23:47:49 +0200
commit8bf8cd9b85c85be387565f6c8ca9f6c72196fb8e (patch)
tree6fa0f8ba32b83a996625bc188903ccebfb7e7c2c /guix
parent5d9e2187929ed7e8d46ec3cb3174fd78c1846360 (diff)
parent229f4fa9522fb56b014ee9c0d8111e8fb6da764d (diff)
downloadpatches-8bf8cd9b85c85be387565f6c8ca9f6c72196fb8e.tar
patches-8bf8cd9b85c85be387565f6c8ca9f6c72196fb8e.tar.gz
Merge branch 'master' into core-updates
Conflicts: gnu/local.mk gnu/packages/backup.scm gnu/packages/emacs-xyz.scm gnu/packages/guile.scm gnu/packages/lisp.scm gnu/packages/openldap.scm gnu/packages/package-management.scm gnu/packages/web.scm gnu/packages/xorg.scm
Diffstat (limited to 'guix')
-rw-r--r--guix/channels.scm4
-rw-r--r--guix/import/crate.scm14
-rw-r--r--guix/profiles.scm36
-rw-r--r--guix/scripts/edit.scm7
-rw-r--r--guix/scripts/pack.scm33
-rwxr-xr-xguix/scripts/substitute.scm8
6 files changed, 69 insertions, 33 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 785b97722e..041fae2a9c 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -568,9 +568,7 @@ channel instances."
(define (package-cache-file manifest)
"Build a package cache file for the instance in MANIFEST. This is meant to
be used as a profile hook."
- (mlet %store-monad ((profile (profile-derivation manifest
- #:hooks '())))
-
+ (let ((profile (profile (content manifest) (hooks '()))))
(define build
#~(begin
(use-modules (gnu packages))
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 0b4482e876..e3ec11d7f8 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -201,14 +201,16 @@ latest version of CRATE-NAME."
(lookup-crate crate-name))
(define version-number
- (or version
- (crate-latest-version crate)))
+ (and crate
+ (or version
+ (crate-latest-version crate))))
(define version*
- (find (lambda (version)
- (string=? (crate-version-number version)
- version-number))
- (crate-versions crate)))
+ (and crate
+ (find (lambda (version)
+ (string=? (crate-version-number version)
+ version-number))
+ (crate-versions crate))))
(and crate version*
(let* ((dependencies (crate-version-dependencies version*))
diff --git a/guix/profiles.scm b/guix/profiles.scm
index fbadf41284..2fecf3eb7d 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -125,6 +125,15 @@
profile-derivation
profile-search-paths
+ profile
+ profile?
+ profile-name
+ profile-content
+ profile-hooks
+ profile-locales?
+ profile-allow-collisions?
+ profile-relative-symlinks?
+
generation-number
generation-profile
generation-numbers
@@ -1660,6 +1669,33 @@ are cross-built for TARGET."
. ,(length
(manifest-entries manifest))))))))
+;; Declarative profile.
+(define-record-type* <profile> profile make-profile
+ profile?
+ (name profile-name (default "profile")) ;string
+ (content profile-content) ;<manifest>
+ (hooks profile-hooks ;list of procedures
+ (default %default-profile-hooks))
+ (locales? profile-locales? ;Boolean
+ (default #t))
+ (allow-collisions? profile-allow-collisions? ;Boolean
+ (default #f))
+ (relative-symlinks? profile-relative-symlinks? ;Boolean
+ (default #f)))
+
+(define-gexp-compiler (profile-compiler (profile <profile>) system target)
+ "Compile PROFILE to a derivation."
+ (match profile
+ (($ <profile> name manifest hooks
+ locales? allow-collisions? relative-symlinks?)
+ (profile-derivation manifest
+ #:name name
+ #:hooks hooks
+ #:locales? locales?
+ #:allow-collisions? allow-collisions?
+ #:relative-symlinks? relative-symlinks?
+ #:system system #:target target))))
+
(define* (profile-search-paths profile
#:optional (manifest (profile-manifest profile))
#:key (getenv (const #f)))
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index a6fd1d2751..43f3011869 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -56,10 +56,9 @@ Start $VISUAL or $EDITOR to edit the definitions of PACKAGE...\n"))
(show-bug-report-information))
(define %editor
- ;; XXX: It would be better to default to something more likely to be
- ;; pre-installed on an average GNU system. Since Nano is not suited for
- ;; editing Scheme, Emacs is used instead.
- (make-parameter (or (getenv "VISUAL") (getenv "EDITOR") "emacs")))
+ ;; Nano is sensible default, as it is installed by base system.
+ ;; For development, user can set custom value for $EDITOR.
+ (make-parameter (or (getenv "VISUAL") (getenv "EDITOR") "nano")))
(define (search-path* path file)
"Like 'search-path' but exit if FILE is not found."
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 4f72304e57..580f696b41 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1071,7 +1071,21 @@ Create a bundle of PACKAGE.\n"))
(localstatedir? (assoc-ref opts 'localstatedir?))
(entry-point (assoc-ref opts 'entry-point))
(profile-name (assoc-ref opts 'profile-name))
- (gc-root (assoc-ref opts 'gc-root)))
+ (gc-root (assoc-ref opts 'gc-root))
+ (profile (profile
+ (content manifest)
+
+ ;; Always produce relative symlinks for
+ ;; Singularity (see
+ ;; <https://bugs.gnu.org/34913>).
+ (relative-symlinks?
+ (or relocatable?
+ (eq? 'squashfs pack-format)))
+
+ (hooks (if bootstrap?
+ '()
+ %default-profile-hooks))
+ (locales? (not bootstrap?)))))
(define (lookup-package package)
(manifest-lookup manifest (manifest-pattern (name package))))
@@ -1085,22 +1099,7 @@ Create a bundle of PACKAGE.\n"))
to your package list.")))
(run-with-store store
- (mlet* %store-monad ((profile (profile-derivation
- manifest
-
- ;; Always produce relative
- ;; symlinks for Singularity (see
- ;; <https://bugs.gnu.org/34913>).
- #:relative-symlinks?
- (or relocatable?
- (eq? 'squashfs pack-format))
-
- #:hooks (if bootstrap?
- '()
- %default-profile-hooks)
- #:locales? (not bootstrap?)
- #:target target))
- (drv (build-image name profile
+ (mlet* %store-monad ((drv (build-image name profile
#:target
target
#:compressor
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 95b47a7816..ba2b2d2d4e 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -494,7 +494,8 @@ MAX-LENGTH first elements."
(loop (+ 1 len) tail (cons head result)))))))
(define* (http-multiple-get base-uri proc seed requests
- #:key port (verify-certificate? #t))
+ #:key port (verify-certificate? #t)
+ (batch-size 1000))
"Send all of REQUESTS to the server at BASE-URI. Call PROC for each
response, passing it the request object, the response, a port from which to
read the response body, and the previous result, starting with SEED, à la
@@ -504,7 +505,7 @@ initial connection on which HTTP requests are sent."
(requests requests)
(result seed))
(define batch
- (at-most 1000 requests))
+ (at-most batch-size requests))
;; (format (current-error-port) "connecting (~a requests left)..."
;; (length requests))
@@ -536,9 +537,10 @@ initial connection on which HTTP requests are sent."
(()
(match (drop requests processed)
(()
+ (close-port p)
(reverse result))
(remainder
- (connect port remainder result))))
+ (connect p remainder result))))
((head tail ...)
(let* ((resp (read-response p))
(body (response-body-port resp))