From 7276b5604d863d1de4f932c3a2e29e0fedaa3005 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 25 Nov 2016 21:43:17 +0100 Subject: [PATCH 001/130] gnu: hydrogen: Update to 0.9.7. * gnu/packages/music.scm (hydrogen): Update to 0.9.7. --- gnu/packages/music.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 14839c1b6e..78ca558b2d 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -234,7 +234,7 @@ many input formats and provides a customisable Vi-style user interface.") (define-public hydrogen (package (name "hydrogen") - (version "0.9.6.1") + (version "0.9.7") (source (origin (method url-fetch) (uri (string-append @@ -242,7 +242,7 @@ many input formats and provides a customisable Vi-style user interface.") version ".tar.gz")) (sha256 (base32 - "0vxnaqfmcv7hhk0cj67imdcqngspnck7f0wfmvhfgfqa7x1xznll")))) + "1dy2jfkdw0nchars4xi4isrz66fqn53a9qk13bqza7lhmsg3s3qy")))) (build-system cmake-build-system) (arguments `(#:test-target "tests")) From 6634180f9eabc70cdc5bc8e9ce2ff0f9250625bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 25 Nov 2016 17:30:32 +0100 Subject: [PATCH 002/130] gnu: guile-ssh: Update to 0.10.2. * gnu/packages/ssh.scm (guile-ssh): Update to 0.10.2. [home-page]: Update. [source]: Use the 'url-fetch' method and a GitHub generated tarball. [arguments] : Remove now unneeded 'chmod' call. --- gnu/packages/ssh.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index 5fdeeb74a4..ea5ec811d1 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -204,24 +204,24 @@ Additionally, various channel-specific options can be negotiated.") (define-public guile-ssh (package (name "guile-ssh") - (version "0.10.1") + (version "0.10.2") + (home-page "https://github.com/artyom-poptsov/guile-ssh") (source (origin ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz ;; exists, but the server appears to be too slow and unreliable. - (method git-fetch) - (uri (git-reference - (url "https://github.com/artyom-poptsov/libguile-ssh.git") - (commit (string-append "v" version)))) - (file-name (string-append name "-" version "-checkout")) + ;; Also, using this URL allows the GitHub updater to work. + (method url-fetch) + (uri (string-append home-page "/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "0ky77kr7rnkhbq938bir61mlr8b86lfjcjjb1bxx1y1fhimsiz72")))) + "0pkiq3fm15pr4w1r420rrwwfmi4jz492r6l6vzjk6v73xlyfyfl3")))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'unpack 'autoreconf (lambda* (#:key inputs #:allow-other-keys) - (chmod "doc/version.texi" #o777) ;make it writable (zero? (system* "autoreconf" "-vfi")))) (add-before 'build 'fix-libguile-ssh-file-name (lambda* (#:key outputs #:allow-other-keys) @@ -255,7 +255,6 @@ Additionally, various channel-specific options can be negotiated.") "Guile-SSH is a library that provides access to the SSH protocol for programs written in GNU Guile interpreter. It is a wrapper to the underlying libssh library.") - (home-page "https://github.com/artyom-poptsov/libguile-ssh") (license license:gpl3+))) (define-public corkscrew From 21531add3205e400707c8fbfd841845f9a71863a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 2 Mar 2014 22:39:48 +0100 Subject: [PATCH 003/130] offload: Use Guile-SSH instead of GNU lsh. * guix/scripts/offload.scm ()[ssh-options]: Remove. [host-key, host-key-type]: New fields. (%lsh-command, %lshg-command, user-lsh-private-key): Remove. (user-openssh-private-key, private-key-from-file*): New procedures. (host-key->type+key, open-ssh-session): New procedures. (remote-pipe): Remove 'mode' parameter. Rewrite in terms of 'open-ssh-session' etc. Update users. (send-files)[missing-files]: Rewrite using the bidirectional channel port. Remove call to 'call-with-compressed-output-port'. (retrieve-files): Remove call to 'call-with-decompressed-port'. (machine-load): Remove exit status logic. * doc/guix.texi (Requirements): Mention Guile-SSH. (Daemon Offload Setup): Document 'host-key' and 'private-key'. Show the default value on each @item line. * m4/guix.m4 (GUIX_CHECK_GUILE_SSH): New macro. * config-daemon.ac: Use 'GUIX_CHECK_GUILE_SSH'. Set 'HAVE_DAEMON_OFFLOAD_HOOK' as a function of that. --- config-daemon.ac | 18 ++- doc/guix.texi | 69 +++++++--- guix/scripts/offload.scm | 273 +++++++++++++++++++-------------------- m4/guix.m4 | 18 +++ 4 files changed, 210 insertions(+), 168 deletions(-) diff --git a/config-daemon.ac b/config-daemon.ac index 8a3e6d8b60..056c939e39 100644 --- a/config-daemon.ac +++ b/config-daemon.ac @@ -128,12 +128,20 @@ if test "x$guix_build_daemon" = "xyes"; then dnl 'restore-file-set', which requires unbuffered custom binary input dnl ports from Guile >= 2.0.10.) GUIX_CHECK_UNBUFFERED_CBIP - guix_build_daemon_offload="$ac_cv_guix_cbips_support_setvbuf" - if test "x$guix_build_daemon_offload" = "xyes"; then - AC_DEFINE([HAVE_DAEMON_OFFLOAD_HOOK], [1], - [Define if the daemon's 'offload' build hook is being built.]) - fi + dnl Check for Guile-SSH, which is required by 'guix offload'. + GUIX_CHECK_GUILE_SSH + + case "x$ac_cv_guix_cbips_support_setvbuf$guix_cv_have_recent_guile_ssh" in + xyesyes) + guix_build_daemon_offload="yes" + AC_DEFINE([HAVE_DAEMON_OFFLOAD_HOOK], [1], + [Define if the daemon's 'offload' build hook is being built (requires Guile-SSH).]) + ;; + *) + guix_build_daemon_offload="no" + ;; + esac dnl Temporary directory used to store the daemon's data. GUIX_TEST_ROOT_DIRECTORY diff --git a/doc/guix.texi b/doc/guix.texi index ebb138e15d..f1cb007aa9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -566,6 +566,12 @@ allow you to use the @command{guix import pypi} command (@pxref{Invoking guix import}). It is of interest primarily for developers and not for casual users. +@item +@c Note: We need at least 0.10.2 for 'channel-send-eof'. +Support for build offloading (@pxref{Daemon Offload Setup}) depends on +@uref{https://github.com/artyom-poptsov/guile-ssh, Guile-SSH}, +version 0.10.2 or later. + @item When @url{http://zlib.net, zlib} is available, @command{guix publish} can compress build byproducts (@pxref{Invoking guix publish}). @@ -814,9 +820,11 @@ available on the system---making it much harder to view them as @cindex offloading @cindex build hook -When desired, the build daemon can @dfn{offload} -derivation builds to other machines -running Guix, using the @code{offload} @dfn{build hook}. When that +When desired, the build daemon can @dfn{offload} derivation builds to +other machines running Guix, using the @code{offload} @dfn{build +hook}@footnote{This feature is available only when +@uref{https://github.com/artyom-poptsov/guile-ssh, Guile-SSH} is +present.}. When that feature is enabled, a list of user-specified build machines is read from @file{/etc/guix/machines.scm}; every time a build is requested, for instance via @code{guix build}, the daemon attempts to offload it to one @@ -832,16 +840,18 @@ The @file{/etc/guix/machines.scm} file typically looks like this: (list (build-machine (name "eightysix.example.org") (system "x86_64-linux") + (host-key "ssh-ed25519 AAAAC3Nza@dots{}") (user "bob") - (speed 2.)) ; incredibly fast! + (speed 2.)) ;incredibly fast! (build-machine (name "meeps.example.org") (system "mips64el-linux") + (host-key "ssh-rsa AAAAB3Nza@dots{}") (user "alice") (private-key (string-append (getenv "HOME") - "/.lsh/identity-for-guix")))) + "/.ssh/identity-for-guix")))) @end example @noindent @@ -875,31 +885,50 @@ The user account to use when connecting to the remote machine over SSH. Note that the SSH key pair must @emph{not} be passphrase-protected, to allow non-interactive logins. +@item host-key +This must be the machine's SSH @dfn{public host key} in OpenSSH format. +This is used to authenticate the machine when we connect to it. It is a +long string that looks like this: + +@example +ssh-ed25519 AAAAC3NzaC@dots{}mde+UhL hint@@example.org +@end example + +If the machine is running the OpenSSH daemon, @command{sshd}, the host +key can be found in a file such as +@file{/etc/ssh/ssh_host_ed25519_key.pub}. + +If the machine is running the SSH daemon of GNU@tie{}lsh, +@command{lshd}, the host key is in @file{/etc/lsh/host-key.pub} or a +similar file. It can be converted to the OpenSSH format using +@command{lsh-export-key} (@pxref{Converting keys,,, lsh, LSH Manual}): + +@example +$ lsh-export-key --openssh < /etc/lsh/host-key.pub +ssh-rsa AAAAB3NzaC1yc2EAAAAEOp8FoQAAAQEAs1eB46LV@dots{} +@end example + @end table A number of optional fields may be specified: -@table @code +@table @asis -@item port -Port number of SSH server on the machine (default: 22). +@item @code{port} (default: @code{22}) +Port number of SSH server on the machine. -@item private-key -The SSH private key file to use when connecting to the machine. +@item @code{private-key} (default: @file{~/.ssh/id_rsa}) +The SSH private key file to use when connecting to the machine, in +OpenSSH format. -Currently offloading uses GNU@tie{}lsh as its SSH client -(@pxref{Invoking lsh,,, GNU lsh Manual}). Thus, the key file here must -be an lsh key file. This may change in the future, though. +@item @code{parallel-builds} (default: @code{1}) +The number of builds that may run in parallel on the machine. -@item parallel-builds -The number of builds that may run in parallel on the machine (1 by -default.) - -@item speed +@item @code{speed} (default: @code{1.0}) A ``relative speed factor''. The offload scheduler will tend to prefer machines with a higher speed factor. -@item features +@item @code{features} (default: @code{'()}) A list of strings denoting specific features supported by the machine. An example is @code{"kvm"} for machines that have the KVM Linux modules and corresponding hardware support. Derivations can request features by @@ -915,7 +944,7 @@ machines, since offloading works by invoking the @code{guix archive} and this is the case by running: @example -lsh build-machine guile -c "'(use-modules (guix config))'" +ssh build-machine guile -c "'(use-modules (guix config))'" @end example There is one last thing to do once @file{machines.scm} is in place. As diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 33d141e7ef..327c99dfea 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -17,6 +17,10 @@ ;;; along with GNU Guix. If not, see . (define-module (guix scripts offload) + #:use-module (ssh key) + #:use-module (ssh auth) + #:use-module (ssh session) + #:use-module (ssh channel) #:use-module (guix config) #:use-module (guix records) #:use-module (guix store) @@ -65,14 +69,13 @@ (system build-machine-system) ; string (user build-machine-user) ; string (private-key build-machine-private-key ; file name - (default (user-lsh-private-key))) + (default (user-openssh-private-key))) + (host-key build-machine-host-key) ; string (parallel-builds build-machine-parallel-builds ; number (default 1)) (speed build-machine-speed ; inexact real (default 1.0)) (features build-machine-features ; list of strings - (default '())) - (ssh-options build-machine-ssh-options ; list of strings (default '()))) (define-record-type* @@ -86,19 +89,11 @@ ;; File that lists machines available as build slaves. (string-append %config-directory "/machines.scm")) -(define %lsh-command - "lsh") - -(define %lshg-command - ;; FIXME: 'lshg' fails to pass large amounts of data, see - ;; . - "lsh") - -(define (user-lsh-private-key) - "Return the user's default lsh private key, or #f if it could not be +(define (user-openssh-private-key) + "Return the user's default SSH private key, or #f if it could not be determined." (and=> (getenv "HOME") - (cut string-append <> "/.lsh/identity"))) + (cut string-append <> "/.ssh/id_rsa"))) (define %user-module ;; Module in which the machine description file is loaded. @@ -134,60 +129,79 @@ determined." (leave (_ "failed to load machine file '~a': ~s~%") file args)))))) -;;; FIXME: The idea was to open the connection to MACHINE once for all, but -;;; lshg is currently non-functional. -;; (define (open-ssh-gateway machine) -;; "Initiate an SSH connection gateway to MACHINE, and return the PID of the -;; running lsh gateway upon success, or #f on failure." -;; (catch 'system-error -;; (lambda () -;; (let* ((port (open-pipe* OPEN_READ %lsh-command -;; "-l" (build-machine-user machine) -;; "-i" (build-machine-private-key machine) -;; ;; XXX: With lsh 2.1, passing '--write-pid' -;; ;; last causes the PID not to be printed. -;; "--write-pid" "--gateway" "--background" -;; (build-machine-name machine))) -;; (line (read-line port)) -;; (status (close-pipe port))) -;; (if (zero? status) -;; (let ((pid (string->number line))) -;; (if (integer? pid) -;; pid -;; (begin -;; (warning (_ "'~a' did not write its PID on stdout: ~s~%") -;; %lsh-command line) -;; #f))) -;; (begin -;; (warning (_ "failed to initiate SSH connection to '~a':\ -;; '~a' exited with ~a~%") -;; (build-machine-name machine) -;; %lsh-command -;; (status:exit-val status)) -;; #f)))) -;; (lambda args -;; (leave (_ "failed to execute '~a': ~a~%") -;; %lsh-command (strerror (system-error-errno args)))))) +(define (host-key->type+key host-key) + "Destructure HOST-KEY, an OpenSSH host key string, and return two values: +its key type as a symbol, and the actual base64-encoded string." + (define (type->symbol type) + (and (string-prefix? "ssh-" type) + (string->symbol (string-drop type 4)))) -(define-syntax with-error-to-port - (syntax-rules () - ((_ port exp0 exp ...) - (let ((new port) - (old (current-error-port))) - (dynamic-wind - (lambda () - (set-current-error-port new)) - (lambda () - exp0 exp ...) - (lambda () - (set-current-error-port old))))))) + (match (string-tokenize host-key) + ((type key _) + (values (type->symbol type) key)) + ((type key) + (values (type->symbol type) key)))) -(define* (remote-pipe machine mode command - #:key (error-port (current-error-port)) (quote? #t)) - "Run COMMAND (a string list) on MACHINE, assuming an lsh gateway has been -set up. When QUOTE? is true, perform shell-quotation of all the elements of -COMMAND. Return either a pipe opened with MODE, or #f if the lsh client could -not be started." +(define (private-key-from-file* file) + "Like 'private-key-from-file', but raise an error that 'with-error-handling' +can interpret meaningfully." + (catch 'guile-ssh-error + (lambda () + (private-key-from-file file)) + (lambda (key proc str . rest) + (raise (condition + (&message (message (format #f (_ "failed to load SSH \ +private key from '~a': ~a") + file str)))))))) + +(define (open-ssh-session machine) + "Open an SSH session for MACHINE and return it. Throw an error on failure." + (let ((private (private-key-from-file* (build-machine-private-key machine))) + (public (public-key-from-file + (string-append (build-machine-private-key machine) + ".pub"))) + (session (make-session #:user (build-machine-user machine) + #:host (build-machine-name machine) + #:port (build-machine-port machine) + #:timeout 5 ;seconds + ;; #:log-verbosity 'protocol + #:identity (build-machine-private-key machine) + + ;; We need lightweight compression when + ;; exchanging full archives. + #:compression "zlib" + #:compression-level 3))) + (connect! session) + + ;; Authenticate the server. XXX: Guile-SSH 0.10.1 doesn't know about + ;; ed25519 keys and 'get-key-type' returns #f in that case. + (let-values (((server) (get-server-public-key session)) + ((type key) (host-key->type+key + (build-machine-host-key machine)))) + (unless (and (or (not (get-key-type server)) + (eq? (get-key-type server) type)) + (string=? (public-key->string server) key)) + ;; Key mismatch: something's wrong. XXX: It could be that the server + ;; provided its Ed25519 key when we where expecting its RSA key. + (leave (_ "server at '~a' returned host key '~a' of type '~a' \ +instead of '~a' of type '~a'~%") + (build-machine-name machine) + (public-key->string server) (get-key-type server) + key type))) + + (let ((auth (userauth-public-key! session private))) + (unless (eq? 'success auth) + (disconnect! session) + (leave (_ "SSH public key authentication failed for '~a': ~a~%") + (build-machine-name machine) (get-error session)))) + + session)) + +(define* (remote-pipe machine command + #:key (quote? #t)) + "Run COMMAND (a list) on MACHINE, and return an open input/output port, +which is also an SSH channel. When QUOTE? is true, perform shell-quotation of +all the elements of COMMAND." (define (shell-quote str) ;; Sort-of shell-quote STR so it can be passed as an argument to the ;; shell. @@ -195,20 +209,15 @@ not be started." (lambda () (write str)))) - ;; Let the child inherit ERROR-PORT. - (with-error-to-port error-port - (apply open-pipe* mode %lshg-command - "-l" (build-machine-user machine) - "-p" (number->string (build-machine-port machine)) - - ;; XXX: Remove '-i' when %LSHG-COMMAND really is lshg. - "-i" (build-machine-private-key machine) - - (append (build-machine-ssh-options machine) - (list (build-machine-name machine)) - (if quote? - (map shell-quote command) - command))))) + ;; TODO: Use (ssh popen) instead. + (let* ((session (open-ssh-session machine)) + (channel (make-channel session))) + (channel-open-session channel) + (channel-request-exec channel + (string-join (if quote? + (map shell-quote command) + command))) + channel)) ;;; @@ -335,10 +344,11 @@ hook." (unless (= EEXIST (system-error-errno args)) (apply throw args))))))) - (let ((pipe (remote-pipe machine OPEN_READ + (let ((pipe (remote-pipe machine `("guile" "-c" ,(object->string script))))) (read-string pipe) - (let ((status (close-pipe pipe))) + (let ((status (channel-get-exit-status pipe))) + (close-port pipe) (unless (zero? status) ;; Better be safe than sorry: if we ignore the error here, then FILE ;; may be GC'd just before we start using it. @@ -367,10 +377,10 @@ hook." (false-if-exception (delete-file file))) roots))))) - (let ((pipe (remote-pipe machine OPEN_READ + (let ((pipe (remote-pipe machine `("guile" "-c" ,(object->string script))))) (read-string pipe) - (close-pipe pipe))) + (close-port pipe))) (define* (offload drv machine #:key print-build-trace? (max-silent-time 3600) @@ -384,7 +394,7 @@ there, and write the build log to LOG-PORT. Return the exit status." ;; Normally DRV has already been protected from GC when it was transferred. ;; The '-r' flag below prevents the build result from being GC'd. - (let ((pipe (remote-pipe machine OPEN_READ + (let ((pipe (remote-pipe machine `("guix" "build" "-r" ,%gc-root-file ,(format #f "--max-silent-time=~a" @@ -397,14 +407,20 @@ there, and write the build log to LOG-PORT. Return the exit status." ;; Since 'guix build' writes the build log to its ;; stderr, everything will go directly to LOG-PORT. - #:error-port log-port))) + ;; #:error-port log-port ;; FIXME + ))) + ;; Make standard error visible. + (channel-set-stream! pipe 'stderr) + (let loop ((line (read-line pipe))) (unless (eof-object? line) (display line log-port) (newline log-port) (loop (read-line pipe)))) - (close-pipe pipe))) + (let loop ((status (channel-get-exit-status pipe))) + (close-port pipe) + status))) (define* (transfer-and-offload drv machine #:key @@ -438,7 +454,7 @@ MACHINE." with exit code ~a~%" (derivation-file-name drv) (build-machine-name machine) - (status:exit-val status)) + status) ;; Use exit code 100 for a permanent build failure. The daemon ;; interprets other non-zero codes as transient build failures. @@ -448,24 +464,14 @@ with exit code ~a~%" "Send the subset of FILES that's missing to MACHINE's store. Return #t on success, #f otherwise." (define (missing-files files) - ;; Return the subset of FILES not already on MACHINE. - (let*-values (((files) - (format #f "~{~a~%~}" files)) - ((missing pids) - (filtered-port - (append (list (which %lshg-command) - "-l" (build-machine-user machine) - "-p" (number->string - (build-machine-port machine)) - "-i" (build-machine-private-key machine)) - (build-machine-ssh-options machine) - (cons (build-machine-name machine) - '("guix" "archive" "--missing"))) - (open-input-string files))) - ((result) - (read-string missing))) - (for-each waitpid pids) - (string-tokenize result))) + ;; Return the subset of FILES not already on MACHINE. Use 'head' as a + ;; hack to make sure the remote end stops reading when we're done. + (let* ((pipe (remote-pipe machine + `("guix" "archive" "--missing") + #:quote? #f))) + (format pipe "~{~a~%~}" files) + (channel-send-eof pipe) + (string-tokenize (read-string pipe)))) (with-store store (guard (c ((nix-protocol-error? c) @@ -476,40 +482,28 @@ success, #f otherwise." ;; Compute the subset of FILES missing on MACHINE, and send them in ;; topologically sorted order so that they can actually be imported. - ;; - ;; To reduce load on the machine that's offloading (since it's typically - ;; already quite busy, see hydra.gnu.org), compress with gzip rather - ;; than xz: For a compression ratio 2 times larger, it is 20 times - ;; faster. (let* ((files (missing-files (topologically-sorted store files))) - (pipe (remote-pipe machine OPEN_WRITE - '("gzip" "-dc" "|" - "guix" "archive" "--import") + (pipe (remote-pipe machine + '("guix" "archive" "--import") #:quote? #f))) (format #t (_ "sending ~a store files to '~a'...~%") (length files) (build-machine-name machine)) - (call-with-compressed-output-port 'gzip pipe - (lambda (compressed) - (catch 'system-error - (lambda () - (export-paths store files compressed)) - (lambda args - (warning (_ "failed while exporting files to '~a': ~a~%") - (build-machine-name machine) - (strerror (system-error-errno args)))))) - #:options '("--fast")) - ;; Wait for the 'lsh' process to complete. - (zero? (close-pipe pipe)))))) + (export-paths store files pipe) + (channel-send-eof pipe) + + ;; Wait for the remote process to complete. + (let ((status (channel-get-exit-status pipe))) + (close pipe) + status))))) (define (retrieve-files files machine) "Retrieve FILES from MACHINE's store, and import them." (define host (build-machine-name machine)) - (let ((pipe (remote-pipe machine OPEN_READ - `("guix" "archive" "--export" ,@files - "|" "xz" "-c") + (let ((pipe (remote-pipe machine + `("guix" "archive" "--export" ,@files) #:quote? #f))) (and pipe (with-store store @@ -522,14 +516,11 @@ success, #f otherwise." ;; We cannot use the 'import-paths' RPC here because we already ;; hold the locks for FILES. - (call-with-decompressed-port 'xz pipe - (lambda (decompressed) - (restore-file-set decompressed - #:log-port (current-error-port) - #:lock? #f))) + (restore-file-set pipe + #:log-port (current-error-port) + #:lock? #f) - ;; Wait for the 'lsh' process to complete. - (zero? (close-pipe pipe))))))) + (close-port pipe)))))) ;;; @@ -547,13 +538,9 @@ success, #f otherwise." (define (machine-load machine) "Return the load of MACHINE, divided by the number of parallel builds allowed on MACHINE." - (let* ((pipe (remote-pipe machine OPEN_READ `("cat" "/proc/loadavg"))) - (line (read-line pipe)) - (status (close-pipe pipe))) - (unless (eqv? 0 (status:exit-val status)) - (warning (_ "failed to obtain load of '~a': SSH client exited with ~a~%") - (build-machine-name machine) - (status:exit-val status))) + (let* ((pipe (remote-pipe machine '("cat" "/proc/loadavg"))) + (line (read-line pipe))) + (close-port pipe) (if (eof-object? line) +inf.0 ;MACHINE does not respond, so assume it is infinitely loaded diff --git a/m4/guix.m4 b/m4/guix.m4 index 6d8ec2e4e0..6630598416 100644 --- a/m4/guix.m4 +++ b/m4/guix.m4 @@ -171,6 +171,24 @@ AC_DEFUN([GUIX_CHECK_UNBUFFERED_CBIP], [ fi]) ]) +dnl GUIX_CHECK_GUILE_SSH +dnl +dnl Check whether a recent-enough Guile-SSH is available. +AC_DEFUN([GUIX_CHECK_GUILE_SSH], [ + dnl Check whether 'channel-send-eof' (introduced in 0.10.2) is present. + AC_CACHE_CHECK([whether Guile-SSH is available and recent enough], + [guix_cv_have_recent_guile_ssh], + [GUILE_CHECK([retval], + [(and (@ (ssh channel) channel-send-eof) + (@ (ssh popen) open-remote-pipe) + (@ (ssh dist node) node-eval))]) + if test "$retval" = 0; then + guix_cv_have_recent_guile_ssh="yes" + else + guix_cv_have_recent_guile_ssh="no" + fi]) +]) + dnl GUIX_TEST_ROOT_DIRECTORY AC_DEFUN([GUIX_TEST_ROOT_DIRECTORY], [ AC_CACHE_CHECK([for unit test root directory], From 9e76eed37fc4cb0f70c1cc1441dfba92b25c33eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 2 Nov 2016 12:00:47 +0100 Subject: [PATCH 004/130] offload: Reuse SSH session during 'transfer-and-offload'. * guix/scripts/offload.scm (remote-pipe): Replace 'machine' parameter with 'session'. Remove 'open-ssh-session' call. (register-gc-root): Replace 'machine' with 'session'. Use ' session-get' instead of 'build-machine-name'. (remove-gc-roots, offload, send-files, retrieve-files): Likewise. (transfer-and-offload): Add 'open-ssh-session' call. Handle 'offload' errors here. (machine-load): Add call to 'open-ssh-session'. --- guix/scripts/offload.scm | 84 ++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 327c99dfea..8704743a7f 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -197,9 +197,9 @@ instead of '~a' of type '~a'~%") session)) -(define* (remote-pipe machine command +(define* (remote-pipe session command #:key (quote? #t)) - "Run COMMAND (a list) on MACHINE, and return an open input/output port, + "Run COMMAND (a list) on SESSION, and return an open input/output port, which is also an SSH channel. When QUOTE? is true, perform shell-quotation of all the elements of COMMAND." (define (shell-quote str) @@ -209,9 +209,7 @@ all the elements of COMMAND." (lambda () (write str)))) - ;; TODO: Use (ssh popen) instead. - (let* ((session (open-ssh-session machine)) - (channel (make-channel session))) + (let* ((channel (make-channel session))) (channel-open-session channel) (channel-request-exec channel (string-join (if quote? @@ -312,8 +310,9 @@ hook." ;; File name of the temporary GC root we install. (format #f "offload-~a-~a" (gethostname) (getpid))) -(define (register-gc-root file machine) - "Mark FILE, a store item, as a garbage collector root on MACHINE." +(define (register-gc-root file session) + "Mark FILE, a store item, as a garbage collector root in SESSION. Return +the exit status, zero on success." (define script `(begin (use-modules (guix config)) @@ -344,7 +343,7 @@ hook." (unless (= EEXIST (system-error-errno args)) (apply throw args))))))) - (let ((pipe (remote-pipe machine + (let ((pipe (remote-pipe session `("guile" "-c" ,(object->string script))))) (read-string pipe) (let ((status (channel-get-exit-status pipe))) @@ -353,10 +352,10 @@ hook." ;; Better be safe than sorry: if we ignore the error here, then FILE ;; may be GC'd just before we start using it. (leave (_ "failed to register GC root for '~a' on '~a' (status: ~a)~%") - file (build-machine-name machine) status))))) + file (session-get session 'host) status))))) -(define (remove-gc-roots machine) - "Remove from MACHINE the GC roots previously installed with +(define (remove-gc-roots session) + "Remove in SESSION the GC roots previously installed with 'register-gc-root'." (define script `(begin @@ -377,24 +376,19 @@ hook." (false-if-exception (delete-file file))) roots))))) - (let ((pipe (remote-pipe machine + (let ((pipe (remote-pipe session `("guile" "-c" ,(object->string script))))) (read-string pipe) (close-port pipe))) -(define* (offload drv machine +(define* (offload drv session #:key print-build-trace? (max-silent-time 3600) build-timeout (log-port (build-log-port))) - "Perform DRV on MACHINE, assuming DRV and its prerequisites are available + "Perform DRV in SESSION, assuming DRV and its prerequisites are available there, and write the build log to LOG-PORT. Return the exit status." - (format (current-error-port) "offloading '~a' to '~a'...~%" - (derivation-file-name drv) (build-machine-name machine)) - (format (current-error-port) "@ build-remote ~a ~a~%" - (derivation-file-name drv) (build-machine-name machine)) - ;; Normally DRV has already been protected from GC when it was transferred. ;; The '-r' flag below prevents the build result from being GC'd. - (let ((pipe (remote-pipe machine + (let ((pipe (remote-pipe session `("guix" "build" "-r" ,%gc-root-file ,(format #f "--max-silent-time=~a" @@ -432,23 +426,31 @@ there, and write the build log to LOG-PORT. Return the exit status." "Offload DRV to MACHINE. Prior to the actual offloading, transfer all of INPUTS to MACHINE; if building DRV succeeds, retrieve all of OUTPUTS from MACHINE." + (define session + (open-ssh-session machine)) + (when (begin - (register-gc-root (derivation-file-name drv) machine) + (register-gc-root (derivation-file-name drv) session) (send-files (cons (derivation-file-name drv) inputs) - machine)) - (let ((status (offload drv machine + session)) + (format (current-error-port) "offloading '~a' to '~a'...~%" + (derivation-file-name drv) (build-machine-name machine)) + (format (current-error-port) "@ build-remote ~a ~a~%" + (derivation-file-name drv) (build-machine-name machine)) + + (let ((status (offload drv session #:print-build-trace? print-build-trace? #:max-silent-time max-silent-time #:build-timeout build-timeout))) (if (zero? status) (begin - (retrieve-files outputs machine) - (remove-gc-roots machine) + (retrieve-files outputs session) + (remove-gc-roots session) (format (current-error-port) "done with offloaded '~a'~%" (derivation-file-name drv))) (begin - (remove-gc-roots machine) + (remove-gc-roots session) (format (current-error-port) "derivation '~a' offloaded to '~a' failed \ with exit code ~a~%" @@ -460,13 +462,13 @@ with exit code ~a~%" ;; interprets other non-zero codes as transient build failures. (primitive-exit 100)))))) -(define (send-files files machine) - "Send the subset of FILES that's missing to MACHINE's store. Return #t on +(define (send-files files session) + "Send the subset of FILES that's missing to SESSION's store. Return #t on success, #f otherwise." (define (missing-files files) - ;; Return the subset of FILES not already on MACHINE. Use 'head' as a + ;; Return the subset of FILES not already on SESSION. Use 'head' as a ;; hack to make sure the remote end stops reading when we're done. - (let* ((pipe (remote-pipe machine + (let* ((pipe (remote-pipe session `("guix" "archive" "--missing") #:quote? #f))) (format pipe "~{~a~%~}" files) @@ -476,18 +478,17 @@ success, #f otherwise." (with-store store (guard (c ((nix-protocol-error? c) (warning (_ "failed to export files for '~a': ~s~%") - (build-machine-name machine) - c) + (session-get session 'host) c) #f)) - ;; Compute the subset of FILES missing on MACHINE, and send them in + ;; Compute the subset of FILES missing on SESSION, and send them in ;; topologically sorted order so that they can actually be imported. (let* ((files (missing-files (topologically-sorted store files))) - (pipe (remote-pipe machine + (pipe (remote-pipe session '("guix" "archive" "--import") #:quote? #f))) (format #t (_ "sending ~a store files to '~a'...~%") - (length files) (build-machine-name machine)) + (length files) (session-get session 'host)) (export-paths store files pipe) (channel-send-eof pipe) @@ -497,12 +498,12 @@ success, #f otherwise." (close pipe) status))))) -(define (retrieve-files files machine) - "Retrieve FILES from MACHINE's store, and import them." +(define (retrieve-files files session) + "Retrieve FILES from SESSION's store, and import them." (define host - (build-machine-name machine)) + (session-get session 'host)) - (let ((pipe (remote-pipe machine + (let ((pipe (remote-pipe session `("guix" "archive" "--export" ,@files) #:quote? #f))) (and pipe @@ -538,8 +539,9 @@ success, #f otherwise." (define (machine-load machine) "Return the load of MACHINE, divided by the number of parallel builds allowed on MACHINE." - (let* ((pipe (remote-pipe machine '("cat" "/proc/loadavg"))) - (line (read-line pipe))) + (let* ((session (open-ssh-session machine)) + (pipe (remote-pipe session '("cat" "/proc/loadavg"))) + (line (read-line pipe))) (close-port pipe) (if (eof-object? line) From 6230d6f04f4bde9ad834f97c5c950db89dde0496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 2 Nov 2016 22:50:31 +0100 Subject: [PATCH 005/130] store: 'open-connection' can taken an open port. * guix/store.scm (open-unix-domain-socket): New procedure. (open-connection): Add #:port parameter and honor it. --- guix/store.scm | 58 ++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/guix/store.scm b/guix/store.scm index 7f54b87db1..689a94c636 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -345,50 +345,58 @@ (message nix-protocol-error-message) (status nix-protocol-error-status)) -(define* (open-connection #:optional (file (%daemon-socket-file)) - #:key (reserve-space? #t) cpu-affinity) - "Connect to the daemon over the Unix-domain socket at FILE. When -RESERVE-SPACE? is true, instruct it to reserve a little bit of extra space on -the file system so that the garbage collector can still operate, should the -disk become full. When CPU-AFFINITY is true, it must be an integer -corresponding to an OS-level CPU number to which the daemon's worker process -for this connection will be pinned. Return a server object." +(define (open-unix-domain-socket file) + "Connect to the Unix-domain socket at FILE and return it. Raise a +'&nix-connection-error' upon error." (let ((s (with-fluids ((%default-port-encoding #f)) ;; This trick allows use of the `scm_c_read' optimization. (socket PF_UNIX SOCK_STREAM 0))) (a (make-socket-address PF_UNIX file))) (catch 'system-error - (cut connect s a) + (lambda () + (connect s a) + s) (lambda args ;; Translate the error to something user-friendly. (let ((errno (system-error-errno args))) (raise (condition (&nix-connection-error (file file) - (errno errno))))))) + (errno errno))))))))) - (write-int %worker-magic-1 s) - (let ((r (read-int s))) +(define* (open-connection #:optional (file (%daemon-socket-file)) + #:key port (reserve-space? #t) cpu-affinity) + "Connect to the daemon over the Unix-domain socket at FILE, or, if PORT is +not #f, use it as the I/O port over which to communicate to a build daemon. + +When RESERVE-SPACE? is true, instruct it to reserve a little bit of extra +space on the file system so that the garbage collector can still operate, +should the disk become full. When CPU-AFFINITY is true, it must be an integer +corresponding to an OS-level CPU number to which the daemon's worker process +for this connection will be pinned. Return a server object." + (let ((port (or port (open-unix-domain-socket file)))) + (write-int %worker-magic-1 port) + (let ((r (read-int port))) (and (eqv? r %worker-magic-2) - (let ((v (read-int s))) + (let ((v (read-int port))) (and (eqv? (protocol-major %protocol-version) (protocol-major v)) (begin - (write-int %protocol-version s) + (write-int %protocol-version port) (when (>= (protocol-minor v) 14) - (write-int (if cpu-affinity 1 0) s) + (write-int (if cpu-affinity 1 0) port) (when cpu-affinity - (write-int cpu-affinity s))) + (write-int cpu-affinity port))) (when (>= (protocol-minor v) 11) - (write-int (if reserve-space? 1 0) s)) - (let ((s (%make-nix-server s - (protocol-major v) - (protocol-minor v) - (make-hash-table 100) - (make-hash-table 100)))) - (let loop ((done? (process-stderr s))) - (or done? (process-stderr s))) - s)))))))) + (write-int (if reserve-space? 1 0) port)) + (let ((conn (%make-nix-server port + (protocol-major v) + (protocol-minor v) + (make-hash-table 100) + (make-hash-table 100)))) + (let loop ((done? (process-stderr conn))) + (or done? (process-stderr conn))) + conn)))))))) (define (close-connection server) "Close the connection to SERVER." From e8a5db80d5fe2e603d7b72c3b3cc5ba6ea6d99d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 5 Nov 2016 00:46:04 +0100 Subject: [PATCH 006/130] offload: Remove 'with-nar-error-handling' macro. * guix/scripts/offload.scm (with-nar-error-handling): Remove. (guix-offload): Use 'with-error-handling' instead. --- guix/scripts/offload.scm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 8704743a7f..35286ab9d5 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -664,17 +664,6 @@ defines a total order on machines.)" ;; Not now, all the machines are busy. (display "# postpone\n"))))))) -(define-syntax-rule (with-nar-error-handling body ...) - "Execute BODY with any &nar-error suitably reported to the user." - (guard (c ((nar-error? c) - (let ((file (nar-error-file c))) - (if (condition-has-type? c &message) - (leave (_ "while importing file '~a': ~a~%") - file (gettext (condition-message c))) - (leave (_ "failed to import file '~a'~%") - file))))) - body ...)) - ;;; ;;; Entry point. @@ -705,7 +694,7 @@ defines a total order on machines.)" (cond ((regexp-exec request-line-rx line) => (lambda (match) - (with-nar-error-handling + (with-error-handling (process-request (equal? (match:substring match 1) "1") (match:substring match 2) ; system (call-with-input-file From cf283dd92eb5ef2dee4b761bb23f6dca2525cd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 5 Nov 2016 00:47:34 +0100 Subject: [PATCH 007/130] offload: Rewrite to make direct RPCs to the remote daemon. * guix/scripts/offload.scm ()[daemon-socket]: New field. (connect-to-remote-daemon): New procedure. (%gc-root-file, register-gc-root, remove-gc-roots, offload): Remove. (transfer-and-offload): Rewrite using 'connect-to-remote-daemon' and RPCs over SSH. (store-import-channel, store-export-channel): New procedures. (send-files, retrieve-files): Rewrite using these. --- doc/guix.texi | 4 + guix/scripts/offload.scm | 355 ++++++++++++++++++--------------------- 2 files changed, 167 insertions(+), 192 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f1cb007aa9..b8e37055e6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -921,6 +921,10 @@ Port number of SSH server on the machine. The SSH private key file to use when connecting to the machine, in OpenSSH format. +@item @code{daemon-socket} (default: @code{"/var/guix/daemon-socket/socket"}) +File name of the Unix-domain socket @command{guix-daemon} is listening +to on that machine. + @item @code{parallel-builds} (default: @code{1}) The number of builds that may run in parallel on the machine. diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 35286ab9d5..1821bb5b7a 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -21,6 +21,9 @@ #:use-module (ssh auth) #:use-module (ssh session) #:use-module (ssh channel) + #:use-module (ssh popen) + #:use-module (ssh dist) + #:use-module (ssh dist node) #:use-module (guix config) #:use-module (guix records) #:use-module (guix store) @@ -71,6 +74,8 @@ (private-key build-machine-private-key ; file name (default (user-openssh-private-key))) (host-key build-machine-host-key) ; string + (daemon-socket build-machine-daemon-socket ; string + (default "/var/guix/daemon-socket/socket")) (parallel-builds build-machine-parallel-builds ; number (default 1)) (speed build-machine-speed ; inexact real @@ -197,6 +202,53 @@ instead of '~a' of type '~a'~%") session)) +(define* (connect-to-remote-daemon session + #:optional + (socket-name "/var/guix/daemon-socket/socket")) + "Connect to the remote build daemon listening on SOCKET-NAME over SESSION, +an SSH session. Return a object." + (define redirect + ;; Code run in SESSION to redirect the remote process' stdin/stdout to the + ;; daemon's socket, à la socat. The SSH protocol supports forwarding to + ;; Unix-domain sockets but libssh doesn't have an API for that, hence this + ;; hack. + `(begin + (use-modules (ice-9 match) (rnrs io ports)) + + (let ((sock (socket AF_UNIX SOCK_STREAM 0)) + (stdin (current-input-port)) + (stdout (current-output-port))) + (setvbuf stdin _IONBF) + (setvbuf stdout _IONBF) + (connect sock AF_UNIX ,socket-name) + + (let loop () + (match (select (list stdin sock) '() (list stdin stdout sock)) + ((reads writes ()) + (when (memq stdin reads) + (match (get-bytevector-some stdin) + ((? eof-object?) + (primitive-exit 0)) + (bv + (put-bytevector sock bv)))) + (when (memq sock reads) + (match (get-bytevector-some sock) + ((? eof-object?) + (primitive-exit 0)) + (bv + (put-bytevector stdout bv)))) + (loop)) + (_ + (primitive-exit 1))))))) + + (let ((channel + (open-remote-pipe* session OPEN_BOTH + ;; Sort-of shell-quote REDIRECT. + "guile" "-c" + (object->string + (object->string redirect))))) + (open-connection #:port channel))) + (define* (remote-pipe session command #:key (quote? #t)) "Run COMMAND (a list) on SESSION, and return an open input/output port, @@ -306,116 +358,6 @@ hook." (set-port-revealed! port 1) port)) -(define %gc-root-file - ;; File name of the temporary GC root we install. - (format #f "offload-~a-~a" (gethostname) (getpid))) - -(define (register-gc-root file session) - "Mark FILE, a store item, as a garbage collector root in SESSION. Return -the exit status, zero on success." - (define script - `(begin - (use-modules (guix config)) - - ;; Note: we can't use 'add-indirect-root' because dangling links under - ;; gcroots/auto are automatically deleted by the GC. This strategy - ;; doesn't have this problem, but it requires write access to that - ;; directory. - (let ((root-directory (string-append %state-directory - "/gcroots/tmp"))) - (catch 'system-error - (lambda () - (mkdir root-directory)) - (lambda args - (unless (= EEXIST (system-error-errno args)) - (error "failed to create remote GC root directory" - root-directory (system-error-errno args))))) - - (catch 'system-error - (lambda () - (symlink ,file - (string-append root-directory "/" ,%gc-root-file))) - (lambda args - ;; If FILE already exists, we can assume that either it's a stale - ;; reference (which is fine), or another process is already - ;; building the derivation represented by FILE (which is fine - ;; too.) Thus, do nothing in that case. - (unless (= EEXIST (system-error-errno args)) - (apply throw args))))))) - - (let ((pipe (remote-pipe session - `("guile" "-c" ,(object->string script))))) - (read-string pipe) - (let ((status (channel-get-exit-status pipe))) - (close-port pipe) - (unless (zero? status) - ;; Better be safe than sorry: if we ignore the error here, then FILE - ;; may be GC'd just before we start using it. - (leave (_ "failed to register GC root for '~a' on '~a' (status: ~a)~%") - file (session-get session 'host) status))))) - -(define (remove-gc-roots session) - "Remove in SESSION the GC roots previously installed with -'register-gc-root'." - (define script - `(begin - (use-modules (guix config) (ice-9 ftw) - (srfi srfi-1) (srfi srfi-26)) - - (let ((root-directory (string-append %state-directory - "/gcroots/tmp"))) - (false-if-exception - (delete-file - (string-append root-directory "/" ,%gc-root-file))) - - ;; These ones were created with 'guix build -r' (there can be more - ;; than one in case of multiple-output derivations.) - (let ((roots (filter (cut string-prefix? ,%gc-root-file <>) - (scandir ".")))) - (for-each (lambda (file) - (false-if-exception (delete-file file))) - roots))))) - - (let ((pipe (remote-pipe session - `("guile" "-c" ,(object->string script))))) - (read-string pipe) - (close-port pipe))) - -(define* (offload drv session - #:key print-build-trace? (max-silent-time 3600) - build-timeout (log-port (build-log-port))) - "Perform DRV in SESSION, assuming DRV and its prerequisites are available -there, and write the build log to LOG-PORT. Return the exit status." - ;; Normally DRV has already been protected from GC when it was transferred. - ;; The '-r' flag below prevents the build result from being GC'd. - (let ((pipe (remote-pipe session - `("guix" "build" - "-r" ,%gc-root-file - ,(format #f "--max-silent-time=~a" - max-silent-time) - ,@(if build-timeout - (list (format #f "--timeout=~a" - build-timeout)) - '()) - ,(derivation-file-name drv)) - - ;; Since 'guix build' writes the build log to its - ;; stderr, everything will go directly to LOG-PORT. - ;; #:error-port log-port ;; FIXME - ))) - ;; Make standard error visible. - (channel-set-stream! pipe 'stderr) - - (let loop ((line (read-line pipe))) - (unless (eof-object? line) - (display line log-port) - (newline log-port) - (loop (read-line pipe)))) - - (let loop ((status (channel-get-exit-status pipe))) - (close-port pipe) - status))) - (define* (transfer-and-offload drv machine #:key (inputs '()) @@ -429,99 +371,128 @@ MACHINE." (define session (open-ssh-session machine)) - (when (begin - (register-gc-root (derivation-file-name drv) session) - (send-files (cons (derivation-file-name drv) inputs) - session)) - (format (current-error-port) "offloading '~a' to '~a'...~%" - (derivation-file-name drv) (build-machine-name machine)) - (format (current-error-port) "@ build-remote ~a ~a~%" - (derivation-file-name drv) (build-machine-name machine)) + (define store + (connect-to-remote-daemon session + (build-machine-daemon-socket machine))) - (let ((status (offload drv session - #:print-build-trace? print-build-trace? - #:max-silent-time max-silent-time - #:build-timeout build-timeout))) - (if (zero? status) - (begin - (retrieve-files outputs session) - (remove-gc-roots session) - (format (current-error-port) - "done with offloaded '~a'~%" - (derivation-file-name drv))) - (begin - (remove-gc-roots session) - (format (current-error-port) - "derivation '~a' offloaded to '~a' failed \ -with exit code ~a~%" - (derivation-file-name drv) - (build-machine-name machine) - status) + (set-build-options store + #:print-build-trace print-build-trace? + #:max-silent-time max-silent-time + #:timeout build-timeout) - ;; Use exit code 100 for a permanent build failure. The daemon - ;; interprets other non-zero codes as transient build failures. - (primitive-exit 100)))))) + ;; Protect DRV from garbage collection. + (add-temp-root store (derivation-file-name drv)) -(define (send-files files session) - "Send the subset of FILES that's missing to SESSION's store. Return #t on -success, #f otherwise." - (define (missing-files files) - ;; Return the subset of FILES not already on SESSION. Use 'head' as a - ;; hack to make sure the remote end stops reading when we're done. - (let* ((pipe (remote-pipe session - `("guix" "archive" "--missing") - #:quote? #f))) - (format pipe "~{~a~%~}" files) - (channel-send-eof pipe) - (string-tokenize (read-string pipe)))) + (send-files (cons (derivation-file-name drv) inputs) + store) + (format (current-error-port) "offloading '~a' to '~a'...~%" + (derivation-file-name drv) (build-machine-name machine)) + (format (current-error-port) "@ build-remote ~a ~a~%" + (derivation-file-name drv) (build-machine-name machine)) + (guard (c ((nix-protocol-error? c) + (format (current-error-port) + (_ "derivation '~a' offloaded to '~a' failed: ~a~%") + (derivation-file-name drv) + (build-machine-name machine) + (nix-protocol-error-message c)) + ;; Use exit code 100 for a permanent build failure. The daemon + ;; interprets other non-zero codes as transient build failures. + (primitive-exit 100))) + (build-derivations store (list drv))) + + (retrieve-files outputs store) + (format (current-error-port) "done with offloaded '~a'~%" + (derivation-file-name drv))) + +(define (store-import-channel session) + "Return an output port to which archives to be exported to SESSION's store +can be written." + ;; Using the 'import-paths' RPC on a remote store would be slow because it + ;; makes a round trip every time 32 KiB have been transferred. This + ;; procedure instead opens a separate channel to use the remote + ;; 'import-paths' procedure, which consumes all the data in a single round + ;; trip. + (define import + `(begin + (use-modules (guix)) + + (with-store store + (setvbuf (current-input-port) _IONBF) + (import-paths store (current-input-port))))) + + (open-remote-output-pipe session + (string-join + `("guile" "-c" + ,(object->string + (object->string import)))))) + +(define (store-export-channel session files) + "Return an input port from which an export of FILES from SESSION's store can +be read." + ;; Same as above: this is more efficient than calling 'export-paths' on a + ;; remote store. + (define export + `(begin + (use-modules (guix)) + + (with-store store + (setvbuf (current-output-port) _IONBF) + (export-paths store ',files (current-output-port))))) + + (open-remote-input-pipe session + (string-join + `("guile" "-c" + ,(object->string + (object->string export)))))) + +(define (send-files files remote) + "Send the subset of FILES that's missing to REMOTE, a remote store." (with-store store - (guard (c ((nix-protocol-error? c) - (warning (_ "failed to export files for '~a': ~s~%") - (session-get session 'host) c) - #f)) + ;; Compute the subset of FILES missing on SESSION, and send them in + ;; topologically sorted order so that they can actually be imported. + (let* ((sorted (topologically-sorted store files)) + (session (channel-get-session (nix-server-socket remote))) + (node (make-node session)) + (missing (node-eval node + `(begin + (use-modules (guix) + (srfi srfi-1) (srfi srfi-26)) - ;; Compute the subset of FILES missing on SESSION, and send them in - ;; topologically sorted order so that they can actually be imported. - (let* ((files (missing-files (topologically-sorted store files))) - (pipe (remote-pipe session - '("guix" "archive" "--import") - #:quote? #f))) - (format #t (_ "sending ~a store files to '~a'...~%") - (length files) (session-get session 'host)) + (with-store store + (remove (cut valid-path? store <>) + ',sorted))))) + (port (store-import-channel session))) + (format #t (_ "sending ~a store files to '~a'...~%") + (length missing) (session-get session 'host)) - (export-paths store files pipe) - (channel-send-eof pipe) + (export-paths store missing port) - ;; Wait for the remote process to complete. - (let ((status (channel-get-exit-status pipe))) - (close pipe) - status))))) + ;; Tell the remote process that we're done. (In theory the + ;; end-of-archive mark of 'export-paths' would be enough, but in + ;; practice it's not.) + (channel-send-eof port) -(define (retrieve-files files session) + ;; Wait for completion of the remote process. + (let ((result (zero? (channel-get-exit-status port)))) + (close-port port) + result)))) + +(define (retrieve-files files remote) "Retrieve FILES from SESSION's store, and import them." - (define host - (session-get session 'host)) + (let* ((session (channel-get-session (nix-server-socket remote))) + (host (session-get session 'host)) + (port (store-export-channel session files))) + (format #t (_ "retrieving ~a files from '~a'...~%") + (length files) host) - (let ((pipe (remote-pipe session - `("guix" "archive" "--export" ,@files) - #:quote? #f))) - (and pipe - (with-store store - (guard (c ((nix-protocol-error? c) - (warning (_ "failed to import files from '~a': ~s~%") - host c) - #f)) - (format (current-error-port) "retrieving ~a files from '~a'...~%" - (length files) host) - - ;; We cannot use the 'import-paths' RPC here because we already - ;; hold the locks for FILES. - (restore-file-set pipe - #:log-port (current-error-port) - #:lock? #f) - - (close-port pipe)))))) + ;; We cannot use the 'import-paths' RPC here because we already + ;; hold the locks for FILES. + (let ((result (restore-file-set port + #:log-port (current-error-port) + #:lock? #f))) + (close-port port) + result))) ;;; From bc1ad4e334fbf5239ed8d617751e9fa7dbe0ab23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 25 Nov 2016 22:47:37 +0100 Subject: [PATCH 008/130] offload: Drop 'remote-pipe'. * guix/scripts/offload.scm (remote-pipe): Remove. (machine-load): Use 'open-remote-pipe*' instead of 'remote-pipe'. --- guix/scripts/offload.scm | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 1821bb5b7a..2e0268020c 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -249,26 +249,6 @@ an SSH session. Return a object." (object->string redirect))))) (open-connection #:port channel))) -(define* (remote-pipe session command - #:key (quote? #t)) - "Run COMMAND (a list) on SESSION, and return an open input/output port, -which is also an SSH channel. When QUOTE? is true, perform shell-quotation of -all the elements of COMMAND." - (define (shell-quote str) - ;; Sort-of shell-quote STR so it can be passed as an argument to the - ;; shell. - (with-output-to-string - (lambda () - (write str)))) - - (let* ((channel (make-channel session))) - (channel-open-session channel) - (channel-request-exec channel - (string-join (if quote? - (map shell-quote command) - command))) - channel)) - ;;; ;;; Synchronization. @@ -511,7 +491,8 @@ be read." "Return the load of MACHINE, divided by the number of parallel builds allowed on MACHINE." (let* ((session (open-ssh-session machine)) - (pipe (remote-pipe session '("cat" "/proc/loadavg"))) + (pipe (open-remote-pipe* session OPEN_READ + "cat" "/proc/loadavg")) (line (read-line pipe))) (close-port pipe) From e44b511298590ecc87c2c85d1cbc043a638dd1e0 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 24 Nov 2016 21:58:40 +0100 Subject: [PATCH 009/130] gnu: ldc: Update to 0.17.2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/ldc.scm (ldc): Update to 0.17.2. * gnu/packages/patches/ldc-disable-tests.patch: Fix timezone file name. Signed-off-by: Ludovic Courtès --- gnu/packages/ldc.scm | 19 ++++---- gnu/packages/patches/ldc-disable-tests.patch | 50 +++++++------------- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/gnu/packages/ldc.scm b/gnu/packages/ldc.scm index 560fa497fb..8d3368a58b 100644 --- a/gnu/packages/ldc.scm +++ b/gnu/packages/ldc.scm @@ -76,7 +76,7 @@ and freshness without requiring additional information from the user.") (define-public ldc (package (name "ldc") - (version "0.16.1") + (version "0.17.2") (source (origin (method url-fetch) (uri (string-append @@ -85,10 +85,9 @@ and freshness without requiring additional information from the user.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1jvilxx0rpqmkbja4m69fhd5g09697xq7vyqp2hz4hvxmmmv4j40")))) + "0iksl6cvhsiwnlh15b7s9v8f3grxk27jn0vja9n4sad7fvfwmmlc")))) (build-system cmake-build-system) - ;; LDC currently only supports the x86_64 and i686 architectures. - (supported-systems '("x86_64-linux" "i686-linux")) + (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux")) (arguments `(#:phases (modify-phases %standard-phases @@ -127,8 +126,10 @@ and freshness without requiring additional information from the user.") ("tzdata" ,tzdata) ("zlib" ,zlib))) (native-inputs - `(("llvm" ,llvm-3.7) - ("clang" ,clang-3.7) + `(("llvm" ,llvm) + ("clang" ,clang) + ("python-lit" ,python-lit) + ("python-wrapper" ,python-wrapper) ("unzip" ,unzip) ("phobos-src" ,(origin @@ -138,7 +139,7 @@ and freshness without requiring additional information from the user.") version ".tar.gz")) (sha256 (base32 - "0sgdj0536c4nb118yiw1f8lqy5d3g3lpg9l99l165lk9xy45l9z4")) + "07hh3ic3r755mq9hn9gfr0wlc5y8cr91xz2ydb6gqy4zy8jgp5s9")) (patches (search-patches "ldc-disable-tests.patch")))) ("druntime-src" ,(origin @@ -148,7 +149,7 @@ and freshness without requiring additional information from the user.") version ".tar.gz")) (sha256 (base32 - "0z4mkyddx6c4sy1vqgqvavz55083dsxws681qkh93jh1rpby9yg6")))) + "1m1dhday9dl3s04njmd29z7ism2xn2ksb9qlrwzykdgz27b3dk6x")))) ("dmd-testsuite-src" ,(origin (method url-fetch) @@ -157,7 +158,7 @@ and freshness without requiring additional information from the user.") version ".tar.gz")) (sha256 (base32 - "0yc6miidzgl9k33ygk7xcppmfd6kivqj02cvv4fmkbs3qz4yy3z1")))))) + "0n7gvalxwfmia4gag53r9qhcnk2cqrw3n4icj1yri0zkgc27pm60")))))) (home-page "http://wiki.dlang.org/LDC") (synopsis "LLVM compiler for the D programming language") (description diff --git a/gnu/packages/patches/ldc-disable-tests.patch b/gnu/packages/patches/ldc-disable-tests.patch index 3f5e6c29a1..bdd6e5b76c 100644 --- a/gnu/packages/patches/ldc-disable-tests.patch +++ b/gnu/packages/patches/ldc-disable-tests.patch @@ -4,19 +4,9 @@ two others use networking. Not bad out of almost 700 tests! by Pjotr Prins -diff --git a/std/datetime.d b/std/datetime.d -index 8e4ed3b..6c15bc5 100644 ---- a/std/datetime.d -+++ b/std/datetime.d -@@ -28018,6 +28018,7 @@ public: - The default directory where the TZ Database files are. It's empty - for Windows, since Windows doesn't have them. - +/ -+ - enum defaultTZDatabaseDir = "/usr/share/zoneinfo/"; - } - else version(Windows) -@@ -28069,14 +28070,13 @@ assert(tz.dstName == "PDT"); +--- a/std/datetime.d.orig 2016-11-24 01:13:52.584495545 +0100 ++++ b/std/datetime.d 2016-11-24 01:17:09.655306728 +0100 +@@ -28081,22 +28081,24 @@ import std.range : retro; import std.format : format; @@ -25,9 +15,20 @@ index 8e4ed3b..6c15bc5 100644 enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir))); enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir))); -- immutable file = buildNormalizedPath(tzDatabaseDir, name); -+ auto filename = "./" ~ strip(name); // make sure the prefix is not stripped -+ immutable file = buildNormalizedPath(tzDatabaseDir, filename); + version(Android) + { ++ name = strip(name); + auto tzfileOffset = name in tzdataIndex(tzDatabaseDir); + enforce(tzfileOffset, new DateTimeException(format("The time zone %s is not listed.", name))); + string tzFilename = separate_index ? "zoneinfo.dat" : "tzdata"; + immutable file = buildNormalizedPath(tzDatabaseDir, tzFilename); + } + else +- immutable file = buildNormalizedPath(tzDatabaseDir, name); ++ { ++ auto filename = "./" ~ strip(name); // make sure the prefix is not stripped ++ immutable file = buildNormalizedPath(tzDatabaseDir, filename); ++ } - enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file))); + enforce(file.exists(), new DateTimeException(format("File %s does not exist in %s.", file, tzDatabaseDir))); @@ -54,23 +55,6 @@ diff --git a/std/socket.d b/std/socket.d index b85d1c9..7fbf346 100644 --- a/std/socket.d +++ b/std/socket.d -@@ -517,6 +517,8 @@ class Protocol - - unittest - { -+ pragma(msg, "test disabled on GNU Guix"); -+/* - // getprotobyname,number are unimplemented on Android - softUnittest({ - Protocol proto = new Protocol; -@@ -530,6 +532,7 @@ unittest - assert(proto.name == "tcp"); - assert(proto.aliases.length == 1 && proto.aliases[0] == "TCP"); - }); -+*/ - } - - @@ -859,6 +862,8 @@ class InternetHost unittest From 0959478c726a3117da815f47c0ce92e4588a8ac4 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Fri, 25 Nov 2016 23:17:30 -0500 Subject: [PATCH 010/130] gnu: Add missing module import to (gnu packages ldc). This is a followup to commit e44b511298590ecc87c2c85d1cbc043a638dd1e0. * gnu/packages/ldc.scm: Import (gnu packages python). --- gnu/packages/ldc.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/ldc.scm b/gnu/packages/ldc.scm index 8d3368a58b..6ea7f664bd 100644 --- a/gnu/packages/ldc.scm +++ b/gnu/packages/ldc.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages libedit) #:use-module (gnu packages llvm) + #:use-module (gnu packages python) #:use-module (gnu packages textutils) #:use-module (gnu packages zip)) From f88371e86602a9b3d86f2030709f719778613552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Mon, 21 Nov 2016 20:41:17 +0800 Subject: [PATCH 011/130] services: Add opensmtpd service. * gnu/services/mail.scm (): New record type. (%default-opensmtpd-config-file, %opensmtpd-accounts): New variables. (opensmtpd-shepherd-service, opensmtpd-activation): New procedures. (opensmtpd-service-type): New variable. * doc/guix.texi (Mail Services): Document it. --- doc/guix.texi | 42 +++++++++++++++++----- gnu/services/mail.scm | 82 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 10 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b8e37055e6..137fec8d7a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10075,16 +10075,11 @@ For MariaDB, the root password is empty. @cindex mail @cindex email The @code{(gnu services mail)} module provides Guix service definitions -for mail services. Currently the only implemented service is Dovecot, -an IMAP, POP3, and LMTP server. +for email services: IMAP, POP3, and LMTP servers, as well as mail +transport agents (MTAs). Lots of acronyms! These services are detailed +in the subsections below. -Guix does not yet have a mail transfer agent (MTA), although for some -lightweight purposes the @code{esmtp} relay-only MTA may suffice. Help -is needed to properly integrate a full MTA, such as Postfix. Patches -welcome! - -To add an IMAP/POP3 server to a GuixSD system, add a -@code{dovecot-service} to the operating system definition: +@subsubheading Dovecot Service @deffn {Scheme Procedure} dovecot-service [#:config (dovecot-configuration)] Return a service that runs the Dovecot IMAP/POP3/LMTP mail server. @@ -11440,6 +11435,35 @@ could instantiate a dovecot service like this: (string ""))) @end example +@subsubheading OpenSMTPD Service + +@deffn {Scheme Variable} opensmtpd-service-type +This is the type of the @uref{https://www.opensmtpd.org, OpenSMTPD} +service, whose value should be an @code{opensmtpd-configuration} object +as in this example: + +@example +(service opensmtpd-service-type + (opensmtpd-configuration + (config-file (local-file "./my-smtpd.conf")))) +@end example +@end deffn + +@deftp {Data Type} opensmtpd-configuration +Data type regresenting the configuration of opensmtpd. + +@table @asis +@item @code{package} (default: @var{opensmtpd}) +Package object of the OpenSMTPD SMTP server. + +@item @code{config-file} (default: @var{%default-opensmtpd-file}) +File-like object of the OpenSMTPD configuration file to use. By default +it listens on the loopback network interface, and allows for mail from +users and daemons on the local machine, as well as permitting email to +remote servers. Run @command{man smtpd.conf} for more information. + +@end table +@end deftp @node Kerberos Services @subsubsection Kerberos Services diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index cb0f119f43..f7ab9516ba 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -51,7 +51,12 @@ protocol-configuration plugin-configuration mailbox-configuration - namespace-configuration)) + namespace-configuration + + opensmtpd-configuration + opensmtpd-configuration? + opensmtpd-service-type + %default-opensmtpd-config-file)) ;;; Commentary: ;;; @@ -1691,3 +1696,78 @@ by @code{dovecot-configuration}. @var{config} may also be created by (format #t "@end deftypevr\n\n"))) fields)))) (generate 'dovecot-configuration)) + + +;;; +;;; OpenSMTPD. +;;; + +(define-record-type* + opensmtpd-configuration make-opensmtpd-configuration + opensmtpd-configuration? + (package opensmtpd-configuration-package + (default opensmtpd)) + (config-file opensmtpd-configuration-config-file + (default %default-opensmtpd-config-file))) + +(define %default-opensmtpd-config-file + (plain-file "smtpd.conf" " +listen on lo +accept from any for local deliver to mbox +accept from local for any relay +")) + +(define opensmtpd-shepherd-service + (match-lambda + (($ package config-file) + (list (shepherd-service + (provision '(smtpd)) + (requirement '(loopback)) + (documentation "Run the OpenSMTPD daemon.") + (start (let ((smtpd (file-append package "/sbin/smtpd"))) + #~(make-forkexec-constructor + (list #$smtpd "-f" #$config-file) + #:pid-file "/var/run/smtpd.pid"))) + (stop #~(make-kill-destructor))))))) + +(define %opensmtpd-accounts + (list (user-group + (name "smtpq") + (system? #t)) + (user-account + (name "smtpd") + (group "nogroup") + (system? #t) + (comment "SMTP Daemon") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))) + (user-account + (name "smtpq") + (group "smtpq") + (system? #t) + (comment "SMTPD Queue") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define opensmtpd-activation + (match-lambda + (($ package config-file) + (let ((smtpd (file-append package "/sbin/smtpd"))) + #~(begin + ;; Create mbox and spool directories. + (mkdir-p "/var/mail") + (mkdir-p "/var/spool/smtpd") + (chmod "/var/spool/smtpd" #o711)))))) + +(define opensmtpd-service-type + (service-type + (name 'opensmtpd) + (extensions + (list (service-extension account-service-type + (const %opensmtpd-accounts)) + (service-extension activation-service-type + opensmtpd-activation) + (service-extension profile-service-type + (compose list opensmtpd-configuration-package)) + (service-extension shepherd-root-service-type + opensmtpd-shepherd-service))))) From c940b8e682ef375f46c69ede4218d0a4d75317b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sat, 26 Nov 2016 12:47:14 +0800 Subject: [PATCH 012/130] doc: mysql-configuration: Fix typo. * doc/guix.texi (Database Services): Fix typo of 'mysql-configuration'. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 137fec8d7a..5747484b20 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10053,7 +10053,7 @@ Return a service that runs @command{mysqld}, the MySQL or MariaDB database server. The optional @var{config} argument specifies the configuration for -@command{mysqld}, which should be a @code{} object. +@command{mysqld}, which should be a @code{} object. @end deffn @deftp {Data Type} mysql-configuration From 53d892dd92d48b5f496af6c581084c38e0b11320 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 26 Nov 2016 00:34:21 -0500 Subject: [PATCH 013/130] gnu: imagemagick: Update to 6.9.6-6 [fixes CVE-2016-9556]. * gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.6-6. --- gnu/packages/imagemagick.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/imagemagick.scm b/gnu/packages/imagemagick.scm index 99d8b76299..4e70212133 100644 --- a/gnu/packages/imagemagick.scm +++ b/gnu/packages/imagemagick.scm @@ -43,14 +43,14 @@ (define-public imagemagick (package (name "imagemagick") - (version "6.9.6-5") + (version "6.9.6-6") (source (origin (method url-fetch) (uri (string-append "mirror://imagemagick/ImageMagick-" version ".tar.xz")) (sha256 (base32 - "037lg2m0y5b17lyi34jdlkq4h03ck67j5m6wr84nvwd3jfx240cd")))) + "02hd0xvpm99wrix2didg8xnra4fla04y9vaks2vnijry3l0gxlcw")))) (build-system gnu-build-system) (arguments `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch") From 75675e4556fe4779687251d0a792925a11a7305c Mon Sep 17 00:00:00 2001 From: ng0 Date: Wed, 23 Nov 2016 22:23:52 +0000 Subject: [PATCH 014/130] mailmap: Associate all commits by ng0 with ng0. Signed-off-by: Leo Famulari --- .mailmap | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index 85f502161b..ada5026ba3 100644 --- a/.mailmap +++ b/.mailmap @@ -30,10 +30,11 @@ Ludovic Courtès Mathieu Lirzin Mathieu Lirzin Nikita Karetnikov -ng0 -ng0 -ng0 -ng0 +ng0 +ng0 +ng0 +ng0 +ng0 Pjotr Prins Pjotr Prins Raimon Grau From fc5dc4e81cacc4e0dcd81863e505ce5b314264c6 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 24 Nov 2016 08:15:55 +0100 Subject: [PATCH 015/130] gnu: Whitespace changes * gnu/services/kerberos.scm: Fold lines to 80 character limit. --- gnu/services/kerberos.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnu/services/kerberos.scm b/gnu/services/kerberos.scm index 144c71bba0..a56f63082c 100644 --- a/gnu/services/kerberos.scm +++ b/gnu/services/kerberos.scm @@ -38,15 +38,17 @@ "Return a PAM service for Kerberos authentication." (lambda (pam) (define pam-krb5-module - #~(string-append #$(pam-krb5-configuration-pam-krb5 config) "/lib/security/pam_krb5.so")) + #~(string-append #$(pam-krb5-configuration-pam-krb5 config) + "/lib/security/pam_krb5.so")) (let ((pam-krb5-sufficient (pam-entry (control "sufficient") (module pam-krb5-module) - (arguments (list - (format #f "minimum_uid=~a" - (pam-krb5-configuration-minimum-uid config))))))) + (arguments + (list + (format #f "minimum_uid=~a" + (pam-krb5-configuration-minimum-uid config))))))) (pam-service (inherit pam) (auth (cons* pam-krb5-sufficient From d3eff97afd08ae2976a3aa80760ef2ba8025e1d6 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 25 Nov 2016 15:29:08 +0100 Subject: [PATCH 016/130] gnu: Add python-polib. * gnu/packages/python.scm (python-polib, python2-polib): New variables. Signed-off-by: Marius Bakke --- gnu/packages/python.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5e8956f946..83ef3727f8 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -31,6 +31,7 @@ ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016 Alex Vong ;;; Copyright © 2016 Arun Isaac +;;; Copyright © 2016 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -1426,6 +1427,31 @@ backported for previous versions of Python from 2.4 to 3.3.") syntax.") (license license:x11))) +(define-public python-polib + (package + (name "python-polib") + (version "1.0.8") + (source (origin + (method url-fetch) + (uri (pypi-uri "polib" version)) + (sha256 + (base32 + "1pq2hbm3m2q0cjdszk8mc4qa1vl3wcblh5nfyirlfnzb2pcy7zss")))) + (build-system python-build-system) + (home-page "https://bitbucket.org/izi/polib/wiki/Home") + (synopsis "Manipulate, create and modify gettext files") + (description "Polib can manipulate any gettext format (po, pot and mo) +files. It can be used to create po files from scratch or to modify +existing ones.") + (license license:expat))) + +(define-public python2-polib + (let ((base (package-with-python2 (strip-python2-variant python-polib)))) + (package + (inherit base) + (arguments `(,@(package-arguments base) + ;; Tests don't work with python2. + #:tests? #f))))) (define-public scons (package From 31a9d653ad37c9f00b601cfe4a95d90c35c09223 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sat, 26 Nov 2016 14:59:30 +1000 Subject: [PATCH 017/130] gnu: Add proteinortho. * gnu/packages/bioinformatics.scm (proteinortho): New variable. --- gnu/packages/bioinformatics.scm | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 773b5909b6..308931f3d8 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -3693,6 +3693,58 @@ for sequences to be aligned and then, simultaneously with the alignment, predicts the locations of structural units in the sequences.") (license license:gpl2+))) +(define-public proteinortho + (package + (name "proteinortho") + (version "5.15") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://www.bioinf.uni-leipzig.de/Software/proteinortho/proteinortho_v" + version "_src.tar.gz")) + (sha256 + (base32 + "05wacnnbx56avpcwhzlcf6b7s77swcpv3qnwz5sh1z54i51gg2ki")))) + (build-system gnu-build-system) + (arguments + `(#:test-target "test" + #:phases + (modify-phases %standard-phases + (replace 'configure + ;; There is no configure script, so we modify the Makefile directly. + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "Makefile" + (("INSTALLDIR=.*") + (string-append + "INSTALLDIR=" (assoc-ref outputs "out") "/bin\n"))) + #t)) + (add-before 'install 'make-install-directory + ;; The install directory is not created during 'make install'. + (lambda* (#:key outputs #:allow-other-keys) + (mkdir-p (string-append (assoc-ref outputs "out") "/bin")) + #t)) + (add-after 'install 'wrap-programs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((path (getenv "PATH")) + (out (assoc-ref outputs "out")) + (binary (string-append out "/bin/proteinortho5.pl"))) + (wrap-program binary `("PATH" ":" prefix (,path)))) + #t))))) + (inputs + `(("perl" ,perl) + ("python" ,python-2) + ("blast+" ,blast+))) + (home-page "http://www.bioinf.uni-leipzig.de/Software/proteinortho") + (synopsis "Detect orthologous genes across species") + (description + "Proteinortho is a tool to detect orthologous genes across different +species. For doing so, it compares similarities of given gene sequences and +clusters them to find significant groups. The algorithm was designed to handle +large-scale data and can be applied to hundreds of species at once.") + (license license:gpl2+))) + (define-public pyicoteo (package (name "pyicoteo") From 5e0a0f4226b1f146fe74c8347fc983ef9ac0d271 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sat, 26 Nov 2016 19:00:17 +1000 Subject: [PATCH 018/130] gnu: roary: Update to 3.7.0. * gnu/packages/bioinformatics.scm (roary): Update to 3.7.0. --- gnu/packages/bioinformatics.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 308931f3d8..8d2cb93c7c 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -3817,7 +3817,7 @@ partial genes, and identifies translation initiation sites.") (define-public roary (package (name "roary") - (version "3.6.8") + (version "3.7.0") (source (origin (method url-fetch) @@ -3826,7 +3826,7 @@ partial genes, and identifies translation initiation sites.") version ".tar.gz")) (sha256 (base32 - "0g0pzcv8y7n2w8q7c9q0a7s2ghkwci6w8smg9mjw4agad5cd7yaw")))) + "0x2hpb3nfsc6x2nq1788w0fhqfzc7cn2dp4xwyva9m3k6xlz0m43")))) (build-system perl-build-system) (arguments `(#:phases From 4f55441fe3cd3ed809f6ba1278eeed3522a333d2 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 25 Nov 2016 03:27:40 +0100 Subject: [PATCH 019/130] gnu: transmission: Update to 2.92. * gnu/packages/bittorrent.scm (transmission): Update to 2.92. [inputs]: Add cyrus-sasl. --- gnu/packages/bittorrent.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm index ad67e02270..eff1b5a1c4 100644 --- a/gnu/packages/bittorrent.scm +++ b/gnu/packages/bittorrent.scm @@ -49,7 +49,7 @@ (define-public transmission (package (name "transmission") - (version "2.84") + (version "2.92") (source (origin (method url-fetch) (uri (string-append @@ -57,7 +57,7 @@ version ".tar.xz")) (sha256 (base32 - "1sxr1magqb5s26yvr5yhs1f7bmir8gl09niafg64lhgfnhv1kz59")))) + "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s")))) (build-system glib-or-gtk-build-system) (outputs '("out" ; library and command-line interface "gui")) ; graphical user interface @@ -84,6 +84,7 @@ `(("inotify-tools" ,inotify-tools) ("libevent" ,libevent) ("curl" ,curl) + ("cyrus-sasl" ,cyrus-sasl) ("openssl" ,openssl) ("file" ,file) ("zlib" ,zlib) From faa29e4bdb44ff609b73fe0b38ef44322840a876 Mon Sep 17 00:00:00 2001 From: ng0 Date: Tue, 22 Nov 2016 23:31:25 +0000 Subject: [PATCH 020/130] gnu: Add mumble. * gnu/packages/telephony.scm (mumble): New variable. Signed-off-by: Marius Bakke --- gnu/packages/telephony.scm | 112 +++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 3d5e58ec2d..6597d26096 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2015 Efraim Flashner ;;; Copyright © 2016 Lukas Gradl ;;; Copyright © 2016 Francesco Frassinelli +;;; Copyright © 2016 ng0 ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,13 +25,20 @@ (define-module (gnu packages telephony) #:use-module (gnu packages) #:use-module (gnu packages autotools) + #:use-module (gnu packages avahi) + #:use-module (gnu packages boost) + #:use-module (gnu packages protobuf) #:use-module (gnu packages gnupg) #:use-module (gnu packages linux) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages speech) #:use-module (gnu packages tls) #:use-module (gnu packages xiph) + #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) @@ -287,3 +295,107 @@ lists. All you need to join an existing conference is the host name or IP address of one of the participants.") (home-page "http://holdenc.altervista.org/seren/") (license license:gpl3+))) + +(define-public mumble + (package + (name "mumble") + (version "1.2.17") + (source (origin + (method url-fetch) + (uri (string-append "https://mumble.info/snapshot/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "176br3b0pv5sz3zvgzsz9rxr3n79irlm902h7n1wh4f6vbph2dhw")) + (modules '((guix build utils))) + (snippet + `(begin + ;; Remove bundled software. + (for-each delete-file-recursively '("3rdparty" + "speex" + "speexbuild" + "opus-build" + "opus-src" + "sbcelt-helper-build" + "sbcelt-lib-build" + "sbcelt-src")) + ;; TODO: Celt is still bundled. It has been merged into Opus + ;; and will be removed after 1.3.0. + ;; https://github.com/mumble-voip/mumble/issues/1999 + #t)))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no "check" target + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "qmake" "main.pro" "-recursive" + (string-append "CONFIG+=" + (string-join + (list "no-update" + "no-server" + "no-embed-qt-translations" + "no-bundled-speex" + "pch" + "no-bundled-opus" + "no-celt" + "no-alsa" + "no-oss" + "no-portaudio" + "speechd" + "no-g15" + "no-bonjour" + "release"))) + (string-append "DEFINES+=" + "PLUGIN_PATH=" + (assoc-ref outputs "out") + "/lib/mumble"))))) + (add-before 'configure 'fix-libspeechd-include + (lambda _ + (substitute* "src/mumble/TextToSpeech_unix.cpp" + (("libspeechd.h") "speech-dispatcher/libspeechd.h")))) + (replace 'install ; install phase does not exist + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (services (string-append out "/share/services")) + (applications (string-append out "/share/applications")) + (icons (string-append out "/share/icons/hicolor/scalable/apps")) + (man (string-append out "/share/man/man1")) + (lib (string-append out "/lib/mumble"))) + (install-file "release/mumble" bin) + (install-file "scripts/mumble-overlay" bin) + (install-file "scripts/mumble.protocol" services) + (install-file "scripts/mumble.desktop" applications) + (install-file "icons/mumble.svg" icons) + (install-file "man/mumble-overlay.1" man) + (install-file "man/mumble.1" man) + (for-each (lambda (file) (install-file file lib)) + (find-files "." "\\.so\\.")) + (for-each (lambda (file) (install-file file lib)) + (find-files "release/plugins" "\\.so$")))))))) + (inputs + `(("avahi" ,avahi) + ("protobuf" ,protobuf) + ("openssl" ,openssl) + ("libsndfile" ,libsndfile) + ("boost" ,boost) + ("opus" ,opus) + ("speex" ,speex) + ("speech-dispatcher" ,speech-dispatcher) + ("libx11" ,libx11) + ("libxi" ,libxi) + ("qt-4" ,qt-4) + ("alsa-lib" ,alsa-lib) + ("pulseaudio" ,pulseaudio))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (synopsis "Low-latency, high quality voice chat software") + (description + "Mumble is an low-latency, high quality voice chat +software primarily intended for use while gaming.") + (home-page "https://wiki.mumble.info/wiki/Main_Page") + (license (list license:bsd-3 + ;; The bundled celt is bsd-2. Remove after 1.3.0. + license:bsd-2)))) From 5aed7f10f322e93407b925293e72bcefdbc79599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sat, 26 Nov 2016 21:44:37 +0800 Subject: [PATCH 021/130] pull: Add guile-ssh to the dependencies. Fix regression introduced in 9e76eed. * build-aux/build-self.scm (guile-ssh): New variable. (build)[builder]: Add 'guile-ssh' to %load-path and %load-compiled-path. --- build-aux/build-self.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 59028305e7..485f91b4c0 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -61,6 +61,8 @@ (define guile-json (first (find-best-packages-by-name "guile-json" #f))) +(define guile-ssh + (first (find-best-packages-by-name "guile-ssh" #f))) ;; The actual build procedure. @@ -103,8 +105,14 @@ files." (use-modules (guix build pull)) (let ((json (string-append #$guile-json "/share/guile/site/2.0"))) - (set! %load-path (cons json %load-path)) - (set! %load-compiled-path (cons json %load-compiled-path))) + (set! %load-path + (cons* json + (string-append #$guile-ssh "/share/guile/site/2.0") + %load-path)) + (set! %load-compiled-path + (cons* json + (string-append #$guile-ssh "/lib/guile/2.0/site-ccache") + %load-compiled-path))) (build-guix #$output #$source From b2e6e150aaa4bf5a3fb5712320b2321768fb29c3 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 26 Nov 2016 14:51:20 +0100 Subject: [PATCH 022/130] gnu: python-simplejson: Update to 3.10.0. * gnu/packages/python.scm (python-simplejson): Update to 3.10.0. Signed-off-by: Marius Bakke --- gnu/packages/python.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 83ef3727f8..418a644d08 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -1181,14 +1181,14 @@ after Andy Lester’s Perl module WWW::Mechanize.") (define-public python-simplejson (package (name "python-simplejson") - (version "3.8.2") + (version "3.10.0") (source (origin (method url-fetch) (uri (pypi-uri "simplejson" version)) (sha256 (base32 - "0zylrnax8b6r0ndgni4w9c599fi6wm9vx5g6k3ddqfj3932kk16m")))) + "1qhwsykjlb85igb4cfl6v6gkprzbbg8gyqdd7zscc8w3x0ifcfwm")))) (build-system python-build-system) (home-page "http://simplejson.readthedocs.org/en/latest/") (synopsis From 61684de28798a4baea952ebfdf398bbc315a7b48 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 26 Nov 2016 14:51:21 +0100 Subject: [PATCH 023/130] gnu: python-pyopenssl: Update to 16.2.0. * gnu/packages/python.scm (python-pyopenssl): Update to 16.2.0. Signed-off-by: Marius Bakke --- gnu/packages/python.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 418a644d08..ad279347a8 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -6723,14 +6723,14 @@ message digests and key derivation functions.") (define-public python-pyopenssl (package (name "python-pyopenssl") - (version "16.1.0") + (version "16.2.0") (source (origin (method url-fetch) (uri (pypi-uri "pyOpenSSL" version)) (sha256 (base32 - "0prm06zz7hl6bk5s2lqzw25lq6smayfv2fgiliw2rbqxlyiavxw8")))) + "0vji4yrfshs15xpczbhzhasnjrwcarsqg87n98ixnyafnyxs6ybp")))) (build-system python-build-system) (propagated-inputs `(("python-cryptography" ,python-cryptography) From c6c80104ab4dcaa8c754b72a3b82735f436e20cc Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 26 Nov 2016 14:51:22 +0100 Subject: [PATCH 024/130] gnu: python-flask: Update to 0.11.1. * gnu/packages/python.scm (python-flask): Update to 0.11.1. [native-inputs]: Add python-click. Signed-off-by: Marius Bakke --- gnu/packages/python.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index ad279347a8..497da52264 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -9558,18 +9558,20 @@ useful for solving the Assignment Problem.") (define-public python-flask (package (name "python-flask") - (version "0.10.1") + (version "0.11.1") (source (origin (method url-fetch) (uri (pypi-uri "Flask" version)) (sha256 (base32 - "0wrkavjdjndknhp8ya8j850jq7a1cli4g5a93mg8nh1xz2gq50sc")))) + "03kbfll4sj3v5z7r31c7bhfpi11r1np076d4p1k2kg4yzcmkywdl")))) (build-system python-build-system) (propagated-inputs `(("python-itsdangerous" ,python-itsdangerous) ("python-jinja2" ,python-jinja2) ("python-werkzeug" ,python-werkzeug))) + (native-inputs + `(("python-click" ,python-click))) (home-page "https://github.com/mitsuhiko/flask/") (synopsis "Microframework based on Werkzeug, Jinja2 and good intentions") (description "Flask is a micro web framework based on the Werkzeug toolkit From eaa45301f46f13a3f71bcae6089d312f31174801 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sat, 26 Nov 2016 13:18:01 -0500 Subject: [PATCH 025/130] gnu: psyclpc: Upgrade to 20160821-2.61cf9aa. This makes the package reproducible. * gnu/packages/psyc.scm (psyclpc): Upgrade to 20160821-2.61cf9aa. Signed-off-by: Leo Famulari --- gnu/packages/psyc.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/packages/psyc.scm b/gnu/packages/psyc.scm index 03df188d1d..1a99a06001 100644 --- a/gnu/packages/psyc.scm +++ b/gnu/packages/psyc.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016 ng0 +;;; Copyright © 2016 ng0 ;;; ;;; This file is part of GNU Guix. ;;; @@ -155,8 +155,8 @@ including psyced.") ;; This commit removes the historic bundled pcre, not released as a tarball so far. (define-public psyclpc - (let* ((commit "8bd51f2a4847860ba8b82dc79348ab37d516011e") - (revision "1")) + (let* ((commit "61cf9aa81297085e5c40170fd01221c752f8deba") + (revision "2")) (package (name "psyclpc") (version (string-append "20160821-" revision "." (string-take commit 7))) @@ -168,7 +168,7 @@ including psyced.") (file-name (string-append name "-" version "-checkout")) (sha256 (base32 - "10w4kx9ygcv1lcmd7j4knvjiy8dac1y3hjfv3lhp67jpv6w3iagz")))) + "1viwqymbhn3cwvx0zl58rlzl5gw47zxn0ldg2nbi55ghm5zxl1z5")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; There are no tests/checks. From ebfc2ecc3c6ac4ea2a853154aba34a86c6a06742 Mon Sep 17 00:00:00 2001 From: ng0 Date: Wed, 23 Nov 2016 19:04:37 +0000 Subject: [PATCH 026/130] gnu: Move content of (gnu packages psyc) into (gnu packages messaging). * gnu/packages/psyc.scm (perl-net-psyc, libpsyc, psyclpc): Move this ... * gnu/packages/messaging.scm (perl-net-psyc, libpsyc, psyclpc): ... here. * gnu/local.mk (GNU_SYSTEM_MODULES): Remove psyc.scm. Signed-off-by: Leo Famulari --- gnu/local.mk | 1 - gnu/packages/messaging.scm | 196 +++++++++++++++++++++++++++++++- gnu/packages/psyc.scm | 227 ------------------------------------- 3 files changed, 195 insertions(+), 229 deletions(-) delete mode 100644 gnu/packages/psyc.scm diff --git a/gnu/local.mk b/gnu/local.mk index 49137277f1..1b2bb4786d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -305,7 +305,6 @@ GNU_SYSTEM_MODULES = \ %D%/packages/pumpio.scm \ %D%/packages/pretty-print.scm \ %D%/packages/protobuf.scm \ - %D%/packages/psyc.scm \ %D%/packages/pv.scm \ %D%/packages/python.scm \ %D%/packages/qemu.scm \ diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 72b89067f0..02e51629ac 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2015 Andreas Enge ;;; Copyright © 2015, 2016 Ricardo Wurmus ;;; Copyright © 2015 Efraim Flashner -;;; Copyright © 2016 ng0 +;;; Copyright © 2016 ng0 ;;; Copyright © 2016 Andy Patterson ;;; Copyright © 2016 Clément Lassieur ;;; @@ -33,6 +33,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system python) + #:use-module (guix build-system perl) #:use-module (gnu packages) #:use-module (gnu packages aidc) #:use-module (gnu packages autotools) @@ -43,11 +44,13 @@ #:use-module (gnu packages databases) #:use-module (gnu packages documentation) #:use-module (gnu packages enchant) + #:use-module (gnu packages gettext) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages xorg) #:use-module (gnu packages xdisorg) #:use-module (gnu packages libcanberra) + #:use-module (gnu packages man) #:use-module (gnu packages networking) #:use-module (gnu packages libidn) #:use-module (gnu packages lua) @@ -57,6 +60,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages glib) #:use-module (gnu packages python) + #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages tcl) #:use-module (gnu packages compression) @@ -67,8 +71,10 @@ #:use-module (gnu packages icu4c) #:use-module (gnu packages qt) #:use-module (gnu packages video) + #:use-module (gnu packages web) #:use-module (gnu packages xiph) #:use-module (gnu packages audio) + #:use-module (gnu packages bison) #:use-module (gnu packages fontutils)) (define-public libotr @@ -859,4 +865,192 @@ into existing applications.") (home-page "https://camaya.net/gloox") (license license:gpl3))) +(define-public perl-net-psyc + (package + (name "perl-net-psyc") + (version "1.1") + (source + (origin + (method url-fetch) + (uri (string-append "http://perlpsyc.psyc.eu/" + "perlpsyc-" version ".zip")) + (file-name (string-append name "-" version ".zip")) + (sha256 + (base32 + "1lw6807qrbmvzbrjn1rna1dhir2k70xpcjvyjn45y35hav333a42")) + ;; psycmp3 currently depends on MP3::List and rxaudio (shareware), + ;; we can add it back when this is no longer the case. + (snippet '(delete-file "contrib/psycmp3")))) + (build-system perl-build-system) + (inputs + `(("perl-curses" ,perl-curses) + ("perl-io-socket-ssl" ,perl-io-socket-ssl))) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) ; No configure script + ;; There is a Makefile, but it does not install everything + ;; (leaves out psycion) and says + ;; "# Just to give you a rough idea". XXX: Fix it upstream. + (replace 'build + (lambda _ + (zero? (system* "make" "manuals")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (string-append out "/share/doc/perl-net-psyc")) + (man1 (string-append out "/share/man/man1")) + (man3 (string-append out "/share/man/man3")) + (bin (string-append out "/bin")) + (libpsyc (string-append out "/lib/psyc/ion")) + (libperl (string-append out "/lib/perl5/site_perl/" + ,(package-version perl)))) + + (copy-recursively "lib/perl5" libperl) + (copy-recursively "lib/psycion" libpsyc) + (copy-recursively "bin" bin) + (install-file "cgi/psycpager" (string-append doc "/cgi")) + (copy-recursively "contrib" (string-append doc "/contrib")) + (copy-recursively "hooks" (string-append doc "/hooks")) + (copy-recursively "sdj" (string-append doc "/sdj")) + (install-file "README.txt" doc) + (install-file "TODO.txt" doc) + (copy-recursively "share/man/man1" man1) + (copy-recursively "share/man/man3" man3) + #t))) + (add-after 'install 'wrap-programs + (lambda* (#:key outputs #:allow-other-keys) + ;; Make sure all executables in "bin" find the Perl modules + ;; provided by this package at runtime. + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin/")) + (path (getenv "PERL5LIB"))) + (for-each (lambda (file) + (wrap-program file + `("PERL5LIB" ":" prefix (,path)))) + (find-files bin "\\.*$")) + #t)))))) + (description + "@code{Net::PSYC} with support for TCP, UDP, Event.pm, @code{IO::Select} and +Gtk2 event loops. This package includes 12 applications and additional scripts: +psycion (a @uref{http://about.psyc.eu,PSYC} chat client), remotor (a control console +for @uref{https://torproject.org,tor} router) and many more.") + (synopsis "Perl implementation of PSYC protocol") + (home-page "http://perlpsyc.psyc.eu/") + (license (list license:gpl2 + (package-license perl) + ;; contrib/irssi-psyc.pl: + license:public-domain + ;; bin/psycplay states AGPL with no version: + license:agpl3+)))) + +(define-public libpsyc + (package + (name "libpsyc") + (version "20160913") + (source (origin + (method url-fetch) + (uri (string-append "http://www.psyced.org/files/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "14q89fxap05ajkfn20rnhc6b1h4i3i2adyr7y6hs5zqwb2lcmc1p")))) + (build-system gnu-build-system) + (native-inputs + `(("perl" ,perl) + ("netcat" ,netcat) + ("procps" ,procps))) + (arguments + `(#:make-flags + (list "CC=gcc" + (string-append "PREFIX=" (assoc-ref %outputs "out"))) + #:phases + (modify-phases %standard-phases + ;; The rust bindings are the only ones in use, the lpc bindings + ;; are in psyclpc. The other bindings are not used by anything, + ;; the chances are high that the bindings do not even work, + ;; therefore we do not include them. + ;; TODO: Get a cargo build system in Guix. + (delete 'configure)))) ; no configure script + (home-page "http://about.psyc.eu/libpsyc") + (description + "@code{libpsyc} is a PSYC library in C which implements +core aspects of PSYC, useful for all kinds of clients and servers +including psyced.") + (synopsis "PSYC library in C") + (license license:agpl3+))) + +;; This commit removes the historic bundled pcre, not released as a tarball so far. +(define-public psyclpc + (let* ((commit "61cf9aa81297085e5c40170fd01221c752f8deba") + (revision "2")) + (package + (name "psyclpc") + (version (string-append "20160821-" revision "." (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "git://git.psyced.org/git/psyclpc") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "1viwqymbhn3cwvx0zl58rlzl5gw47zxn0ldg2nbi55ghm5zxl1z5")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; There are no tests/checks. + #:configure-flags + ;; If you have questions about this part, look at + ;; "src/settings/psyced" and the ebuild. + (list + "--enable-use-tls=yes" + "--enable-use-mccp" ; Mud Client Compression Protocol, leave this enabled. + (string-append "--prefix=" + (assoc-ref %outputs "out")) + ;; src/Makefile: Set MUD_LIB to the directory which contains + ;; the mud data. defaults to MUD_LIB = @libdir@ + (string-append "--libdir=" + (assoc-ref %outputs "out") + "/opt/psyced/world") + (string-append "--bindir=" + (assoc-ref %outputs "out") + "/opt/psyced/bin") + ;; src/Makefile: Set ERQ_DIR to directory which contains the + ;; stuff which ERQ can execute (hopefully) savely. Was formerly + ;; defined in config.h. defaults to ERQ_DIR= @libexecdir@ + (string-append "--libexecdir=" + (assoc-ref %outputs "out") + "/opt/psyced/run")) + #:phases + (modify-phases %standard-phases + (add-before 'configure 'chdir-to-src + ;; We need to pass this as env variables + ;; and manually change the directory. + (lambda _ + (chdir "src") + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "SHELL" (which "sh")) + #t))) + #:make-flags (list "install-all"))) + (inputs + `(("zlib" ,zlib) + ("openssl" ,openssl) + ("pcre" ,pcre))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("bison" ,bison) + ("gettext" ,gettext-minimal) + ("help2man" ,help2man) + ("autoconf" ,autoconf) + ("automake" ,automake))) + (home-page "http://lpc.psyc.eu/") + (synopsis "psycLPC is a multi-user network server programming language") + (description + "LPC is a bytecode language, invented to specifically implement +multi user virtual environments on the internet. This technology is used for +MUDs and also the psyced implementation of the Protocol for SYnchronous +Conferencing (PSYC). psycLPC is a fork of LDMud with some new features and +many bug fixes.") + (license license:gpl2)))) + ;;; messaging.scm ends here diff --git a/gnu/packages/psyc.scm b/gnu/packages/psyc.scm deleted file mode 100644 index 1a99a06001..0000000000 --- a/gnu/packages/psyc.scm +++ /dev/null @@ -1,227 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016 ng0 -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see . - -(define-module (gnu packages psyc) - #:use-module (guix download) - #:use-module (guix git-download) - #:use-module ((guix licenses) #:prefix license:) - #:use-module (guix packages) - #:use-module (guix build-system perl) - #:use-module (guix build-system gnu) - #:use-module (gnu packages) - #:use-module (gnu packages admin) - #:use-module (gnu packages autotools) - #:use-module (gnu packages bison) - #:use-module (gnu packages compression) - #:use-module (gnu packages gettext) - #:use-module (gnu packages linux) - #:use-module (gnu packages man) - #:use-module (gnu packages ncurses) - #:use-module (gnu packages perl) - #:use-module (gnu packages pcre) - #:use-module (gnu packages pkg-config) - #:use-module (gnu packages tls) - #:use-module (gnu packages web)) - -(define-public perl-net-psyc - (package - (name "perl-net-psyc") - (version "1.1") - (source - (origin - (method url-fetch) - (uri (string-append "http://perlpsyc.psyc.eu/" - "perlpsyc-" version ".zip")) - (file-name (string-append name "-" version ".zip")) - (sha256 - (base32 - "1lw6807qrbmvzbrjn1rna1dhir2k70xpcjvyjn45y35hav333a42")) - ;; psycmp3 currently depends on MP3::List and rxaudio (shareware), - ;; we can add it back when this is no longer the case. - (snippet '(delete-file "contrib/psycmp3")))) - (build-system perl-build-system) - (inputs - `(("perl-curses" ,perl-curses) - ("perl-io-socket-ssl" ,perl-io-socket-ssl))) - (arguments - `(#:phases - (modify-phases %standard-phases - (delete 'configure) ; No configure script - ;; There is a Makefile, but it does not install everything - ;; (leaves out psycion) and says - ;; "# Just to give you a rough idea". XXX: Fix it upstream. - (replace 'build - (lambda _ - (zero? (system* "make" "manuals")))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (doc (string-append out "/share/doc/perl-net-psyc")) - (man1 (string-append out "/share/man/man1")) - (man3 (string-append out "/share/man/man3")) - (bin (string-append out "/bin")) - (libpsyc (string-append out "/lib/psyc/ion")) - (libperl (string-append out "/lib/perl5/site_perl/" - ,(package-version perl)))) - - (copy-recursively "lib/perl5" libperl) - (copy-recursively "lib/psycion" libpsyc) - (copy-recursively "bin" bin) - (install-file "cgi/psycpager" (string-append doc "/cgi")) - (copy-recursively "contrib" (string-append doc "/contrib")) - (copy-recursively "hooks" (string-append doc "/hooks")) - (copy-recursively "sdj" (string-append doc "/sdj")) - (install-file "README.txt" doc) - (install-file "TODO.txt" doc) - (copy-recursively "share/man/man1" man1) - (copy-recursively "share/man/man3" man3) - #t))) - (add-after 'install 'wrap-programs - (lambda* (#:key outputs #:allow-other-keys) - ;; Make sure all executables in "bin" find the Perl modules - ;; provided by this package at runtime. - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin/")) - (path (getenv "PERL5LIB"))) - (for-each (lambda (file) - (wrap-program file - `("PERL5LIB" ":" prefix (,path)))) - (find-files bin "\\.*$")) - #t)))))) - (description - "@code{Net::PSYC} with support for TCP, UDP, Event.pm, @code{IO::Select} and -Gtk2 event loops. This package includes 12 applications and additional scripts: -psycion (a @uref{http://about.psyc.eu,PSYC} chat client), remotor (a control console -for @uref{https://torproject.org,tor} router) and many more.") - (synopsis "Perl implementation of PSYC protocol") - (home-page "http://perlpsyc.psyc.eu/") - (license (list license:gpl2 - (package-license perl) - ;; contrib/irssi-psyc.pl: - license:public-domain - ;; bin/psycplay states AGPL with no version: - license:agpl3+)))) - -(define-public libpsyc - (package - (name "libpsyc") - (version "20160913") - (source (origin - (method url-fetch) - (uri (string-append "http://www.psyced.org/files/" - name "-" version ".tar.xz")) - (sha256 - (base32 - "14q89fxap05ajkfn20rnhc6b1h4i3i2adyr7y6hs5zqwb2lcmc1p")))) - (build-system gnu-build-system) - (native-inputs - `(("perl" ,perl) - ("netcat" ,netcat) - ("procps" ,procps))) - (arguments - `(#:make-flags - (list "CC=gcc" - (string-append "PREFIX=" (assoc-ref %outputs "out"))) - #:phases - (modify-phases %standard-phases - ;; The rust bindings are the only ones in use, the lpc bindings - ;; are in psyclpc. The other bindings are not used by anything, - ;; the chances are high that the bindings do not even work, - ;; therefore we do not include them. - ;; TODO: Get a cargo build system in Guix. - (delete 'configure)))) ; no configure script - (home-page "http://about.psyc.eu/libpsyc") - (description - "@code{libpsyc} is a PSYC library in C which implements -core aspects of PSYC, useful for all kinds of clients and servers -including psyced.") - (synopsis "PSYC library in C") - (license license:agpl3+))) - -;; This commit removes the historic bundled pcre, not released as a tarball so far. -(define-public psyclpc - (let* ((commit "61cf9aa81297085e5c40170fd01221c752f8deba") - (revision "2")) - (package - (name "psyclpc") - (version (string-append "20160821-" revision "." (string-take commit 7))) - (source (origin - (method git-fetch) - (uri (git-reference - (url "git://git.psyced.org/git/psyclpc") - (commit commit))) - (file-name (string-append name "-" version "-checkout")) - (sha256 - (base32 - "1viwqymbhn3cwvx0zl58rlzl5gw47zxn0ldg2nbi55ghm5zxl1z5")))) - (build-system gnu-build-system) - (arguments - `(#:tests? #f ; There are no tests/checks. - #:configure-flags - ;; If you have questions about this part, look at - ;; "src/settings/psyced" and the ebuild. - (list - "--enable-use-tls=yes" - "--enable-use-mccp" ; Mud Client Compression Protocol, leave this enabled. - (string-append "--prefix=" - (assoc-ref %outputs "out")) - ;; src/Makefile: Set MUD_LIB to the directory which contains - ;; the mud data. defaults to MUD_LIB = @libdir@ - (string-append "--libdir=" - (assoc-ref %outputs "out") - "/opt/psyced/world") - (string-append "--bindir=" - (assoc-ref %outputs "out") - "/opt/psyced/bin") - ;; src/Makefile: Set ERQ_DIR to directory which contains the - ;; stuff which ERQ can execute (hopefully) savely. Was formerly - ;; defined in config.h. defaults to ERQ_DIR= @libexecdir@ - (string-append "--libexecdir=" - (assoc-ref %outputs "out") - "/opt/psyced/run")) - #:phases - (modify-phases %standard-phases - (add-before 'configure 'chdir-to-src - ;; We need to pass this as env variables - ;; and manually change the directory. - (lambda _ - (chdir "src") - (setenv "CONFIG_SHELL" (which "sh")) - (setenv "SHELL" (which "sh")) - #t))) - #:make-flags (list "install-all"))) - (inputs - `(("zlib" ,zlib) - ("openssl" ,openssl) - ("pcre" ,pcre))) - (native-inputs - `(("pkg-config" ,pkg-config) - ("bison" ,bison) - ("gettext" ,gettext-minimal) - ("help2man" ,help2man) - ("autoconf" ,autoconf) - ("automake" ,automake))) - (home-page "http://lpc.psyc.eu/") - (synopsis "psycLPC is a multi-user network server programming language") - (description - "LPC is a bytecode language, invented to specifically implement -multi user virtual environments on the internet. This technology is used for -MUDs and also the psyced implementation of the Protocol for SYnchronous -Conferencing (PSYC). psycLPC is a fork of LDMud with some new features and -many bug fixes.") - (license license:gpl2)))) From cf3678df6e1bdbb4bf80d2fae041be69eec2cd67 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 26 Nov 2016 13:25:08 -0500 Subject: [PATCH 027/130] gnu: psyclpc: Update comment. This is a followup to commit eaa45301f46f13a3f71bcae6089d312f31174801. * gnu/packages/messaging.scm (psyclpc): Update comment. --- gnu/packages/messaging.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 02e51629ac..8660915bb0 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -980,7 +980,7 @@ including psyced.") (synopsis "PSYC library in C") (license license:agpl3+))) -;; This commit removes the historic bundled pcre, not released as a tarball so far. +;; This commit removes the historic bundled pcre and makes psyclpc reproducible. (define-public psyclpc (let* ((commit "61cf9aa81297085e5c40170fd01221c752f8deba") (revision "2")) From 5305ed20027a32ff1221cac6a131849852e807ba Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Wed, 23 Nov 2016 21:43:42 +0100 Subject: [PATCH 028/130] services: Factorize configuration abstraction. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/mail.scm and gnu/services/cups.scm (&configuration-error) (configuration-error, configuration-field-error) (configuration-missing-field, configuration-field, serialize-configuration) (validate-configuration, define-configuration, uglify-field-name) (serialize-field, serialize-package, serialize-string) (serialize-space-separated-string-list, space-separated-string-list?) (serialize-file-name, file-name?, serialize-field-name) (generate-documentation): Move duplicate code... * gnu/services/configuration.scm: ...to this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add configuration.scm. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/services/configuration.scm | 205 +++++++++++++++++++++++++++++++++ gnu/services/cups.scm | 180 ++--------------------------- gnu/services/mail.scm | 183 +++-------------------------- 4 files changed, 233 insertions(+), 336 deletions(-) create mode 100644 gnu/services/configuration.scm diff --git a/gnu/local.mk b/gnu/local.mk index 1b2bb4786d..f3f8772337 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -399,6 +399,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/admin.scm \ %D%/services/avahi.scm \ %D%/services/base.scm \ + %D%/services/configuration.scm \ %D%/services/cups.scm \ %D%/services/databases.scm \ %D%/services/dbus.scm \ diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm new file mode 100644 index 0000000000..9f28aabc96 --- /dev/null +++ b/gnu/services/configuration.scm @@ -0,0 +1,205 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Andy Wingo +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services configuration) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (guix gexp) + #:autoload (texinfo) (texi-fragment->stexi) + #:autoload (texinfo serialize) (stexi->texi) + #:use-module (ice-9 match) + #:use-module ((srfi srfi-1) #:select (append-map)) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) + #:export (configuration-field + configuration-field-name + configuration-missing-field + configuration-field-error + serialize-configuration + define-configuration + validate-configuration + generate-documentation + serialize-field + serialize-string + serialize-name + serialize-space-separated-string-list + space-separated-string-list? + serialize-file-name + file-name? + serialize-boolean + serialize-package)) + +;;; Commentary: +;;; +;;; Syntax for creating Scheme bindings to complex configuration files. +;;; +;;; Code: + +(define-condition-type &configuration-error &error + configuration-error?) + +(define (configuration-error message) + (raise (condition (&message (message message)) + (&configuration-error)))) +(define (configuration-field-error field val) + (configuration-error + (format #f "Invalid value for field ~a: ~s" field val))) +(define (configuration-missing-field kind field) + (configuration-error + (format #f "~a configuration missing required field ~a" kind field))) + +(define-record-type* + configuration-field make-configuration-field configuration-field? + (name configuration-field-name) + (type configuration-field-type) + (getter configuration-field-getter) + (predicate configuration-field-predicate) + (serializer configuration-field-serializer) + (default-value-thunk configuration-field-default-value-thunk) + (documentation configuration-field-documentation)) + +(define (serialize-configuration config fields) + (for-each (lambda (field) + ((configuration-field-serializer field) + (configuration-field-name field) + ((configuration-field-getter field) config))) + fields)) + +(define (validate-configuration config fields) + (for-each (lambda (field) + (let ((val ((configuration-field-getter field) config))) + (unless ((configuration-field-predicate field) val) + (configuration-field-error + (configuration-field-name field) val)))) + fields)) + +(define-syntax define-configuration + (lambda (stx) + (define (id ctx part . parts) + (let ((part (syntax->datum part))) + (datum->syntax + ctx + (match parts + (() part) + (parts (symbol-append part + (syntax->datum (apply id ctx parts)))))))) + (syntax-case stx () + ((_ stem (field (field-type def) doc) ...) + (with-syntax (((field-getter ...) + (map (lambda (field) + (id #'stem #'stem #'- field)) + #'(field ...))) + ((field-predicate ...) + (map (lambda (type) + (id #'stem type #'?)) + #'(field-type ...))) + ((field-serializer ...) + (map (lambda (type) + (id #'stem #'serialize- type)) + #'(field-type ...)))) + #`(begin + (define-record-type* #,(id #'stem #'< #'stem #'>) + #,(id #'stem #'% #'stem) + #,(id #'stem #'make- #'stem) + #,(id #'stem #'stem #'?) + (field field-getter (default def)) + ...) + (define #,(id #'stem #'stem #'-fields) + (list (configuration-field + (name 'field) + (type 'field-type) + (getter field-getter) + (predicate field-predicate) + (serializer field-serializer) + (default-value-thunk (lambda () def)) + (documentation doc)) + ...)) + (define-syntax-rule (stem arg (... ...)) + (let ((conf (#,(id #'stem #'% #'stem) arg (... ...)))) + (validate-configuration conf + #,(id #'stem #'stem #'-fields)) + conf)))))))) + +(define (uglify-field-name field-name) + (let ((str (symbol->string field-name))) + (string-concatenate + (map string-titlecase + (string-split (if (string-suffix? "?" str) + (substring str 0 (1- (string-length str))) + str) + #\-))))) + +(define (serialize-field field-name val) + (format #t "~a ~a\n" (uglify-field-name field-name) val)) + +(define (serialize-package field-name val) + #f) + +(define (serialize-string field-name val) + (serialize-field field-name val)) + +(define (space-separated-string-list? val) + (and (list? val) + (and-map (lambda (x) + (and (string? x) (not (string-index x #\space)))) + val))) +(define (serialize-space-separated-string-list field-name val) + (serialize-field field-name (string-join val " "))) + +(define (file-name? val) + (and (string? val) + (string-prefix? "/" val))) +(define (serialize-file-name field-name val) + (serialize-string field-name val)) + +(define (serialize-boolean field-name val) + (serialize-string field-name (if val "yes" "no"))) + +;; A little helper to make it easier to document all those fields. +(define (generate-documentation documentation documentation-name) + (define (str x) (object->string x)) + (define (generate configuration-name) + (match (assq-ref documentation configuration-name) + ((fields . sub-documentation) + `((para "Available " (code ,(str configuration-name)) " fields are:") + ,@(map + (lambda (f) + (let ((field-name (configuration-field-name f)) + (field-type (configuration-field-type f)) + (field-docs (cdr (texi-fragment->stexi + (configuration-field-documentation f)))) + (default (catch #t + (configuration-field-default-value-thunk f) + (lambda _ '%invalid)))) + (define (show-default? val) + (or (string? default) (number? default) (boolean? default) + (and (symbol? val) (not (eq? val '%invalid))) + (and (list? val) (and-map show-default? val)))) + `(deftypevr (% (category + (code ,(str configuration-name)) " parameter") + (data-type ,(str field-type)) + (name ,(str field-name))) + ,@field-docs + ,@(if (show-default? default) + `((para "Defaults to " (samp ,(str default)) ".")) + '()) + ,@(append-map + generate + (or (assq-ref sub-documentation field-name) '()))))) + fields))))) + (stexi->texi `(*fragment* . ,(generate documentation-name)))) diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm index 7542ee26c0..391046a75f 100644 --- a/gnu/services/cups.scm +++ b/gnu/services/cups.scm @@ -19,6 +19,7 @@ (define-module (gnu services cups) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (gnu services configuration) #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages cups) @@ -26,16 +27,9 @@ #:use-module (guix packages) #:use-module (guix records) #:use-module (guix gexp) - #:use-module (texinfo) - #:use-module (texinfo serialize) #:use-module (ice-9 match) #:use-module ((srfi srfi-1) #:select (append-map)) - #:use-module (srfi srfi-34) - #:use-module (srfi srfi-35) - #:export (&cups-configuation-error - cups-configuration-error? - - cups-service-type + #:export (cups-service-type cups-configuration opaque-cups-configuration @@ -51,91 +45,6 @@ ;;; ;;; Code: -(define-condition-type &cups-configuration-error &error - cups-configuration-error?) - -(define (cups-error message) - (raise (condition (&message (message message)) - (&cups-configuration-error)))) -(define (cups-configuration-field-error field val) - (cups-error - (format #f "Invalid value for field ~a: ~s" field val))) -(define (cups-configuration-missing-field kind field) - (cups-error - (format #f "~a configuration missing required field ~a" kind field))) - -(define-record-type* - configuration-field make-configuration-field configuration-field? - (name configuration-field-name) - (type configuration-field-type) - (getter configuration-field-getter) - (predicate configuration-field-predicate) - (serializer configuration-field-serializer) - (default-value-thunk configuration-field-default-value-thunk) - (documentation configuration-field-documentation)) - -(define (serialize-configuration config fields) - (for-each (lambda (field) - ((configuration-field-serializer field) - (configuration-field-name field) - ((configuration-field-getter field) config))) - fields)) - -(define (validate-configuration config fields) - (for-each (lambda (field) - (let ((val ((configuration-field-getter field) config))) - (unless ((configuration-field-predicate field) val) - (cups-configuration-field-error - (configuration-field-name field) val)))) - fields)) - -(define-syntax define-configuration - (lambda (stx) - (define (id ctx part . parts) - (let ((part (syntax->datum part))) - (datum->syntax - ctx - (match parts - (() part) - (parts (symbol-append part - (syntax->datum (apply id ctx parts)))))))) - (syntax-case stx () - ((_ stem (field (field-type def) doc) ...) - (with-syntax (((field-getter ...) - (map (lambda (field) - (id #'stem #'stem #'- field)) - #'(field ...))) - ((field-predicate ...) - (map (lambda (type) - (id #'stem type #'?)) - #'(field-type ...))) - ((field-serializer ...) - (map (lambda (type) - (id #'stem #'serialize- type)) - #'(field-type ...)))) - #`(begin - (define-record-type* #,(id #'stem #'< #'stem #'>) - #,(id #'stem #'% #'stem) - #,(id #'stem #'make- #'stem) - #,(id #'stem #'stem #'?) - (field field-getter (default def)) - ...) - (define #,(id #'stem #'stem #'-fields) - (list (configuration-field - (name 'field) - (type 'field-type) - (getter field-getter) - (predicate field-predicate) - (serializer field-serializer) - (default-value-thunk (lambda () def)) - (documentation doc)) - ...)) - (define-syntax-rule (stem arg (... ...)) - (let ((conf (#,(id #'stem #'% #'stem) arg (... ...)))) - (validate-configuration conf - #,(id #'stem #'stem #'-fields)) - conf)))))))) - (define %cups-accounts (list (user-group (name "lp") (system? #t)) (user-group (name "lpadmin") (system? #t)) @@ -147,24 +56,6 @@ (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) -(define (uglify-field-name field-name) - (let ((str (symbol->string field-name))) - (string-concatenate - (map string-titlecase - (string-split (if (string-suffix? "?" str) - (substring str 0 (1- (string-length str))) - str) - #\-))))) - -(define (serialize-field field-name val) - (format #t "~a ~a\n" (uglify-field-name field-name) val)) - -(define (serialize-package field-name val) - #f) - -(define (serialize-string field-name val) - (serialize-field field-name val)) - (define (multiline-string-list? val) (and (list? val) (and-map (lambda (x) @@ -173,28 +64,11 @@ (define (serialize-multiline-string-list field-name val) (for-each (lambda (str) (serialize-field field-name str)) val)) -(define (space-separated-string-list? val) - (and (list? val) - (and-map (lambda (x) - (and (string? x) (not (string-index x #\space)))) - val))) -(define (serialize-space-separated-string-list field-name val) - (serialize-field field-name (string-join val " "))) - (define (space-separated-symbol-list? val) (and (list? val) (and-map symbol? val))) (define (serialize-space-separated-symbol-list field-name val) (serialize-field field-name (string-join (map symbol->string val) " "))) -(define (file-name? val) - (and (string? val) - (string-prefix? "/" val))) -(define (serialize-file-name field-name val) - (serialize-string field-name val)) - -(define (serialize-boolean field-name val) - (serialize-string field-name (if val "yes" "no"))) - (define (non-negative-integer? val) (and (exact-integer? val) (not (negative? val)))) (define (serialize-non-negative-integer field-name val) @@ -333,7 +207,7 @@ methods. Otherwise apply to only the listed methods.") (define-configuration location-access-control (path - (file-name (cups-configuration-missing-field 'location-access-control 'path)) + (file-name (configuration-missing-field 'location-access-control 'path)) "Specifies the URI path to which the access control applies.") (access-controls (access-control-list '()) @@ -359,7 +233,7 @@ methods. Otherwise apply to only the listed methods.") (define-configuration policy-configuration (name - (string (cups-configuration-missing-field 'policy-configuration 'name)) + (string (configuration-missing-field 'policy-configuration 'name)) "Name of the policy.") (job-private-access (string "@OWNER @SYSTEM") @@ -925,12 +799,12 @@ IPP specifications.") (package-list '()) "Drivers and other extensions to the CUPS package.") (cupsd.conf - (string (cups-configuration-missing-field 'opaque-cups-configuration - 'cupsd.conf)) + (string (configuration-missing-field 'opaque-cups-configuration + 'cupsd.conf)) "The contents of the @code{cupsd.conf} to use.") (cups-files.conf - (string (cups-configuration-missing-field 'opaque-cups-configuration - 'cups-files.conf)) + (string (configuration-missing-field 'opaque-cups-configuration + 'cups-files.conf)) "The contents of the @code{cups-files.conf} to use.")) (define %cups-activation @@ -1117,8 +991,8 @@ extensions that it uses." extensions))))))))) ;; A little helper to make it easier to document all those fields. -(define (generate-documentation) - (define documentation +(define (generate-cups-documentation) + (generate-documentation `((cups-configuration ,cups-configuration-fields (files-configuration files-configuration) @@ -1132,35 +1006,5 @@ extensions that it uses." ,location-access-control-fields (method-access-controls method-access-controls)) (operation-access-controls ,operation-access-control-fields) - (method-access-controls ,method-access-control-fields))) - (define (str x) (object->string x)) - (define (generate configuration-name) - (match (assq-ref documentation configuration-name) - ((fields . sub-documentation) - `((para "Available " (code ,(str configuration-name)) " fields are:") - ,@(map - (lambda (f) - (let ((field-name (configuration-field-name f)) - (field-type (configuration-field-type f)) - (field-docs (cdr (texi-fragment->stexi - (configuration-field-documentation f)))) - (default (catch #t - (configuration-field-default-value-thunk f) - (lambda _ '%invalid)))) - (define (show-default? val) - (or (string? default) (number? default) (boolean? default) - (and (symbol? val) (not (eq? val '%invalid))) - (and (list? val) (and-map show-default? val)))) - `(deftypevr (% (category - (code ,(str configuration-name)) " parameter") - (data-type ,(str field-type)) - (name ,(str field-name))) - ,@field-docs - ,@(if (show-default? default) - `((para "Defaults to " (samp ,(str default)) ".")) - '()) - ,@(append-map - generate - (or (assq-ref sub-documentation field-name) '()))))) - fields))))) - (stexi->texi `(*fragment* . ,(generate 'cups-configuration)))) + (method-access-controls ,method-access-control-fields)) + 'cups-configuration)) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index f7ab9516ba..c1381405d8 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -21,6 +21,7 @@ (define-module (gnu services mail) #:use-module (gnu services) #:use-module (gnu services base) + #:use-module (gnu services configuration) #:use-module (gnu services shepherd) #:use-module (gnu system pam) #:use-module (gnu system shadow) @@ -30,13 +31,8 @@ #:use-module (guix records) #:use-module (guix packages) #:use-module (guix gexp) - #:use-module (srfi srfi-34) - #:use-module (srfi srfi-35) #:use-module (ice-9 match) - #:export (&dovecot-configuation-error - dovecot-configuration-error? - - dovecot-service + #:export (dovecot-service dovecot-service-type dovecot-configuration opaque-dovecot-configuration @@ -65,112 +61,6 @@ ;;; ;;; Code: -(define-condition-type &dovecot-configuration-error &error - dovecot-configuration-error?) - -(define (dovecot-error message) - (raise (condition (&message (message message)) - (&dovecot-configuration-error)))) -(define (dovecot-configuration-field-error field val) - (dovecot-error - (format #f "Invalid value for field ~a: ~s" field val))) -(define (dovecot-configuration-missing-field kind field) - (dovecot-error - (format #f "~a configuration missing required field ~a" kind field))) - -(define-record-type* - configuration-field make-configuration-field configuration-field? - (name configuration-field-name) - (type configuration-field-type) - (getter configuration-field-getter) - (predicate configuration-field-predicate) - (serializer configuration-field-serializer) - (default-value-thunk configuration-field-default-value-thunk) - (documentation configuration-field-documentation)) - -(define-syntax define-configuration - (lambda (stx) - (define (id ctx part . parts) - (let ((part (syntax->datum part))) - (datum->syntax - ctx - (match parts - (() part) - (parts (symbol-append part - (syntax->datum (apply id ctx parts)))))))) - (syntax-case stx () - ((_ stem (field (field-type def) doc) ...) - (with-syntax (((field-getter ...) - (map (lambda (field) - (id #'stem #'stem #'- field)) - #'(field ...))) - ((field-predicate ...) - (map (lambda (type) - (id #'stem type #'?)) - #'(field-type ...))) - ((field-serializer ...) - (map (lambda (type) - (id #'stem #'serialize- type)) - #'(field-type ...)))) - #`(begin - (define-record-type* #,(id #'stem #'< #'stem #'>) - stem #,(id #'stem #'make- #'stem) #,(id #'stem #'stem #'?) - (field field-getter (default def)) - ...) - (define #,(id #'stem #'stem #'-fields) - (list (configuration-field - (name 'field) - (type 'field-type) - (getter field-getter) - (predicate field-predicate) - (serializer field-serializer) - (default-value-thunk (lambda () def)) - (documentation doc)) - ...)))))))) - -(define (serialize-configuration config fields) - (for-each (lambda (field) - ((configuration-field-serializer field) - (configuration-field-name field) - ((configuration-field-getter field) config))) - fields)) - -(define (validate-configuration config fields) - (for-each (lambda (field) - (let ((val ((configuration-field-getter field) config))) - (unless ((configuration-field-predicate field) val) - (dovecot-configuration-field-error - (configuration-field-name field) val)))) - fields)) - -(define (validate-package field-name package) - (unless (package? package) - (dovecot-configuration-field-error field-name package))) - -(define (uglify-field-name field-name) - (let ((str (symbol->string field-name))) - (string-join (string-split (if (string-suffix? "?" str) - (substring str 0 (1- (string-length str))) - str) - #\-) - "_"))) - -(define (serialize-package field-name val) - #f) - -(define (serialize-field field-name val) - (format #t "~a=~a\n" (uglify-field-name field-name) val)) - -(define (serialize-string field-name val) - (serialize-field field-name val)) - -(define (space-separated-string-list? val) - (and (list? val) - (and-map (lambda (x) - (and (string? x) (not (string-index x #\space)))) - val))) -(define (serialize-space-separated-string-list field-name val) - (serialize-field field-name (string-join val " "))) (define (comma-separated-string-list? val) (and (list? val) @@ -180,12 +70,6 @@ (define (serialize-comma-separated-string-list field-name val) (serialize-field field-name (string-join val ","))) -(define (file-name? val) - (and (string? val) - (string-prefix? "/" val))) -(define (serialize-file-name field-name val) - (serialize-string field-name val)) - (define (colon-separated-file-name-list? val) (and (list? val) ;; Trailing slashes not needed and not @@ -193,9 +77,6 @@ (define (serialize-colon-separated-file-name-list field-name val) (serialize-field field-name (string-join val ":"))) -(define (serialize-boolean field-name val) - (serialize-string field-name (if val "yes" "no"))) - (define (non-negative-integer? val) (and (exact-integer? val) (not (negative? val)))) (define (serialize-non-negative-integer field-name val) @@ -276,7 +157,7 @@ (define-configuration unix-listener-configuration (path - (file-name (dovecot-configuration-missing-field 'unix-listener 'path)) + (file-name (configuration-missing-field 'unix-listener 'path)) "The file name on which to listen.") (mode (string "0600") @@ -295,7 +176,7 @@ (define-configuration fifo-listener-configuration (path - (file-name (dovecot-configuration-missing-field 'fifo-listener 'path)) + (file-name (configuration-missing-field 'fifo-listener 'path)) "The file name on which to listen.") (mode (string "0600") @@ -314,14 +195,14 @@ (define-configuration inet-listener-configuration (protocol - (string (dovecot-configuration-missing-field 'inet-listener 'protocol)) + (string (configuration-missing-field 'inet-listener 'protocol)) "The protocol to listen for.") (address (string "") "The address on which to listen, or empty for all addresses.") (port (non-negative-integer - (dovecot-configuration-missing-field 'inet-listener 'port)) + (configuration-missing-field 'inet-listener 'port)) "The port on which to listen.") (ssl? (boolean #t) @@ -345,7 +226,7 @@ (serialize-fifo-listener-configuration field-name val)) ((inet-listener-configuration? val) (serialize-inet-listener-configuration field-name val)) - (else (dovecot-configuration-field-error field-name val)))) + (else (configuration-field-error field-name val)))) (define (listener-configuration-list? val) (and (list? val) (and-map listener-configuration? val))) (define (serialize-listener-configuration-list field-name val) @@ -355,7 +236,7 @@ (define-configuration service-configuration (kind - (string (dovecot-configuration-missing-field 'service 'kind)) + (string (configuration-missing-field 'service 'kind)) "The service kind. Valid values include @code{director}, @code{imap-login}, @code{pop3-login}, @code{lmtp}, @code{imap}, @code{pop3}, @code{auth}, @code{auth-worker}, @code{dict}, @@ -393,7 +274,7 @@ this.")) (define-configuration protocol-configuration (name - (string (dovecot-configuration-missing-field 'protocol 'name)) + (string (configuration-missing-field 'protocol 'name)) "The name of the protocol.") (auth-socket-path (string "/var/run/dovecot/auth-userdb") @@ -1497,8 +1378,8 @@ greyed out, instead of only later giving \"not selectable\" popup error. "The dovecot package.") (string - (string (dovecot-configuration-missing-field 'opaque-dovecot-configuration - 'string)) + (string (configuration-missing-field 'opaque-dovecot-configuration + 'string)) "The contents of the @code{dovecot.conf} to use.")) (define %dovecot-accounts @@ -1634,8 +1515,8 @@ by @code{dovecot-configuration}. @var{config} may also be created by (service dovecot-service-type config)) ;; A little helper to make it easier to document all those fields. -(define (generate-documentation) - (define documentation +(define (generate-dovecot-documentation) + (generate-documentation `((dovecot-configuration ,dovecot-configuration-fields (dict dict-configuration) @@ -1660,42 +1541,8 @@ by @code{dovecot-configuration}. @var{config} may also be created by ,service-configuration-fields (listeners unix-listener-configuration fifo-listener-configuration inet-listener-configuration)) - (protocol-configuration ,protocol-configuration-fields))) - (define (generate configuration-name) - (match (assq-ref documentation configuration-name) - ((fields . sub-documentation) - (format #t "\nAvailable @code{~a} fields are:\n\n" configuration-name) - (for-each - (lambda (f) - (let ((field-name (configuration-field-name f)) - (field-type (configuration-field-type f)) - (field-docs (string-trim-both - (configuration-field-documentation f))) - (default (catch #t - (configuration-field-default-value-thunk f) - (lambda _ 'nope)))) - (define (escape-chars str chars escape) - (with-output-to-string - (lambda () - (string-for-each (lambda (c) - (when (char-set-contains? chars c) - (display escape)) - (display c)) - str)))) - (define (show-default? val) - (or (string? default) (number? default) (boolean? default) - (and (list? val) (and-map show-default? val)))) - (format #t "@deftypevr {@code{~a} parameter} ~a ~a\n~a\n" - configuration-name field-type field-name field-docs) - (when (show-default? default) - (format #t "Defaults to @samp{~a}.\n" - (escape-chars (format #f "~s" default) - (char-set #\@ #\{ #\}) - #\@))) - (for-each generate (or (assq-ref sub-documentation field-name) '())) - (format #t "@end deftypevr\n\n"))) - fields)))) - (generate 'dovecot-configuration)) + (protocol-configuration ,protocol-configuration-fields)) + 'dovecot-configuration)) ;;; From 9e46245b89e0f30397f69391a2219a29caa336a2 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Fri, 25 Nov 2016 01:47:14 -0500 Subject: [PATCH 029/130] gnu: gst-plugins-good: Fix CVE-2016-{9634,9635,9636} and other security issues. * gnu/packages/patches/gst-plugins-good-fix-crashes.patch, gnu/packages/patches/gst-plugins-good-fix-invalid-read.patch, gnu/packages/patches/gst-plugins-good-fix-signedness.patch, gnu/packages/patches/gst-plugins-good-flic-bounds-check.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/gstreamer.scm (gst-plugins-good): Use them. --- gnu/local.mk | 4 + gnu/packages/gstreamer.scm | 5 + .../gst-plugins-good-fix-crashes.patch | 1047 +++++++++++++++++ .../gst-plugins-good-fix-invalid-read.patch | 37 + .../gst-plugins-good-fix-signedness.patch | 58 + .../gst-plugins-good-flic-bounds-check.patch | 319 +++++ 6 files changed, 1470 insertions(+) create mode 100644 gnu/packages/patches/gst-plugins-good-fix-crashes.patch create mode 100644 gnu/packages/patches/gst-plugins-good-fix-invalid-read.patch create mode 100644 gnu/packages/patches/gst-plugins-good-fix-signedness.patch create mode 100644 gnu/packages/patches/gst-plugins-good-flic-bounds-check.patch diff --git a/gnu/local.mk b/gnu/local.mk index f3f8772337..8ca4d932d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -585,6 +585,10 @@ dist_patch_DATA = \ %D%/packages/patches/grub-gets-undeclared.patch \ %D%/packages/patches/grub-freetype.patch \ %D%/packages/patches/gsl-test-i686.patch \ + %D%/packages/patches/gst-plugins-good-fix-crashes.patch \ + %D%/packages/patches/gst-plugins-good-fix-invalid-read.patch \ + %D%/packages/patches/gst-plugins-good-fix-signedness.patch \ + %D%/packages/patches/gst-plugins-good-flic-bounds-check.patch \ %D%/packages/patches/guile-1.8-cpp-4.5.patch \ %D%/packages/patches/guile-arm-fixes.patch \ %D%/packages/patches/guile-default-utf8.patch \ diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm index 5fe84ec2fc..86ea690e8b 100644 --- a/gnu/packages/gstreamer.scm +++ b/gnu/packages/gstreamer.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2015, 2016 Sou Bunnbu ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2016 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -207,6 +208,10 @@ for the GStreamer multimedia library.") (uri (string-append "https://gstreamer.freedesktop.org/src/" name "/" name "-" version ".tar.xz")) + (patches (search-patches "gst-plugins-good-flic-bounds-check.patch" + "gst-plugins-good-fix-signedness.patch" + "gst-plugins-good-fix-invalid-read.patch" + "gst-plugins-good-fix-crashes.patch")) (sha256 (base32 "1hkcap9l2603266gyi6jgvx7frbvfmb7xhfhjizbczy1wykjwr57")))) diff --git a/gnu/packages/patches/gst-plugins-good-fix-crashes.patch b/gnu/packages/patches/gst-plugins-good-fix-crashes.patch new file mode 100644 index 0000000000..c36a595608 --- /dev/null +++ b/gnu/packages/patches/gst-plugins-good-fix-crashes.patch @@ -0,0 +1,1047 @@ +Fixes upstream bug #774859 (flic decoder: Invalid memory read in +flx_decode_chunks): + +https://bugzilla.gnome.org/show_bug.cgi?id=774859 + +Patch copied from upstream source repository: + +https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=be670f0daf67304fb92c76aa09c30cae0bfd1fe4 + +From be670f0daf67304fb92c76aa09c30cae0bfd1fe4 Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Wed, 23 Nov 2016 07:09:06 +1100 +Subject: [PATCH] flxdec: rewrite logic based on GstByteReader/Writer + +Solves overreading/writing the given arrays and will error out if the +streams asks to do that. + +Also does more error checking that the stream is valid and won't +overrun any allocated arrays. Also mitigate integer overflow errors +calculating allocation sizes. + +https://bugzilla.gnome.org/show_bug.cgi?id=774859 +--- + gst/flx/flx_color.c | 1 - + gst/flx/flx_fmt.h | 72 ------- + gst/flx/gstflxdec.c | 610 ++++++++++++++++++++++++++++++++++++---------------- + gst/flx/gstflxdec.h | 4 +- + 4 files changed, 427 insertions(+), 260 deletions(-) + +diff --git a/gst/flx/flx_color.c b/gst/flx/flx_color.c +index 047bfdf..3a58135 100644 +--- a/gst/flx/flx_color.c ++++ b/gst/flx/flx_color.c +@@ -101,7 +101,6 @@ flx_set_palette_vector (FlxColorSpaceConverter * flxpal, guint start, guint num, + } else { + memcpy (&flxpal->palvec[start * 3], newpal, grab * 3); + } +- + } + + void +diff --git a/gst/flx/flx_fmt.h b/gst/flx/flx_fmt.h +index 9ab31ba..abff200 100644 +--- a/gst/flx/flx_fmt.h ++++ b/gst/flx/flx_fmt.h +@@ -123,78 +123,6 @@ typedef struct _FlxFrameType + } FlxFrameType; + #define FlxFrameTypeSize 10 + +-#if G_BYTE_ORDER == G_BIG_ENDIAN +-#define LE_TO_BE_16(i16) ((guint16) (((i16) << 8) | ((i16) >> 8))) +-#define LE_TO_BE_32(i32) \ +- (((guint32) (LE_TO_BE_16((guint16) (i32))) << 16) | (LE_TO_BE_16((i32) >> 16))) +- +-#define FLX_FRAME_TYPE_FIX_ENDIANNESS(frm_type_p) \ +- do { \ +- (frm_type_p)->chunks = LE_TO_BE_16((frm_type_p)->chunks); \ +- (frm_type_p)->delay = LE_TO_BE_16((frm_type_p)->delay); \ +- } while(0) +- +-#define FLX_HUFFMAN_TABLE_FIX_ENDIANNESS(hffmn_table_p) \ +- do { \ +- (hffmn_table_p)->codelength = \ +- LE_TO_BE_16((hffmn_table_p)->codelength); \ +- (hffmn_table_p)->numcodes = LE_TO_BE_16((hffmn_table_p)->numcodes); \ +- } while(0) +- +-#define FLX_SEGMENT_TABLE_FIX_ENDIANNESS(sgmnt_table_p) \ +- ((sgmnt_table_p)->segments = LE_TO_BE_16((sgmnt_table_p)->segments)) +- +-#define FLX_PREFIX_CHUNK_FIX_ENDIANNESS(prfx_chnk_p) \ +- do { \ +- (prfx_chnk_p)->chunks = LE_TO_BE_16((prfx_chnk_p)->chunks); \ +- } while(0) +- +-#define FLX_FRAME_CHUNK_FIX_ENDIANNESS(frm_chnk_p) \ +- do { \ +- (frm_chnk_p)->size = LE_TO_BE_32((frm_chnk_p)->size); \ +- (frm_chnk_p)->id = LE_TO_BE_16((frm_chnk_p)->id); \ +- } while(0) +- +-#define FLX_HDR_FIX_ENDIANNESS(hdr_p) \ +- do { \ +- (hdr_p)->size = LE_TO_BE_32((hdr_p)->size); \ +- (hdr_p)->type = LE_TO_BE_16((hdr_p)->type); \ +- (hdr_p)->frames = LE_TO_BE_16((hdr_p)->frames); \ +- (hdr_p)->width = LE_TO_BE_16((hdr_p)->width); \ +- (hdr_p)->height = LE_TO_BE_16((hdr_p)->height); \ +- (hdr_p)->depth = LE_TO_BE_16((hdr_p)->depth); \ +- (hdr_p)->flags = LE_TO_BE_16((hdr_p)->flags); \ +- (hdr_p)->speed = LE_TO_BE_32((hdr_p)->speed); \ +- (hdr_p)->reserved1 = LE_TO_BE_16((hdr_p)->reserved1); \ +- (hdr_p)->created = LE_TO_BE_32((hdr_p)->created); \ +- (hdr_p)->creator = LE_TO_BE_32((hdr_p)->creator); \ +- (hdr_p)->updated = LE_TO_BE_32((hdr_p)->updated); \ +- (hdr_p)->updater = LE_TO_BE_32((hdr_p)->updater); \ +- (hdr_p)->aspect_dx = LE_TO_BE_16((hdr_p)->aspect_dx); \ +- (hdr_p)->aspect_dy = LE_TO_BE_16((hdr_p)->aspect_dy); \ +- (hdr_p)->ext_flags = LE_TO_BE_16((hdr_p)->ext_flags); \ +- (hdr_p)->keyframes = LE_TO_BE_16((hdr_p)->keyframes); \ +- (hdr_p)->totalframes = LE_TO_BE_16((hdr_p)->totalframes); \ +- (hdr_p)->req_memory = LE_TO_BE_32((hdr_p)->req_memory); \ +- (hdr_p)->max_regions = LE_TO_BE_16((hdr_p)->max_regions); \ +- (hdr_p)->transp_num = LE_TO_BE_16((hdr_p)->transp_num); \ +- (hdr_p)->oframe1 = LE_TO_BE_32((hdr_p)->oframe1); \ +- (hdr_p)->oframe2 = LE_TO_BE_32((hdr_p)->oframe2); \ +- } while(0) +-#else +- +-#define LE_TO_BE_16(i16) ((i16)) +-#define LE_TO_BE_32(i32) ((i32)) +- +-#define FLX_FRAME_TYPE_FIX_ENDIANNESS(frm_type_p) +-#define FLX_HUFFMAN_TABLE_FIX_ENDIANNESS(hffmn_table_p) +-#define FLX_SEGMENT_TABLE_FIX_ENDIANNESS(sgmnt_table_p) +-#define FLX_PREFIX_CHUNK_FIX_ENDIANNESS(prfx_chnk_p) +-#define FLX_FRAME_CHUNK_FIX_ENDIANNESS(frm_chnk_p) +-#define FLX_HDR_FIX_ENDIANNESS(hdr_p) +- +-#endif /* G_BYTE_ORDER == G_BIG_ENDIAN */ +- + G_END_DECLS + + #endif /* __GST_FLX_FMT_H__ */ +diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c +index a237976..aa1bed5 100644 +--- a/gst/flx/gstflxdec.c ++++ b/gst/flx/gstflxdec.c +@@ -1,5 +1,6 @@ + /* GStreamer + * Copyright (C) <1999> Erik Walthinsen ++ * Copyright (C) <2016> Matthew Waters + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -24,6 +25,7 @@ + /* + * http://www.coolutils.com/Formats/FLI + * http://woodshole.er.usgs.gov/operations/modeling/flc.html ++ * http://www.compuphase.com/flic.htm + */ + + #ifdef HAVE_CONFIG_H +@@ -73,10 +75,14 @@ static GstStateChangeReturn gst_flxdec_change_state (GstElement * element, + static gboolean gst_flxdec_src_query_handler (GstPad * pad, GstObject * parent, + GstQuery * query); + +-static void flx_decode_color (GstFlxDec *, guchar *, guchar *, gint); +-static gboolean flx_decode_brun (GstFlxDec *, guchar *, guchar *); +-static gboolean flx_decode_delta_fli (GstFlxDec *, guchar *, guchar *); +-static gboolean flx_decode_delta_flc (GstFlxDec *, guchar *, guchar *); ++static gboolean flx_decode_color (GstFlxDec * flxdec, GstByteReader * reader, ++ GstByteWriter * writer, gint scale); ++static gboolean flx_decode_brun (GstFlxDec * flxdec, ++ GstByteReader * reader, GstByteWriter * writer); ++static gboolean flx_decode_delta_fli (GstFlxDec * flxdec, ++ GstByteReader * reader, GstByteWriter * writer); ++static gboolean flx_decode_delta_flc (GstFlxDec * flxdec, ++ GstByteReader * reader, GstByteWriter * writer); + + #define rndalign(off) ((off) + ((off) & 1)) + +@@ -204,57 +210,59 @@ gst_flxdec_sink_event_handler (GstPad * pad, GstObject * parent, + } + + static gboolean +-flx_decode_chunks (GstFlxDec * flxdec, gulong count, guchar * data, +- guchar * dest) ++flx_decode_chunks (GstFlxDec * flxdec, gulong n_chunks, GstByteReader * reader, ++ GstByteWriter * writer) + { +- FlxFrameChunk *hdr; + gboolean ret = TRUE; + +- g_return_val_if_fail (data != NULL, FALSE); +- +- while (count--) { +- hdr = (FlxFrameChunk *) data; +- FLX_FRAME_CHUNK_FIX_ENDIANNESS (hdr); +- data += FlxFrameChunkSize; ++ while (n_chunks--) { ++ GstByteReader chunk; ++ guint32 size; ++ guint16 type; ++ ++ if (!gst_byte_reader_get_uint32_le (reader, &size)) ++ goto parse_error; ++ if (!gst_byte_reader_get_uint16_le (reader, &type)) ++ goto parse_error; ++ GST_LOG_OBJECT (flxdec, "chunk has type 0x%02x size %d", type, size); ++ ++ if (!gst_byte_reader_get_sub_reader (reader, &chunk, ++ size - FlxFrameChunkSize)) { ++ GST_ERROR_OBJECT (flxdec, "Incorrect size in the chunk header"); ++ goto error; ++ } + +- switch (hdr->id) { ++ switch (type) { + case FLX_COLOR64: +- flx_decode_color (flxdec, data, dest, 2); +- data += rndalign (hdr->size) - FlxFrameChunkSize; ++ ret = flx_decode_color (flxdec, &chunk, writer, 2); + break; + + case FLX_COLOR256: +- flx_decode_color (flxdec, data, dest, 0); +- data += rndalign (hdr->size) - FlxFrameChunkSize; ++ ret = flx_decode_color (flxdec, &chunk, writer, 0); + break; + + case FLX_BRUN: +- ret = flx_decode_brun (flxdec, data, dest); +- data += rndalign (hdr->size) - FlxFrameChunkSize; ++ ret = flx_decode_brun (flxdec, &chunk, writer); + break; + + case FLX_LC: +- ret = flx_decode_delta_fli (flxdec, data, dest); +- data += rndalign (hdr->size) - FlxFrameChunkSize; ++ ret = flx_decode_delta_fli (flxdec, &chunk, writer); + break; + + case FLX_SS2: +- ret = flx_decode_delta_flc (flxdec, data, dest); +- data += rndalign (hdr->size) - FlxFrameChunkSize; ++ ret = flx_decode_delta_flc (flxdec, &chunk, writer); + break; + + case FLX_BLACK: +- memset (dest, 0, flxdec->size); ++ ret = gst_byte_writer_fill (writer, 0, flxdec->size); + break; + + case FLX_MINI: +- data += rndalign (hdr->size) - FlxFrameChunkSize; + break; + + default: +- GST_WARNING ("Unimplented chunk type: 0x%02x size: %d - skipping", +- hdr->id, hdr->size); +- data += rndalign (hdr->size) - FlxFrameChunkSize; ++ GST_WARNING ("Unimplemented chunk type: 0x%02x size: %d - skipping", ++ type, size); + break; + } + +@@ -263,43 +271,60 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, guchar * data, + } + + return ret; ++ ++parse_error: ++ GST_ERROR_OBJECT (flxdec, "Failed to decode chunk"); ++error: ++ return FALSE; + } + + +-static void +-flx_decode_color (GstFlxDec * flxdec, guchar * data, guchar * dest, gint scale) ++static gboolean ++flx_decode_color (GstFlxDec * flxdec, GstByteReader * reader, ++ GstByteWriter * writer, gint scale) + { +- guint packs, count, indx; ++ guint8 count, indx; ++ guint16 packs; + +- g_return_if_fail (flxdec != NULL); +- +- packs = (data[0] + (data[1] << 8)); +- +- data += 2; ++ if (!gst_byte_reader_get_uint16_le (reader, &packs)) ++ goto error; + indx = 0; + +- GST_LOG ("GstFlxDec: cmap packs: %d", packs); ++ GST_LOG ("GstFlxDec: cmap packs: %d", (guint) packs); + while (packs--) { ++ const guint8 *data; ++ guint16 actual_count; ++ + /* color map index + skip count */ +- indx += *data++; ++ if (!gst_byte_reader_get_uint8 (reader, &indx)) ++ goto error; + + /* number of rgb triplets */ +- count = *data++ & 0xff; +- if (count == 0) +- count = 256; ++ if (!gst_byte_reader_get_uint8 (reader, &count)) ++ goto error; + +- GST_LOG ("GstFlxDec: cmap count: %d (indx: %d)", count, indx); +- flx_set_palette_vector (flxdec->converter, indx, count, data, scale); ++ actual_count = count == 0 ? 256 : count; + +- data += (count * 3); ++ if (!gst_byte_reader_get_data (reader, count * 3, &data)) ++ goto error; ++ ++ GST_LOG_OBJECT (flxdec, "cmap count: %d (indx: %d)", actual_count, indx); ++ flx_set_palette_vector (flxdec->converter, indx, actual_count, ++ (guchar *) data, scale); + } ++ ++ return TRUE; ++ ++error: ++ GST_ERROR_OBJECT (flxdec, "Error decoding color palette"); ++ return FALSE; + } + + static gboolean +-flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) ++flx_decode_brun (GstFlxDec * flxdec, GstByteReader * reader, ++ GstByteWriter * writer) + { +- gulong count, lines, row; +- guchar x; ++ gulong lines, row; + + g_return_val_if_fail (flxdec != NULL, FALSE); + +@@ -310,82 +335,125 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) + * contain more then 255 RLE packets. we use the frame + * width instead. + */ +- data++; ++ if (!gst_byte_reader_skip (reader, 1)) ++ goto error; + + row = flxdec->hdr.width; + while (row) { +- count = *data++; ++ gint8 count; ++ ++ if (!gst_byte_reader_get_int8 (reader, &count)) ++ goto error; ++ ++ if (count <= 0) { ++ const guint8 *data; + +- if (count > 0x7f) { + /* literal run */ +- count = 0x100 - count; +- if ((glong) row - (glong) count < 0) { +- GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected."); ++ count = ABS (count); ++ ++ GST_LOG_OBJECT (flxdec, "have literal run of size %d", count); ++ ++ if (count > row) { ++ GST_ERROR_OBJECT (flxdec, "Invalid BRUN line detected. " ++ "bytes to write exceeds the end of the row"); + return FALSE; + } + row -= count; + +- while (count--) +- *dest++ = *data++; +- ++ if (!gst_byte_reader_get_data (reader, count, &data)) ++ goto error; ++ if (!gst_byte_writer_put_data (writer, data, count)) ++ goto error; + } else { +- if ((glong) row - (glong) count < 0) { +- GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected."); ++ guint8 x; ++ ++ GST_LOG_OBJECT (flxdec, "have replicate run of size %d", count); ++ ++ if (count > row) { ++ GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected." ++ "bytes to write exceeds the end of the row"); + return FALSE; + } + + /* replicate run */ + row -= count; +- x = *data++; + +- while (count--) +- *dest++ = x; ++ if (!gst_byte_reader_get_uint8 (reader, &x)) ++ goto error; ++ if (!gst_byte_writer_fill (writer, x, count)) ++ goto error; + } + } + } + + return TRUE; ++ ++error: ++ GST_ERROR_OBJECT (flxdec, "Failed to decode BRUN packet"); ++ return FALSE; + } + + static gboolean +-flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) ++flx_decode_delta_fli (GstFlxDec * flxdec, GstByteReader * reader, ++ GstByteWriter * writer) + { +- gulong count, packets, lines, start_line; +- guchar *start_p, x; ++ guint16 start_line, lines; ++ guint line_start_i; + + g_return_val_if_fail (flxdec != NULL, FALSE); + g_return_val_if_fail (flxdec->delta_data != NULL, FALSE); + + /* use last frame for delta */ +- memcpy (dest, flxdec->delta_data, flxdec->size); ++ if (!gst_byte_writer_put_data (writer, flxdec->delta_data, flxdec->size)) ++ goto error; ++ ++ if (!gst_byte_reader_get_uint16_le (reader, &start_line)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &lines)) ++ goto error; ++ GST_LOG_OBJECT (flxdec, "height %d start line %d line count %d", ++ flxdec->hdr.height, start_line, lines); + +- start_line = (data[0] + (data[1] << 8)); +- lines = (data[2] + (data[3] << 8)); + if (start_line + lines > flxdec->hdr.height) { + GST_ERROR_OBJECT (flxdec, "Invalid FLI packet detected. too many lines."); + return FALSE; + } +- data += 4; + +- /* start position of delta */ +- dest += (flxdec->hdr.width * start_line); +- start_p = dest; ++ line_start_i = flxdec->hdr.width * start_line; ++ if (!gst_byte_writer_set_pos (writer, line_start_i)) ++ goto error; + + while (lines--) { ++ guint8 packets; ++ + /* packet count */ +- packets = *data++; ++ if (!gst_byte_reader_get_uint8 (reader, &packets)) ++ goto error; ++ GST_LOG_OBJECT (flxdec, "have %d packets", packets); + + while (packets--) { + /* skip count */ +- guchar skip = *data++; +- dest += skip; ++ guint8 skip; ++ gint8 count; ++ if (!gst_byte_reader_get_uint8 (reader, &skip)) ++ goto error; ++ ++ /* skip bytes */ ++ if (!gst_byte_writer_set_pos (writer, ++ gst_byte_writer_get_pos (writer) + skip)) ++ goto error; + + /* RLE count */ +- count = *data++; ++ if (!gst_byte_reader_get_int8 (reader, &count)) ++ goto error; ++ ++ if (count < 0) { ++ guint8 x; + +- if (count > 0x7f) { + /* literal run */ +- count = 0x100 - count; ++ count = ABS (count); ++ GST_LOG_OBJECT (flxdec, "have literal run of size %d at offset %d", ++ count, skip); + + if (skip + count > flxdec->hdr.width) { + GST_ERROR_OBJECT (flxdec, "Invalid FLI packet detected. " +@@ -393,11 +461,16 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) + return FALSE; + } + +- x = *data++; +- while (count--) +- *dest++ = x; +- ++ if (!gst_byte_reader_get_uint8 (reader, &x)) ++ goto error; ++ if (!gst_byte_writer_fill (writer, x, count)) ++ goto error; + } else { ++ const guint8 *data; ++ ++ GST_LOG_OBJECT (flxdec, "have replicate run of size %d at offset %d", ++ count, skip); ++ + if (skip + count > flxdec->hdr.width) { + GST_ERROR_OBJECT (flxdec, "Invalid FLI packet detected. " + "line too long."); +@@ -405,45 +478,60 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) + } + + /* replicate run */ +- while (count--) +- *dest++ = *data++; ++ if (!gst_byte_reader_get_data (reader, count, &data)) ++ goto error; ++ if (!gst_byte_writer_put_data (writer, data, count)) ++ goto error; + } + } +- start_p += flxdec->hdr.width; +- dest = start_p; ++ line_start_i += flxdec->hdr.width; ++ if (!gst_byte_writer_set_pos (writer, line_start_i)) ++ goto error; + } + + return TRUE; ++ ++error: ++ GST_ERROR_OBJECT (flxdec, "Failed to decode FLI packet"); ++ return FALSE; + } + + static gboolean +-flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) ++flx_decode_delta_flc (GstFlxDec * flxdec, GstByteReader * reader, ++ GstByteWriter * writer) + { +- gulong count, lines, start_l, opcode; +- guchar *start_p; ++ guint16 lines, start_l; + + g_return_val_if_fail (flxdec != NULL, FALSE); + g_return_val_if_fail (flxdec->delta_data != NULL, FALSE); + + /* use last frame for delta */ +- memcpy (dest, flxdec->delta_data, flxdec->size); ++ if (!gst_byte_writer_put_data (writer, flxdec->delta_data, flxdec->size)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &lines)) ++ goto error; + +- lines = (data[0] + (data[1] << 8)); + if (lines > flxdec->hdr.height) { + GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. too many lines."); + return FALSE; + } +- data += 2; + +- start_p = dest; + start_l = lines; + + while (lines) { +- dest = start_p + (flxdec->hdr.width * (start_l - lines)); ++ guint16 opcode; ++ ++ if (!gst_byte_writer_set_pos (writer, ++ flxdec->hdr.width * (start_l - lines))) ++ goto error; + + /* process opcode(s) */ +- while ((opcode = (data[0] + (data[1] << 8))) & 0xc000) { +- data += 2; ++ while (TRUE) { ++ if (!gst_byte_reader_get_uint16_le (reader, &opcode)) ++ goto error; ++ if ((opcode & 0xc000) == 0) ++ break; ++ + if ((opcode & 0xc000) == 0xc000) { + /* line skip count */ + gulong skip = (0x10000 - opcode); +@@ -453,27 +541,44 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + return FALSE; + } + start_l += skip; +- dest += flxdec->hdr.width * skip; ++ if (!gst_byte_writer_set_pos (writer, ++ gst_byte_writer_get_pos (writer) + flxdec->hdr.width * skip)) ++ goto error; + } else { + /* last pixel */ +- dest += flxdec->hdr.width; +- *dest++ = (opcode & 0xff); ++ if (!gst_byte_writer_set_pos (writer, ++ gst_byte_writer_get_pos (writer) + flxdec->hdr.width)) ++ goto error; ++ if (!gst_byte_writer_put_uint8 (writer, opcode & 0xff)) ++ goto error; + } + } +- data += 2; + + /* last opcode is the packet count */ ++ GST_LOG_OBJECT (flxdec, "have %d packets", opcode); + while (opcode--) { + /* skip count */ +- guchar skip = *data++; +- dest += skip; ++ guint8 skip; ++ gint8 count; ++ ++ if (!gst_byte_reader_get_uint8 (reader, &skip)) ++ goto error; ++ if (!gst_byte_writer_set_pos (writer, ++ gst_byte_writer_get_pos (writer) + skip)) ++ goto error; + + /* RLE count */ +- count = *data++; ++ if (!gst_byte_reader_get_int8 (reader, &count)) ++ goto error; ++ ++ if (count < 0) { ++ guint16 x; + +- if (count > 0x7f) { + /* replicate word run */ +- count = 0x100 - count; ++ count = ABS (count); ++ ++ GST_LOG_OBJECT (flxdec, "have replicate run of size %d at offset %d", ++ count, skip); + + if (skip + count > flxdec->hdr.width) { + GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. " +@@ -481,22 +586,31 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + return FALSE; + } + ++ if (!gst_byte_reader_get_uint16_le (reader, &x)) ++ goto error; ++ + while (count--) { +- *dest++ = data[0]; +- *dest++ = data[1]; ++ if (!gst_byte_writer_put_uint16_le (writer, x)) { ++ goto error; ++ } + } +- data += 2; + } else { ++ GST_LOG_OBJECT (flxdec, "have literal run of size %d at offset %d", ++ count, skip); ++ + if (skip + count > flxdec->hdr.width) { + GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. " + "line too long."); + return FALSE; + } + +- /* literal word run */ + while (count--) { +- *dest++ = *data++; +- *dest++ = *data++; ++ guint16 x; ++ ++ if (!gst_byte_reader_get_uint16_le (reader, &x)) ++ goto error; ++ if (!gst_byte_writer_put_uint16_le (writer, x)) ++ goto error; + } + } + } +@@ -504,13 +618,91 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + } + + return TRUE; ++ ++error: ++ GST_ERROR_OBJECT (flxdec, "Failed to decode FLI packet"); ++ return FALSE; ++} ++ ++static gboolean ++_read_flx_header (GstFlxDec * flxdec, GstByteReader * reader, FlxHeader * flxh) ++{ ++ memset (flxh, 0, sizeof (*flxh)); ++ ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->size)) ++ goto error; ++ if (flxh->size < FlxHeaderSize) { ++ GST_ERROR_OBJECT (flxdec, "Invalid file size in the header"); ++ return FALSE; ++ } ++ ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->type)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->frames)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->width)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->height)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->depth)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->flags)) ++ goto error; ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->speed)) ++ goto error; ++ if (!gst_byte_reader_skip (reader, 2)) /* reserved */ ++ goto error; ++ /* FLC */ ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->created)) ++ goto error; ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->creator)) ++ goto error; ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->updated)) ++ goto error; ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->updater)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->aspect_dx)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->aspect_dy)) ++ goto error; ++ /* EGI */ ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->ext_flags)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->keyframes)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->totalframes)) ++ goto error; ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->req_memory)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->max_regions)) ++ goto error; ++ if (!gst_byte_reader_get_uint16_le (reader, &flxh->transp_num)) ++ goto error; ++ if (!gst_byte_reader_skip (reader, 24)) /* reserved */ ++ goto error; ++ /* FLC */ ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->oframe1)) ++ goto error; ++ if (!gst_byte_reader_get_uint32_le (reader, &flxh->oframe2)) ++ goto error; ++ if (!gst_byte_reader_skip (reader, 40)) /* reserved */ ++ goto error; ++ ++ return TRUE; ++ ++error: ++ GST_ERROR_OBJECT (flxdec, "Error reading file header"); ++ return FALSE; + } + + static GstFlowReturn + gst_flxdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + { ++ GstByteReader reader; ++ GstBuffer *input; ++ GstMapInfo map_info; + GstCaps *caps; +- guint avail; ++ guint available; + GstFlowReturn res = GST_FLOW_OK; + + GstFlxDec *flxdec; +@@ -521,31 +713,50 @@ gst_flxdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + g_return_val_if_fail (flxdec != NULL, GST_FLOW_ERROR); + + gst_adapter_push (flxdec->adapter, buf); +- avail = gst_adapter_available (flxdec->adapter); ++ available = gst_adapter_available (flxdec->adapter); ++ input = gst_adapter_get_buffer (flxdec->adapter, available); ++ if (!gst_buffer_map (input, &map_info, GST_MAP_READ)) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Failed to map buffer"), (NULL)); ++ goto error; ++ } ++ gst_byte_reader_init (&reader, map_info.data, map_info.size); + + if (flxdec->state == GST_FLXDEC_READ_HEADER) { +- if (avail >= FlxHeaderSize) { +- const guint8 *data = gst_adapter_map (flxdec->adapter, FlxHeaderSize); ++ if (available >= FlxHeaderSize) { ++ GstByteReader header; + GstCaps *templ; + +- memcpy ((gchar *) & flxdec->hdr, data, FlxHeaderSize); +- FLX_HDR_FIX_ENDIANNESS (&(flxdec->hdr)); +- gst_adapter_unmap (flxdec->adapter); ++ if (!gst_byte_reader_get_sub_reader (&reader, &header, FlxHeaderSize)) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Could not read header"), (NULL)); ++ goto unmap_input_error; ++ } + gst_adapter_flush (flxdec->adapter, FlxHeaderSize); ++ available -= FlxHeaderSize; ++ ++ if (!_read_flx_header (flxdec, &header, &flxdec->hdr)) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Failed to parse header"), (NULL)); ++ goto unmap_input_error; ++ } + + flxh = &flxdec->hdr; + + /* check header */ + if (flxh->type != FLX_MAGICHDR_FLI && +- flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) +- goto wrong_type; ++ flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, WRONG_TYPE, (NULL), ++ ("not a flx file (type %x)", flxh->type)); ++ goto unmap_input_error; ++ } + +- GST_LOG ("size : %d", flxh->size); +- GST_LOG ("frames : %d", flxh->frames); +- GST_LOG ("width : %d", flxh->width); +- GST_LOG ("height : %d", flxh->height); +- GST_LOG ("depth : %d", flxh->depth); +- GST_LOG ("speed : %d", flxh->speed); ++ GST_INFO_OBJECT (flxdec, "size : %d", flxh->size); ++ GST_INFO_OBJECT (flxdec, "frames : %d", flxh->frames); ++ GST_INFO_OBJECT (flxdec, "width : %d", flxh->width); ++ GST_INFO_OBJECT (flxdec, "height : %d", flxh->height); ++ GST_INFO_OBJECT (flxdec, "depth : %d", flxh->depth); ++ GST_INFO_OBJECT (flxdec, "speed : %d", flxh->speed); + + flxdec->next_time = 0; + +@@ -573,18 +784,32 @@ gst_flxdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + gst_pad_set_caps (flxdec->srcpad, caps); + gst_caps_unref (caps); + +- if (flxh->depth <= 8) +- flxdec->converter = +- flx_colorspace_converter_new (flxh->width, flxh->height); ++ /* zero means 8 */ ++ if (flxh->depth == 0) ++ flxh->depth = 8; ++ ++ if (flxh->depth != 8) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, WRONG_TYPE, ++ ("%s", "Don't know how to decode non 8 bit depth streams"), (NULL)); ++ goto unmap_input_error; ++ } ++ ++ flxdec->converter = ++ flx_colorspace_converter_new (flxh->width, flxh->height); + + if (flxh->type == FLX_MAGICHDR_FLC || flxh->type == FLX_MAGICHDR_FLX) { +- GST_LOG ("(FLC) aspect_dx : %d", flxh->aspect_dx); +- GST_LOG ("(FLC) aspect_dy : %d", flxh->aspect_dy); +- GST_LOG ("(FLC) oframe1 : 0x%08x", flxh->oframe1); +- GST_LOG ("(FLC) oframe2 : 0x%08x", flxh->oframe2); ++ GST_INFO_OBJECT (flxdec, "(FLC) aspect_dx : %d", flxh->aspect_dx); ++ GST_INFO_OBJECT (flxdec, "(FLC) aspect_dy : %d", flxh->aspect_dy); ++ GST_INFO_OBJECT (flxdec, "(FLC) oframe1 : 0x%08x", flxh->oframe1); ++ GST_INFO_OBJECT (flxdec, "(FLC) oframe2 : 0x%08x", flxh->oframe2); + } + + flxdec->size = ((guint) flxh->width * (guint) flxh->height); ++ if (flxdec->size >= G_MAXSIZE / 4) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Cannot allocate required memory"), (NULL)); ++ goto unmap_input_error; ++ } + + /* create delta and output frame */ + flxdec->frame_data = g_malloc (flxdec->size); +@@ -596,55 +821,66 @@ gst_flxdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + GstBuffer *out; + + /* while we have enough data in the adapter */ +- while (avail >= FlxFrameChunkSize && res == GST_FLOW_OK) { +- FlxFrameChunk flxfh; +- guchar *chunk; +- const guint8 *data; +- GstMapInfo map; +- +- chunk = NULL; +- data = gst_adapter_map (flxdec->adapter, FlxFrameChunkSize); +- memcpy (&flxfh, data, FlxFrameChunkSize); +- FLX_FRAME_CHUNK_FIX_ENDIANNESS (&flxfh); +- gst_adapter_unmap (flxdec->adapter); +- +- switch (flxfh.id) { +- case FLX_FRAME_TYPE: +- /* check if we have the complete frame */ +- if (avail < flxfh.size) +- goto need_more_data; +- +- /* flush header */ +- gst_adapter_flush (flxdec->adapter, FlxFrameChunkSize); +- +- chunk = gst_adapter_take (flxdec->adapter, +- flxfh.size - FlxFrameChunkSize); +- FLX_FRAME_TYPE_FIX_ENDIANNESS ((FlxFrameType *) chunk); +- if (((FlxFrameType *) chunk)->chunks == 0) +- break; ++ while (available >= FlxFrameChunkSize && res == GST_FLOW_OK) { ++ guint32 size; ++ guint16 type; + +- /* create 32 bits output frame */ +-// res = gst_pad_alloc_buffer_and_set_caps (flxdec->srcpad, +-// GST_BUFFER_OFFSET_NONE, +-// flxdec->size * 4, GST_PAD_CAPS (flxdec->srcpad), &out); +-// if (res != GST_FLOW_OK) +-// break; ++ if (!gst_byte_reader_get_uint32_le (&reader, &size)) ++ goto parse_error; ++ if (available < size) ++ goto need_more_data; + +- out = gst_buffer_new_and_alloc (flxdec->size * 4); ++ available -= size; ++ gst_adapter_flush (flxdec->adapter, size); ++ ++ if (!gst_byte_reader_get_uint16_le (&reader, &type)) ++ goto parse_error; ++ ++ switch (type) { ++ case FLX_FRAME_TYPE:{ ++ GstByteReader chunks; ++ GstByteWriter writer; ++ guint16 n_chunks; ++ GstMapInfo map; ++ ++ GST_LOG_OBJECT (flxdec, "Have frame type 0x%02x of size %d", type, ++ size); ++ ++ if (!gst_byte_reader_get_sub_reader (&reader, &chunks, ++ size - FlxFrameChunkSize)) ++ goto parse_error; ++ ++ if (!gst_byte_reader_get_uint16_le (&chunks, &n_chunks)) ++ goto parse_error; ++ GST_LOG_OBJECT (flxdec, "Have %d chunks", n_chunks); ++ ++ if (n_chunks == 0) ++ break; ++ if (!gst_byte_reader_skip (&chunks, 8)) /* reserved */ ++ goto parse_error; ++ ++ gst_byte_writer_init_with_data (&writer, flxdec->frame_data, ++ flxdec->size, TRUE); + + /* decode chunks */ +- if (!flx_decode_chunks (flxdec, +- ((FlxFrameType *) chunk)->chunks, +- chunk + FlxFrameTypeSize, flxdec->frame_data)) { ++ if (!flx_decode_chunks (flxdec, n_chunks, &chunks, &writer)) { + GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, + ("%s", "Could not decode chunk"), NULL); +- return GST_FLOW_ERROR; ++ goto unmap_input_error; + } ++ gst_byte_writer_reset (&writer); + + /* save copy of the current frame for possible delta. */ + memcpy (flxdec->delta_data, flxdec->frame_data, flxdec->size); + +- gst_buffer_map (out, &map, GST_MAP_WRITE); ++ out = gst_buffer_new_and_alloc (flxdec->size * 4); ++ if (!gst_buffer_map (out, &map, GST_MAP_WRITE)) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Could not map output buffer"), NULL); ++ gst_buffer_unref (out); ++ goto unmap_input_error; ++ } ++ + /* convert current frame. */ + flx_colorspace_convert (flxdec->converter, flxdec->frame_data, + map.data); +@@ -655,30 +891,32 @@ gst_flxdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + + res = gst_pad_push (flxdec->srcpad, out); + break; ++ } + default: +- /* check if we have the complete frame */ +- if (avail < flxfh.size) +- goto need_more_data; +- +- gst_adapter_flush (flxdec->adapter, flxfh.size); ++ GST_DEBUG_OBJECT (flxdec, "Unknown frame type 0x%02x, skipping %d", ++ type, size); ++ if (!gst_byte_reader_skip (&reader, size - FlxFrameChunkSize)) ++ goto parse_error; + break; + } +- +- g_free (chunk); +- +- avail = gst_adapter_available (flxdec->adapter); + } + } ++ ++ gst_buffer_unmap (input, &map_info); ++ gst_buffer_unref (input); ++ + need_more_data: + return res; + + /* ERRORS */ +-wrong_type: +- { +- GST_ELEMENT_ERROR (flxdec, STREAM, WRONG_TYPE, (NULL), +- ("not a flx file (type %x)", flxh->type)); +- return GST_FLOW_ERROR; +- } ++parse_error: ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Failed to parse stream"), (NULL)); ++unmap_input_error: ++ gst_buffer_unmap (input, &map_info); ++ gst_buffer_unref (input); ++error: ++ return GST_FLOW_ERROR; + } + + static GstStateChangeReturn +diff --git a/gst/flx/gstflxdec.h b/gst/flx/gstflxdec.h +index 3f9a0aa..4fd8dfd 100644 +--- a/gst/flx/gstflxdec.h ++++ b/gst/flx/gstflxdec.h +@@ -23,6 +23,8 @@ + #include + + #include ++#include ++#include + #include "flx_color.h" + + G_BEGIN_DECLS +@@ -45,7 +47,7 @@ struct _GstFlxDec { + + guint8 *delta_data, *frame_data; + GstAdapter *adapter; +- gulong size; ++ gsize size; + GstFlxDecState state; + gint64 frame_time; + gint64 next_time; +-- +2.10.2 + diff --git a/gnu/packages/patches/gst-plugins-good-fix-invalid-read.patch b/gnu/packages/patches/gst-plugins-good-fix-invalid-read.patch new file mode 100644 index 0000000000..1daaa2ae15 --- /dev/null +++ b/gnu/packages/patches/gst-plugins-good-fix-invalid-read.patch @@ -0,0 +1,37 @@ +Fixes upstream bug #774897 (flxdec: Unreferences itself one time too many on +invalid files): + +https://bugzilla.gnome.org/show_bug.cgi?id=774897 + +Patch copied from upstream source repository: + +https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=b31c504645a814c59d91d49e4fe218acaf93f4ca + +From b31c504645a814c59d91d49e4fe218acaf93f4ca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Wed, 23 Nov 2016 11:20:49 +0200 +Subject: [PATCH] flxdec: Don't unref() parent in the chain function + +We don't own the reference here, it is owned by the caller and given to +us for the scope of this function. Leftover mistake from 0.10 porting. + +https://bugzilla.gnome.org/show_bug.cgi?id=774897 +--- + gst/flx/gstflxdec.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c +index e675c99..a237976 100644 +--- a/gst/flx/gstflxdec.c ++++ b/gst/flx/gstflxdec.c +@@ -677,7 +677,6 @@ wrong_type: + { + GST_ELEMENT_ERROR (flxdec, STREAM, WRONG_TYPE, (NULL), + ("not a flx file (type %x)", flxh->type)); +- gst_object_unref (flxdec); + return GST_FLOW_ERROR; + } + } +-- +2.10.2 + diff --git a/gnu/packages/patches/gst-plugins-good-fix-signedness.patch b/gnu/packages/patches/gst-plugins-good-fix-signedness.patch new file mode 100644 index 0000000000..a3e20e19dd --- /dev/null +++ b/gnu/packages/patches/gst-plugins-good-fix-signedness.patch @@ -0,0 +1,58 @@ +This is a followup fix for upstream bug #774834 (flic decoder: Buffer overflow +in flx_decode_delta_fli): + +https://bugzilla.gnome.org/show_bug.cgi?id=774834#c2 + +Patch copied from upstream source repository: + +https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=1ab2b26193861b124426e2f8eb62b75b59ec5488 + +From 1ab2b26193861b124426e2f8eb62b75b59ec5488 Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Tue, 22 Nov 2016 23:46:00 +1100 +Subject: [PATCH] flxdec: fix some warnings comparing unsigned < 0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +bf43f44fcfada5ec4a3ce60cb374340486fe9fac was comparing an unsigned +expression to be < 0 which was always false. + +gstflxdec.c: In function ‘flx_decode_brun’: +gstflxdec.c:322:33: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] + if ((glong) row - count < 0) { + ^ +gstflxdec.c:332:33: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] + if ((glong) row - count < 0) { + ^ + +https://bugzilla.gnome.org/show_bug.cgi?id=774834 +--- + gst/flx/gstflxdec.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c +index d51a8e6..e675c99 100644 +--- a/gst/flx/gstflxdec.c ++++ b/gst/flx/gstflxdec.c +@@ -319,7 +319,7 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) + if (count > 0x7f) { + /* literal run */ + count = 0x100 - count; +- if ((glong) row - count < 0) { ++ if ((glong) row - (glong) count < 0) { + GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected."); + return FALSE; + } +@@ -329,7 +329,7 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) + *dest++ = *data++; + + } else { +- if ((glong) row - count < 0) { ++ if ((glong) row - (glong) count < 0) { + GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected."); + return FALSE; + } +-- +2.10.2 + diff --git a/gnu/packages/patches/gst-plugins-good-flic-bounds-check.patch b/gnu/packages/patches/gst-plugins-good-flic-bounds-check.patch new file mode 100644 index 0000000000..f77dca2cd6 --- /dev/null +++ b/gnu/packages/patches/gst-plugins-good-flic-bounds-check.patch @@ -0,0 +1,319 @@ +Fix CVE-2016-{9634,9635,9636}. + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9634 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9635 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9636 + +This fixes upstream bug #774834 (flic decoder: Buffer overflow in +flx_decode_delta_fli): + +https://bugzilla.gnome.org/show_bug.cgi?id=774834 + +Patch copied from upstream source repository: + +https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=2e203a79b7d9af4029307c1a845b3c148d5f5e62 + +From 2e203a79b7d9af4029307c1a845b3c148d5f5e62 Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Tue, 22 Nov 2016 19:05:00 +1100 +Subject: [PATCH] flxdec: add some write bounds checking + +Without checking the bounds of the frame we are writing into, we can +write off the end of the destination buffer. + +https://scarybeastsecurity.blogspot.dk/2016/11/0day-exploit-advancing-exploitation.html + +https://bugzilla.gnome.org/show_bug.cgi?id=774834 +--- + gst/flx/gstflxdec.c | 116 +++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 91 insertions(+), 25 deletions(-) + +diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c +index 604be2f..d51a8e6 100644 +--- a/gst/flx/gstflxdec.c ++++ b/gst/flx/gstflxdec.c +@@ -74,9 +74,9 @@ static gboolean gst_flxdec_src_query_handler (GstPad * pad, GstObject * parent, + GstQuery * query); + + static void flx_decode_color (GstFlxDec *, guchar *, guchar *, gint); +-static void flx_decode_brun (GstFlxDec *, guchar *, guchar *); +-static void flx_decode_delta_fli (GstFlxDec *, guchar *, guchar *); +-static void flx_decode_delta_flc (GstFlxDec *, guchar *, guchar *); ++static gboolean flx_decode_brun (GstFlxDec *, guchar *, guchar *); ++static gboolean flx_decode_delta_fli (GstFlxDec *, guchar *, guchar *); ++static gboolean flx_decode_delta_flc (GstFlxDec *, guchar *, guchar *); + + #define rndalign(off) ((off) + ((off) & 1)) + +@@ -203,13 +203,14 @@ gst_flxdec_sink_event_handler (GstPad * pad, GstObject * parent, + return ret; + } + +-static void ++static gboolean + flx_decode_chunks (GstFlxDec * flxdec, gulong count, guchar * data, + guchar * dest) + { + FlxFrameChunk *hdr; ++ gboolean ret = TRUE; + +- g_return_if_fail (data != NULL); ++ g_return_val_if_fail (data != NULL, FALSE); + + while (count--) { + hdr = (FlxFrameChunk *) data; +@@ -228,17 +229,17 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, guchar * data, + break; + + case FLX_BRUN: +- flx_decode_brun (flxdec, data, dest); ++ ret = flx_decode_brun (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; + + case FLX_LC: +- flx_decode_delta_fli (flxdec, data, dest); ++ ret = flx_decode_delta_fli (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; + + case FLX_SS2: +- flx_decode_delta_flc (flxdec, data, dest); ++ ret = flx_decode_delta_flc (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; + +@@ -256,7 +257,12 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, guchar * data, + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; + } ++ ++ if (!ret) ++ break; + } ++ ++ return ret; + } + + +@@ -289,13 +295,13 @@ flx_decode_color (GstFlxDec * flxdec, guchar * data, guchar * dest, gint scale) + } + } + +-static void ++static gboolean + flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) + { + gulong count, lines, row; + guchar x; + +- g_return_if_fail (flxdec != NULL); ++ g_return_val_if_fail (flxdec != NULL, FALSE); + + lines = flxdec->hdr.height; + while (lines--) { +@@ -313,12 +319,21 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) + if (count > 0x7f) { + /* literal run */ + count = 0x100 - count; ++ if ((glong) row - count < 0) { ++ GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected."); ++ return FALSE; ++ } + row -= count; + + while (count--) + *dest++ = *data++; + + } else { ++ if ((glong) row - count < 0) { ++ GST_ERROR_OBJECT (flxdec, "Invalid BRUN packet detected."); ++ return FALSE; ++ } ++ + /* replicate run */ + row -= count; + x = *data++; +@@ -328,22 +343,28 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) + } + } + } ++ ++ return TRUE; + } + +-static void ++static gboolean + flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) + { + gulong count, packets, lines, start_line; + guchar *start_p, x; + +- g_return_if_fail (flxdec != NULL); +- g_return_if_fail (flxdec->delta_data != NULL); ++ g_return_val_if_fail (flxdec != NULL, FALSE); ++ g_return_val_if_fail (flxdec->delta_data != NULL, FALSE); + + /* use last frame for delta */ + memcpy (dest, flxdec->delta_data, flxdec->size); + + start_line = (data[0] + (data[1] << 8)); + lines = (data[2] + (data[3] << 8)); ++ if (start_line + lines > flxdec->hdr.height) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLI packet detected. too many lines."); ++ return FALSE; ++ } + data += 4; + + /* start position of delta */ +@@ -356,7 +377,8 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) + + while (packets--) { + /* skip count */ +- dest += *data++; ++ guchar skip = *data++; ++ dest += skip; + + /* RLE count */ + count = *data++; +@@ -364,12 +386,24 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) + if (count > 0x7f) { + /* literal run */ + count = 0x100 - count; +- x = *data++; + ++ if (skip + count > flxdec->hdr.width) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLI packet detected. " ++ "line too long."); ++ return FALSE; ++ } ++ ++ x = *data++; + while (count--) + *dest++ = x; + + } else { ++ if (skip + count > flxdec->hdr.width) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLI packet detected. " ++ "line too long."); ++ return FALSE; ++ } ++ + /* replicate run */ + while (count--) + *dest++ = *data++; +@@ -378,21 +412,27 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) + start_p += flxdec->hdr.width; + dest = start_p; + } ++ ++ return TRUE; + } + +-static void ++static gboolean + flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + { + gulong count, lines, start_l, opcode; + guchar *start_p; + +- g_return_if_fail (flxdec != NULL); +- g_return_if_fail (flxdec->delta_data != NULL); ++ g_return_val_if_fail (flxdec != NULL, FALSE); ++ g_return_val_if_fail (flxdec->delta_data != NULL, FALSE); + + /* use last frame for delta */ + memcpy (dest, flxdec->delta_data, flxdec->size); + + lines = (data[0] + (data[1] << 8)); ++ if (lines > flxdec->hdr.height) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. too many lines."); ++ return FALSE; ++ } + data += 2; + + start_p = dest; +@@ -405,9 +445,15 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + while ((opcode = (data[0] + (data[1] << 8))) & 0xc000) { + data += 2; + if ((opcode & 0xc000) == 0xc000) { +- /* skip count */ +- start_l += (0x10000 - opcode); +- dest += flxdec->hdr.width * (0x10000 - opcode); ++ /* line skip count */ ++ gulong skip = (0x10000 - opcode); ++ if (skip > flxdec->hdr.height) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. " ++ "skip line count too big."); ++ return FALSE; ++ } ++ start_l += skip; ++ dest += flxdec->hdr.width * skip; + } else { + /* last pixel */ + dest += flxdec->hdr.width; +@@ -419,7 +465,8 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + /* last opcode is the packet count */ + while (opcode--) { + /* skip count */ +- dest += *data++; ++ guchar skip = *data++; ++ dest += skip; + + /* RLE count */ + count = *data++; +@@ -427,12 +474,25 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + if (count > 0x7f) { + /* replicate word run */ + count = 0x100 - count; ++ ++ if (skip + count > flxdec->hdr.width) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. " ++ "line too long."); ++ return FALSE; ++ } ++ + while (count--) { + *dest++ = data[0]; + *dest++ = data[1]; + } + data += 2; + } else { ++ if (skip + count > flxdec->hdr.width) { ++ GST_ERROR_OBJECT (flxdec, "Invalid FLC packet detected. " ++ "line too long."); ++ return FALSE; ++ } ++ + /* literal word run */ + while (count--) { + *dest++ = *data++; +@@ -442,6 +502,8 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) + } + lines--; + } ++ ++ return TRUE; + } + + static GstFlowReturn +@@ -571,9 +633,13 @@ gst_flxdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + out = gst_buffer_new_and_alloc (flxdec->size * 4); + + /* decode chunks */ +- flx_decode_chunks (flxdec, +- ((FlxFrameType *) chunk)->chunks, +- chunk + FlxFrameTypeSize, flxdec->frame_data); ++ if (!flx_decode_chunks (flxdec, ++ ((FlxFrameType *) chunk)->chunks, ++ chunk + FlxFrameTypeSize, flxdec->frame_data)) { ++ GST_ELEMENT_ERROR (flxdec, STREAM, DECODE, ++ ("%s", "Could not decode chunk"), NULL); ++ return GST_FLOW_ERROR; ++ } + + /* save copy of the current frame for possible delta. */ + memcpy (flxdec->delta_data, flxdec->frame_data, flxdec->size); +-- +2.10.2 + From 439a2f62ceba61b6148df85af952662e1a0a2f33 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 26 Nov 2016 22:53:13 +0200 Subject: [PATCH 030/130] gnu: ffmpeg: Update to 3.2.1. * gnu/packages/video.scm (ffmpeg): Update to 3.2.1. --- gnu/packages/video.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 4eab99b5aa..3b93f27426 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -441,14 +441,14 @@ standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).") (define-public ffmpeg (package (name "ffmpeg") - (version "3.2") + (version "3.2.1") (source (origin (method url-fetch) (uri (string-append "https://ffmpeg.org/releases/ffmpeg-" version ".tar.xz")) (sha256 (base32 - "1nnmd3h9pr2zic08isjcm1cmvcyd0aimpayb9r4qy45bihdhrxw8")))) + "1pxsy9s9n2nvz970rid3j3b45w6s7ziwnrbc16rny7k0bpd97kqy")))) (build-system gnu-build-system) (inputs `(("fontconfig" ,fontconfig) From cd65d600ac6e8701ef9c54f5d09a45cd6c149949 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 26 Nov 2016 15:03:06 -0500 Subject: [PATCH 031/130] gnu: cyrus-sasl: Fix CVE-2013-4122. * gnu/packages/patches/cyrus-sasl-CVE-2013-4122.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/cyrus-sasl.scm (cyrus-sasl)[replacement]: New field. (cyrus-sasl/fixed): New variable. [source]: Use patch. --- gnu/local.mk | 1 + gnu/packages/cyrus-sasl.scm | 9 ++ .../patches/cyrus-sasl-CVE-2013-4122.patch | 130 ++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 gnu/packages/patches/cyrus-sasl-CVE-2013-4122.patch diff --git a/gnu/local.mk b/gnu/local.mk index 8ca4d932d3..dfa9c0077d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -506,6 +506,7 @@ dist_patch_DATA = \ %D%/packages/patches/cssc-missing-include.patch \ %D%/packages/patches/clucene-contribs-lib.patch \ %D%/packages/patches/cursynth-wave-rand.patch \ + %D%/packages/patches/cyrus-sasl-CVE-2013-4122.patch \ %D%/packages/patches/dbus-helper-search-path.patch \ %D%/packages/patches/devil-CVE-2009-3994.patch \ %D%/packages/patches/devil-fix-libpng.patch \ diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm index 99ff1e228e..89a4a49797 100644 --- a/gnu/packages/cyrus-sasl.scm +++ b/gnu/packages/cyrus-sasl.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge +;;; Copyright © 2016 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,6 +31,7 @@ (define-public cyrus-sasl (package (name "cyrus-sasl") + (replacement cyrus-sasl/fixed) (version "2.1.26") (source (origin (method url-fetch) @@ -64,3 +66,10 @@ server writers.") (license (license:non-copyleft "file://COPYING" "See COPYING in the distribution.")) (home-page "http://cyrusimap.web.cmu.edu"))) + +(define cyrus-sasl/fixed + (package + (inherit cyrus-sasl) + (source (origin + (inherit (package-source cyrus-sasl)) + (patches (search-patches "cyrus-sasl-CVE-2013-4122.patch")))))) diff --git a/gnu/packages/patches/cyrus-sasl-CVE-2013-4122.patch b/gnu/packages/patches/cyrus-sasl-CVE-2013-4122.patch new file mode 100644 index 0000000000..fc72e42e03 --- /dev/null +++ b/gnu/packages/patches/cyrus-sasl-CVE-2013-4122.patch @@ -0,0 +1,130 @@ +Fix CVE-2013-4122. + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-4122 + +Patch copied from upstream source repository: +https://github.com/cyrusimap/cyrus-sasl/commit/dedad73e5e7a75d01a5f3d5a6702ab8ccd2ff40d + +From dedad73e5e7a75d01a5f3d5a6702ab8ccd2ff40d Mon Sep 17 00:00:00 2001 +From: mancha +Date: Thu, 11 Jul 2013 10:08:07 +0100 +Subject: Handle NULL returns from glibc 2.17+ crypt() + +Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL +(w/ NULL return) if the salt violates specifications. Additionally, +on FIPS-140 enabled Linux systems, DES/MD5-encrypted passwords +passed to crypt() fail with EPERM (w/ NULL return). + +When using glibc's crypt(), check return value to avoid a possible +NULL pointer dereference. + +Patch by mancha1@hush.com. +--- + pwcheck/pwcheck_getpwnam.c | 3 ++- + pwcheck/pwcheck_getspnam.c | 4 +++- + saslauthd/auth_getpwent.c | 4 +++- + saslauthd/auth_shadow.c | 8 +++----- + 4 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/pwcheck/pwcheck_getpwnam.c b/pwcheck/pwcheck_getpwnam.c +index 4b34222..400289c 100644 +--- a/pwcheck/pwcheck_getpwnam.c ++++ b/pwcheck/pwcheck_getpwnam.c +@@ -32,6 +32,7 @@ char *userid; + char *password; + { + char* r; ++ char* crpt_passwd; + struct passwd *pwd; + + pwd = getpwnam(userid); +@@ -41,7 +42,7 @@ char *password; + else if (pwd->pw_passwd[0] == '*') { + r = "Account disabled"; + } +- else if (strcmp(pwd->pw_passwd, crypt(password, pwd->pw_passwd)) != 0) { ++ else if (!(crpt_passwd = crypt(password, pwd->pw_passwd)) || strcmp(pwd->pw_passwd, (const char *)crpt_passwd) != 0) { + r = "Incorrect password"; + } + else { +diff --git a/pwcheck/pwcheck_getspnam.c b/pwcheck/pwcheck_getspnam.c +index 2b11286..6d607bb 100644 +--- a/pwcheck/pwcheck_getspnam.c ++++ b/pwcheck/pwcheck_getspnam.c +@@ -32,13 +32,15 @@ char *userid; + char *password; + { + struct spwd *pwd; ++ char *crpt_passwd; + + pwd = getspnam(userid); + if (!pwd) { + return "Userid not found"; + } + +- if (strcmp(pwd->sp_pwdp, crypt(password, pwd->sp_pwdp)) != 0) { ++ crpt_passwd = crypt(password, pwd->sp_pwdp); ++ if (!crpt_passwd || strcmp(pwd->sp_pwdp, (const char *)crpt_passwd) != 0) { + return "Incorrect password"; + } + else { +diff --git a/saslauthd/auth_getpwent.c b/saslauthd/auth_getpwent.c +index fc8029d..d4ebe54 100644 +--- a/saslauthd/auth_getpwent.c ++++ b/saslauthd/auth_getpwent.c +@@ -77,6 +77,7 @@ auth_getpwent ( + { + /* VARIABLES */ + struct passwd *pw; /* pointer to passwd file entry */ ++ char *crpt_passwd; /* encrypted password */ + int errnum; + /* END VARIABLES */ + +@@ -105,7 +106,8 @@ auth_getpwent ( + } + } + +- if (strcmp(pw->pw_passwd, (const char *)crypt(password, pw->pw_passwd))) { ++ crpt_passwd = crypt(password, pw->pw_passwd); ++ if (!crpt_passwd || strcmp(pw->pw_passwd, (const char *)crpt_passwd)) { + if (flags & VERBOSE) { + syslog(LOG_DEBUG, "DEBUG: auth_getpwent: %s: invalid password", login); + } +diff --git a/saslauthd/auth_shadow.c b/saslauthd/auth_shadow.c +index 677131b..1988afd 100644 +--- a/saslauthd/auth_shadow.c ++++ b/saslauthd/auth_shadow.c +@@ -210,8 +210,8 @@ auth_shadow ( + RETURN("NO Insufficient permission to access NIS authentication database (saslauthd)"); + } + +- cpw = strdup((const char *)crypt(password, sp->sp_pwdp)); +- if (strcmp(sp->sp_pwdp, cpw)) { ++ cpw = crypt(password, sp->sp_pwdp); ++ if (!cpw || strcmp(sp->sp_pwdp, (const char *)cpw)) { + if (flags & VERBOSE) { + /* + * This _should_ reveal the SHADOW_PW_LOCKED prefix to an +@@ -221,10 +221,8 @@ auth_shadow ( + syslog(LOG_DEBUG, "DEBUG: auth_shadow: pw mismatch: '%s' != '%s'", + sp->sp_pwdp, cpw); + } +- free(cpw); + RETURN("NO Incorrect password"); + } +- free(cpw); + + /* + * The following fields will be set to -1 if: +@@ -286,7 +284,7 @@ auth_shadow ( + RETURN("NO Invalid username"); + } + +- if (strcmp(upw->upw_passwd, crypt(password, upw->upw_passwd)) != 0) { ++ if (!(cpw = crypt(password, upw->upw_passwd)) || (strcmp(upw->upw_passwd, (const char *)cpw) != 0)) { + if (flags & VERBOSE) { + syslog(LOG_DEBUG, "auth_shadow: pw mismatch: %s != %s", + password, upw->upw_passwd); +-- +cgit v0.12 + From c3e2a2471cae95a4f08b97739ee315e14a332986 Mon Sep 17 00:00:00 2001 From: Toni Reina Date: Sat, 26 Nov 2016 15:12:22 +0100 Subject: [PATCH 032/130] gnu: Add Mozilla Fira Mono font. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/fonts.scm (font-fira-mono): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/fonts.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 009efd2955..f385559f7e 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2016 Dmitry Nikolaev ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 Marius Bakke +;;; Copyright © 2016 Toni Reina ;;; ;;; This file is part of GNU Guix. ;;; @@ -898,3 +899,38 @@ powerline support.") "Source Code Pro is a set of monospaced OpenType fonts that have been designed to work well in user interface environments.") (license license:silofl1.1))) + +(define-public font-fira-mono + (package + (name "font-fira-mono") + (version "3.206") + (source (origin + (method url-fetch) + (uri (string-append "https://carrois.com/downloads/fira_mono_3_2/" + "FiraMonoFonts" + (string-replace-substring version "." "") + ".zip")) + (sha256 + (base32 + "1z65x0dw5dq6rs6p9wyfrir50rlh95vgzsxr8jcd40nqazw4jhpi")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((unzip (string-append (assoc-ref %build-inputs "unzip") + "/bin/unzip")) + (font-dir (string-append %output "/share/fonts/opentype"))) + (mkdir-p font-dir) + (system* unzip + "-j" + (assoc-ref %build-inputs "source") + "*.otf" + "-d" font-dir))))) + (native-inputs + `(("unzip" ,unzip))) + (home-page "http://mozilla.github.io/Fira/") + (synopsis "Mozilla's monospace font") + (description "This is the typeface used by Mozilla in Firefox OS.") + (license license:silofl1.1))) From 1cd1d8a7ea43bfb99aa05c74da5430bb3d8a4309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 26 Nov 2016 23:00:36 +0100 Subject: [PATCH 033/130] offload: Call 'machine-load' only once per machine. This fixes a longstanding issue where 'choose-build-machine' would make on average O(N log(N)) calls to 'machine-load', plus an extra call for the selected machine, instead of N calls. * guix/scripts/offload.scm (machine-load): Add comment. (machine-power-factor, machine-less-loaded-or-faster?): Remove. (choose-build-machine)[machines+slots]: Rename to... [machines+slots+loads]: ... this. [undecorate]: Adjust accordingly. [machine-less-loaded-or-faster?]: New procedure. Remove extra 'machine-load' call in body. --- guix/scripts/offload.scm | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 2e0268020c..bc024a8701 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -490,6 +490,7 @@ be read." (define (machine-load machine) "Return the load of MACHINE, divided by the number of parallel builds allowed on MACHINE." + ;; Note: This procedure is costly since it creates a new SSH session. (let* ((session (open-ssh-session machine)) (pipe (open-remote-pipe* session OPEN_READ "cat" "/proc/loadavg")) @@ -510,17 +511,6 @@ allowed on MACHINE." (_ +inf.0))))) ;something's fishy about MACHINE, so avoid it -(define (machine-power-factor m) - "Return a factor that aggregates the speed and load of M. The higher the -better." - (/ (build-machine-speed m) - (+ 1 (machine-load m)))) - -(define (machine-less-loaded-or-faster? m1 m2) - "Return #t if M1 is either less loaded or faster than M2. (This relation -defines a total order on machines.)" - (> (machine-power-factor m1) (machine-power-factor m2))) - (define (machine-lock-file machine hint) "Return the name of MACHINE's lock file for HINT." (string-append %state-directory "/offload/" @@ -548,29 +538,39 @@ defines a total order on machines.)" ;; 5. Release the global machine-choice lock. (with-file-lock (machine-choice-lock-file) - (define machines+slots + (define machines+slots+loads (filter-map (lambda (machine) + ;; Call 'machine-load' from here to make sure it is called + ;; only once per machine (it is expensive). (let ((slot (acquire-build-slot machine))) - (and slot (list machine slot)))) + (and slot + (list machine slot (machine-load machine))))) machines)) (define (undecorate pred) (lambda (a b) (match a - ((machine1 slot1) + ((machine1 slot1 load1) (match b - ((machine2 slot2) - (pred machine1 machine2))))))) + ((machine2 slot2 load2) + (pred machine1 load1 machine2 load2))))))) - (let loop ((machines+slots - (sort machines+slots + (define (machine-less-loaded-or-faster? m1 l1 m2 l2) + ;; Return #t if M1 is either less loaded or faster than M2, with L1 + ;; being the load of M1 and L2 the load of M2. (This relation defines a + ;; total order on machines.) + (> (/ (build-machine-speed m1) (+ 1 l1)) + (/ (build-machine-speed m2) (+ 1 l2)))) + + (let loop ((machines+slots+loads + (sort machines+slots+loads (undecorate machine-less-loaded-or-faster?)))) - (match machines+slots - (((best slot) others ...) + (match machines+slots+loads + (((best slot load) others ...) ;; Return the best machine unless it's already overloaded. - (if (< (machine-load best) 2.) + (if (< load 2.) (match others - (((machines slots) ...) + (((machines slots loads) ...) ;; Release slots from the uninteresting machines. (for-each release-build-slot slots) From 35c0ad444861362e3b48acea2609bf8951cce5c5 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 27 Nov 2016 01:14:33 +0100 Subject: [PATCH 034/130] gnu: libgphoto2: Update to 2.5.10. * gnu/packages/photo.scm (libgphoto2): Update to 2.5.10. --- gnu/packages/photo.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index f4d110edbc..e220549711 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -89,14 +89,14 @@ data as produced by digital cameras.") (define-public libgphoto2 (package (name "libgphoto2") - (version "2.5.2") + (version "2.5.10") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/gphoto/libgphoto/" version "/libgphoto2-" version ".tar.bz2")) (sha256 (base32 - "0f1818l1vs5fbmrihzyv3qasddbqi3r01jik5crrxddwalsi2bd3")))) + "1wjf79ipqwb5phfjjwf15rwgigakylnfqaj4crs5qnds6ba6i1ld")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) (inputs From 9dcc9bbf3b51874d3a3dd30c69aa319d8dc6bc7b Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 27 Nov 2016 01:15:38 +0100 Subject: [PATCH 035/130] gnu: gphoto2: Update to 2.5.10. * gnu/packages/photo.scm (gphoto2): Update to 2.5.10. --- gnu/packages/photo.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index e220549711..f3f5ffea35 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -119,14 +119,14 @@ from digital cameras.") (define-public gphoto2 (package (name "gphoto2") - (version "2.5.2") + (version "2.5.10") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version "/gphoto2-" version ".tar.bz2")) (sha256 (base32 - "16c8k1cxfypg7v5h8xi87grclw7a5ayaamn548ys3zkj727r5fcf")))) + "1436i2chc1xzq1bng48yx52kgqjqbaashij52sifbdslbm9jzk36")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) From d32f4800d65837eb28e2d355ebec0430f2096ebd Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 27 Nov 2016 01:25:24 +0100 Subject: [PATCH 036/130] gnu: libgphoto2: Add XML support. * gnu/packages/photo.scm (libgphoto2)[inputs]: Add libxml2. --- gnu/packages/photo.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index f3f5ffea35..2b93d7bbf0 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -102,7 +102,8 @@ data as produced by digital cameras.") (inputs `(;; ("libjpeg-turbo" ,libjpeg-turbo) ("libltdl" ,libltdl) - ("libusb" ,libusb))) + ("libusb" ,libusb) + ("libxml2" ,libxml2))) (propagated-inputs `(;; The .pc refers to libexif. ("libexif" ,libexif))) From b46cefc95486c88d50b768443dae7ee8b9d599f8 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 26 Nov 2016 17:01:14 -0500 Subject: [PATCH 037/130] gnu: libsodium: Update to 1.0.11. * gnu/packages/crypto.scm (libsodium): Update to 1.0.11. --- gnu/packages/crypto.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm index c7445a1eba..e4a8a4bd54 100644 --- a/gnu/packages/crypto.scm +++ b/gnu/packages/crypto.scm @@ -56,7 +56,7 @@ (define-public libsodium (package (name "libsodium") - (version "1.0.10") + (version "1.0.11") (source (origin (method url-fetch) (uri (list (string-append @@ -67,7 +67,7 @@ "releases/old/libsodium-" version ".tar.gz"))) (sha256 (base32 - "1gn45g956lyz8l6iq187yc6l627vyivyp8qc5dkr6dnhdnlqddvi")))) + "0rf7z6bgpnf8lyz8sph4h43fbb28pmj4dgybf0hsxxj97kdljid1")))) (build-system gnu-build-system) (synopsis "Portable NaCl-based crypto library") (description From a82f0b36177848eda340d880ae0802c3e26c4ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sat, 26 Nov 2016 13:51:58 +0800 Subject: [PATCH 038/130] tests: Add 'opensmtpd-service-type' test. * gnu/tests/mail.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/tests/mail.scm | 159 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 gnu/tests/mail.scm diff --git a/gnu/local.mk b/gnu/local.mk index dfa9c0077d..821533837a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -447,6 +447,7 @@ GNU_SYSTEM_MODULES = \ %D%/tests.scm \ %D%/tests/base.scm \ %D%/tests/install.scm \ + %D%/tests/mail.scm \ %D%/tests/ssh.scm diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm new file mode 100644 index 0000000000..47328a54ae --- /dev/null +++ b/gnu/tests/mail.scm @@ -0,0 +1,159 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Sou Bunnbu +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu tests mail) + #:use-module (gnu tests) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system grub) + #:use-module (gnu system vm) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services mail) + #:use-module (gnu services networking) + #:use-module (guix gexp) + #:use-module (guix monads) + #:use-module (guix store) + #:export (%test-opensmtpd)) + +(define %opensmtpd-os + (operating-system + (host-name "komputilo") + (timezone "Europe/Berlin") + (locale "en_US.UTF-8") + (bootloader (grub-configuration (device #f))) + (file-systems %base-file-systems) + (firmware '()) + (services (cons* + (dhcp-client-service) + (service opensmtpd-service-type + (opensmtpd-configuration + (config-file + (plain-file "smtpd.conf" " +listen on 0.0.0.0 +accept from any for local deliver to mbox +")))) + %base-services)))) + +(define (run-opensmtpd-test) + "Return a test of an OS running OpenSMTPD service." + (mlet* %store-monad ((command (system-qemu-image/shared-store-script + (marionette-operating-system + %opensmtpd-os + #:imported-modules '((gnu services herd))) + #:graphic? #f))) + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (rnrs base) + (srfi srfi-64) + (ice-9 rdelim) + (ice-9 regex) + (gnu build marionette)) + + (define marionette + (make-marionette + ;; Enable TCP forwarding of the guest's port 25. + '(#$command "-net" "user,hostfwd=tcp::1025-:25"))) + + (define (read-reply-code port) + "Read a SMTP reply from PORT and return its reply code." + (let* ((line (read-line port)) + (mo (string-match "([0-9]+)([ -]).*" line)) + (code (string->number (match:substring mo 1))) + (finished? (string= " " (match:substring mo 2)))) + (if finished? + code + (read-reply-code port)))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "opensmptd") + + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'smtpd) + #t) + marionette)) + + (test-assert "mbox is empty" + (marionette-eval + '(and (file-exists? "/var/mail") + (not (file-exists? "/var/mail/root"))) + marionette)) + + (test-eq "accept an email" + #t + (let* ((smtp (socket AF_INET SOCK_STREAM 0)) + (addr (make-socket-address AF_INET INADDR_LOOPBACK 1025))) + (connect smtp addr) + ;; Be greeted. + (read-reply-code smtp) ;220 + ;; Greet the server. + (write-line "EHLO somehost" smtp) + (read-reply-code smtp) ;250 + ;; Set sender email. + (write-line "MAIL FROM: " smtp) + (read-reply-code smtp) ;250 + ;; Set recipient email. + (write-line "RCPT TO: " smtp) + (read-reply-code smtp) ;250 + ;; Send message. + (write-line "DATA" smtp) + (read-reply-code smtp) ;354 + (write-line "Subject: Hello" smtp) + (newline smtp) + (write-line "Nice to meet you!" smtp) + (write-line "." smtp) + (read-reply-code smtp) ;250 + ;; Say goodbye. + (write-line "QUIT" smtp) + (read-reply-code smtp) ;221 + (close smtp) + #t)) + + (test-assert "mail arrived" + (marionette-eval + '(begin + (use-modules (ice-9 popen) + (ice-9 rdelim)) + + (define (queue-empty?) + (eof-object? + (read-line + (open-input-pipe "smtpctl show queue")))) + + (let wait () + (if (queue-empty?) + (file-exists? "/var/mail/root") + (begin (sleep 1) (wait))))) + marionette)) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "opensmtpd-test" test))) + +(define %test-opensmtpd + (system-test + (name "opensmtpd") + (description "Send an email to a running OpenSMTPD server.") + (value (run-opensmtpd-test)))) From 45591fd7fde1a400a416cb99939f6dd766445f94 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 25 Nov 2016 22:58:10 +0100 Subject: [PATCH 039/130] gnu: Add threaded variants of fftw and fftwf for Ardour and mod-host. * gnu/packages/algebra.scm (fftw-with-threads, fftwf-with-threads): New variables. * gnu/packages/audio.scm (ardour)[inputs]: Replace "fftw" and "fftwf" with "fftw-with-threads" and "fftwf-with-threads", respectively. * gnu/packages/music.scm (mod-host)[inputs]: Likewise. --- gnu/packages/algebra.scm | 16 ++++++++++++++++ gnu/packages/audio.scm | 4 ++-- gnu/packages/music.scm | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 76f385e340..4288913f78 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -576,6 +576,22 @@ cosine/ sine transforms or DCT/DST).") (string-append (package-description fftw) " Single-precision version.")))) +;; FIXME: These packages are used temporarily by packages like Ardour until +;; "--enable-flags" is added to the fftw and fftwf packages. +(define-public fftw-with-threads + (package (inherit fftw) + (arguments + (substitute-keyword-arguments (package-arguments fftw) + ((#:configure-flags flags) + `(cons "--enable-threads" ,flags)))))) + +(define-public fftwf-with-threads + (package (inherit fftwf) + (arguments + (substitute-keyword-arguments (package-arguments fftwf) + ((#:configure-flags flags) + `(cons "--enable-threads" ,flags)))))) + (define-public fftw-openmpi (package (inherit fftw) (name "fftw-openmpi") diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index b535448af1..66db4c52c6 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -238,8 +238,8 @@ namespace ARDOUR { const char* revision = \"5.4\" ; }")))) ("lv2" ,lv2) ("vamp" ,vamp) ("curl" ,curl) - ("fftw" ,fftw) - ("fftwf" ,fftwf) + ("fftw" ,fftw-with-threads) + ("fftwf" ,fftwf-with-threads) ("jack" ,jack-1) ("serd" ,serd) ("sord" ,sord) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 78ca558b2d..188791976c 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1744,8 +1744,8 @@ analogue-like user interface.") #t))))) (inputs `(("lilv" ,lilv) - ("fftw" ,fftw) - ("fftwf" ,fftwf) + ("fftw" ,fftw-with-threads) + ("fftwf" ,fftwf-with-threads) ("lv2" ,lv2) ("jack" ,jack-1) ("readline" ,readline))) From d4ba9a5f210e62742fbd2e9a0cbcde3c1b504fd6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 16:00:58 +0100 Subject: [PATCH 040/130] gnu: Add perl-mojolicious. * gnu/packages/perl-web.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/perl-web.scm | 47 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 gnu/packages/perl-web.scm diff --git a/gnu/local.mk b/gnu/local.mk index 821533837a..5a9001b6d4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -294,6 +294,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/pdf.scm \ %D%/packages/pem.scm \ %D%/packages/perl.scm \ + %D%/packages/perl-web.scm \ %D%/packages/photo.scm \ %D%/packages/php.scm \ %D%/packages/pkg-config.scm \ diff --git a/gnu/packages/perl-web.scm b/gnu/packages/perl-web.scm new file mode 100644 index 0000000000..9c92a95dad --- /dev/null +++ b/gnu/packages/perl-web.scm @@ -0,0 +1,47 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Ricardo Wurmus +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages perl-web) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system perl)) + +(define-public perl-mojolicious + (package + (name "perl-mojolicious") + (version "7.10") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/S/SR/SRI/Mojolicious-" + version ".tar.gz")) + (sha256 + (base32 + "0811f3wajgf71y02dr2khqnaswjh582pcvhv93k101qpg61syihn")))) + (build-system perl-build-system) + (home-page "http://mojolicious.org/") + (synopsis "Real-time web framework") + (description "Back in the early days of the web, many people learned Perl +because of a wonderful Perl library called @code{CGI}. It was simple enough +to get started without knowing much about the language and powerful enough to +keep you going, learning by doing was much fun. While most of the techniques +used are outdated now, the idea behind it is not. Mojolicious is a new +endeavor to implement this idea using modern technologies.") + (license license:artistic2.0))) From 3f1df54cc059abc326c6691ea305f6676bc89c8a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 16:01:39 +0100 Subject: [PATCH 041/130] gnu: Add perl-autovivification. * gnu/packages/perl.scm (perl-autovivification): New variable. --- gnu/packages/perl.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index e9f3dca15a..92d973b7b1 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -266,6 +266,33 @@ manipulate, read, and write Zip archive files.") list manipulation routines.") (license (package-license perl)))) +(define-public perl-autovivification + (package + (name "perl-autovivification") + (version "0.16") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/V/VP/VPIT/" + "autovivification-" version ".tar.gz")) + (sha256 + (base32 + "1422kw9fknv7rbjkgdfflg1q3mb69d3yryszp38dn0bgzkqhwkc1")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/autovivification") + (synopsis "Lexically disable autovivification") + (description "When an undefined variable is dereferenced, it gets silently +upgraded to an array or hash reference (depending of the type of the +dereferencing). This behaviour is called autovivification and usually does +what you mean but it may be unnatural or surprising because your variables get +populated behind your back. This is especially true when several levels of +dereferencing are involved, in which case all levels are vivified up to the +last, or when it happens in intuitively read-only constructs like +@code{exists}. The pragma provided by this package lets you disable +autovivification for some constructs and optionally throws a warning or an +error when it would have happened.") + (license (package-license perl)))) + (define-public perl-base (package (name "perl-base") From a3f5beb7a238e0cb2c60686f6c861d5e41bc4082 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 16:04:14 +0100 Subject: [PATCH 042/130] gnu: Add perl-business-isbn-data. * gnu/packages/perl.scm (perl-business-isbn-data): New variable. --- gnu/packages/perl.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 92d973b7b1..733b86536c 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -407,6 +407,26 @@ library can nevertheless be used stand-alone, without Perl.") special objects: true and false.") (license (package-license perl)))) +(define-public perl-business-isbn-data + (package + (name "perl-business-isbn-data") + (version "20140910.003") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BD/BDFOY/" + "Business-ISBN-Data-" version ".tar.gz")) + (sha256 + (base32 + "1jc5jrjwkr6pqga7998zkgw0yrxgb5n1y7lzgddawxibkf608mn7")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Business-ISBN-Data") + (synopsis "Data files for Business::ISBN") + (description "This package provides a data pack for @code{Business::ISBN}. +These data are generated from the RangeMessage.xml file provided by the ISBN +Agency.") + (license (package-license perl)))) + (define-public perl-cache-cache (package (name "perl-cache-cache") From 72f8646ef5b5edc587f1bfbe68c43cfd9162bdb1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 21:57:52 +0100 Subject: [PATCH 043/130] gnu: Add perl-business-isbn. * gnu/packages/perl.scm (perl-business-isbn): New variable. --- gnu/packages/perl.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 733b86536c..157c715c0c 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -34,7 +34,8 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (guix build-system perl)) + #:use-module (guix build-system perl) + #:use-module (gnu packages perl-web)) ;;; ;;; Please: Try to add new module packages in alphabetic order. @@ -427,6 +428,28 @@ These data are generated from the RangeMessage.xml file provided by the ISBN Agency.") (license (package-license perl)))) +(define-public perl-business-isbn + (package + (name "perl-business-isbn") + (version "3.003") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BD/BDFOY/" + "Business-ISBN-" version ".tar.gz")) + (sha256 + (base32 + "1i2bxzqkki257rqbswa4ryj1grmwa5s47wrxln2ff5mha1ry31gm")))) + (build-system perl-build-system) + (propagated-inputs + `(("perl-business-isbn-data" ,perl-business-isbn-data) + ("perl-mojolicious" ,perl-mojolicious))) + (home-page "http://search.cpan.org/dist/Business-ISBN") + (synopsis "Work with International Standard Book Numbers") + (description "This modules provides tools to deal with International +Standard Book Numbers, including ISBN-10 and ISBN-13.") + (license artistic2.0))) + (define-public perl-cache-cache (package (name "perl-cache-cache") From e0b6accf1902bf2cbcac6380d1d930c4c6a770b7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 21:58:31 +0100 Subject: [PATCH 044/130] gnu: Add perl-business-issn. * gnu/packages/perl.scm (perl-business-issn): New variable. --- gnu/packages/perl.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 157c715c0c..8e4ec88cb8 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -450,6 +450,25 @@ Agency.") Standard Book Numbers, including ISBN-10 and ISBN-13.") (license artistic2.0))) +(define-public perl-business-issn + (package + (name "perl-business-issn") + (version "0.91") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BD/BDFOY/" + "Business-ISSN-" version ".tar.gz")) + (sha256 + (base32 + "1dfnm7h7lbqj356700ldlmgbr51v6hyjn1qig2bb4ysl1wn1jnzi")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Business-ISSN") + (synopsis "Work with International Standard Serial Numbers") + (description "This modules provides tools to deal with International +Standard Serial Numbers.") + (license (package-license perl)))) + (define-public perl-cache-cache (package (name "perl-cache-cache") From 296663839b35bbf6b69f3dd678ca9a463e3790ac Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 21:59:54 +0100 Subject: [PATCH 045/130] gnu: Add perl-tie-cycle. * gnu/packages/perl.scm (perl-tie-cycle): New variable. --- gnu/packages/perl.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 8e4ec88cb8..aa275eaf8b 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -6656,6 +6656,25 @@ controlled with command line parameters. The default parameter settings approximately follow the suggestions in the Perl Style Guide.") (license gpl2+))) +(define-public perl-tie-cycle + (package + (name "perl-tie-cycle") + (version "1.221") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BD/BDFOY/Tie-Cycle-" + version ".tar.gz")) + (sha256 + (base32 + "10g6kirf6jfaldckg98y4pl87vrm7grqlg6ymb7a9vhrznyn7qn6")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Tie-Cycle") + (synopsis "Cycle through a list of values") + (description "You use @code{Tie::Cycle} to go through a list over and over +again. Once you get to the end of the list, you go back to the beginning.") + (license (package-license perl)))) + (define-public perl-tie-ixhash (package (name "perl-tie-ixhash") From adbf4b944c8c67d9819bb9b4c95c83cd29a6659f Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:00:20 +0100 Subject: [PATCH 046/130] gnu: Add perl-business-ismn. * gnu/packages/perl.scm (perl-business-ismn): New variable. --- gnu/packages/perl.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index aa275eaf8b..e23e8285ff 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -469,6 +469,27 @@ Standard Book Numbers, including ISBN-10 and ISBN-13.") Standard Serial Numbers.") (license (package-license perl)))) +(define-public perl-business-ismn + (package + (name "perl-business-ismn") + (version "1.13") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BD/BDFOY/" + "Business-ISMN-" version ".tar.gz")) + (sha256 + (base32 + "0cm1v75axg4gp6cnbyavmnqqjscsxh7nc60vcbw34rqivvf9idc9")))) + (build-system perl-build-system) + (native-inputs + `(("perl-tie-cycle" ,perl-tie-cycle))) + (home-page "http://search.cpan.org/dist/Business-ISMN") + (synopsis "Work with International Standard Music Numbers") + (description "This modules provides tools to deal with International +Standard Music Numbers.") + (license (package-license perl)))) + (define-public perl-cache-cache (package (name "perl-cache-cache") From 9413e95f598dfb2792249fc79542fb4d55d9a209 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:01:01 +0100 Subject: [PATCH 047/130] gnu: Add perl-data-compare. * gnu/packages/perl.scm (perl-data-compare): New variable. --- gnu/packages/perl.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index e23e8285ff..8bac955579 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -1310,6 +1310,27 @@ functions and data structures for processing and analysing genomic and bioinformatics data.") (license gpl3+))) +(define-public perl-data-compare + (package + (name "perl-data-compare") + (version "1.25") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/D/DC/DCANTRELL/" + "Data-Compare-" version ".tar.gz")) + (sha256 + (base32 + "0wzasidg9yjcfsi2gdiaw6726ikqda7n24n0v2ngpaazakdkcjqx")))) + (build-system perl-build-system) + (propagated-inputs + `(("perl-file-find-rule" ,perl-file-find-rule))) + (home-page "http://search.cpan.org/dist/Data-Compare") + (synopsis "Compare Perl data structures") + (description "This module compares arbitrary data structures to see if +they are copies of each other.") + (license (package-license perl)))) + (define-public perl-data-dump (package (name "perl-data-dump") From cc3dafbb022825669cdcf96d66d73e6fdfe41bbe Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:01:28 +0100 Subject: [PATCH 048/130] gnu: Add perl-data-uniqid. * gnu/packages/perl.scm (perl-data-uniqid): New variable. --- gnu/packages/perl.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 8bac955579..b87e33937b 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -1331,6 +1331,26 @@ bioinformatics data.") they are copies of each other.") (license (package-license perl)))) +(define-public perl-data-uniqid + (package + (name "perl-data-uniqid") + (version "0.12") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/M/MW/MWX/Data-Uniqid-" + version ".tar.gz")) + (sha256 + (base32 + "1jsc6acmv97pzsvx1fqywz4qvxxpp7kwmb78ygyqpsczkfj9p4dn")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Data-Uniqid") + (synopsis "Perl extension for generating unique identifiers") + (description "@code{Data::Uniqid} provides three simple routines for +generating unique ids. These ids are coded with a Base62 systen to make them +short and handy (e.g. to use it as part of a URL).") + (license (package-license perl)))) + (define-public perl-data-dump (package (name "perl-data-dump") From 36dd594316df1b89137735c07018df17ae6310bf Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:02:12 +0100 Subject: [PATCH 049/130] gnu: Add perl-date-simple. * gnu/packages/perl.scm (perl-date-simple): New variable. --- gnu/packages/perl.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index b87e33937b..d3df8b20c1 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -1619,6 +1619,28 @@ operations, such as comparing two times, determining a date a given amount of time from another, or parsing international times.") (license (package-license perl)))) +(define-public perl-date-simple + (package + (name "perl-date-simple") + (version "3.03") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/" + "Date-Simple-" version ".tar.gz")) + (sha256 + (base32 + "016x17r9wi6ffdc4idwirzd1sxqcb4lmq5fn2aiq25nf2iir5899")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Date-Simple") + (synopsis "Simple date handling") + (description "Dates are complex enough without times and timezones. This +module may be used to create simple date objects. It handles validation, +interval arithmetic, and day-of-week calculation. It does not deal with +hours, minutes, seconds, and time zones.") + ;; Can be used with either license. + (license (list (package-license perl) gpl2+)))) + (define-public perl-datetime (package (name "perl-datetime") From 7a146c252835c992e7aa9647d59d2732f78d34d8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:02:52 +0100 Subject: [PATCH 050/130] gnu: Add perl-datetime-calendar-julian. * gnu/packages/perl.scm (perl-datetime-calendar-julian): New variable. --- gnu/packages/perl.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index d3df8b20c1..5a42cbb354 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -1670,6 +1670,30 @@ combinations. It represents the Gregorian calendar, extended backwards in time before its creation (in 1582).") (license artistic2.0))) +(define-public perl-datetime-calendar-julian + (package + (name "perl-datetime-calendar-julian") + (version "0.04") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/P/PI/PIJLL/" + "DateTime-Calendar-Julian-" version ".tar.gz")) + (sha256 + (base32 + "03h0llkwsiw2d2ci1ah5x9sp8xrvnbgd471i5hnpgl5w32nnhndv")))) + (build-system perl-build-system) + ;; Only needed for tests + (native-inputs + `(("perl-datetime" ,perl-datetime))) + (home-page "http://search.cpan.org/dist/DateTime-Calendar-Julian") + (synopsis "Dates in the Julian calendar") + (description "This package is a companion module to @code{DateTime.pm}. +It implements the Julian calendar. It supports everything that +@code{DateTime.pm} supports and more: about one day per century more, to be +precise.") + (license (package-license perl)))) + (define-public perl-datetime-set (package (name "perl-datetime-set") From 49a3fcc13c4efbb543625b50f8156603c9825ec5 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:04:31 +0100 Subject: [PATCH 051/130] gnu: perl-encode-detect: Move to alphabetical position. * gnu/packages/perl.scm (perl-encode-detect): Move variable definition. --- gnu/packages/perl.scm | 45 ++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 5a42cbb354..a7424479b6 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -2322,6 +2322,27 @@ SHA-1 message digest algorithm for use by Perl programs.") modules separately and deal with them after the module is done installing.") (license (package-license perl)))) +(define-public perl-encode-detect + (package + (name "perl-encode-detect") + (version "1.01") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/J/JG/JGMYERS/" + "Encode-Detect-" version ".tar.gz")) + (sha256 + (base32 + "1wdv9ffgs4xyfh5dnh09dqkmmlbf5m1hxgdgb3qy6v6vlwx8jkc3")))) + (build-system perl-build-system) + (native-inputs + `(("perl-module-build" ,perl-module-build))) + (home-page "http://search.cpan.org/dist/Encode-Detect") + (synopsis "Detect the encoding of data") + (description "This package provides a class @code{Encode::Detect} to detect +the encoding of data.") + (license mpl1.1))) + (define-public perl-env-path (package (name "perl-env-path") @@ -7484,27 +7505,3 @@ interface to File::Find::Object.") (description "Test::TrailingSpace tests for trailing spaces in Perl source files.") (license x11))) - -(define-public perl-encode-detect - (package - (name "perl-encode-detect") - (version "1.01") - (source - (origin - (method url-fetch) - (uri (string-append - "mirror://cpan/authors/id/J/JG/JGMYERS/Encode-Detect-" - version - ".tar.gz")) - (sha256 - (base32 - "1wdv9ffgs4xyfh5dnh09dqkmmlbf5m1hxgdgb3qy6v6vlwx8jkc3")))) - (build-system perl-build-system) - (inputs - `(("perl-module-build" ,perl-module-build))) - (home-page - "http://search.cpan.org/dist/Encode-Detect") - (synopsis - "Perl Encode::Encoding subclass that detects the encoding of data") - (description "Encode::Detect detects the encoding of data for Perl.") - (license mpl1.1))) From 891d9679a2c30a1f0d65f371a133a414dfef94ce Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:04:51 +0100 Subject: [PATCH 052/130] gnu: Add perl-encode-eucjpascii. * gnu/packages/perl.scm (perl-encode-eucjpascii): New variable. --- gnu/packages/perl.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index a7424479b6..283aa8d92c 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -2343,6 +2343,25 @@ modules separately and deal with them after the module is done installing.") the encoding of data.") (license mpl1.1))) +(define-public perl-encode-eucjpascii + (package + (name "perl-encode-eucjpascii") + (version "0.03") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/N/NE/NEZUMI/" + "Encode-EUCJPASCII-" version ".tar.gz")) + (sha256 + (base32 + "0qg8kmi7r9jcf8326b4fyq5sdpqyim2a11h7j77q577xam6x767r")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Encode-EUCJPASCII") + (synopsis "ASCII mapping for eucJP encoding") + (description "This package provides an ASCII mapping for the eucJP +encoding.") + (license (package-license perl)))) + (define-public perl-env-path (package (name "perl-env-path") From 2bc1b85ce6b3f66d31f3a3cdb4f8db897f4d313e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:05:17 +0100 Subject: [PATCH 053/130] gnu: Add perl-encode-jis2k. * gnu/packages/perl.scm (perl-encode-jis2k): New variable. --- gnu/packages/perl.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 283aa8d92c..de74c6dafe 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -2362,6 +2362,25 @@ the encoding of data.") encoding.") (license (package-license perl)))) +(define-public perl-encode-jis2k + (package + (name "perl-encode-jis2k") + (version "0.03") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/D/DA/DANKOGAI/" + "Encode-JIS2K-" version ".tar.gz")) + (sha256 + (base32 + "1k1mdj4rd9m1z4h7qd2dl92ky0r1rk7mmagwsvdb9pirvdr4vj0y")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Encode-JIS2K") + (synopsis "JIS X 0212 (aka JIS 2000) encodings") + (description "This package provides encodings for JIS X 0212, which is +also known as JIS 2000.") + (license (package-license perl)))) + (define-public perl-env-path (package (name "perl-env-path") From 0185442003186b371d962f2e7f16cb2d184f07ce Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:06:12 +0100 Subject: [PATCH 054/130] gnu: Add perl-encode-hanextra. * gnu/packages/perl.scm (perl-encode-hanextra): New variable. --- gnu/packages/perl.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index de74c6dafe..2dd6c01833 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -2381,6 +2381,27 @@ encoding.") also known as JIS 2000.") (license (package-license perl)))) +(define-public perl-encode-hanextra + (package + (name "perl-encode-hanextra") + (version "0.23") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/A/AU/AUDREYT/" + "Encode-HanExtra-" version ".tar.gz")) + (sha256 + (base32 + "0fj4vd8iva2i0j6s2fyhwgr9afrvhr6gjlzi7805h257mmnb1m0z")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Encode-HanExtra") + (synopsis "Additional Chinese encodings") + (description "This Perl module provides Chinese encodings that are not +part of Perl by default, including \"BIG5-1984\", \"BIG5-2003\", \"BIG5PLUS\", +\"BIG5EXT\", \"CCCII\", \"EUC-TW\", \"CNS11643-*\", \"GB18030\", and +\"UNISYS\".") + (license expat))) + (define-public perl-env-path (package (name "perl-env-path") From 81157cf5a7bdbcdbbfba3e6fc280c49f7905a32d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:06:47 +0100 Subject: [PATCH 055/130] gnu: Add perl-extutils-libbuilder. * gnu/packages/perl.scm (perl-extutils-libbuilder): New variable. --- gnu/packages/perl.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 2dd6c01833..226d1afa1e 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -2602,6 +2602,29 @@ it ties together a family of modern toolchain modules.") module building modules.") (license (package-license perl)))) +(define-public perl-extutils-libbuilder + (package + (name "perl-extutils-libbuilder") + (version "0.08") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/" + "ExtUtils-LibBuilder-" version ".tar.gz")) + (sha256 + (base32 + "1lmmfcjxvsvhn4f3v2lyylgr8dzcf5j7mnd1pkq3jc75dph724f5")))) + (build-system perl-build-system) + (native-inputs + `(("perl-module-build" ,perl-module-build))) + (home-page "http://search.cpan.org/dist/ExtUtils-LibBuilder") + (synopsis "Tool to build C libraries") + (description "Some Perl modules need to ship C libraries together with +their Perl code. Although there are mechanisms to compile and link (or glue) +C code in your Perl programs, there isn't a clear method to compile standard, +self-contained C libraries. This module main goal is to help in that task.") + (license (package-license perl)))) + (define-public perl-file-changenotify (package (name "perl-file-changenotify") From e9ef394ac918267fdaa889bf34e04cf539eb31cd Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:07:23 +0100 Subject: [PATCH 056/130] gnu: Add perl-ipc-cmd. * gnu/packages/perl.scm (perl-ipc-cmd): New variable. --- gnu/packages/perl.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 226d1afa1e..a3f7c33a35 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -3323,6 +3323,26 @@ filehandles; in particular, IO::Scalar, IO::ScalarArray, and IO::Lines.") pseudo ttys.") (license (package-license perl)))) +(define-public perl-ipc-cmd + (package + (name "perl-ipc-cmd") + (version "0.96") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BI/BINGOS/IPC-Cmd-" + version ".tar.gz")) + (sha256 + (base32 + "0a2v44x70gj9fd5wa8i08f9z6n14qppj1j49m1hc333wh72mzk6i")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/IPC-Cmd") + (synopsis "Run interactive command-line programs") + (description "@code{IPC::Cmd} allows for the searching and execution of +any binary on your system. It adheres to verbosity settings and is able to +run interactively. It also has an option to capture output/error buffers.") + (license (package-license perl)))) + (define-public perl-ipc-run (package (name "perl-ipc-run") From 37115dc6500c5acc4f8289125e54879c5fe5b619 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:08:13 +0100 Subject: [PATCH 057/130] gnu: Add perl-lingua-translit. * gnu/packages/perl.scm (perl-lingua-translit): New variable. --- gnu/packages/perl.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index a3f7c33a35..a3c9acc97b 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -3665,6 +3665,26 @@ version.") one: logging, exceptions, and translations.") (license (package-license perl)))) +(define-public perl-lingua-translit + (package + (name "perl-lingua-translit") + (version "0.26") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/A/AL/ALINKE/" + "Lingua-Translit-" version ".tar.gz")) + (sha256 + (base32 + "161589h08kzliga17i2g0hb0yn4cjmb8rdiyadq5bw97974bac14")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Lingua-Translit") + (synopsis "Transliterate text between writing systems") + (description "@code{Lingua::Translit} can be used to convert text from one +writing system to another, based on national or international transliteration +tables. Where possible a reverse transliteration is supported.") + (license (package-license perl)))) + (define-public perl-list-allutils (package (name "perl-list-allutils") From 3521dc929348fb4cf3d17cc2a8891e66963b981b Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:08:35 +0100 Subject: [PATCH 058/130] gnu: Add perl-mozilla-ca. * gnu/packages/perl.scm (perl-mozilla-ca): New variable. --- gnu/packages/perl.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index a3c9acc97b..03d3c4310d 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -4712,6 +4712,26 @@ own set of Moose-like types. These custom types can then be used to describe fields in Moo-based classes.") (license (package-license perl)))) +(define-public perl-mozilla-ca + (package + (name "perl-mozilla-ca") + (version "20160104") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/A/AB/ABH/Mozilla-CA-" + version ".tar.gz")) + (sha256 + (base32 + "0aizn08lrdrgjz9vagkjmw2c7sxn46fzz521v9dbcqii4jd0d9r7")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Mozilla-CA") + (synopsis "Mozilla's CA cert bundle in PEM format") + (description "@code{Mozilla::CA} provides a copy of Mozilla's bundle of +Certificate Authority certificates in a form that can be consumed by modules +and libraries based on OpenSSL.") + (license mpl2.0))) + (define-public perl-mro-compat (package (name "perl-mro-compat") From 0ef5191c8800fbcaef71ecea53708ba57c6efe7b Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:09:03 +0100 Subject: [PATCH 059/130] gnu: Add perl-sort-key. * gnu/packages/perl.scm (perl-sort-key): New variable. --- gnu/packages/perl.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 03d3c4310d..427705b132 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -5405,6 +5405,25 @@ designed to be slow or big, neither has it been designed to be fast or compact.") (license (package-license perl)))) +(define-public perl-sort-key + (package + (name "perl-sort-key") + (version "1.33") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/S/SA/SALVA/Sort-Key-" + version ".tar.gz")) + (sha256 + (base32 + "1kqs10s2plj6c96srk0j8d7xj8dxk1704r7mck8rqk09mg7lqspd")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Sort-Key") + (synopsis "Sort arrays by one or multiple calculated keys") + (description "This Perl module provides various functions to quickly sort +arrays by one or multiple calculated keys.") + (license (package-license perl)))) + (define-public perl-spiffy (package (name "perl-spiffy") From 44c31aaae8b7ba021c0144dead0ccb4fee929d10 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:10:21 +0100 Subject: [PATCH 060/130] gnu: Add perl-text-csv-xs. * gnu/packages/perl.scm (perl-text-csv-xs): New variable. --- gnu/packages/perl.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 427705b132..42514d1a1e 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -6768,6 +6768,29 @@ decomposition of comma-separated values. An instance of the Text::CSV class can combine fields into a CSV string and parse a CSV string into fields.") (license (package-license perl)))) +(define-public perl-text-csv-xs + (package + (name "perl-text-csv-xs") + (version "1.25") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/H/HM/HMBRAND/" + "Text-CSV_XS-" version ".tgz")) + (sha256 + (base32 + "06zlfbqrwbl0g2g3bhk6046yy5pf2rz80fzcp8aj47rnswz2yx5k")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Text-CSV_XS") + (synopsis "Rountines for manipulating CSV files") + (description "@code{Text::CSV_XS} provides facilities for the composition +and decomposition of comma-separated values. An instance of the +@code{Text::CSV_XS} class will combine fields into a CSV string and parse a +CSV string into fields. The module accepts either strings or files as input +and support the use of user-specified characters for delimiters, separators, +and escapes.") + (license (package-license perl)))) + (define-public perl-text-diff (package (name "perl-text-diff") From dc32ee53810c830c2ecf866e0a9ef182ec6b5f3d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:10:44 +0100 Subject: [PATCH 061/130] gnu: Add perl-text-roman. * gnu/packages/perl.scm (perl-text-roman): New variable. --- gnu/packages/perl.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 42514d1a1e..9ed0f05240 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -6861,6 +6861,27 @@ template engine, for when you need speed rather than complex features, yet need more features than simple variable substitution.") (license (package-license perl)))) +(define-public perl-text-roman + (package + (name "perl-text-roman") + (version "3.5") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/S/SY/SYP/Text-Roman-" + version ".tar.gz")) + (sha256 + (base32 + "0sh47svzz0wm993ywfgpn0fvhajl2sj5hcnf5zxjz02in6ihhjnb")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Text-Roman") + (synopsis "Convert between Roman and Arabic algorisms") + (description "This package provides functions to convert between Roman and +Arabic algorisms. It supports both conventional Roman algorisms (which range +from 1 to 3999) and Milhar Romans, a variation which uses a bar across the +algorism to indicate multiplication by 1000.") + (license (package-license perl)))) + (define-public perl-text-simpletable (package (name "perl-text-simpletable") From 37e7a4929fcbbe677047b942d0f824738ccb0129 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:11:07 +0100 Subject: [PATCH 062/130] gnu: Add perl-unicode-normalize. * gnu/packages/perl.scm (perl-unicode-normalize): New variable. --- gnu/packages/perl.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 9ed0f05240..42601772a1 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -7252,6 +7252,24 @@ else.") common serialisation formats such as JSON or CBOR.") (license (package-license perl)))) +(define-public perl-unicode-normalize + (package + (name "perl-unicode-normalize") + (version "1.25") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/K/KH/KHW/" + "Unicode-Normalize-" version ".tar.gz")) + (sha256 + (base32 + "0v04bcyjfcfap4kfpc8q3ikq3j7s68nym4ckw3iasmmksdskmcq0")))) + (build-system perl-build-system) + (home-page "http://search.cpan.org/dist/Unicode-Normalize") + (synopsis "Unicode normalization forms") + (description "This Perl module provides Unicode normalization forms.") + (license (package-license perl)))) + (define-public perl-unicode-linebreak (package (name "perl-unicode-linebreak") From 5d2ecbffb2fc191df39cc25ff73127bffa1d691b Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:11:26 +0100 Subject: [PATCH 063/130] gnu: Add perl-unicode-collate. * gnu/packages/perl.scm (perl-unicode-collate): New variable. --- gnu/packages/perl.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 42601772a1..36db63d8be 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -7270,6 +7270,29 @@ common serialisation formats such as JSON or CBOR.") (description "This Perl module provides Unicode normalization forms.") (license (package-license perl)))) +(define-public perl-unicode-collate + (package + (name "perl-unicode-collate") + (version "1.18") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/S/SA/SADAHIRO/" + "Unicode-Collate-" version ".tar.gz")) + (sha256 + (base32 + "1lq4p3mqqljhhy8wyiyahris33j4m5qfzpi6iacmcqjzw5g4afbm")))) + (build-system perl-build-system) + (propagated-inputs + `(("perl-unicode-normalize" ,perl-unicode-normalize))) + (home-page "http://search.cpan.org/dist/Unicode-Collate") + (synopsis "Unicode collation algorithm") + (description "This package provides tools for sorting and comparing +Unicode data.") + ;; The file Unicode/Collate/allkeys.txt is released under the Expat + ;; license. + (license (list (package-license perl) expat)))) + (define-public perl-unicode-linebreak (package (name "perl-unicode-linebreak") From df669244f9c36564904481ab9c71e4edebc58d3e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:12:04 +0100 Subject: [PATCH 064/130] gnu: perl-unicode-linebreak: Update to 2016.003. * gnu/packages/perl.scm (perl-unicode-linebreak): Update to 2016.003. --- gnu/packages/perl.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 36db63d8be..d54b2bcb2f 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -7296,14 +7296,14 @@ Unicode data.") (define-public perl-unicode-linebreak (package (name "perl-unicode-linebreak") - (version "2015.12") + (version "2016.003") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/N/NE/NEZUMI/" "Unicode-LineBreak-" version ".tar.gz")) (sha256 (base32 - "1d0nnc97irfpab4d3b2lvq22hac118k7zbfrj0lnxkbfwx7122cm")))) + "096wf5x99swx7l7yd8pm2aw50g596nf50rkq7250zjcc1acjskp6")))) (build-system perl-build-system) (propagated-inputs `(("perl-mime-charset" ,perl-mime-charset))) From 93863a5e7257ea074a9a5e3f36a393a8ec29fedf Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:13:28 +0100 Subject: [PATCH 065/130] gnu: Add perl-xml-libxslt. * gnu/packages/xml.scm (perl-xml-libxslt): New variable. --- gnu/packages/xml.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 505d585e66..80534d69f2 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -329,6 +329,29 @@ XML parser and the high performance DOM implementation.") @code{XML::LibXML}.") (license (package-license perl)))) +(define-public perl-xml-libxslt + (package + (name "perl-xml-libxslt") + (version "1.95") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/" + "XML-LibXSLT-" version ".tar.gz")) + (sha256 + (base32 + "0dggycql18kfxzkb1kw3yc7gslxlrrgyyn2r2ygsylycb89j3jpi")))) + (build-system perl-build-system) + (inputs + `(("libxslt" ,libxslt))) + (propagated-inputs + `(("perl-xml-libxml" ,perl-xml-libxml))) + (home-page "http://search.cpan.org/dist/XML-LibXSLT") + (synopsis "Perl bindings to GNOME libxslt library") + (description "This Perl module is an interface to the GNOME project's +libxslt library.") + (license (package-license perl)))) + (define-public perl-xml-namespacesupport (package (name "perl-xml-namespacesupport") From ebcf74daf855d5bb679827d497ebee924b66721e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:14:41 +0100 Subject: [PATCH 066/130] gnu: Add perl-text-bibtex. * gnu/packages/tex.scm (perl-text-bibtex): New variable. --- gnu/packages/tex.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 9186e4693a..85ef83fd49 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 Federico Beffa ;;; Copyright © 2016 Thomas Danckaert +;;; Copyright © 2016 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) + #:use-module (guix build-system perl) #:use-module (guix build-system trivial) #:use-module (guix utils) #:use-module (guix git-download) @@ -382,6 +384,48 @@ world. This package contains a small working part of the TeX Live distribution."))) +(define-public perl-text-bibtex + (package + (name "perl-text-bibtex") + (version "0.77") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-" + version ".tar.gz")) + (sha256 + (base32 + "0kkfx8skk763pivz6h2ffy2zdp1lvy6d5sz0kjaj0mdbjffvnnb4")))) + (build-system perl-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'add-output-directory-to-rpath + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "inc/MyBuilder.pm" + (("-Lbtparse" line) + (string-append "-Wl,-rpath=" + (assoc-ref outputs "out") "/lib " line))) + #t)) + (add-after 'unpack 'install-libraries-to-/lib + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "Build.PL" + (("lib64") "lib")) + #t))))) + (native-inputs + `(("perl-capture-tiny" ,perl-capture-tiny) + ("perl-config-autoconf" ,perl-config-autoconf) + ("perl-extutils-libbuilder" ,perl-extutils-libbuilder) + ("perl-module-build" ,perl-module-build))) + (home-page "http://search.cpan.org/dist/Text-BibTeX") + (synopsis "Interface to read and parse BibTeX files") + (description "@code{Text::BibTeX} is a Perl library for reading, parsing, +and processing BibTeX files. @code{Text::BibTeX} gives you access to the data +at many different levels: you may work with BibTeX entries as simple field to +string mappings, or get at the original form of the data as a list of simple +values (strings, macros, or numbers) pasted together.") + (license (package-license perl)))) + (define-public rubber (package From d400068085ed3cf1a0cb956e25812033a97b7b2c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:15:28 +0100 Subject: [PATCH 067/130] gnu: Add biber. * gnu/packages/tex.scm (biber): New variable. --- gnu/packages/tex.scm | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 85ef83fd49..e950944587 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -52,6 +52,8 @@ #:use-module (gnu packages ruby) #:use-module (gnu packages shells) #:use-module (gnu packages base) + #:use-module (gnu packages web) + #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (gnu packages xdisorg) #:use-module (gnu packages zip) @@ -426,6 +428,86 @@ string mappings, or get at the original form of the data as a list of simple values (strings, macros, or numbers) pasted together.") (license (package-license perl)))) +(define-public biber + (package + (name "biber-next") + (version "2.6") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/plk/biber/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "158smzgjhjvyabdv97si5q88zjj5l8j1zbfnddvzy6fkpfhskgkp")))) + (build-system perl-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-programs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (perl5lib (getenv "PERL5LIB"))) + (wrap-program (string-append out "/bin/biber") + `("PERL5LIB" ":" prefix + (,(string-append perl5lib ":" out + "/lib/perl5/site_perl"))))) + #t))))) + (inputs + `(("perl-autovivification" ,perl-autovivification) + ("perl-class-accessor" ,perl-class-accessor) + ("perl-data-dump" ,perl-data-dump) + ("perl-data-compare" ,perl-data-compare) + ("perl-data-uniqid" ,perl-data-uniqid) + ("perl-datetime-format-builder" ,perl-datetime-format-builder) + ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian) + ("perl-file-slurp" ,perl-file-slurp) + ("perl-ipc-cmd" ,perl-ipc-cmd) + ("perl-ipc-run3" ,perl-ipc-run3) + ("perl-list-allutils" ,perl-list-allutils) + ("perl-list-moreutils" ,perl-list-moreutils) + ("perl-mozilla-ca" ,perl-mozilla-ca) + ("perl-regexp-common" ,perl-regexp-common) + ("perl-log-log4perl" ,perl-log-log4perl) + ;; We cannot use perl-unicode-collate here, because otherwise the + ;; hardcoded hashes in the tests would differ. See + ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html + ;;("perl-unicode-collate" ,perl-unicode-collate) + ("perl-unicode-normalize" ,perl-unicode-normalize) + ("perl-unicode-linebreak" ,perl-unicode-linebreak) + ("perl-encode-eucjpascii" ,perl-encode-eucjpascii) + ("perl-encode-jis2k" ,perl-encode-jis2k) + ("perl-encode-hanextra" ,perl-encode-hanextra) + ("perl-xml-libxml" ,perl-xml-libxml) + ("perl-xml-libxml-simple" ,perl-xml-libxml-simple) + ("perl-xml-libxslt" ,perl-xml-libxslt) + ("perl-xml-writer" ,perl-xml-writer) + ("perl-sort-key" ,perl-sort-key) + ("perl-text-csv" ,perl-text-csv) + ("perl-text-csv-xs" ,perl-text-csv-xs) + ("perl-text-roman" ,perl-text-roman) + ("perl-uri" ,perl-uri) + ("perl-text-bibtex" ,perl-text-bibtex) + ("perl-libwww" ,perl-libwww) + ("perl-lwp-protocol-https" ,perl-lwp-protocol-https) + ("perl-business-isbn" ,perl-business-isbn) + ("perl-business-issn" ,perl-business-issn) + ("perl-business-ismn" ,perl-business-ismn) + ("perl-lingua-translit" ,perl-lingua-translit))) + (native-inputs + `(("perl-config-autoconf" ,perl-config-autoconf) + ("perl-extutils-libbuilder" ,perl-extutils-libbuilder) + ("perl-module-build" ,perl-module-build) + ;; for tests + ("perl-file-which" ,perl-file-which) + ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient + ("perl-test-differences" ,perl-test-differences))) + (home-page "http://biblatex-biber.sourceforge.net/") + (synopsis "Backend for the BibLaTeX citation management tool") + (description "Biber is a BibTeX replacement for users of biblatex. Among +other things it comes with full Unicode support.") + (license license:artistic2.0))) + (define-public rubber (package From 253cdd6c1464c944be2418ee9161f5f5b57e0eee Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 23 Nov 2016 22:15:51 +0100 Subject: [PATCH 068/130] gnu: Add biber-2.5. * gnu/packages/tex.scm (biber-2.5): New variable. --- gnu/packages/tex.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index e950944587..7c84ed7194 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -508,6 +508,32 @@ values (strings, macros, or numbers) pasted together.") other things it comes with full Unicode support.") (license license:artistic2.0))) +;; Our version of texlive comes with biblatex 3.4, which is only compatible +;; with biber 2.5 according to the compatibility matrix in the biber +;; documentation. +(define-public biber-2.5 + (package (inherit biber) + (name "biber") + (version "2.5") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/plk/biber/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "163sd343wkrzwnvj2003m2j0kz517jmjr4savw6f8bjxhj8fdrqv")))) + (arguments + (substitute-keyword-arguments (package-arguments biber) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'check 'delete-failing-test + (lambda _ + (delete-file "t/sort-order.t") + #t)))))) + (inputs + `(("perl-date-simple" ,perl-date-simple) + ,@(package-inputs biber))))) (define-public rubber (package From dbf8f84f15fb80fa41caeed073460853083e48d3 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 25 Nov 2016 22:29:41 +0100 Subject: [PATCH 069/130] gnu: gcj: Fix build on armhf. * gnu/packages/patches/gcj-arm-mode.patch: New file. * gnu/local.mk (dist_patch_DATA): Add patch. * gnu/packages/gcc.scm (gcj): Add patch. [arguments]: Delete failing tests. --- gnu/local.mk | 1 + gnu/packages/gcc.scm | 14 ++++++++++ gnu/packages/patches/gcj-arm-mode.patch | 36 +++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 gnu/packages/patches/gcj-arm-mode.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5a9001b6d4..5ab9c3b036 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -554,6 +554,7 @@ dist_patch_DATA = \ %D%/packages/patches/gcc-5.0-libvtv-runpath.patch \ %D%/packages/patches/gcc-6-arm-none-eabi-multilib.patch \ %D%/packages/patches/gcc-6-cross-environment-variables.patch \ + %D%/packages/patches/gcj-arm-mode.patch \ %D%/packages/patches/gd-CVE-2016-7568.patch \ %D%/packages/patches/gd-CVE-2016-8670.patch \ %D%/packages/patches/gd-fix-chunk-size-on-boundaries.patch \ diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index c26cc4f497..ead270a3b5 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -521,6 +521,16 @@ as the 'native-search-paths' field." (define-public gcj (package (inherit gcc) (name "gcj") + (version (package-version gcc)) + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gcc/gcc-" + version "/gcc-" version ".tar.bz2")) + (sha256 + (base32 + "0zmnm00d2a1hsd41g34bhvxzvxisa2l584q3p447bd91lfjv4ci3")) + (patches (cons (search-patch "gcj-arm-mode.diff") + (origin-patches (package-source gcc)))))) (inputs `(("fastjar" ,fastjar) ("perl" ,perl) @@ -568,6 +578,10 @@ as the 'native-search-paths' field." 'unpack 'patch-testsuite ;; dejagnu-1.6 removes the 'absolute' command (lambda _ + ;; This test fails on armhf. It seems harmless enough to disable it. + (for-each delete-file '("libjava/testsuite/libjava.lang/Throw_2.java" + "libjava/testsuite/libjava.lang/Throw_2.out" + "libjava/testsuite/libjava.lang/Throw_2.jar")) (substitute* "libjava/testsuite/lib/libjava.exp" (("absolute") "file normalize")) #t)) diff --git a/gnu/packages/patches/gcj-arm-mode.patch b/gnu/packages/patches/gcj-arm-mode.patch new file mode 100644 index 0000000000..16fdb5ecac --- /dev/null +++ b/gnu/packages/patches/gcj-arm-mode.patch @@ -0,0 +1,36 @@ +Taken from +https://sources.debian.net/data/main/g/gcc-4.9/4.9.2-10/debian/patches/gcj-arm-mode.diff + +# DP: For armhf, force arm mode instead of thumb mode + +--- a/src/libjava/configure.host ++++ b/src/libjava/configure.host +@@ -66,6 +66,9 @@ + ;; + esac + ++# on armhf force arm mode ++libgcj_flags="${libgcj_flags} -marm" ++ + AM_RUNTESTFLAGS= + + # Set any host dependent compiler flags. +--- a/src/gcc/java/lang-specs.h ++++ b/src/gcc/java/lang-specs.h +@@ -47,7 +47,7 @@ + %{.class|.zip|.jar|!fsyntax-only:jc1 \ + %{.java|fsaw-java-file:%U.jar -fsource-filename=%i % Date: Fri, 11 Nov 2016 09:05:45 -0800 Subject: [PATCH 070/130] gnu: udisks: Add manpages. * gnu/packages/freedesktop.scm (udisks)[native-inputs]: Add docbook-xml and docbook-xsl. [arguments]: Add #:make-flags to specify XML catalog files for manuals. Signed-off-by: Marius Bakke --- gnu/packages/freedesktop.scm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 456d569063..16d78603f0 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -461,7 +461,9 @@ Analysis and Reporting Technology) functionality.") "119pr2zbff8vkwlhghim7d7ir24c1dil9hp4q49wm4f6pnrjpbmb")))) (build-system gnu-build-system) (native-inputs - `(("glib:bin" ,glib "bin") ; for glib-mkenums + `(("docbook-xml" ,docbook-xml-4.3) ; to build the manpages + ("docbook-xsl" ,docbook-xsl) + ("glib:bin" ,glib "bin") ; for glib-mkenums ("gobject-introspection" ,gobject-introspection) ("intltool" ,intltool) ("pkg-config" ,pkg-config) @@ -480,13 +482,28 @@ Analysis and Reporting Technology) functionality.") `(#:tests? #f ; requiring system message dbus #:disallowed-references ("doc") ;enforce separation of "doc" #:configure-flags - (list "--disable-man" + (list "--enable-man" "--localstatedir=/var" "--enable-fhs-media" ;mount devices in /media, not /run/media (string-append "--with-html-dir=" (assoc-ref %outputs "doc") "/share/doc/udisks/html") (string-append "--with-udevdir=" %output "/lib/udev")) + #:make-flags + (let* ((docbook-xsl-name-version ,(string-append + (package-name docbook-xsl) "-" + (package-version docbook-xsl))) + (docbook-xsl-catalog-file (string-append + (assoc-ref %build-inputs "docbook-xsl") + "/xml/xsl/" + docbook-xsl-name-version + "/catalog.xml")) + (docbook-xml-catalog-file (string-append + (assoc-ref %build-inputs "docbook-xml") + "/xml/dtd/docbook/catalog.xml"))) + ;; Reference the catalog files required to build the manpages. + (list (string-append "XML_CATALOG_FILES=" docbook-xsl-catalog-file " " + docbook-xml-catalog-file))) #:phases (modify-phases %standard-phases (add-before From 988e1dca4b61ed5ddf77bd2913b8c0ff4a6b24e7 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 27 Nov 2016 11:13:50 +0100 Subject: [PATCH 071/130] gnu: udisks: Update to 2.1.8. * gnu/packages/freedesktop.scm (udisks): Update to 2.1.8. [home-page]: Use HTTPS. --- gnu/packages/freedesktop.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 16d78603f0..fb7b82e051 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -451,14 +451,14 @@ Analysis and Reporting Technology) functionality.") (define-public udisks (package (name "udisks") - (version "2.1.7") + (version "2.1.8") (source (origin (method url-fetch) (uri (string-append "https://udisks.freedesktop.org/releases/" name "-" version ".tar.bz2")) (sha256 (base32 - "119pr2zbff8vkwlhghim7d7ir24c1dil9hp4q49wm4f6pnrjpbmb")))) + "1nkxhnqh39c9pzvm4zfj50rgv6apqawdx09bv3sfaxrah4a6jhfs")))) (build-system gnu-build-system) (native-inputs `(("docbook-xml" ,docbook-xml-4.3) ; to build the manpages @@ -526,7 +526,7 @@ Analysis and Reporting Technology) functionality.") "/run/current-system/profile/bin" "/run/current-system/profile/sbin"))) #t)))))) - (home-page "http://www.freedesktop.org/wiki/Software/udisks/") + (home-page "https://www.freedesktop.org/wiki/Software/udisks/") (synopsis "Disk manager service") (description "UDisks provides interfaces to enumerate and perform operations on disks From 7574cecf0fb8c737f89d5d670121241538f5a98e Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 27 Nov 2016 09:53:20 +0100 Subject: [PATCH 072/130] gnu: python2-flask: Pick up python-flask's native-inputs. * gnu/packages/python.scm (python2-flask)[native-inputs]: Pick up python-flask's native-inputs. Signed-off-by: Marius Bakke --- gnu/packages/python.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 497da52264..39b40e7753 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -9581,9 +9581,11 @@ presume or force a developer to use a particular tool or library.") (properties `((python2-variant . ,(delay python2-flask)))))) (define-public python2-flask - (package (inherit (package-with-python2 - (strip-python2-variant python-flask))) - (native-inputs `(("python2-setuptools" ,python2-setuptools))))) + (let ((base (package-with-python2 (strip-python2-variant python-flask)))) + (package + (inherit base) + (native-inputs `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs base)))))) (define-public python-cookies (package From cd569f0d2989f7231939ad7446aea9942904dd09 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 10:51:38 -0500 Subject: [PATCH 073/130] gnu: gcj: Fix typo in patch filename. This is a followup to commit dbf8f84f15fb80fa41caeed073460853083e48d3. Reported by quigonjinn on #guix. * gnu/packages/gcc.scm (gcj)[source]: Fix typo. --- gnu/packages/gcc.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index ead270a3b5..7ff6e3c56f 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -529,7 +529,7 @@ as the 'native-search-paths' field." (sha256 (base32 "0zmnm00d2a1hsd41g34bhvxzvxisa2l584q3p447bd91lfjv4ci3")) - (patches (cons (search-patch "gcj-arm-mode.diff") + (patches (cons (search-patch "gcj-arm-mode.patch") (origin-patches (package-source gcc)))))) (inputs `(("fastjar" ,fastjar) From 8c4140e49e496bbf1d71331333127bf68e48e18e Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 27 Nov 2016 18:25:42 +0100 Subject: [PATCH 074/130] gnu: notmuch: Update to 0.23.3. * gnu/packages/mail.scm (notmuch): Update to 0.23.3. [arguments]: Re-enable previously failing tests. --- gnu/packages/mail.scm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 9dcaea364c..e0d0fd164c 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -537,14 +537,14 @@ invoking @command{notifymuch} from the post-new hook.") (define-public notmuch (package (name "notmuch") - (version "0.23.2") + (version "0.23.3") (source (origin (method url-fetch) (uri (string-append "https://notmuchmail.org/releases/notmuch-" version ".tar.gz")) (sha256 (base32 - "1g4p5hsrqqbqk6s2w756als60wppvjgpyq104smy3w9vshl7bzgd")))) + "10hqjnl5aavf9clfmx3y832jyz58fplmc3f58pip9dq30b7sap8g")))) (build-system gnu-build-system) (arguments '(#:make-flags (list "V=1") ; Verbose test output. @@ -568,11 +568,6 @@ invoking @command{notifymuch} from the post-new hook.") ;; Patch various inline shell invocations. (substitute* (find-files "test" "\\.sh$") (("/bin/sh") (which "sh"))) - ;; XXX: Some signature verification tests fail with - ;; gnupg-2.1.16, so we skip them. See this thread: - ;; https://notmuchmail.org/pipermail/notmuch/2016/023688.html - (setenv "NOTMUCH_SKIP_TESTS" - "T350-crypto.2 T350-crypto.3 T350-crypto.4 T350-crypto.15") #t))))) (native-inputs `(("bash-completion" ,bash-completion) From bac640997072a3f1b729eaa7df04d94bd0675bb0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 27 Nov 2016 18:59:54 +0100 Subject: [PATCH 075/130] gnu: gcj: Correct paths in ARM patch. * gnu/packages/patches/gcj-arm-mode.patch: Strip directories. --- gnu/packages/patches/gcj-arm-mode.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/packages/patches/gcj-arm-mode.patch b/gnu/packages/patches/gcj-arm-mode.patch index 16fdb5ecac..a3f999f7e9 100644 --- a/gnu/packages/patches/gcj-arm-mode.patch +++ b/gnu/packages/patches/gcj-arm-mode.patch @@ -3,8 +3,8 @@ https://sources.debian.net/data/main/g/gcc-4.9/4.9.2-10/debian/patches/gcj-arm-m # DP: For armhf, force arm mode instead of thumb mode ---- a/src/libjava/configure.host -+++ b/src/libjava/configure.host +--- a/libjava/configure.host ++++ b/libjava/configure.host @@ -66,6 +66,9 @@ ;; esac @@ -15,8 +15,8 @@ https://sources.debian.net/data/main/g/gcc-4.9/4.9.2-10/debian/patches/gcj-arm-m AM_RUNTESTFLAGS= # Set any host dependent compiler flags. ---- a/src/gcc/java/lang-specs.h -+++ b/src/gcc/java/lang-specs.h +--- a/gcc/java/lang-specs.h ++++ b/gcc/java/lang-specs.h @@ -47,7 +47,7 @@ %{.class|.zip|.jar|!fsyntax-only:jc1 \ %{.java|fsaw-java-file:%U.jar -fsource-filename=%i % Date: Sun, 27 Nov 2016 19:00:57 +0100 Subject: [PATCH 076/130] gnu: gcj: Inherit source field from "gcc". * gnu/packages/gcc.scm (gcj)[source]: Inherit source from "gcc" package. --- gnu/packages/gcc.scm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 7ff6e3c56f..4d93317785 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -522,15 +522,9 @@ as the 'native-search-paths' field." (package (inherit gcc) (name "gcj") (version (package-version gcc)) - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/gcc/gcc-" - version "/gcc-" version ".tar.bz2")) - (sha256 - (base32 - "0zmnm00d2a1hsd41g34bhvxzvxisa2l584q3p447bd91lfjv4ci3")) - (patches (cons (search-patch "gcj-arm-mode.patch") - (origin-patches (package-source gcc)))))) + (source (origin (inherit (package-source gcc)) + (patches (cons (search-patch "gcj-arm-mode.patch") + (origin-patches (package-source gcc)))))) (inputs `(("fastjar" ,fastjar) ("perl" ,perl) From 4228a79e6fef44542e6bfbcd65e12ab2f6d9442d Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:14:11 -0500 Subject: [PATCH 077/130] gnu: python-mutagen: Update to 1.35.1. * gnu/packages/music.scm (python-mutagen, python2-mutagen): Update to 1.35.1. [native-inputs]: Add python-pytest. --- gnu/packages/music.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 188791976c..d6dcf1c217 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1796,14 +1796,16 @@ event-based scripts for scrobbling, notifications, etc.") (define-public python-mutagen (package (name "python-mutagen") - (version "1.31") + (version "1.35.1") (source (origin (method url-fetch) (uri (pypi-uri "mutagen" version)) (sha256 (base32 - "16fnnhspniac2i7qswxafawsh2x2a803hmc6bn9k1zl5fxq1380a")))) + "0klk68c1n3285vvm2xzk8ii7mlqp1dxii04askan0gi1wlpagka9")))) (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest))) (home-page "https://bitbucket.org/lazka/mutagen") (synopsis "Read and write audio tags") (description "Mutagen is a Python module to handle audio metadata. It From 38e81a2c55fe2ae35c53cdb2cda84baa7b6fcb86 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:14:58 -0500 Subject: [PATCH 078/130] gnu: python-munkres: Update to 1.0.8. * gnu/packages/python.scm (python-munkres, python2-munkres): Update to 1.0.8. --- gnu/packages/python.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 39b40e7753..ef38e35470 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -9535,13 +9535,13 @@ way.") (define-public python-munkres (package (name "python-munkres") - (version "1.0.7") + (version "1.0.8") (source (origin (method url-fetch) (uri (pypi-uri "munkres" version)) (sha256 (base32 - "1i6nf45i0kkzdx6k70giybsqxz4dxsjbrkrfqgjd7znfkf25sjik")))) + "0mbspx4zv8id4x6pim6ybsa1xh96qwpbqj7skbqz4c9c9nf1lpqq")))) (build-system python-build-system) (arguments '(#:tests? #f)) ; no test suite From daedf34db90e1fe40855fdc325c3c1fe50797410 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:15:57 -0500 Subject: [PATCH 079/130] gnu: python-musicbrainzngs: Update to 0.6. * gnu/packages/music.scm (python-musicbrainzngs, python2-musicbrainzngs): Update to 0.6. [arguments]: Disable the test suites. --- gnu/packages/music.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index d6dcf1c217..5b2bded07d 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1823,14 +1823,18 @@ streams on an individual packet/page level.") (define-public python-musicbrainzngs (package (name "python-musicbrainzngs") - (version "0.5") + (version "0.6") (source (origin (method url-fetch) (uri (pypi-uri "musicbrainzngs" version)) (sha256 (base32 - "12f48llmdf5rkiqxcb70k2k1dmhm8byq0ifazvlrca8dfnmqh4r8")))) + "1dddarpjawryll2wss65xq3v9q8ln8dan7984l5dxzqx88d2dvr8")))) (build-system python-build-system) + (arguments + '(;; The tests fail suffer from race conditions: + ;; https://github.com/alastair/python-musicbrainzngs/issues/211 + #:tests? #f)) (home-page "https://python-musicbrainzngs.readthedocs.org/") (synopsis "Python bindings for MusicBrainz NGS webservice") (description "Musicbrainzngs implements Python bindings of the MusicBrainz From b04d9b97c45b4607618452d35e5b7c0e07b278fa Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:17:12 -0500 Subject: [PATCH 080/130] gnu: python-pylast: Update 1.6.0. * gnu/packages/music.scm (python-pylast, python2-pylast): Update to 1.6.0. --- gnu/packages/music.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 5b2bded07d..c2a995d02f 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1883,13 +1883,13 @@ detailed track info including timbre, pitch, rhythm and loudness information. (define-public python-pylast (package (name "python-pylast") - (version "1.5.1") + (version "1.6.0") (source (origin (method url-fetch) (uri (pypi-uri "pylast" version)) (sha256 (base32 - "10znd9xr1vs2ix519jkz3ccm90zciaddcdr2w2wrrh2jyy3bc59a")))) + "0bml11gfkxqd3i2jxkn5k2xllc4rvxjcyhs8an05gcyy1zp2bwvb")))) (build-system python-build-system) (native-inputs `(("python-coverage" ,python-coverage) From 8c4964dd51dd680bb30cc512d66798a5ade4e5ae Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:17:59 -0500 Subject: [PATCH 081/130] gnu: python-jellyfish: Update to 0.5.6. * gnu/packages/python.scm (python-jellyfish, python2-jellyfish): Update to 0.5.6. --- gnu/packages/python.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index ef38e35470..5c27b90402 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -9761,13 +9761,13 @@ ambiguities (forward vs. backward slashes, etc.). (define-public python-jellyfish (package (name "python-jellyfish") - (version "0.5.3") + (version "0.5.6") (source (origin (method url-fetch) (uri (pypi-uri "jellyfish" version)) (sha256 (base32 - "12bxh8cy9xmvyrjz7aw159nd5pyvb645rkvw4r6bvm4xbvs8gd07")))) + "1j9rplb16ba2prjj6mip46z0w9pnhnqpwgiwi0x93vnas14rlyl8")))) (build-system python-build-system) (native-inputs `(("python-pytest" ,python-pytest))) From 6782444764d6072ef2684403efb92ca1aaabc016 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:19:21 -0500 Subject: [PATCH 082/130] gnu: python-rarfile: Update to 2.8. * gnu/packages/python.scm (python-rarfile, python2-rarfile): Update to 2.8. [source]: Remove obsolete patch. * gnu/packages/patches/python-rarfile-fix-tests.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - .../patches/python-rarfile-fix-tests.patch | 14 -------------- gnu/packages/python.scm | 6 ++---- 3 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 gnu/packages/patches/python-rarfile-fix-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5ab9c3b036..c50ef254e0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -827,7 +827,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-file-double-encoding-bug.patch \ %D%/packages/patches/python-fix-tests.patch \ %D%/packages/patches/python-parse-too-many-fields.patch \ - %D%/packages/patches/python-rarfile-fix-tests.patch \ %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ %D%/packages/patches/python-statsmodels-fix-tests.patch \ %D%/packages/patches/python-configobj-setuptools.patch \ diff --git a/gnu/packages/patches/python-rarfile-fix-tests.patch b/gnu/packages/patches/python-rarfile-fix-tests.patch deleted file mode 100644 index 8ae8894009..0000000000 --- a/gnu/packages/patches/python-rarfile-fix-tests.patch +++ /dev/null @@ -1,14 +0,0 @@ -There is no test.sh, but there are test1.sh and test2.sh. - -diff --git a/test/Makefile b/test/Makefile -index 027bc5f..5383db3 100644 ---- a/test/Makefile -+++ b/test/Makefile -@@ -1,5 +1,6 @@ - test: -- ./test.sh -+ ./test1.sh -+ ./test2.sh - - clean: - rm -rf __pycache__ diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5c27b90402..e3cde11ab4 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -9816,15 +9816,13 @@ module, adding support for Unicode strings.") (define-public python-rarfile (package (name "python-rarfile") - (version "2.7") + (version "2.8") (source (origin (method url-fetch) (uri (pypi-uri "rarfile" version)) (sha256 (base32 - "0d8n1dlpiz7av8dmbp0vclrwl9cnxizr4f2c9xvj1h5nvn480527")) - ;; https://github.com/markokr/rarfile/pull/17/ - (patches (search-patches "python-rarfile-fix-tests.patch")))) + "0qfad483kcbga0bn4qmcz953xjk16r52fahiy46zzn56v80y89ra")))) (build-system python-build-system) (arguments '(#:phases From d3db5efbf97dd0d880b18c8fc0d3c76d91fd6e4d Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 01:13:53 -0500 Subject: [PATCH 083/130] gnu: Add python-discogs-client. * gnu/packages/music.scm (python-discogs-client, python2-discogs-client): New variables. --- gnu/packages/music.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index c2a995d02f..b8145bbbb6 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -2427,3 +2427,37 @@ a simulation of an analog Wah pedal with switchless activation.")))) filters, crossovers, simple gain plugins without zipper noise, switch box plugins, a switch trigger, a toggle switch, and a peakmeter.") (license license:gpl2+)))) + +(define-public python-discogs-client + (package + (name "python-discogs-client") + (version "2.2.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "discogs-client" version)) + (sha256 + (base32 + "053ld2psh0yj3z0kg6z5bn4y3cr562m727494n0ayhgzbkjbacly")))) + (build-system python-build-system) + (propagated-inputs + `(("python-oauthlib" ,python-oauthlib) + ("python-requests" ,python-requests))) + (native-inputs + `(("python-six" ,python-six))) + (home-page "https://github.com/discogs/discogs_client") + (synopsis "Official Python client for the Discogs API") + (description "This is the official Discogs API client for Python. It enables +you to query the Discogs database for information on artists, releases, labels, +users, Marketplace listings, and more. It also supports OAuth 1.0a +authorization, which allows you to change user data such as profile information, +collections and wantlists, inventory, and orders.") + (license license:bsd-2) + (properties `((python2-variant . ,(delay python2-discogs-client)))))) + +(define-public python2-discogs-client + (let ((base (package-with-python2 + (strip-python2-variant python-discogs-client)))) + (package (inherit base) + (native-inputs + `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs base)))))) From f27ec24d88e7b0ddd157342f6ee65ce911a3751d Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 27 Nov 2016 00:20:05 -0500 Subject: [PATCH 084/130] gnu: beets: Update to 1.4.1. * gnu/packages/music.scm (beets): Update to 1.4.1. [inputs]: Add python2-discogs-client. --- gnu/packages/music.scm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index b8145bbbb6..edc34ffe87 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1918,16 +1918,20 @@ websites such as Libre.fm.") (define-public beets (package (name "beets") - (version "1.3.19") + (version "1.4.1") (source (origin (method url-fetch) (uri (pypi-uri "beets" version)) (sha256 (base32 - "1vi1dh3fr554bnm8y9pjy09hblw18v6cl2jppzwlp72afri1w93b")))) + "14yn88xrcinpdg3ic285ar0wmwldzyjfd3ll6clmp3z3r4iqffip")))) (build-system python-build-system) (arguments - `(#:python ,python-2 ; only Python 2 is supported + `(;; Python 3 support is still "alpha", and the upstream maintainers ask + ;; packagers not to use it yet: + ;; https://github.com/beetbox/beets/releases/tag/v1.4.1 + ;; TODO Check this again for the next release. + #:python ,python-2 #:phases (modify-phases %standard-phases (add-after 'unpack 'set-HOME @@ -1949,7 +1953,8 @@ websites such as Libre.fm.") ("python2-responses" ,python2-responses))) ;; TODO: Install optional plugins and dependencies. (inputs - `(("python2-enum34" ,python2-enum34) + `(("python2-discogs-client" ,python2-discogs-client) + ("python2-enum34" ,python2-enum34) ("python2-jellyfish" ,python2-jellyfish) ("python2-munkres" ,python2-munkres) ("python2-musicbrainzngs" ,python2-musicbrainzngs) From 69874f5fd2b529a6028eaa7c1a342b321bd87f59 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 27 Nov 2016 02:11:37 +0100 Subject: [PATCH 085/130] gnu: libgphoto2: Update to 2.5.11. * gnu/packages/photo.scm (libgphoto2): Update to 2.5.11. --- gnu/packages/photo.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index 2b93d7bbf0..9d34e4797c 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -89,14 +89,14 @@ data as produced by digital cameras.") (define-public libgphoto2 (package (name "libgphoto2") - (version "2.5.10") + (version "2.5.11") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/gphoto/libgphoto/" version "/libgphoto2-" version ".tar.bz2")) (sha256 (base32 - "1wjf79ipqwb5phfjjwf15rwgigakylnfqaj4crs5qnds6ba6i1ld")))) + "1ap070zz6l4kn2mbyxb1yj4x5ar8hpdbmf2pvjxgnly1ss319dkz")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) (inputs From f6c44a3f0492a84fe2fac2279bc29931a5442e02 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 27 Nov 2016 02:12:26 +0100 Subject: [PATCH 086/130] gnu: gphoto2: Update to 2.5.11. * gnu/packages/photo.scm (gphoto2): Update to 2.5.11. --- gnu/packages/photo.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index 9d34e4797c..00bbb5d9a9 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -120,14 +120,14 @@ from digital cameras.") (define-public gphoto2 (package (name "gphoto2") - (version "2.5.10") + (version "2.5.11") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/gphoto/gphoto/" version "/gphoto2-" version ".tar.bz2")) (sha256 (base32 - "1436i2chc1xzq1bng48yx52kgqjqbaashij52sifbdslbm9jzk36")))) + "1sgr6rsvzzagcwhc8fxbnvz3k02wr2hab0vrbvcb04k5l3b48a1r")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) From c7a70c336f11f5db2636a15372fa85a8b426fd3b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 27 Nov 2016 20:23:20 +0200 Subject: [PATCH 087/130] gnu: jasper: Update to 2.0.0 [fixes security issues]. * gnu/packages/image.scm (jasper): Update to 2.0.0. [build-system]: Switch to cmake-build-system. --- gnu/packages/image.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 526c87cf86..981e1f8109 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -843,15 +843,15 @@ convert, manipulate, filter and display a wide variety of image formats.") (define-public jasper (package (name "jasper") - (version "1.900.29") + (version "2.0.0") (source (origin (method url-fetch) (uri (string-append "https://www.ece.uvic.ca/~frodo/jasper" "/software/jasper-" version ".tar.gz")) (sha256 (base32 - "1h1575wdzq1p7y2xvy1gbiypai1iils5awhy4gadr78qpb9ykrra")))) - (build-system gnu-build-system) + "1kg5yrdwgazhbczybyx4548m0ijssabcp8hl5l87w78z833vikks")))) + (build-system cmake-build-system) (inputs `(("libjpeg" ,libjpeg))) (synopsis "JPEG-2000 library") (description "The JasPer Project is an initiative to provide a reference From aa28ecc40af91d7cdff2fb3ab4ad86ad10d43ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 27 Nov 2016 23:03:45 +0100 Subject: [PATCH 088/130] pull: Hack to allow compilation with older Guile-SSH packages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by iyzsong@member.fsf.org (宋文武) at . * build-aux/build-self.scm (build): Set 'LTDL_LIBRARY_PATH' when GUILE-SSH has a "0.9." version prefix. --- build-aux/build-self.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 485f91b4c0..cc702490df 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -114,6 +114,13 @@ files." (string-append #$guile-ssh "/lib/guile/2.0/site-ccache") %load-compiled-path))) + ;; XXX: The 'guile-ssh' package prior to Guix commit 92b7258 was + ;; broken: libguile-ssh could not be found. Work around that. + ;; FIXME: We want Guile-SSH 0.10.2 or later anyway. + #$(if (string-prefix? "0.9." (package-version guile-ssh)) + #~(setenv "LTDL_LIBRARY_PATH" (string-append #$guile-ssh "/lib")) + #t) + (build-guix #$output #$source #:system #$%system From 9926875572cf2936b7f23fb291328bfa68c038c6 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sun, 27 Nov 2016 13:11:46 +1000 Subject: [PATCH 089/130] gnu: Add newick-utils. * gnu/packages/bioinformatics.scm (newick-utils): New variable. --- gnu/packages/bioinformatics.scm | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 8d2cb93c7c..f04acc0a5c 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -50,6 +50,7 @@ #:use-module (gnu packages documentation) #:use-module (gnu packages datastructures) #:use-module (gnu packages file) + #:use-module (gnu packages flex) #:use-module (gnu packages gawk) #:use-module (gnu packages gcc) #:use-module (gnu packages gd) @@ -3472,6 +3473,45 @@ program for nucleotide and protein sequences.") ;; License information found in 'muscle -h' and usage.cpp. (license license:public-domain))) +(define-public newick-utils + ;; There are no recent releases so we package from git. + (let ((commit "da121155a977197cab9fbb15953ca1b40b11eb87")) + (package + (name "newick-utils") + (version (string-append "1.6-1." (string-take commit 8))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tjunier/newick_utils.git") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "1hkw21rq1mwf7xp0rmbb2gqc0i6p11108m69i7mr7xcjl268pxnb")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'autoconf + (lambda _ (zero? (system* "autoreconf" "-vif"))))))) + (inputs + ;; XXX: TODO: Enable Lua and Guile bindings. + ;; https://github.com/tjunier/newick_utils/issues/13 + `(("libxml2" ,libxml2) + ("flex" ,flex) + ("bison" ,bison))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + (synopsis "Programs for working with newick format phylogenetic trees") + (description + "Newick-utils is a suite of utilities for processing phylogenetic trees +in Newick format. Functions include re-rooting, extracting subtrees, +trimming, pruning, condensing, drawing (ASCII graphics or SVG).") + (home-page "https://github.com/tjunier/newick_utils") + (license license:bsd-3)))) + (define-public orfm (package (name "orfm") From f0ddc5e55b0a022a2c7478efa791c5ae03ea8010 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 25 Nov 2016 15:13:08 +0100 Subject: [PATCH 090/130] gnu: Add editres. * gnu/packages/xorg.scm (editres): New variable. --- gnu/packages/xorg.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 9f9549b6b9..4e79d2d132 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2016 ng0 ;;; Copyright © 2016 Alex Kost ;;; Copyright © 2016 David Craven +;;; Copyright © 2016 John Darrington ;;; ;;; This file is part of GNU Guix. ;;; @@ -335,6 +336,44 @@ provided.") "See 'dri3proto.h' in the distribution.")))) +(define-public editres + (package + (name "editres") + (version "1.0.6") + (source + (origin + (method url-fetch) + (uri (string-append + "mirror://xorg/individual/app/" name "-" + version + ".tar.bz2")) + (sha256 + (base32 + "1w2d5hb5pw9ii2jlf4yjlp899402zfwc8hdkpdr3i1fy1cjd2riv")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list (string-append "--with-appdefaultdir=" + %output "/lib/X11/app-defaults")))) + (inputs + `(("libxaw" ,libxaw) + ("libxmu" ,libxmu) + ("libxt" ,libxt))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (home-page "https://www.x.org/wiki/") + (synopsis "Tool to browse and edit X Toolkit resource specifications") + (description + "Editres is a tool that allows users and application developers to view +the full widget hierarchy of any X Toolkit application that speaks the Editres +protocol. In addition, editres will help the user construct resource +specifications, allow the user to apply the resource to the application and +view the results dynamically. Once the user is happy with a resource +specification editres will append the resource string to the user's X +Resources file.") + (license license:x11))) + + (define-public encodings (package (name "encodings") From d35de59b645beb5fce4349b445265b9cf8878cf8 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 28 Nov 2016 11:11:38 +0200 Subject: [PATCH 091/130] gnu: ntp: Fix indentation. * gnu/packages/ntp.scm (ntp): Fix indentation to only use spaces. --- gnu/packages/ntp.scm | 53 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/gnu/packages/ntp.scm b/gnu/packages/ntp.scm index 177eb8946a..382fa3f433 100644 --- a/gnu/packages/ntp.scm +++ b/gnu/packages/ntp.scm @@ -40,32 +40,33 @@ (package (name "ntp") (version "4.2.8p8") - (source (origin - (method url-fetch) - (uri (list (string-append - "http://archive.ntp.org/ntp4/ntp-" - (version-major+minor version) - "/ntp-" version ".tar.gz") - (string-append - "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-" - (version-major+minor version) - "/ntp-" version ".tar.gz"))) - (sha256 - (base32 - "1vlpgd0dk2wkpmmf869sfxi8f46sfnmjgk51vl8n6vj5y2sx1cra")) - (modules '((guix build utils))) - (snippet - '(begin - ;; Remove the bundled copy of libevent, but we must keep - ;; sntp/libevent/build-aux since configure.ac contains - ;; AC_CONFIG_AUX_DIR([sntp/libevent/build-aux]) - (rename-file "sntp/libevent/build-aux" - "sntp/libevent:build-aux") - (delete-file-recursively "sntp/libevent") - (mkdir "sntp/libevent") - (rename-file "sntp/libevent:build-aux" - "sntp/libevent/build-aux") - #t)))) + (source + (origin + (method url-fetch) + (uri (list (string-append + "http://archive.ntp.org/ntp4/ntp-" + (version-major+minor version) + "/ntp-" version ".tar.gz") + (string-append + "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-" + (version-major+minor version) + "/ntp-" version ".tar.gz"))) + (sha256 + (base32 + "1vlpgd0dk2wkpmmf869sfxi8f46sfnmjgk51vl8n6vj5y2sx1cra")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove the bundled copy of libevent, but we must keep + ;; sntp/libevent/build-aux since configure.ac contains + ;; AC_CONFIG_AUX_DIR([sntp/libevent/build-aux]) + (rename-file "sntp/libevent/build-aux" + "sntp/libevent:build-aux") + (delete-file-recursively "sntp/libevent") + (mkdir "sntp/libevent") + (rename-file "sntp/libevent:build-aux" + "sntp/libevent/build-aux") + #t)))) (native-inputs `(("which" ,which) ("pkg-config" ,pkg-config))) (inputs From 5e9cce55b5217fb72649aad1cfbeb94b58d94787 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 28 Nov 2016 21:50:57 +0200 Subject: [PATCH 092/130] gnu: ntp: Update to 4.2.8p9. * gnu/packages/ntp.scm (ntp): Update to 4.2.8p9. --- gnu/packages/ntp.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/ntp.scm b/gnu/packages/ntp.scm index 382fa3f433..13781fbdad 100644 --- a/gnu/packages/ntp.scm +++ b/gnu/packages/ntp.scm @@ -39,7 +39,7 @@ (define-public ntp (package (name "ntp") - (version "4.2.8p8") + (version "4.2.8p9") (source (origin (method url-fetch) @@ -53,7 +53,7 @@ "/ntp-" version ".tar.gz"))) (sha256 (base32 - "1vlpgd0dk2wkpmmf869sfxi8f46sfnmjgk51vl8n6vj5y2sx1cra")) + "0whbyf82lrczbri4adbsa4hg1ppfa6c7qcj7nhjwdfp1g1vjh95p")) (modules '((guix build utils))) (snippet '(begin From 1bbe79594e24e9731003289292d6fb94219aad93 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 28 Nov 2016 22:00:41 +0100 Subject: [PATCH 093/130] gnu: non-sequencer: Update to 1.9.5-2.a22f33f. * gnu/packages/music.scm (non-sequencer): Update to 1.9.5-2.a22f33f. --- gnu/packages/music.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index edc34ffe87..3c56d199d2 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -588,11 +588,12 @@ Guile.") (define-public non-sequencer ;; The latest tagged release is three years old and uses a custom build - ;; system, so we take the last commit affecting the "sequencer" directory. - (let ((commit "1d9bd576f6bf7ea240af5f7a60260592750af0dd")) + ;; system, so we take the last commit. + (let ((commit "a22f33f486a5c6f75b60e36f66504c036c0f6f8c") + (revision "2")) (package (name "non-sequencer") - (version (string-append "1.9.5-" (string-take commit 7))) + (version (string-append "1.9.5-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference @@ -600,7 +601,7 @@ Guile.") (commit commit))) (sha256 (base32 - "0pkkw8q6d55j38xm7r4rwpdv1wy00a44h8c4wrn7vbgpq9nij46y")) + "09q5x8i4f8mqnl8w6xnsq5zriy4bzdl4x2vq9n34a433rfrk84bg")) (file-name (string-append name "-" version "-checkout")))) (build-system waf-build-system) (arguments From eb21d248066feb26b4ca7dd0530ad2e4fbb11914 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 27 Nov 2016 23:33:33 +0100 Subject: [PATCH 094/130] gnu: lv2: Update to 1.14.0. * gnu/packages/audio.scm (lv2): Update to 1.14.0. --- gnu/packages/audio.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 66db4c52c6..940683da14 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -1551,15 +1551,14 @@ significantly faster and have minimal dependencies.") (define-public lv2 (package (name "lv2") - (version "1.12.0") + (version "1.14.0") (source (origin (method url-fetch) (uri (string-append "http://lv2plug.in/spec/lv2-" - version - ".tar.bz2")) + version ".tar.bz2")) (sha256 (base32 - "1saq0vwqy5zjdkgc5ahs8kcabxfmff2mmg68fiqrkv8hiw9m6jks")))) + "0chxwys3vnn3nxc9x2vchm74s9sx0vfra6y893byy12ci61jc1dq")))) (build-system waf-build-system) (arguments `(#:tests? #f ; no check target From e48ddb96282cd231e4aed2255f6b918901a71922 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 28 Nov 2016 19:46:03 +0100 Subject: [PATCH 095/130] doc: Suggest installing gvfs. * gnu/system/examples/desktop.tmpl: Add gvfs to the system-wide list of packages. --- gnu/system/examples/desktop.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index 82687e740b..21b4563b53 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -4,7 +4,7 @@ (use-modules (gnu) (gnu system nss)) (use-service-modules desktop) -(use-package-modules certs) +(use-package-modules certs gnome) (operating-system (host-name "antelope") @@ -42,6 +42,7 @@ ;; This is where we specify system-wide packages. (packages (cons* nss-certs ;for HTTPS access + gvfs ;for user mounts %base-packages)) ;; Add GNOME and/or Xfce---we can choose at the log-in From 58612fd2c869995fd18ed915d4d240b173079e73 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 14:55:01 +0100 Subject: [PATCH 096/130] gnu: Add r-rematch. * gnu/packages/statistics.scm (r-rematch): New variable. --- gnu/packages/statistics.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 700a8957cc..612ea530d8 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3272,6 +3272,26 @@ noncentral hypergeometric distribution (also called extended hypergeometric distribution).") (license license:gpl3+))) +(define-public r-rematch + (package + (name "r-rematch") + (version "1.0.1") + (source + (origin + (method url-fetch) + (uri (cran-uri "rematch" version)) + (sha256 + (base32 + "0y3mshvpvz9csmq8hk8jbabx4nxlv5sckvfzvm6920ndg34xw2d4")))) + (build-system r-build-system) + (home-page "https://github.com/MangoTheCat/rematch") + (synopsis "Match regular expressions with a nicer API") + (description + "This package provides a small wrapper on @code{regexpr} to extract the +matches and captured groups from the match of a regular expression to a +character vector.") + (license license:expat))) + (define-public r-rpart (package (name "r-rpart") From d427e03eee99461ade0df4837bc2e7c20c397f10 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 14:56:05 +0100 Subject: [PATCH 097/130] gnu: Add r-cellranger. * gnu/packages/statistics.scm (r-cellranger): New variable. --- gnu/packages/statistics.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 612ea530d8..cec304db66 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3292,6 +3292,28 @@ matches and captured groups from the match of a regular expression to a character vector.") (license license:expat))) +(define-public r-cellranger + (package + (name "r-cellranger") + (version "1.1.0") + (source + (origin + (method url-fetch) + (uri (cran-uri "cellranger" version)) + (sha256 + (base32 + "16fgi3annn34c3cxi0pxf62mmmmxi21hp0zzlv7bkfsjqy4g4f2x")))) + (build-system r-build-system) + (propagated-inputs + `(("r-rematch" ,r-rematch) + ("r-tibble" ,r-tibble))) + (home-page "https://github.com/rsheets/cellranger") + (synopsis "Translate spreadsheet cell ranges to rows and columns") + (description + "This package provides helper functions to work with spreadsheets and the +@code{A1:D10} style of cell range specification.") + (license license:expat))) + (define-public r-rpart (package (name "r-rpart") From 9f5435d96391cd8438ba6ce6142b20753360b025 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 14:57:06 +0100 Subject: [PATCH 098/130] gnu: Add r-googlesheets. * gnu/packages/statistics.scm (r-googlesheets): New variable. --- gnu/packages/statistics.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index cec304db66..0ba33165d6 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3314,6 +3314,34 @@ character vector.") @code{A1:D10} style of cell range specification.") (license license:expat))) +(define-public r-googlesheets + (package + (name "r-googlesheets") + (version "0.2.1") + (source + (origin + (method url-fetch) + (uri (cran-uri "googlesheets" version)) + (sha256 + (base32 + "0ps13h1cv7fj5dh8s4nvwi64wnnyqdsadcaa4iizq1c5s615cwk3")))) + (build-system r-build-system) + (propagated-inputs + `(("r-cellranger" ,r-cellranger) + ("r-dplyr" ,r-dplyr) + ("r-httr" ,r-httr) + ("r-jsonlite" ,r-jsonlite) + ("r-purrr" ,r-purrr) + ("r-readr" ,r-readr) + ("r-stringr" ,r-stringr) + ("r-tidyr" ,r-tidyr) + ("r-xml2" ,r-xml2))) + (home-page "https://github.com/jennybc/googlesheets") + (synopsis "Manage Google spreadsheets from R") + (description "This package provides tools to interact with Google Sheets +from within R.") + (license license:expat))) + (define-public r-rpart (package (name "r-rpart") From e7d16ad1616878f28b9e0eb403be845d3892a4aa Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 14:58:40 +0100 Subject: [PATCH 099/130] gnu: Add r-spams. * gnu/packages/statistics.scm (r-spams): New variable. --- gnu/packages/statistics.scm | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 0ba33165d6..dcf6dbe626 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3342,6 +3342,58 @@ character vector.") from within R.") (license license:expat))) +(define-public r-spams + (package + (name "r-spams") + (version "2.5-svn2014-07-04") + (source + (origin + (method url-fetch) + (uri (string-append "https://gforge.inria.fr/frs/download.php/33815/" + "spams-R-v" version ".tar.gz")) + (sha256 + (base32 + "1k459jg9a334slkw31w63l4d39xszjzsng7dv5j1mp78zifz7hvx")))) + (build-system r-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ (chdir "spams") #t)) + ;; Since R 3.3.0 including R headers inside of an extern "C" block + ;; causes C headers to be included, which results in a lot of + ;; duplicate definitions. This can be avoided by defining + ;; NO_C_HEADERS before including the R headers. + (add-after 'chdir 'patch-use-of-R-headers + (lambda _ + (substitute* "src/spams.cpp" + (("#include " line) + (string-append "#define NO_C_HEADERS\n" line))) + #t)) + ;; This looks like a syntax error. + (add-after 'chdir 'patch-isnan + (lambda _ + (substitute* '"src/spams/linalg/linalg.h" + (("if isnan\\(lambda\\) \\{") + "if (isnan(lambda)) {")) + #t))))) + (home-page "http://spams-devel.gforge.inria.fr") + (synopsis "Toolbox for solving sparse estimation problems") + (description "SPAMS (SPArse Modeling Software) is an optimization toolbox +for solving various sparse estimation problems. It includes tools for the +following problems: + +@enumerate +@item Dictionary learning and matrix factorization (NMF, sparse @dfn{principle + component analysis} (PCA), ...) +@item Solving sparse decomposition problems with LARS, coordinate descent, + OMP, SOMP, proximal methods +@item Solving structured sparse decomposition problems (l1/l2, l1/linf, sparse + group lasso, tree-structured regularization, structured sparsity with + overlapping groups,...). +@end enumerate\n") + (license license:gpl3+))) + (define-public r-rpart (package (name "r-rpart") From e619a5c245d76c559ff98b4f5dc070c571d90574 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:04:18 +0100 Subject: [PATCH 100/130] gnu: Add r-r4rna. * gnu/packages/bioinformatics.scm (r-r4rna): New variable. --- gnu/packages/bioinformatics.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index f04acc0a5c..0b6fbe5df2 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -7338,6 +7338,29 @@ two-dimensional genome scans.") libraries for systems that do not have these available via other means.") (license license:artistic2.0))) +(define-public r-r4rna + (package + (name "r-r4rna") + (version "0.1.4") + (source + (origin + (method url-fetch) + (uri (string-append "http://www.e-rna.org/r-chie/files/R4RNA_" + version ".tar.gz")) + (sha256 + (base32 + "1p0i78wh76jfgmn9jphbwwaz6yy6pipzfg08xs54cxavxg2j81p5")))) + (build-system r-build-system) + (propagated-inputs + `(("r-optparse" ,r-optparse) + ("r-rcolorbrewer" ,r-rcolorbrewer))) + (home-page "http://www.e-rna.org/r-chie/index.cgi") + (synopsis "Analysis framework for RNA secondary structure") + (description + "The R4RNA package aims to be a general framework for the analysis of RNA +secondary structure and comparative analysis in R.") + (license license:gpl3+))) + (define-public r-rhtslib (package (name "r-rhtslib") From c9a6671490c4f415cdd17691fc6585baff892db7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:06:32 +0100 Subject: [PATCH 101/130] gnu: Add r-dynamictreecut. * gnu/packages/statistics.scm (r-dynamictreecut): New variable. --- gnu/packages/statistics.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index dcf6dbe626..c48620895c 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3497,6 +3497,27 @@ conversion of R objects to LaTeX code, and recoding variables.") framework, with additional code inspection and report generation tools.") (license license:gpl2+))) +(define-public r-dynamictreecut + (package + (name "r-dynamictreecut") + (version "1.63-1") + (source + (origin + (method url-fetch) + (uri (cran-uri "dynamicTreeCut" version)) + (sha256 + (base32 + "1fadbql7g5r2vvlkr89nlrjxwp4yx4xrdqmv077qvmnx9vv0f4w3")))) + (properties `((upstream-name . "dynamicTreeCut"))) + (build-system r-build-system) + (home-page + "http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/BranchCutting/") + (synopsis "Detect clusters in hierarchical clustering dendrograms") + (description + "This package contains methods for the detection of clusters in +hierarchical clustering dendrograms.") + (license license:gpl2+))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From c4708783eec4cf0d312b6401949b15e76407b724 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:08:22 +0100 Subject: [PATCH 102/130] gnu: Add r-preprocesscore. * gnu/packages/statistics.scm (r-preprocesscore): New variable. --- gnu/packages/statistics.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index c48620895c..d2ca35ef6b 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3518,6 +3518,27 @@ framework, with additional code inspection and report generation tools.") hierarchical clustering dendrograms.") (license license:gpl2+))) +(define-public r-preprocesscore + (package + (name "r-preprocesscore") + (version "1.36.0") + (source + (origin + (method url-fetch) + (uri (bioconductor-uri "preprocessCore" version)) + (sha256 + (base32 + "1n8y12q7145f385gm2k3c6y3vwvin7jlb47la4mnl7mar6pq9kmp")))) + (properties + `((upstream-name . "preprocessCore"))) + (build-system r-build-system) + (home-page "https://github.com/bmbolstad/preprocessCore") + (synopsis "Collection of pre-processing functions") + (description + "This package provides a library of core pre-processing and normalization +routines.") + (license license:lgpl2.0+))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From 1bd46f55207f5940131e37678bdd10ccff1dd56d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:15:27 +0100 Subject: [PATCH 103/130] gnu: Add r-fastcluster. * gnu/packages/statistics.scm (r-fastcluster): New variable. --- gnu/packages/statistics.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index d2ca35ef6b..3c2bd0c03c 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3539,6 +3539,31 @@ hierarchical clustering dendrograms.") routines.") (license license:lgpl2.0+))) +(define-public r-fastcluster + (package + (name "r-fastcluster") + (version "1.1.20") + (source + (origin + (method url-fetch) + (uri (cran-uri "fastcluster" version)) + (sha256 + (base32 + "0rlbxhh894znf10x0xgkv9dzpibgq9jw5aqpgviccdnxc2c5hwid")))) + (build-system r-build-system) + (home-page "http://danifold.net/fastcluster.html") + (synopsis "Fast hierarchical clustering routines") + (description + "This package implements fast hierarchical, agglomerative clustering +routines. Part of the functionality is designed as drop-in replacement for +existing routines: @code{linkage()} in the SciPy package +@code{scipy.cluster.hierarchy}, @code{hclust()} in R's @code{stats} package, +and the @code{flashClust} package. It provides the same functionality with +the benefit of a much faster implementation. Moreover, there are +memory-saving routines for clustering of vector data, which go beyond what the +existing packages provide.") + (license license:bsd-2))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From d71605294fff1a12f3145fa4788da1556284c91c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:15:45 +0100 Subject: [PATCH 104/130] gnu: Add r-wgcna. * gnu/packages/bioinformatics.scm (r-wgcna): New variable. --- gnu/packages/bioinformatics.scm | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 0b6fbe5df2..0b10b1b6e7 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -7541,6 +7541,42 @@ characterization and visualization of a wide range of mutational patterns in SNV base substitution data.") (license license:expat))) +(define-public r-wgcna + (package + (name "r-wgcna") + (version "1.51") + (source + (origin + (method url-fetch) + (uri (cran-uri "WGCNA" version)) + (sha256 + (base32 + "0hzvnhw76vwg8bl8x368f0c5szpwb8323bmrb3bir93i5bmfjsxx")))) + (properties `((upstream-name . "WGCNA"))) + (build-system r-build-system) + (propagated-inputs + `(("r-annotationdbi" ,r-annotationdbi) + ("r-doparallel" ,r-doparallel) + ("r-dynamictreecut" ,r-dynamictreecut) + ("r-fastcluster" ,r-fastcluster) + ("r-foreach" ,r-foreach) + ("r-go-db" ,r-go-db) + ("r-hmisc" ,r-hmisc) + ("r-impute" ,r-impute) + ("r-matrixstats" ,r-matrixstats) + ("r-preprocesscore" ,r-preprocesscore))) + (home-page + "http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/Rpackages/WGCNA/") + (synopsis "Weighted correlation network analysis") + (description + "This package provides functions necessary to perform Weighted +Correlation Network Analysis on high-dimensional data. It includes functions +for rudimentary data cleaning, construction and summarization of correlation +networks, module identification and functions for relating both variables and +modules to sample traits. It also includes a number of utility functions for +data manipulation and visualization.") + (license license:gpl2+))) + (define-public emboss (package (name "emboss") From 6335bf1c805940f2c3ea9b16f477084c2cf0eb52 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:16:53 +0100 Subject: [PATCH 105/130] gnu: Add r-sfsmisc. * gnu/packages/statistics.scm (r-sfsmisc): New variable. --- gnu/packages/statistics.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 3c2bd0c03c..0c5425860c 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3564,6 +3564,25 @@ memory-saving routines for clustering of vector data, which go beyond what the existing packages provide.") (license license:bsd-2))) +(define-public r-sfsmisc + (package + (name "r-sfsmisc") + (version "1.1-0") + (source + (origin + (method url-fetch) + (uri (cran-uri "sfsmisc" version)) + (sha256 + (base32 + "0580piv4n1nispl3pa8nfjjfnb8iwaqky2dzdy0aqnxrxgrhqhvz")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/sfsmisc") + (synopsis "Utilities from \"Seminar fuer Statistik\" ETH Zurich") + (description + "This package provides useful utilities from Seminar fuer Statistik ETH +Zurich, including many that are related to graphics.") + (license license:gpl2+))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From f05c7eb48d6e0daf5fda287a5df63e2f30062db6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:18:06 +0100 Subject: [PATCH 106/130] gnu: Add r-kernlab. * gnu/packages/machine-learning.scm (r-kernlab): New variable. --- gnu/packages/machine-learning.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index c239c4f00f..8f1f8ee53b 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -479,6 +479,28 @@ geometric models.") single hidden layer, and for multinomial log-linear models.") (license (list license:gpl2+ license:gpl3+)))) +(define-public r-kernlab + (package + (name "r-kernlab") + (version "0.9-25") + (source + (origin + (method url-fetch) + (uri (cran-uri "kernlab" version)) + (sha256 + (base32 + "0qnaq9x3j2xc6jrmmd98wc6hkzch487s4p3a9lnc00xvahkhgpmr")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/kernlab") + (synopsis "Kernel-based machine learning tools") + (description + "This package provides kernel-based machine learning methods for +classification, regression, clustering, novelty detection, quantile regression +and dimensionality reduction. Among other methods @code{kernlab} includes +Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes +and a QP solver.") + (license license:gpl2))) + (define-public dlib (package (name "dlib") From 1571f90e3520b3b606078cdb1e92291a638da15f Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:19:01 +0100 Subject: [PATCH 107/130] gnu: Add r-gtools. * gnu/packages/statistics.scm (r-gtools): New variable. --- gnu/packages/statistics.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 0c5425860c..8027aed617 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3583,6 +3583,28 @@ existing packages provide.") Zurich, including many that are related to graphics.") (license license:gpl2+))) +(define-public r-gtools + (package + (name "r-gtools") + (version "3.5.0") + (source + (origin + (method url-fetch) + (uri (cran-uri "gtools" version)) + (sha256 + (base32 + "1xknwk9xlsj027pg0nwiizigcrsc84hdrig0jn0cgcyxj8dabdl6")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/gtools") + (synopsis "Various R programming tools") + (description + "This package contains a collection of various functions to assist in R +programming, such as tools to assist in developing, updating, and maintaining +R and R packages, calculating the logit and inverse logit transformations, +tests for whether a value is missing, empty or contains only @code{NA} and +@code{NULL} values, and many more.") + (license license:gpl2))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From c827f2028629c43f73aee99600d34fc97fca4208 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:22:03 +0100 Subject: [PATCH 108/130] gnu: Add r-chipkernels. * gnu/packages/bioinformatics.scm (r-chipkernels): New variable. --- gnu/packages/bioinformatics.scm | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 0b10b1b6e7..73e1d09b89 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -7577,6 +7577,42 @@ modules to sample traits. It also includes a number of utility functions for data manipulation and visualization.") (license license:gpl2+))) +(define-public r-chipkernels + (let ((commit "c9cfcacb626b1221094fb3490ea7bac0fd625372") + (revision "1")) + (package + (name "r-chipkernels") + (version (string-append "1.1-" revision "." (string-take commit 9))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ManuSetty/ChIPKernels.git") + (commit commit))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "14bj5qhjm1hsm9ay561nfbqi9wxsa7y487df2idsaaf6z10nw4v0")))) + (build-system r-build-system) + (propagated-inputs + `(("r-iranges" ,r-iranges) + ("r-xvector" ,r-xvector) + ("r-biostrings" ,r-biostrings) + ("r-bsgenome" ,r-bsgenome) + ("r-gtools" ,r-gtools) + ("r-genomicranges" ,r-genomicranges) + ("r-sfsmisc" ,r-sfsmisc) + ("r-kernlab" ,r-kernlab) + ("r-s4vectors" ,r-s4vectors) + ("r-biocgenerics" ,r-biocgenerics))) + (home-page "https://github.com/ManuSetty/ChIPKernels") + (synopsis "Build string kernels for DNA Sequence analysis") + (description "ChIPKernels is an R package for building different string +kernels used for DNA Sequence analysis. A dictionary of the desired kernel +must be built and this dictionary can be used for determining kernels for DNA +Sequences.") + (license license:gpl2+)))) + (define-public emboss (package (name "emboss") From 2d9fb1702fb0d142e83cfbf949f9330981ed9687 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:24:25 +0100 Subject: [PATCH 109/130] gnu: Add r-seqgl. * gnu/packages/bioinformatics.scm (r-seqgl): New variable. --- gnu/packages/bioinformatics.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 73e1d09b89..5f63707bf8 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -7613,6 +7613,36 @@ must be built and this dictionary can be used for determining kernels for DNA Sequences.") (license license:gpl2+)))) +(define-public r-seqgl + (package + (name "r-seqgl") + (version "1.1.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/ManuSetty/SeqGL/" + "archive/" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0pnk1p3sci5yipyc8xnb6jbmydpl80fld927xgnbcv104hy8h8yh")))) + (build-system r-build-system) + (propagated-inputs + `(("r-biostrings" ,r-biostrings) + ("r-chipkernels" ,r-chipkernels) + ("r-genomicranges" ,r-genomicranges) + ("r-spams" ,r-spams) + ("r-wgcna" ,r-wgcna) + ("r-fastcluster" ,r-fastcluster))) + (home-page "https://github.com/ManuSetty/SeqGL") + (synopsis "Group lasso for Dnase/ChIP-seq data") + (description "SeqGL is a group lasso based algorithm to extract +transcription factor sequence signals from ChIP, DNase and ATAC-seq profiles. +This package presents a method which uses group lasso to discriminate between +bound and non bound genomic regions to accurately identify transcription +factors bound at the specific regions.") + (license license:gpl2+))) + (define-public emboss (package (name "emboss") From 6034cd905e610e2ed5d7d40b30953917b8619535 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:38:41 +0100 Subject: [PATCH 110/130] gnu: Add r-gdata. * gnu/packages/statistics.scm (r-gdata): New variable. --- gnu/packages/statistics.scm | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 8027aed617..dc519b46a2 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3605,6 +3605,46 @@ tests for whether a value is missing, empty or contains only @code{NA} and @code{NULL} values, and many more.") (license license:gpl2))) +(define-public r-gdata + (package + (name "r-gdata") + (version "2.17.0") + (source + (origin + (method url-fetch) + (uri (cran-uri "gdata" version)) + (sha256 + (base32 + "0kiy3jbcszlpmarg311spdsfi5pn89wgy742dxsbzxk8907fr5w0")))) + (build-system r-build-system) + (inputs + `(("perl" ,perl))) + (propagated-inputs + `(("r-gtools" ,r-gtools))) + (home-page "http://cran.r-project.org/web/packages/gdata") + (synopsis "Various R programming tools for data manipulation") + (description + "This package provides various R programming tools for data manipulation, +including: + +@itemize +@item medical unit conversions +@item combining objects +@item character vector operations +@item factor manipulation +@item obtaining information about R objects +@item manipulating MS-Excel formatted files +@item generating fixed-width format files +@item extricating components of date and time objects +@item operations on columns of data frames +@item matrix operations +@item operations on vectors and data frames +@item value of last evaluated expression +@item wrapper for @code{sample} that ensures consistent behavior for + both scalar and vector arguments +@end itemize\n") + (license license:gpl2+))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From 0cfe0570f2d6c88bd811fa4739075bfe2f223324 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:39:24 +0100 Subject: [PATCH 111/130] gnu: Add r-gplots. * gnu/packages/statistics.scm (r-gplots): New variable. --- gnu/packages/statistics.scm | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index dc519b46a2..f014f16a97 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3645,6 +3645,46 @@ including: @end itemize\n") (license license:gpl2+))) +(define-public r-gplots + (package + (name "r-gplots") + (version "3.0.1") + (source + (origin + (method url-fetch) + (uri (cran-uri "gplots" version)) + (sha256 + (base32 + "02nb8n3s7c1zxq2s7ycaq2ys72y7mzirxrwj954h6gdc4x1zhg9l")))) + (build-system r-build-system) + (propagated-inputs + `(("r-catools" ,r-catools) + ("r-gdata" ,r-gdata) + ("r-gtools" ,r-gtools) + ("r-kernsmooth" ,r-kernsmooth))) + (home-page "http://cran.r-project.org/web/packages/gplots") + (synopsis "Various R programming tools for plotting data") + (description + "This package provides various R programming tools for plotting data, +including: + +@itemize +@item calculating and plotting locally smoothed summary function +@item enhanced versions of standard plots +@item manipulating colors +@item calculating and plotting two-dimensional data summaries +@item enhanced regression diagnostic plots +@item formula-enabled interface to @code{stats::lowess} function +@item displaying textual data in plots +@item baloon plots +@item plotting \"Venn\" diagrams +@item displaying Open-Office style plots +@item plotting multiple data on same region, with separate axes +@item plotting means and confidence intervals +@item spacing points in an x-y plot so they don't overlap +@end itemize\n") + (license license:gpl2+))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From 419a8a186f87308e6092067ad01b4f80199dd629 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:41:17 +0100 Subject: [PATCH 112/130] gnu: Add r-rocr. * gnu/packages/statistics.scm (r-rocr): New variable. --- gnu/packages/statistics.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index f014f16a97..c2d46f29d4 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3685,6 +3685,36 @@ including: @end itemize\n") (license license:gpl2+))) +(define-public r-rocr + (package + (name "r-rocr") + (version "1.0-7") + (source + (origin + (method url-fetch) + (uri (cran-uri "ROCR" version)) + (sha256 + (base32 + "1jay8cm7lgq56i967vm5c2hgaxqkphfpip0gn941li3yhh7p3vz7")))) + (properties `((upstream-name . "ROCR"))) + (build-system r-build-system) + (propagated-inputs + `(("r-gplots" ,r-gplots))) + (home-page "http://rocr.bioinf.mpi-sb.mpg.de/") + (synopsis "Visualizing the performance of scoring classifiers") + (description + "ROCR is a flexible tool for creating cutoff-parameterized 2D performance +curves by freely combining two from over 25 performance measures (new +performance measures can be added using a standard interface). Curves from +different cross-validation or bootstrapping runs can be averaged by different +methods, and standard deviations, standard errors or box plots can be used to +visualize the variability across the runs. The parameterization can be +visualized by printing cutoff values at the corresponding curve positions, or +by coloring the curve according to cutoff. All components of a performance +plot can be quickly adjusted using a flexible parameter dispatching +mechanism.") + (license license:gpl2+))) + (define-public r-kernsmooth (package (name "r-kernsmooth") From bd3be46e7fd148eef4b4ba81ee5cd4d159e9c20c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Nov 2016 15:42:22 +0100 Subject: [PATCH 113/130] gnu: Add r-gkmsvm. * gnu/packages/bioinformatics.scm (r-gkmsvm): New variable. --- gnu/packages/bioinformatics.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 5f63707bf8..4b848535dc 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -7643,6 +7643,39 @@ bound and non bound genomic regions to accurately identify transcription factors bound at the specific regions.") (license license:gpl2+))) +(define-public r-gkmsvm + (package + (name "r-gkmsvm") + (version "0.71.0") + (source + (origin + (method url-fetch) + (uri (cran-uri "gkmSVM" version)) + (sha256 + (base32 + "1zpxgxmf2nd5j5wn00ps6kfxr8wxh7d1swr1rr4spq7sj5z5z0k0")))) + (properties `((upstream-name . "gkmSVM"))) + (build-system r-build-system) + (propagated-inputs + `(("r-biocgenerics" ,r-biocgenerics) + ("r-biostrings" ,r-biostrings) + ("r-genomeinfodb" ,r-genomeinfodb) + ("r-genomicranges" ,r-genomicranges) + ("r-iranges" ,r-iranges) + ("r-kernlab" ,r-kernlab) + ("r-rcpp" ,r-rcpp) + ("r-rocr" ,r-rocr) + ("r-rtracklayer" ,r-rtracklayer) + ("r-s4vectors" ,r-s4vectors) + ("r-seqinr" ,r-seqinr))) + (home-page "http://cran.r-project.org/web/packages/gkmSVM") + (synopsis "Gapped-kmer support vector machine") + (description + "This R package provides tools for training gapped-kmer SVM classifiers +for DNA and protein sequences. This package supports several sequence +kernels, including: gkmSVM, kmer-SVM, mismatch kernel and wildcard kernel.") + (license license:gpl2+))) + (define-public emboss (package (name "emboss") From 9a5187b687e659da86000b32c951e2f55e1f74bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 28 Nov 2016 16:19:04 +0100 Subject: [PATCH 114/130] doc: Document NSS incompatibility issues on foreign distros. * doc/guix.texi (Application Setup)[Name Service Switch]: New subsection. --- doc/guix.texi | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 5747484b20..ce1e5d075a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1242,6 +1242,56 @@ data in the right format. This is important because the locale data format used by different libc versions may be incompatible. +@subsection Name Service Switch + +@cindex name service switch, glibc +@cindex NSS (name service switch), glibc +@cindex nscd (name service caching daemon) +@cindex name service caching daemon (nscd) +When using Guix on a foreign distro, we @emph{strongly recommend} that +the system run the GNU C library's @dfn{name service cache daemon}, +@command{nscd}, which should be listening on the +@file{/var/run/nscd/socket} socket. Failing to do that, applications +installed with Guix may fail to look up host names or user accounts, or +may even crash. The next paragraphs explain why. + +@cindex @file{nsswitch.conf} +The GNU C library implements a @dfn{name service switch} (NSS), which is +an extensible mechanism for ``name lookups'' in general: host name +resolution, user accounts, and more (@pxref{Name Service Switch,,, libc, +The GNU C Library Reference Manual}). + +@cindex Network information service (NIS) +@cindex NIS (Network information service) +Being extensible, the NSS supports @dfn{plugins}, which provide new name +lookup implementations: for example, the @code{nss-mdns} plugin allow +resolution of @code{.local} host names, the @code{nis} plugin allows +user account lookup using the Network information service (NIS), and so +on. These extra ``lookup services'' are configured system-wide in +@file{/etc/nsswitch.conf}, and all the programs running on the system +honor those settings (@pxref{NSS Configuration File,,, libc, The GNU C +Reference Manual}). + +When they perform a name lookup---for instance by calling the +@code{getaddrinfo} function in C---applications first try to connect to +the nscd; on success, nscd performs name lookups on their behalf. If +the nscd is not running, then they perform the name lookup by +themselves, by loading the name lookup services into their own address +space and running it. These name lookup services---the +@file{libnss_*.so} files---are @code{dlopen}'d, but they may come from +the host system's C library, rather than from the C library the +application is linked against (the C library coming from Guix). + +And this is where the problem is: if your application is linked against +Guix's C library (say, glibc 2.24) and tries to load NSS plugins from +another C library (say, @code{libnss_mdns.so} for glibc 2.22), it will +likely crash or have its name lookups fail unexpectedly. + +Running @command{nscd} on the system, among other advantages, eliminates +this binary incompatibility problem because those @code{libnss_*.so} +files are loaded in the @command{nscd} process, not in applications +themselves. + @subsection X11 Fonts @cindex fonts From c062b1eb6c9d799f0015e26b14cd77eaf8d946dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 28 Nov 2016 22:08:17 +0100 Subject: [PATCH 115/130] pull: Set '%nix-instantiate' to a sensible value. Reported by ng0 . Fixes . * guix/build/pull.scm (build-guix): Replace "@NIX_INSTANTIATE@" in guix/config.scm with "nix-instantiate". --- guix/build/pull.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/build/pull.scm b/guix/build/pull.scm index 871bf6f535..6034e93cbf 100644 --- a/guix/build/pull.scm +++ b/guix/build/pull.scm @@ -84,7 +84,7 @@ containing the source code. Write any debugging output to DEBUG-PORT." (("@GZIP@") (string-append gzip "/bin/gzip")) (("@BZIP2@") (string-append bzip2 "/bin/bzip2")) (("@XZ@") (string-append xz "/bin/xz")) - (("@NIX_INSTANTIATE@") "")) ;remnants from the past + (("@NIX_INSTANTIATE@") "nix-instantiate")) ;for (guix import nix) ;; Augment the search path so Scheme code can be compiled. (set! %load-path (cons out %load-path)) From d2bcf35e1805b06fb575352531d9c439425dc379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 28 Nov 2016 22:56:41 +0100 Subject: [PATCH 116/130] vm: Avoid needless file copy in 'load-in-linux-vm'. Reported by Chris Webber. * gnu/build/vm.scm (load-in-linux-vm)[image-file]: Remove. Directly refer to OUTPUT instead. --- gnu/build/vm.scm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index cc5cf45362..60ee18ebe0 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -79,12 +79,9 @@ it via /dev/hda. REFERENCES-GRAPHS can specify a list of reference-graph files as produced by the #:references-graphs parameter of 'derivation'." - (define image-file - (string-append "image." disk-image-format)) - (when make-disk-image? (unless (zero? (system* "qemu-img" "create" "-f" disk-image-format - image-file + output (number->string disk-image-size))) (error "qemu-img failed"))) @@ -115,7 +112,7 @@ the #:references-graphs parameter of 'derivation'." builder) (append (if make-disk-image? - `("-drive" ,(string-append "file=" image-file + `("-drive" ,(string-append "file=" output ",if=virtio")) '()) ;; Only enable kvm if we see /dev/kvm exists. @@ -126,11 +123,10 @@ the #:references-graphs parameter of 'derivation'." '())))) (error "qemu failed" qemu)) - (if make-disk-image? - (copy-file image-file output) - (begin - (mkdir output) - (copy-recursively "xchg" output)))) + ;; When MAKE-DISK-IMAGE? is true, the image is in OUTPUT already. + (unless make-disk-image? + (mkdir output) + (copy-recursively "xchg" output))) ;;; From 7c635ed6f767cc5723528b50fae2ddfbf77f98a0 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 28 Nov 2016 23:05:23 +0100 Subject: [PATCH 117/130] gnu: perl-dbd-mysql: Update to 4.041 [security fix]. * gnu/packages/databases.scm (perl-dbd-mysql): Update to 4.041. [source]: Update CPAN URI. --- gnu/packages/databases.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index d6746f092f..bd60e4cc66 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -819,15 +819,15 @@ columns, primary keys, unique constraints and relationships.") (define-public perl-dbd-mysql (package (name "perl-dbd-mysql") - (version "4.039") + (version "4.041") (source (origin (method url-fetch) - (uri (string-append "mirror://cpan/authors/id/C/CA/CAPTTOFU/" + (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/" "DBD-mysql-" version ".tar.gz")) (sha256 (base32 - "0k4p3bjdbmxm2amb0qiiwmn8v83zrjkz5qp84xdjrg8k5v9aj0hn")))) + "0h4h6zwzj8fwh9ljb8svnsa0a3ch4p10hp59kpdibdb4qh8xwxs7")))) (build-system perl-build-system) ;; Tests require running MySQL server (arguments `(#:tests? #f)) From 0c85db79f7a8abc3bcdbf8931d959fe94306a5a1 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 26 Nov 2016 10:29:23 +0100 Subject: [PATCH 118/130] gnu: Allow nfs file systems to be automatically mounted. * gnu/build/file-systems.scm (mount-file-system): Append target addr= when mounting nfs filesystems. --- gnu/build/file-systems.scm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 0d55e91978..431b287d0c 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -464,6 +464,27 @@ form: DEVICE, MOUNT-POINT, and TYPE must be strings; OPTIONS can be a string or #f; FLAGS must be a list of symbols. CHECK? is a Boolean indicating whether to run a file system check." + + (define (mount-nfs source mount-point type flags options) + (let* ((idx (string-rindex source #\:)) + (host-part (string-take source idx)) + ;; Strip [] from around host if present + (host (match (string-split host-part (string->char-set "[]")) + (("" h "") h) + ((h) h))) + (aa (match (getaddrinfo host "nfs") ((x . _) x))) + (sa (addrinfo:addr aa)) + (inet-addr (inet-ntop (sockaddr:fam sa) + (sockaddr:addr sa)))) + + ;; Mounting an NFS file system requires passing the address + ;; of the server in the addr= option + (mount source mount-point type flags + (string-append "addr=" + inet-addr + (if options + (string-append "," options) + ""))))) (match spec ((source title mount-point type (flags ...) options check?) (let ((source (canonicalize-device-spec source title)) @@ -481,7 +502,11 @@ run a file system check." (call-with-output-file mount-point (const #t))) (mkdir-p mount-point)) - (mount source mount-point type flags options) + (cond + ((string-prefix? "nfs" type) + (mount-nfs source mount-point type flags options)) + (else + (mount source mount-point type flags options))) ;; For read-only bind mounts, an extra remount is needed, as per ;; , which still applies to Linux 4.0. From 3e757c005f91182c69c9a08f0cfa8a3c75ba7c6e Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 29 Nov 2016 09:35:11 +0200 Subject: [PATCH 119/130] gnu: aspell-dict-en: Update to 2016.11.20-0. * gnu/packages/aspell.scm (aspell-dict-en): Update to 2016.11.20-0. --- gnu/packages/aspell.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/aspell.scm b/gnu/packages/aspell.scm index b3ca380533..04a9197839 100644 --- a/gnu/packages/aspell.scm +++ b/gnu/packages/aspell.scm @@ -108,10 +108,10 @@ dictionaries, including personal ones.") (define-public aspell-dict-en (aspell-dictionary "en" "English" - #:version "2016.01.19-0" + #:version "2016.11.20-0" #:sha256 (base32 - "01h4cl4lngp6mcfbyb47cjrc2gspyg2519dvknd97ki896nx7vcn"))) + "1496jnhh2jvhkzcj0p4vy89bcs4g5wz6a76m33vw4dhchn5xm9jw"))) (define-public aspell-dict-eo (aspell-dictionary "eo" "Esperanto" From 22486fbea669c5e1a5e19b52fc37c44f6f615de5 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 21 Nov 2016 22:10:11 +0200 Subject: [PATCH 120/130] gnu: Add wgetpaste. * gnu/packages/wget.scm (wgetpaste): New variable. --- gnu/packages/wget.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/wget.scm b/gnu/packages/wget.scm index 80da33272e..72aab86c14 100644 --- a/gnu/packages/wget.scm +++ b/gnu/packages/wget.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012 Nikita Karetnikov ;;; Copyright © 2014, 2015 Ludovic Courtès +;;; Copyright © 2016 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -60,3 +61,36 @@ HTTPS and FTP protocols. It can resume interrupted downloads, use file name wild cards, supports proxies and cookies, and it can convert absolute links in downloaded documents to relative links.") (license gpl3+))) ; some files are under GPLv2+ + +(define-public wgetpaste + (package + (name "wgetpaste") + (version "2.28") + (source + (origin + (method url-fetch) + (uri (string-append "http://wgetpaste.zlin.dk/wgetpaste-" + version ".tar.bz2")) + (sha256 + (base32 + "1hh9svyypqcvdg5mjxyyfzpdzhylhf7s7xq5dzglnm4injx3i3ak")))) + (build-system gnu-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (zsh (string-append out "/share/zsh/site-functions"))) + (install-file "wgetpaste" bin) + (install-file "_wgetpaste" zsh))))) + #:tests? #f)) ; no test target + (home-page "http://wgetpaste.zlin.dk/") + (synopsis "Script that automates pasting to a number of pastebin services") + (description + "@code{wgetpaste} is an extremely simple command-line interface to various +online pastebin services.") + (license public-domain))) From eb55f018219e5912fc5606c4e1881a64f8fa5710 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 21 Nov 2016 22:16:43 +0200 Subject: [PATCH 121/130] gnu: Add viewnior. * gnu/packages/image-viewers.scm (viewnior): New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/image-viewers.scm | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 gnu/packages/image-viewers.scm diff --git a/gnu/local.mk b/gnu/local.mk index c50ef254e0..49609cd68f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -187,6 +187,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/icu4c.scm \ %D%/packages/idutils.scm \ %D%/packages/image.scm \ + %D%/packages/image-viewers.scm \ %D%/packages/imagemagick.scm \ %D%/packages/indent.scm \ %D%/packages/inklingreader.scm \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm new file mode 100644 index 0000000000..4be0ebbc2d --- /dev/null +++ b/gnu/packages/image-viewers.scm @@ -0,0 +1,78 @@ +;;; Copyright © 2016 Efraim Flashner +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages image-viewers) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages geeqie) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages pkg-config)) + +(define-public viewnior + (package + (name "viewnior") + (version "1.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/xsisqox/Viewnior/archive/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "18309qjgwak3kn228z3p3nx7yxasqgzx69v3rgc23hf161nky0c9")))) + (build-system gnu-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'autogen + (lambda _ + (zero? (system* "sh" "autogen.sh"))))))) + (native-inputs + `(("automake" ,automake) + ("autoconf" ,autoconf) + ("intltool" ,intltool) + ("glib" ,glib "bin") ; glib-genmarshal + ("gnome-common" ,gnome-common) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) + ("shared-mime-info" ,shared-mime-info) + ("which" ,which))) + (inputs + `(("exiv2" ,exiv2) + ("gdk-pixbuf" ,gdk-pixbuf) + ("gtk+-2" ,gtk+-2))) + (home-page "http://siyanpanayotov.com/project/viewnior/") + (synopsis "Simple, fast and elegant image viewer") + (description "Viewnior is an image viewer program. Created to be simple, +fast and elegant. Its minimalistic interface provides more screenspace for +your images. Among its features are: +@enumerate +@item Fullscreen & Slideshow +@item Rotate, flip, crop, save, delete images +@item Animation support +@item Browse only selected images +@item Navigation window +@item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen) +@item Simple interface +@item EXIF and IPTC metadata +@item Configurable mouse actions +@end enumerate\n") + (license license:gpl3+))) From c51d926c740f98883ce3332852e826f57fdf4566 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 28 Nov 2016 19:25:21 +0200 Subject: [PATCH 122/130] gnu: cairo: Fix CVE-2016-9082. * gnu/packages/gtk.scm (cairo)[replacement]: New field. (cairo/fixed): New variable. (cairo-xcb)[source]: Use patch. [replacement]: New field, set false. * gnu/packages/pdf.scm (poppler)[inputs]: Custom cairo should be replaced by a new custom patched cairo. * gnu/packages/patches/cairo-CVE-2016-9082.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/gtk.scm | 12 ++ .../patches/cairo-CVE-2016-9082.patch | 122 ++++++++++++++++++ gnu/packages/pdf.scm | 11 ++ 4 files changed, 146 insertions(+) create mode 100644 gnu/packages/patches/cairo-CVE-2016-9082.patch diff --git a/gnu/local.mk b/gnu/local.mk index 49609cd68f..9d0e4c5094 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -489,6 +489,7 @@ dist_patch_DATA = \ %D%/packages/patches/binutils-loongson-workaround.patch \ %D%/packages/patches/binutils-mips-bash-bug.patch \ %D%/packages/patches/byobu-writable-status.patch \ + %D%/packages/patches/cairo-CVE-2016-9082.patch \ %D%/packages/patches/calibre-drop-unrar.patch \ %D%/packages/patches/calibre-no-updates-dialog.patch \ %D%/packages/patches/cdparanoia-fpic.patch \ diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 17bd9c9b00..8a258b54cc 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -100,6 +100,7 @@ tools have full access to view and control running applications.") (define-public cairo (package (name "cairo") + (replacement cairo/fixed) (version "1.14.6") (source (origin (method url-fetch) @@ -153,6 +154,10 @@ affine transformation (scale, rotation, shear, etc.).") (package (inherit cairo) (name "cairo-xcb") + (source (origin + (inherit (package-source cairo)) + (patches (search-patches "cairo-CVE-2016-9082.patch")))) + (replacement #f) (inputs `(("mesa" ,mesa) ,@(package-inputs cairo))) @@ -162,6 +167,13 @@ affine transformation (scale, rotation, shear, etc.).") '("--enable-xlib-xcb" "--enable-gl" "--enable-egl"))) (synopsis "2D graphics library (with X11 support)"))) +(define cairo/fixed + (package + (inherit cairo) + (source (origin + (inherit (package-source cairo)) + (patches (search-patches "cairo-CVE-2016-9082.patch")))))) + (define-public harfbuzz (package (name "harfbuzz") diff --git a/gnu/packages/patches/cairo-CVE-2016-9082.patch b/gnu/packages/patches/cairo-CVE-2016-9082.patch new file mode 100644 index 0000000000..ad83404194 --- /dev/null +++ b/gnu/packages/patches/cairo-CVE-2016-9082.patch @@ -0,0 +1,122 @@ +From: Adrian Johnson +Date: Thu, 20 Oct 2016 21:12:30 +1030 +Subject: [PATCH] image: prevent invalid ptr access for > 4GB images + +Image data is often accessed using: + + image->data + y * image->stride + +On 64-bit achitectures if the image data is > 4GB, this computation +will overflow since both y and stride are 32-bit types. + +bug report: https://bugs.freedesktop.org/show_bug.cgi?id=98165 +patch: https://bugs.freedesktop.org/attachment.cgi?id=127421 +--- + boilerplate/cairo-boilerplate.c | 4 +++- + src/cairo-image-compositor.c | 4 ++-- + src/cairo-image-surface-private.h | 2 +- + src/cairo-mesh-pattern-rasterizer.c | 2 +- + src/cairo-png.c | 2 +- + src/cairo-script-surface.c | 3 ++- + 6 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c +index 7fdbf79..4804dea 100644 +--- a/boilerplate/cairo-boilerplate.c ++++ b/boilerplate/cairo-boilerplate.c +@@ -42,6 +42,7 @@ + #undef CAIRO_VERSION_H + #include "../cairo-version.h" + ++#include + #include + #include + #include +@@ -976,7 +977,8 @@ cairo_surface_t * + cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file) + { + char format; +- int width, height, stride; ++ int width, height; ++ ptrdiff_t stride; + int x, y; + unsigned char *data; + cairo_surface_t *image = NULL; +diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c +index 48072f8..3ca0006 100644 +--- a/src/cairo-image-compositor.c ++++ b/src/cairo-image-compositor.c +@@ -1575,7 +1575,7 @@ typedef struct _cairo_image_span_renderer { + pixman_image_t *src, *mask; + union { + struct fill { +- int stride; ++ ptrdiff_t stride; + uint8_t *data; + uint32_t pixel; + } fill; +@@ -1594,7 +1594,7 @@ typedef struct _cairo_image_span_renderer { + struct finish { + cairo_rectangle_int_t extents; + int src_x, src_y; +- int stride; ++ ptrdiff_t stride; + uint8_t *data; + } mask; + } u; +diff --git a/src/cairo-image-surface-private.h b/src/cairo-image-surface-private.h +index 8ca694c..7e78d61 100644 +--- a/src/cairo-image-surface-private.h ++++ b/src/cairo-image-surface-private.h +@@ -71,7 +71,7 @@ struct _cairo_image_surface { + + int width; + int height; +- int stride; ++ ptrdiff_t stride; + int depth; + + unsigned owns_data : 1; +diff --git a/src/cairo-mesh-pattern-rasterizer.c b/src/cairo-mesh-pattern-rasterizer.c +index 1b63ca8..e7f0db6 100644 +--- a/src/cairo-mesh-pattern-rasterizer.c ++++ b/src/cairo-mesh-pattern-rasterizer.c +@@ -470,7 +470,7 @@ draw_pixel (unsigned char *data, int width, int height, int stride, + tg += tg >> 16; + tb += tb >> 16; + +- *((uint32_t*) (data + y*stride + 4*x)) = ((ta << 16) & 0xff000000) | ++ *((uint32_t*) (data + y*(ptrdiff_t)stride + 4*x)) = ((ta << 16) & 0xff000000) | + ((tr >> 8) & 0xff0000) | ((tg >> 16) & 0xff00) | (tb >> 24); + } + } +diff --git a/src/cairo-png.c b/src/cairo-png.c +index 562b743..aa8c227 100644 +--- a/src/cairo-png.c ++++ b/src/cairo-png.c +@@ -673,7 +673,7 @@ read_png (struct png_read_closure_t *png_closure) + } + + for (i = 0; i < png_height; i++) +- row_pointers[i] = &data[i * stride]; ++ row_pointers[i] = &data[i * (ptrdiff_t)stride]; + + png_read_image (png, row_pointers); + png_read_end (png, info); +diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c +index ea0117d..91e4baa 100644 +--- a/src/cairo-script-surface.c ++++ b/src/cairo-script-surface.c +@@ -1202,7 +1202,8 @@ static cairo_status_t + _write_image_surface (cairo_output_stream_t *output, + const cairo_image_surface_t *image) + { +- int stride, row, width; ++ int row, width; ++ ptrdiff_t stride; + uint8_t row_stack[CAIRO_STACK_BUFFER_SIZE]; + uint8_t *rowdata; + uint8_t *data; +-- +2.1.4 + diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 39f4d021de..6442f08af9 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -95,6 +95,17 @@ ;; To build poppler-glib (as needed by Evince), we need Cairo and ;; GLib. But of course, that Cairo must not depend on Poppler. ("cairo" ,(package (inherit cairo) + (replacement + (package + (inherit cairo) + (replacement #f) + (source + (origin + (inherit (package-source cairo)) + (patches (search-patches + "cairo-CVE-2016-9082.patch")))) + (inputs (alist-delete "poppler" + (package-inputs cairo))))) (inputs (alist-delete "poppler" (package-inputs cairo))))) ("glib" ,glib))) From 0944bb1a6aaaf5ad61599897ee382bb246c27675 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 29 Nov 2016 11:02:39 +0200 Subject: [PATCH 123/130] gnu: offlineimap: Update to 7.0.10. * gnu/packages/mail.scm (offlineimap): Update to 7.0.10. --- gnu/packages/mail.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index e0d0fd164c..9948a21d94 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -329,7 +329,7 @@ and corrections. It is based on a Bayesian filter.") (define-public offlineimap (package (name "offlineimap") - (version "7.0.9") + (version "7.0.10") (source (origin (method url-fetch) (uri (string-append "https://github.com/OfflineIMAP/offlineimap/" @@ -337,7 +337,7 @@ and corrections. It is based on a Bayesian filter.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "04kapx0ddz7ccwhcjshkml2y916wcan3rl28mpmq25p4gywlkhxf")))) + "0h8mgmwkvwh8x3yam32ipqkzcz4g1dmkbni3v1755lkm0z132m3j")))) (build-system python-build-system) (native-inputs `(("asciidoc" ,asciidoc) From ded69d6f8699f901472616c8b34ce7b59ec4b9fa Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 28 Nov 2016 22:02:09 +0100 Subject: [PATCH 124/130] gnu: Add non-session-manager. * gnu/packages/music.scm (non-session-manager): New variable. --- gnu/packages/music.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 3c56d199d2..e6d87e83c3 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -639,6 +639,28 @@ Sequencer happens on-line, in real-time. Music can be composed live, while the transport is rolling.") (license license:gpl2+)))) +(define-public non-session-manager + (package (inherit non-sequencer) + (name "non-session-manager") + (arguments + (substitute-keyword-arguments (package-arguments non-sequencer) + ((#:configure-flags flags) + `(cons "--project=session-manager" + (delete "--project=sequencer" ,flags))))) + (inputs + `(("jack" ,jack-1) + ("liblo" ,liblo) + ("ntk" ,ntk))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (home-page "http://non.tuxfamily.org/nsm/") + (synopsis "Audio session management") + (description + "The Non Session Manager is an API and an implementation for audio +session management. NSM clients use a well-specified OSC protocol to +communicate with the session management daemon.") + (license license:gpl2+))) + (define-public solfege (package (name "solfege") From 658c987fdd30c9cc071fd819c7e6d27bdb02600e Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 29 Nov 2016 13:15:47 +0200 Subject: [PATCH 125/130] gnu: wine: Update to 1.9.24. * gnu/packages/wine.scm (wine): Update to 1.9.24. [home-page]: Use https. --- gnu/packages/wine.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm index 9a1bd56608..d2d3fdd80b 100644 --- a/gnu/packages/wine.scm +++ b/gnu/packages/wine.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015 Sou Bunnbu ;;; Copyright © 2016 Ricardo Wurmus +;;; Copyright © 2016 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -52,7 +53,7 @@ (define-public wine (package (name "wine") - (version "1.9.15") + (version "1.9.24") (source (origin (method url-fetch) (uri (string-append "https://dl.winehq.org/wine/source/" @@ -60,7 +61,7 @@ "/wine-" version ".tar.bz2")) (sha256 (base32 - "1nmd65knzyh8b0yhxlqqvzai5rpnmhhm0c46n789zr5hj74jm6fg")))) + "0qb07vfxwz41wj71lb0ss3apf22m4ch06382rqfksf7gg34pswnb")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) ("gettext" ,gettext-minimal) @@ -129,7 +130,7 @@ (("(#define SONAME_.* )\"(.*)\"" _ defso soname) (format #f "~a\"~a\"" defso (find-so soname)))))) %standard-phases))) - (home-page "http://www.winehq.org/") + (home-page "https://www.winehq.org/") (synopsis "Implementation of the Windows API") (description "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a From 07cda02c5b6bc44007c1d3f44b7f003b35ac07ec Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 29 Nov 2016 13:18:05 +0200 Subject: [PATCH 126/130] gnu: wine: Use 'modify-phases' syntax. * gnu/packages/wine.scm (wine)[arguments]: Use 'modify-phases' syntax. --- gnu/packages/wine.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm index d2d3fdd80b..367f27af5e 100644 --- a/gnu/packages/wine.scm +++ b/gnu/packages/wine.scm @@ -118,18 +118,18 @@ (list "SHELL=bash") #:phases - (alist-cons-after - 'configure 'patch-dlopen-paths - ;; Hardcode dlopened sonames to absolute paths. - (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) - (find-so (lambda (soname) - (search-path library-path soname)))) - (substitute* "include/config.h" - (("(#define SONAME_.* )\"(.*)\"" _ defso soname) - (format #f "~a\"~a\"" defso (find-so soname)))))) - %standard-phases))) + (modify-phases %standard-phases + (add-after 'configure 'patch-dlopen-paths + ;; Hardcode dlopened sonames to absolute paths. + (lambda _ + (let* ((library-path (search-path-as-string->list + (getenv "LIBRARY_PATH"))) + (find-so (lambda (soname) + (search-path library-path soname)))) + (substitute* "include/config.h" + (("(#define SONAME_.* )\"(.*)\"" _ defso soname) + (format #f "~a\"~a\"" defso (find-so soname)))) + #t)))))) (home-page "https://www.winehq.org/") (synopsis "Implementation of the Windows API") (description From a409de98116dacb75bb033bcebf22d8c1eb3d64b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 29 Nov 2016 15:45:40 +0200 Subject: [PATCH 127/130] gnu: efl: Update to 1.18.3. * gnu/packages/enlightenment.scm (efl): Update to 1.18.3. --- gnu/packages/enlightenment.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/enlightenment.scm b/gnu/packages/enlightenment.scm index 25b8caf306..ae0f553a36 100644 --- a/gnu/packages/enlightenment.scm +++ b/gnu/packages/enlightenment.scm @@ -56,7 +56,7 @@ (define-public efl (package (name "efl") - (version "1.18.2") + (version "1.18.3") (source (origin (method url-fetch) (uri (string-append @@ -64,7 +64,7 @@ version ".tar.xz")) (sha256 (base32 - "1vbvsrrpkvvrmvjavwnp5q77kw5i7vmbaj2vq5mnmrbzamvaybr9")))) + "1h347sfxajyb5s931m9qga14wwiqci7aicww2imxjhzm8w4fqj07")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) From e9c72306fdfd6a60158918850cb25d0ff3837d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 29 Nov 2016 15:07:07 +0100 Subject: [PATCH 128/130] refresh: Warn about packages that lack an updater. * guix/upstream.scm (package-update-path): Rename to... (package-latest-release): ... this. Remove 'version>?' check. (package-latest-release*): New procedure. (package-update): Use it. * guix/scripts/refresh.scm (lookup-updater): Rename to... (lookup-updater-by-name): ... this. (warn-no-updater): New procedure. (update-package): Add #:warn? parameter and honor it. (check-for-package-update): New procedure. (guix-refresh)[warn?]: New variable. Replace inline code when UPDATE? is false with a call to 'check-for-package-update'. Pass WARN? to 'check-for-package-update' and 'update-package'. * doc/guix.texi (Invoking guix refresh): Document it. Fix a couple of typos. --- doc/guix.texi | 19 +++++--- guix/scripts/refresh.scm | 96 +++++++++++++++++++++++++--------------- guix/upstream.scm | 30 ++++++++----- 3 files changed, 95 insertions(+), 50 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ce1e5d075a..4677e5cf79 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5250,10 +5250,19 @@ gnu/packages/gettext.scm:29:13: gettext would be upgraded from 0.18.1.1 to 0.18. gnu/packages/glib.scm:77:12: glib would be upgraded from 2.34.3 to 2.37.0 @end example -It does so by browsing the FTP directory of each package and determining -the highest version number of the source tarballs therein. The command +Alternately, one can specify packages to consider, in which case a +warning is emitted for packages that lack an updater: + +@example +$ guix refresh coreutils guile guile-ssh +gnu/packages/ssh.scm:205:2: warning: no updater for guile-ssh +gnu/packages/guile.scm:136:12: guile would be upgraded from 2.0.12 to 2.0.13 +@end example + +@command{guix refresh} browses the upstream repository of each package and determines +the highest version number of the releases therein. The command knows how to update specific types of packages: GNU packages, ELPA -packages, etc.---see the documentation for @option{--type} below. The +packages, etc.---see the documentation for @option{--type} below. There are many packages, though, for which it lacks a method to determine whether a new upstream release is available. However, the mechanism is extensible, so feel free to get in touch with us to add a new method! @@ -5293,7 +5302,7 @@ usually run from a checkout of the Guix source tree (@pxref{Running Guix Before It Is Installed}): @example -$ ./pre-inst-env guix refresh -s non-core +$ ./pre-inst-env guix refresh -s non-core -u @end example @xref{Defining Packages}, for more information on package definitions. @@ -5359,7 +5368,7 @@ In addition, @command{guix refresh} can be passed one or more package names, as in this example: @example -$ ./pre-inst-env guix refresh -u emacs idutils gcc-4.8.4 +$ ./pre-inst-env guix refresh -u emacs idutils gcc@@4.8 @end example @noindent diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index b81c69f9fe..ed28ed5fcb 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -208,7 +208,7 @@ unavailable optional dependencies such as Guile-JSON." ((guix import gem) => %gem-updater) ((guix import github) => %github-updater))) -(define (lookup-updater name) +(define (lookup-updater-by-name name) "Return the updater called NAME." (or (find (lambda (updater) (eq? name (upstream-updater-name updater))) @@ -225,31 +225,60 @@ unavailable optional dependencies such as Guile-JSON." %updaters) (exit 0)) +(define (warn-no-updater package) + (format (current-error-port) + (_ "~a: warning: no updater for ~a~%") + (location->string (package-location package)) + (package-name package))) + (define* (update-package store package updaters - #:key (key-download 'interactive)) + #:key (key-download 'interactive) warn?) "Update the source file that defines PACKAGE with the new version. KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed -values: 'interactive' (default), 'always', and 'never'." - (let-values (((version tarball) - (package-update store package updaters - #:key-download key-download)) - ((loc) - (or (package-field-location package 'version) - (package-location package)))) - (when version - (if (and=> tarball file-exists?) - (begin - (format (current-error-port) - (_ "~a: ~a: updating from version ~a to version ~a...~%") - (location->string loc) - (package-name package) - (package-version package) version) - (let ((hash (call-with-input-file tarball - port-sha256))) - (update-package-source package version hash))) - (warning (_ "~a: version ~a could not be \ +values: 'interactive' (default), 'always', and 'never'. When WARN? is true, +warn about packages that have no matching updater." + (if (lookup-updater package updaters) + (let-values (((version tarball) + (package-update store package updaters + #:key-download key-download)) + ((loc) + (or (package-field-location package 'version) + (package-location package)))) + (when version + (if (and=> tarball file-exists?) + (begin + (format (current-error-port) + (_ "~a: ~a: updating from version ~a to version ~a...~%") + (location->string loc) + (package-name package) + (package-version package) version) + (let ((hash (call-with-input-file tarball + port-sha256))) + (update-package-source package version hash))) + (warning (_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") - (package-name package) version))))) + (package-name package) version)))) + (when warn? + (warn-no-updater package)))) + +(define* (check-for-package-update package #:key warn?) + "Check whether an update is available for PACKAGE and print a message. When +WARN? is true and no updater exists for PACKAGE, print a warning." + (match (package-latest-release package %updaters) + ((? upstream-source? source) + (when (version>? (upstream-source-version source) + (package-version package)) + (let ((loc (or (package-field-location package 'version) + (package-location package)))) + (format (current-error-port) + (_ "~a: ~a would be upgraded from ~a to ~a~%") + (location->string loc) + (package-name package) (package-version package) + (upstream-source-version source))))) + (#f + (when warn? + (warn-no-updater package))))) + ;;; @@ -312,7 +341,7 @@ dependent packages are rebuilt: ~{~a~^ ~}~%" ;; Return the list of updaters to use. (match (filter-map (match-lambda (('updaters . names) - (map lookup-updater names)) + (map lookup-updater-by-name names)) (_ #f)) opts) (() @@ -360,6 +389,12 @@ update would trigger a complete rebuild." (updaters (options->updaters opts)) (list-dependent? (assoc-ref opts 'list-dependent?)) (key-download (assoc-ref opts 'key-download)) + + ;; Warn about missing updaters when a package is explicitly given on + ;; the command line. + (warn? (or (assoc-ref opts 'argument) + (assoc-ref opts 'expression))) + (packages (match (filter-map (match-lambda (('argument . spec) @@ -397,22 +432,13 @@ update would trigger a complete rebuild." (%gpg-command)))) (for-each (cut update-package store <> updaters - #:key-download key-download) + #:key-download key-download + #:warn? warn?) packages) (with-monad %store-monad (return #t)))) (else - (for-each (lambda (package) - (match (package-update-path package updaters) - ((? upstream-source? source) - (let ((loc (or (package-field-location package 'version) - (package-location package)))) - (format (current-error-port) - (_ "~a: ~a would be upgraded from ~a to ~a~%") - (location->string loc) - (package-name package) (package-version package) - (upstream-source-version source)))) - (#f #f))) + (for-each (cut check-for-package-update <> #:warn? warn?) packages) (with-monad %store-monad (return #t))))))))) diff --git a/guix/upstream.scm b/guix/upstream.scm index 18157376d2..08992dc19e 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -49,8 +49,11 @@ upstream-updater-predicate upstream-updater-latest + lookup-updater + download-tarball - package-update-path + package-latest-release + package-latest-release* package-update update-package-source)) @@ -127,17 +130,24 @@ them matches." (and (pred package) latest))) updaters)) -(define (package-update-path package updaters) +(define (package-latest-release package updaters) "Return an upstream source to update PACKAGE, a object, or #f if -no update is needed or known." +none of UPDATERS matches PACKAGE. It is the caller's responsibility to ensure +that the returned source is newer than the current one." (match (lookup-updater package updaters) ((? procedure? latest-release) - (match (latest-release package) - ((and source ($ name version)) - (and (version>? version (package-version package)) - source)) - (_ #f))) - (#f #f))) + (latest-release package)) + (_ #f))) + +(define (package-latest-release* package updaters) + "Like 'package-latest-release', but ensure that the return source is newer +than that of PACKAGE." + (match (package-latest-release package updaters) + ((and source ($ name version)) + (and (version>? version (package-version package)) + source)) + (_ + #f))) (define* (download-tarball store url signature-url #:key (key-download 'interactive)) @@ -179,7 +189,7 @@ values: the item from LST1 and the item from LST2 that match PRED." PACKAGE, or #f and #f when PACKAGE is up-to-date. KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'always', 'never', and 'interactive' (default)." - (match (package-update-path package updaters) + (match (package-latest-release* package updaters) (($ _ version urls signature-urls) (let*-values (((name) (package-name package)) From 3e95d88d51a63854d44cbf8c8caa47b26d81e091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 29 Nov 2016 16:10:10 +0100 Subject: [PATCH 129/130] gnu-maintenance: 'latest-kde-release' honors 'upstream-name' properties. * guix/gnu-maintenance.scm (latest-kde-release): Honor the 'upstream-name' property of PACKAGE. --- guix/gnu-maintenance.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 78392c9a11..6c6c0722d5 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -525,7 +525,8 @@ elpa.gnu.org, and all the GNOME packages." (let ((uri (string->uri (origin-uri (package-source package))))) (false-if-ftp-error (latest-ftp-release - (package-name package) + (or (assoc-ref (package-properties package) 'upstream-name) + (package-name package)) #:server "mirrors.mit.edu" #:directory (string-append "/kde" (dirname (dirname (uri-path uri)))) From 683c5ab70accb909697717bb61741a7692c52c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 29 Nov 2016 16:10:50 +0100 Subject: [PATCH 130/130] gnu: oxygen-icons: Add 'upstream-name' property. Fixes . Reported by Hartmut Goebel . * gnu/packages/kde-frameworks.scm (oxygen-icons)[properties]: New field. --- gnu/packages/kde-frameworks.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm index 9df37ac38d..230527a837 100644 --- a/gnu/packages/kde-frameworks.scm +++ b/gnu/packages/kde-frameworks.scm @@ -1030,7 +1030,8 @@ which are used in DBus communication.") (home-page "https://community.kde.org/Frameworks") (synopsis "Oxygen provides the standard icon theme for the KDE desktop") (description "Oxygen icon theme for the KDE desktop") - (license license:lgpl3+))) + (license license:lgpl3+) + (properties '((upstream-name . "oxygen-icons5"))))) (define-public solid (package