summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/bioconductor.scm42
-rw-r--r--gnu/packages/cran.scm27
-rw-r--r--gnu/packages/llvm.scm10
-rw-r--r--gnu/services/desktop.scm58
-rw-r--r--gnu/services/herd.scm36
-rw-r--r--guix/scripts/import.scm39
6 files changed, 170 insertions, 42 deletions
diff --git a/gnu/packages/bioconductor.scm b/gnu/packages/bioconductor.scm
index 59b921af82..4d3f86bfd3 100644
--- a/gnu/packages/bioconductor.scm
+++ b/gnu/packages/bioconductor.scm
@@ -5111,6 +5111,48 @@ includes methods formerly found in the scran package, and the new fast and
comprehensive scDblFinder method.")
(license license:gpl3)))
+(define-public r-scmap
+ (package
+ (name "r-scmap")
+ (version "1.18.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (bioconductor-uri "scmap" version))
+ (sha256
+ (base32 "0pfwaa9pgml11b84rpf7afdkmg8kxb4srgpc56571vaz388xrv7l"))))
+ (properties `((upstream-name . "scmap")))
+ (build-system r-build-system)
+ (propagated-inputs
+ (list r-biobase
+ r-biocgenerics
+ r-dplyr
+ r-e1071
+ r-ggplot2
+ r-googlevis
+ r-matrixstats
+ r-proxy
+ r-randomforest
+ r-rcpp
+ r-rcpparmadillo
+ r-reshape2
+ r-s4vectors
+ r-singlecellexperiment
+ r-summarizedexperiment))
+ (native-inputs (list r-knitr))
+ (home-page "https://github.com/hemberg-lab/scmap")
+ (synopsis "Tool for unsupervised projection of single cell RNA-seq data")
+ (description
+ "@dfn{Single-cell RNA-seq} (scRNA-seq) is widely used to investigate the
+composition of complex tissues since the technology allows researchers to
+define cell-types using unsupervised clustering of the transcriptome.
+However, due to differences in experimental methods and computational
+analyses, it is often challenging to directly compare the cells identified in
+two different experiments. @code{scmap} is a method for projecting cells from
+a scRNA-seq experiment onto the cell-types or individual cells identified in a
+different experiment.")
+ (license license:gpl3)))
+
(define-public r-seqlogo
(package
(name "r-seqlogo")
diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index 61a1b055b9..5a8285b342 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -425,6 +425,33 @@ Distance (EMD).")
(description "This package lets you manage Google Drive files from R.")
(license license:expat)))
+(define-public r-googlevis
+ (package
+ (name "r-googlevis")
+ (version "0.7.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (cran-uri "googleVis" version))
+ (sha256
+ (base32 "1s82xcs6zrlmnhay764bspzwvabfyi35nq6fwdrrk3v79q13c5jz"))))
+ (properties `((upstream-name . "googleVis")))
+ (build-system r-build-system)
+ (propagated-inputs (list r-jsonlite))
+ (native-inputs (list r-knitr))
+ (home-page "https://mages.github.io/googleVis/")
+ (synopsis "R interface to Google Charts")
+ (description
+ "The @code{googleVis} package provides an interface between R and the Google
+Charts API. Google Charts offer interactive charts which can be embedded into
+web pages. The functions of the @code{googleVis} package allow the user to
+visualise data stored in R data frames with Google Charts without uploading
+the data to Google. The output of a @code{googleVis} function is HTML code
+that contains the data and references to JavaScript functions hosted by
+Google. @code{googleVis} makes use of the internal R HTTP server to display
+the output locally.")
+ (license license:gpl2+)))
+
(define-public r-guix-install
(package
(name "r-guix-install")
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index aedf039ff4..d3b16f2759 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -216,7 +216,15 @@ given PATCHES. When TOOLS-EXTRA is given, it must point to the
;; Use a sane default include directory.
(string-append "-DC_INCLUDE_DIRS="
(assoc-ref %build-inputs "libc")
- "/include"))
+ "/include")
+ ,@(if (target-riscv64?)
+ (list "-DLIBOMP_LIBFLAGS=-latomic"
+ "-DCMAKE_SHARED_LINKER_FLAGS=-latomic")
+ `()))
+
+ ,@(if (target-riscv64?)
+ `(#:make-flags '("LDFLAGS=-latomic"))
+ '())
;; Don't use '-g' during the build to save space.
#:build-type "Release"
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 24fd43a207..0499071436 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1075,10 +1075,60 @@ include the @command{udisksctl} command, part of UDisks, and GNOME Disks."
("HybridSleepMode" (sleep-list elogind-hybrid-sleep-mode))))
(define (elogind-dbus-service config)
- (list (wrapped-dbus-service (elogind-package config)
- "libexec/elogind/elogind"
- `(("ELOGIND_CONF_FILE"
- ,(elogind-configuration-file config))))))
+ "Return a @file{org.freedesktop.login1.service} file that tells D-Bus how to
+\"start\" elogind. In practice though, our elogind is started when booting by
+shepherd. Thus, the @code{Exec} line of this @file{.service} file does not
+explain how to start elogind; instead, it spawns a wrapper that waits for the
+@code{elogind} shepherd service. This avoids a race condition where both
+@command{shepherd} and @command{dbus-daemon} would attempt to start elogind."
+ ;; For more info on the elogind startup race, see
+ ;; <https://issues.guix.gnu.org/55444>.
+
+ (define elogind
+ (elogind-package config))
+
+ (define wrapper
+ (program-file "elogind-dbus-shepherd-sync"
+ (with-imported-modules '((gnu services herd))
+ #~(begin
+ (use-modules (gnu services herd)
+ (srfi srfi-34))
+
+ (guard (c ((service-not-found-error? c)
+ (format (current-error-port)
+ "no elogind shepherd service~%")
+ (exit 1))
+ ((shepherd-error? c)
+ (format (current-error-port)
+ "elogind shepherd service not \
+started~%")
+ (exit 2)))
+ (wait-for-service 'elogind))))))
+
+ (define build
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils)
+ (ice-9 match))
+
+ (define service-directory
+ "/share/dbus-1/system-services")
+
+ (mkdir-p (dirname (string-append #$output service-directory)))
+ (copy-recursively (string-append #$elogind service-directory)
+ (string-append #$output service-directory))
+ (symlink (string-append #$elogind "/etc") ;for etc/dbus-1
+ (string-append #$output "/etc"))
+
+ ;; Replace the "Exec=" line of the 'org.freedesktop.login1.service'
+ ;; file with one that refers to WRAPPER instead of elogind.
+ (match (find-files #$output "\\.service$")
+ ((file)
+ (substitute* file
+ (("Exec[[:blank:]]*=.*" _)
+ (string-append "Exec=" #$wrapper "\n"))))))))
+
+ (list (computed-file "elogind-dbus-service-wrapper" build)))
(define (pam-extension-procedure config)
"Return an extension for PAM-ROOT-SERVICE-TYPE that ensures that all the PAM
diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm
index 80d08f849e..a7c845b4b0 100644
--- a/gnu/services/herd.scm
+++ b/gnu/services/herd.scm
@@ -58,7 +58,8 @@
load-services/safe
start-service
stop-service
- restart-service))
+ restart-service
+ wait-for-service))
;;; Commentary:
;;;
@@ -313,6 +314,39 @@ when passed a service with an already-registered name."
(with-shepherd-action name ('restart) result
result))
+(define* (wait-for-service name #:key (timeout 20))
+ "Wait for the service providing NAME, a symbol, to be up and running, and
+return its \"running value\". Give up after TIMEOUT seconds and raise a
+'&shepherd-error' exception. Raise a '&service-not-found-error' exception
+when NAME is not found."
+ (define (relevant-service? service)
+ (memq name (live-service-provision service)))
+
+ (define start
+ (car (gettimeofday)))
+
+ ;; Note: As of Shepherd 0.9.1, we cannot just call the 'start' method and
+ ;; wait for it: it would spawn an additional elogind process. Thus, poll.
+ (let loop ((attempts 0))
+ (define services
+ (current-services))
+
+ (define now
+ (car (gettimeofday)))
+
+ (when (>= (- now start) timeout)
+ (raise (condition (&shepherd-error)))) ;XXX: better exception?
+
+ (match (find relevant-service? services)
+ (#f
+ (raise (condition (&service-not-found-error
+ (service name)))))
+ (service
+ (or (live-service-running service)
+ (begin
+ (sleep 1)
+ (loop (+ attempts 1))))))))
+
;; Local Variables:
;; eval: (put 'alist-let* 'scheme-indent-function 2)
;; eval: (put 'with-shepherd 'scheme-indent-function 1)
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index fa79f3211e..62aa7bdbc5 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2012, 2013, 2014, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 David Thompson <davet@gnu.org>
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
-;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
@@ -25,6 +25,7 @@
(define-module (guix scripts import)
#:use-module (guix ui)
#:use-module (guix scripts)
+ #:use-module (guix scripts style)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
@@ -32,43 +33,11 @@
#:use-module (srfi srfi-37)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
- #:use-module (ice-9 pretty-print)
#:export (%standard-import-options
guix-import))
;;;
-;;; Helper.
-;;;
-
-(define (newline-rewriting-port output)
- "Return an output port that rewrites strings containing the \\n escape
-to an actual newline. This works around the behavior of `pretty-print'
-and `write', which output these as \\n instead of actual newlines,
-whereas we want the `description' field to contain actual newlines
-rather than \\n."
- (define (write-string str)
- (let loop ((chars (string->list str)))
- (match chars
- (()
- #t)
- ((#\\ #\n rest ...)
- (newline output)
- (loop rest))
- ((chr rest ...)
- (write-char chr output)
- (loop rest)))))
-
- (make-soft-port (vector (cut write-char <>)
- write-string
- (lambda _ #t) ; flush
- #f
- (lambda _ #t) ; close
- #f)
- "w"))
-
-
-;;;
;;; Command line options.
;;;
@@ -119,9 +88,7 @@ Run IMPORTER with ARGS.\n"))
((importer args ...)
(if (member importer importers)
(let ((print (lambda (expr)
- (pretty-print expr (newline-rewriting-port
- (current-output-port))
- #:max-expr-width 80))))
+ (pretty-print-with-comments (current-output-port) expr))))
(match (apply (resolve-importer importer) args)
((and expr (or ('package _ ...)
('let _ ...)