summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--doc/guix.texi144
-rw-r--r--gnu/local.mk10
-rw-r--r--gnu/packages/bioinformatics.scm4
-rw-r--r--gnu/packages/bootloaders.scm15
-rw-r--r--gnu/packages/compression.scm6
-rw-r--r--gnu/packages/databases.scm4
-rw-r--r--gnu/packages/dns.scm4
-rw-r--r--gnu/packages/dunst.scm2
-rw-r--r--gnu/packages/emacs.scm148
-rw-r--r--gnu/packages/embedded.scm11
-rw-r--r--gnu/packages/game-development.scm27
-rw-r--r--gnu/packages/glib.scm4
-rw-r--r--gnu/packages/gnome.scm37
-rw-r--r--gnu/packages/gnupg.scm4
-rw-r--r--gnu/packages/golang.scm135
-rw-r--r--gnu/packages/graphics.scm21
-rw-r--r--gnu/packages/haskell.scm44
-rw-r--r--gnu/packages/iso-codes.scm2
-rw-r--r--gnu/packages/linux.scm20
-rw-r--r--gnu/packages/lsof.scm10
-rw-r--r--gnu/packages/lua.scm4
-rw-r--r--gnu/packages/mail.scm8
-rw-r--r--gnu/packages/messaging.scm75
-rw-r--r--gnu/packages/monitoring.scm1
-rw-r--r--gnu/packages/patches/openscenegraph-ffmpeg3.patch156
-rw-r--r--gnu/packages/patches/rust-bootstrap-stage0-test.patch55
-rw-r--r--gnu/packages/patches/rust-coresimd-doctest.patch21
-rw-r--r--gnu/packages/patches/syncthing-fix-crash.patch72
-rw-r--r--gnu/packages/patches/xapian-revert-5489fb2f8.patch23
-rw-r--r--gnu/packages/php.scm2
-rw-r--r--gnu/packages/python.scm4
-rw-r--r--gnu/packages/rust.scm189
-rw-r--r--gnu/packages/samba.scm22
-rw-r--r--gnu/packages/search.scm7
-rw-r--r--gnu/packages/syncthing.scm2
-rw-r--r--gnu/packages/textutils.scm18
-rw-r--r--gnu/packages/version-control.scm4
-rw-r--r--gnu/packages/video.scm7
-rw-r--r--gnu/packages/web.scm10
-rw-r--r--gnu/packages/wine.scm6
-rw-r--r--gnu/packages/xorg.scm4
-rw-r--r--gnu/services/herd.scm3
-rw-r--r--gnu/services/mcron.scm76
-rw-r--r--gnu/services/monitoring.scm38
-rw-r--r--gnu/services/shepherd.scm23
-rw-r--r--gnu/tests/base.scm7
-rw-r--r--gnu/tests/monitoring.scm97
-rw-r--r--guix/build/haskell-build-system.scm5
-rw-r--r--guix/build/profiles.scm2
-rw-r--r--guix/gexp.scm10
-rw-r--r--guix/gnu-maintenance.scm26
-rw-r--r--guix/import/cabal.scm70
-rw-r--r--guix/import/gem.scm48
-rw-r--r--guix/import/opam.scm193
-rw-r--r--guix/profiles.scm26
-rw-r--r--guix/scripts/environment.scm210
-rw-r--r--guix/scripts/import.scm2
-rw-r--r--guix/scripts/import/gem.scm27
-rw-r--r--guix/scripts/import/opam.scm92
-rw-r--r--guix/store.scm15
-rw-r--r--guix/ui.scm2
-rw-r--r--tests/gem.scm108
-rw-r--r--tests/hackage.scm71
-rw-r--r--tests/opam.scm118
65 files changed, 2062 insertions, 552 deletions
diff --git a/Makefile.am b/Makefile.am
index 5dc04de35c..618d1653e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -231,11 +231,13 @@ MODULES += \
guix/import/github.scm \
guix/import/gnome.scm \
guix/import/json.scm \
+ guix/import/opam.scm \
guix/import/pypi.scm \
guix/import/stackage.scm \
guix/scripts/import/crate.scm \
guix/scripts/import/gem.scm \
guix/scripts/import/json.scm \
+ guix/scripts/import/opam.scm \
guix/scripts/import/pypi.scm \
guix/scripts/import/stackage.scm \
guix/scripts/weather.scm
@@ -382,6 +384,7 @@ if HAVE_GUILE_JSON
SCM_TESTS += \
tests/pypi.scm \
+ tests/opam.scm \
tests/cpan.scm \
tests/gem.scm \
tests/crate.scm
diff --git a/doc/guix.texi b/doc/guix.texi
index a458c7c8dd..eaec4c422b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -27,7 +27,7 @@ Copyright @copyright{} 2016, 2017, 2018 Chris Marusich@*
Copyright @copyright{} 2016, 2017, 2018 Efraim Flashner@*
Copyright @copyright{} 2016 John Darrington@*
Copyright @copyright{} 2016, 2017 Nils Gillmann@*
-Copyright @copyright{} 2016, 2017 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018 Jan Nieuwenhuizen@*
Copyright @copyright{} 2016 Julien Lepiller@*
Copyright @copyright{} 2016 Alex ter Weele@*
Copyright @copyright{} 2017, 2018 Clément Lassieur@*
@@ -48,7 +48,8 @@ Copyright @copyright{} 2017 nee@*
Copyright @copyright{} 2018 Rutger Helling@*
Copyright @copyright{} 2018 Oleg Pykhalov@*
Copyright @copyright{} 2018 Mike Gerwitz@*
-Copyright @copyright{} 2018 Pierre-Antoine Rouby
+Copyright @copyright{} 2018 Pierre-Antoine Rouby@*
+Copyright @copyright{} 2018 Gábor Boskovits@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -429,7 +430,7 @@ Installing goes along these lines:
@item
@cindex downloading Guix binary
Download the binary tarball from
-@indicateurl{ftp://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz},
+@indicateurl{https://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz},
where @var{system} is @code{x86_64-linux} for an @code{x86_64} machine
already running the kernel Linux, and so on.
@@ -438,7 +439,7 @@ Make sure to download the associated @file{.sig} file and to verify the
authenticity of the tarball against it, along these lines:
@example
-$ wget ftp://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz.sig
+$ wget https://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz.sig
$ gpg --verify guix-binary-@value{VERSION}.@var{system}.tar.xz.sig
@end example
@@ -4915,6 +4916,12 @@ containing @var{text}, a string. @var{references} is a list of store items that
resulting text file refers to; it defaults to the empty list.
@end deffn
+@deffn {Monadic Procedure} binary-file @var{name} @var{data} [@var{references}]
+Return as a monadic value the absolute file name in the store of the file
+containing @var{data}, a bytevector. @var{references} is a list of store
+items that the resulting binary file refers to; it defaults to the empty list.
+@end deffn
+
@deffn {Monadic Procedure} interned-file @var{file} [@var{name}] @
[#:recursive? #t] [#:select? (const #t)]
Return the name of @var{file} once interned in the store. Use
@@ -5348,7 +5355,7 @@ procedure (@pxref{The Store Monad, @code{interned-file}}).
@deffn {Scheme Procedure} plain-file @var{name} @var{content}
Return an object representing a text file called @var{name} with the given
-@var{content} (a string) to be added to the store.
+@var{content} (a string or a bytevector) to be added to the store.
This is the declarative counterpart of @code{text-file}.
@end deffn
@@ -6379,6 +6386,14 @@ The command below imports metadata for the @code{rails} Ruby package:
guix import gem rails
@end example
+@table @code
+@item --recursive
+@itemx -r
+Traverse the dependency graph of the given upstream package recursively
+and generate package expressions for all those packages that are not yet
+in Guix.
+@end table
+
@item cpan
@cindex CPAN
Import metadata from @uref{https://www.metacpan.org/, MetaCPAN}@footnote{This
@@ -6660,6 +6675,12 @@ in Guix.
@cindex crate
Import metadata from the crates.io Rust package repository
@uref{https://crates.io, crates.io}.
+
+@item opam
+@cindex OPAM
+@cindex OCaml
+Import metadata from the @uref{https://opam.ocaml.org/, OPAM} package
+repository used by the OCaml community.
@end table
The structure of the @command{guix import} code is modular. It would be
@@ -8392,7 +8413,7 @@ about their support in GNU/Linux.
An ISO-9660 installation image that can be written to a USB stick or
burnt to a DVD can be downloaded from
-@indicateurl{ftp://alpha.gnu.org/gnu/guix/guixsd-install-@value{VERSION}.@var{system}.iso.xz},
+@indicateurl{https://alpha.gnu.org/gnu/guix/guixsd-install-@value{VERSION}.@var{system}.iso.xz},
where @var{system} is one of:
@table @code
@@ -8408,7 +8429,7 @@ Make sure to download the associated @file{.sig} file and to verify the
authenticity of the image against it, along these lines:
@example
-$ wget ftp://alpha.gnu.org/gnu/guix/guixsd-install-@value{VERSION}.@var{system}.iso.xz.sig
+$ wget https://alpha.gnu.org/gnu/guix/guixsd-install-@value{VERSION}.@var{system}.iso.xz.sig
$ gpg --verify guixsd-install-@value{VERSION}.@var{system}.iso.xz.sig
@end example
@@ -10829,6 +10850,21 @@ gexps to introduce job definitions that are passed to mcron
for more information on mcron job specifications. Below is the
reference of the mcron service.
+On a running system, you can use the @code{schedule} action of the service to
+visualize the mcron jobs that will be executed next:
+
+@example
+# herd schedule mcron
+@end example
+
+@noindent
+The example above lists the next five tasks that will be executed, but you can
+also specify the number of tasks to display:
+
+@example
+# herd schedule mcron 10
+@end example
+
@deffn {Scheme Procedure} mcron-service @var{jobs} [#:mcron @var{mcron}]
Return an mcron service running @var{mcron} that schedules @var{jobs}, a
list of gexps denoting mcron job specifications.
@@ -15649,6 +15685,39 @@ Specify the path of the base URL. This can be useful if
@end table
@end deftp
+@subsubheading Prometheus Node Exporter Service
+
+@cindex prometheus-node-exporter
+The Prometheus ``node exporter'' makes hardware and operating system statistics
+provided by the Linux kernel available for the Prometheus monitoring system.
+This service should be deployed on all physical nodes and virtual machines,
+where monitoring these statistics is desirable.
+
+@defvar {Scheme variable} prometheus-node-exporter-service-type
+This is the service type for the
+@uref{https://github.com/prometheus/node_exporter/, prometheus-node-exporter}
+service, its value must be a @code{prometheus-node-exporter-configuration}
+record as in this example:
+
+@example
+(service prometheus-node-exporter-service-type
+ (prometheus-node-exporter-configuration
+ (web-listen-address ":9100")))
+@end example
+@end defvar
+
+@deftp {Data Type} prometheus-node-exporter-configuration
+Data type representing the configuration of @command{node_exporter}.
+
+@table @asis
+@item @code{package} (default: @code{go-github-com-prometheus-node-exporter})
+The prometheus-node-exporter package to use.
+
+@item @code{web-listen-address} (default: @code{":9100"})
+Bind the web interface to the specified address.
+
+@end table
+@end deftp
@node Kerberos Services
@subsubsection Kerberos Services
@@ -21323,7 +21392,7 @@ example graph.
@cindex virtual machine
To run GuixSD in a virtual machine (VM), one can either use the
pre-built GuixSD VM image distributed at
-@indicateurl{ftp://alpha.gnu.org/guix/guixsd-vm-image-@value{VERSION}.@var{system}.tar.xz}
+@indicateurl{https://alpha.gnu.org/gnu/guix/guixsd-vm-image-@value{VERSION}.@var{system}.xz}
, or build their own virtual machine image using @command{guix system
vm-image} (@pxref{Invoking guix system}). The returned image is in
qcow2 format, which the @uref{http://qemu.org/, QEMU emulator} can
@@ -21915,6 +21984,17 @@ Constructors,,, shepherd, The GNU Shepherd Manual}). They are given as
G-expressions that get expanded in the Shepherd configuration file
(@pxref{G-Expressions}).
+@item @code{actions} (default: @code{'()})
+@cindex actions, of Shepherd services
+This is a list of @code{shepherd-action} objects (see below) defining
+@dfn{actions} supported by the service, in addition to the standard
+@code{start} and @code{stop} actions. Actions listed here become available as
+@command{herd} sub-commands:
+
+@example
+herd @var{action} @var{service} [@var{arguments}@dots{}]
+@end example
+
@item @code{documentation}
A documentation string, as shown when running:
@@ -21932,6 +22012,54 @@ This is the list of modules that must be in scope when @code{start} and
@end table
@end deftp
+@deftp {Data Type} shepherd-action
+This is the data type that defines additional actions implemented by a
+Shepherd service (see above).
+
+@table @code
+@item name
+Symbol naming the action.
+
+@item documentation
+This is a documentation string for the action. It can be viewed by running:
+
+@example
+herd doc @var{service} action @var{action}
+@end example
+
+@item procedure
+This should be a gexp that evaluates to a procedure of at least one argument,
+which is the ``running value'' of the service (@pxref{Slots of services,,,
+shepherd, The GNU Shepherd Manual}).
+@end table
+
+The following example defines an action called @code{say-hello} that kindly
+greets the user:
+
+@example
+(shepherd-action
+ (name 'say-hello)
+ (documentation "Say hi!")
+ (procedure #~(lambda (running . args)
+ (format #t "Hello, friend! arguments: ~s\n"
+ args)
+ #t)))
+@end example
+
+Assuming this action is added to the @code{example} service, then you can do:
+
+@example
+# herd say-hello example
+Hello, friend! arguments: ()
+# herd say-hello example a b c
+Hello, friend! arguments: ("a" "b" "c")
+@end example
+
+This, as you can see, is a fairly sophisticated way to say hello.
+@xref{Service Convenience,,, shepherd, The GNU Shepherd Manual}, for more
+info on actions.
+@end deftp
+
@defvr {Scheme Variable} shepherd-root-service-type
The service type for the Shepherd ``root service''---i.e., PID@tie{}1.
diff --git a/gnu/local.mk b/gnu/local.mk
index cde94f4cf8..979c3b4b93 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -15,7 +15,7 @@
# Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
# Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
# Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
-# Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
+# Copyright © 2017, 2018 Gábor Boskovits <boskovits@gmail.com>
# Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
# Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
#
@@ -530,6 +530,7 @@ GNU_SYSTEM_MODULES = \
%D%/tests/databases.scm \
%D%/tests/desktop.scm \
%D%/tests/dict.scm \
+ %D%/tests/monitoring.scm \
%D%/tests/nfs.scm \
%D%/tests/install.scm \
%D%/tests/mail.scm \
@@ -985,7 +986,6 @@ dist_patch_DATA = \
%D%/packages/patches/openfoam-4.1-cleanup.patch \
%D%/packages/patches/openldap-CVE-2017-9287.patch \
%D%/packages/patches/openocd-nrf52.patch \
- %D%/packages/patches/openscenegraph-ffmpeg3.patch \
%D%/packages/patches/opensmtpd-fix-crash.patch \
%D%/packages/patches/openssl-runpath.patch \
%D%/packages/patches/openssl-1.0.2-CVE-2018-0495.patch \
@@ -1016,6 +1016,7 @@ dist_patch_DATA = \
%D%/packages/patches/perl-net-amazon-s3-moose-warning.patch \
%D%/packages/patches/perl-net-dns-resolver-programmable-fix.patch \
%D%/packages/patches/perl-no-sys-dirs.patch \
+ %D%/packages/patches/perl-text-markdown-discount-unbundle.patch \
%D%/packages/patches/perl-module-pluggable-search.patch \
%D%/packages/patches/perl-reproducible-build-date.patch \
%D%/packages/patches/perl-www-curl-remove-symbol.patch \
@@ -1108,11 +1109,14 @@ dist_patch_DATA = \
%D%/packages/patches/rpcbind-CVE-2017-8779.patch \
%D%/packages/patches/rsem-makefile.patch \
%D%/packages/patches/rtags-separate-rct.patch \
+ %D%/packages/patches/racket-fix-xform-issue.patch \
%D%/packages/patches/ruby-rubygems-276-for-ruby24.patch \
%D%/packages/patches/ruby-concurrent-ignore-broken-test.patch \
%D%/packages/patches/ruby-concurrent-test-arm.patch \
%D%/packages/patches/ruby-rack-ignore-failing-test.patch \
%D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\
+ %D%/packages/patches/rust-bootstrap-stage0-test.patch \
+ %D%/packages/patches/rust-coresimd-doctest.patch \
%D%/packages/patches/rxvt-unicode-escape-sequences.patch \
%D%/packages/patches/scheme48-tests.patch \
%D%/packages/patches/scotch-test-threading.patch \
@@ -1134,6 +1138,7 @@ dist_patch_DATA = \
%D%/packages/patches/superlu-dist-scotchmetis.patch \
%D%/packages/patches/swish-e-search.patch \
%D%/packages/patches/swish-e-format-security.patch \
+ %D%/packages/patches/syncthing-fix-crash.patch \
%D%/packages/patches/synfigstudio-fix-ui-with-gtk3.patch \
%D%/packages/patches/t1lib-CVE-2010-2642.patch \
%D%/packages/patches/t1lib-CVE-2011-0764.patch \
@@ -1209,6 +1214,7 @@ dist_patch_DATA = \
%D%/packages/patches/wpa-supplicant-krack-followups.patch \
%D%/packages/patches/wxmaxima-do-not-use-old-gnuplot-parameters.patch \
%D%/packages/patches/x265-fix-ppc64le-build.patch \
+ %D%/packages/patches/xapian-revert-5489fb2f8.patch \
%D%/packages/patches/xboing-CVE-2004-0149.patch \
%D%/packages/patches/xdotool-fix-makefile.patch \
%D%/packages/patches/xf86-video-ark-remove-mibstore.patch \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 9bf629947b..245e7dd564 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3760,13 +3760,13 @@ experiments.")
(define-public macs
(package
(name "macs")
- (version "2.1.0.20151222")
+ (version "2.1.1.20160309")
(source (origin
(method url-fetch)
(uri (pypi-uri "MACS2" version))
(sha256
(base32
- "1r2hcz6irhcq7lwbafjks98jbn34hv05avgbdjnp6w6mlfjkf8x5"))))
+ "09ixspd1vcqmz1c81ih70xs4m7qml2iy5vyx1y74zww3iy1vl210"))))
(build-system python-build-system)
(arguments
`(#:python ,python-2 ; only compatible with Python 2.7
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 6e4e021180..7599f4ac25 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -357,7 +357,7 @@ tree binary files. These are board description files used by Linux and BSD.")
(define u-boot
(package
(name "u-boot")
- (version "2018.05")
+ (version "2018.07")
(source (origin
(method url-fetch)
(uri (string-append
@@ -365,10 +365,12 @@ tree binary files. These are board description files used by Linux and BSD.")
"u-boot-" version ".tar.bz2"))
(sha256
(base32
- "0j60p4iskzb4hamxgykc6gd7xchxfka1zwh8hv08r9rrc4m3r8ad"))))
+ "1m7nw64mxflpc6sqvnz2kb5fxfkb4mrpy8b1wi15dcwipj4dy44z"))))
(native-inputs
`(("bc" ,bc)
+ ("bison" ,bison)
("dtc" ,dtc)
+ ("flex" ,flex)
("openssl" ,openssl)
("python-2" ,python-2)
("python2-coverage" ,python2-coverage)
@@ -423,8 +425,7 @@ def test_ctrl_c"))
(apply invoke "make" "tools_defconfig" make-flags)))
(replace 'build
(lambda* (#:key inputs make-flags #:allow-other-keys)
- (apply invoke "make" "tools-only" make-flags)
- (apply invoke "make" "envtools" make-flags)))
+ (apply invoke "make" "tools-all" make-flags)))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -441,7 +442,8 @@ def test_ctrl_c"))
"tools/mkimage"
"tools/proftool"
"tools/fdtgrep"
- "tools/env/fw_printenv"))
+ "tools/env/fw_printenv"
+ "tools/sunxi-spl-image-builder"))
#t)))
(delete 'check)
(add-after 'install 'check
@@ -517,7 +519,8 @@ board-independent tools.")))
(let ((target-file (string-append libexec "/" file)))
(mkdir-p (dirname target-file))
(copy-file file target-file)))
- uboot-files))))))))))
+ uboot-files)
+ #t)))))))))
(define-public u-boot-vexpress
(make-u-boot-package "vexpress_ca9x4" "arm-linux-gnueabihf"))
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 2ca431b2c1..0d73886109 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -1889,19 +1889,19 @@ create, manipulate, read, and write Zip archive files.")
(define-public libzip
(package
(name "libzip")
- (version "1.3.2")
+ (version "1.5.1")
(source (origin
(method url-fetch)
(uri (string-append
"https://libzip.org/download/" name "-" version ".tar.xz"))
(sha256
(base32
- "11g1hvm2bxa2v5plakfzcwyk5hb5fz4kgrkp38l0xhnv21888xv2"))))
+ "0wnkkvkq90wyawj9221i77sf3nix1vj3ygzdy59k8yvcjnv3bsh4"))))
(native-inputs
`(("perl" ,perl)))
(inputs
`(("zlib" ,zlib)))
- (build-system gnu-build-system)
+ (build-system cmake-build-system)
(home-page "https://libzip.org")
(synopsis "C library for reading, creating, and modifying zip archives")
(description "Libzip is a C library for reading, creating, and modifying
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c2005144b4..55979834c9 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1070,14 +1070,14 @@ is in the public domain.")
(define-public tdb
(package
(name "tdb")
- (version "1.3.15")
+ (version "1.3.16")
(source (origin
(method url-fetch)
(uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
version ".tar.gz"))
(sha256
(base32
- "0a37jhpij8wr4f4pjqdlwnffy2l6a2vkqdpz1bqxj6v06cwbz8dl"))))
+ "1ibcz466xwk1x6xvzlgzd5va4lyrjzm3rnjak29kkwk7cmhw4gva"))))
(build-system gnu-build-system)
(arguments
'(#:phases
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 78479b2d32..9d728c3464 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -288,7 +288,7 @@ asynchronous fashion.")
(define-public unbound
(package
(name "unbound")
- (version "1.6.8")
+ (version "1.7.3")
(source
(origin
(method url-fetch)
@@ -296,7 +296,7 @@ asynchronous fashion.")
version ".tar.gz"))
(sha256
(base32
- "0jfxhh4gc5amhndikskz1s7da27ycn442j3l20bm992n7zijid73"))))
+ "0bb0p8nbda77ghx20yfl7hqxm9x709223q35465v99i8v4ay27f1"))))
(build-system gnu-build-system)
(outputs '("out" "python"))
(native-inputs
diff --git a/gnu/packages/dunst.scm b/gnu/packages/dunst.scm
index eaad227747..7328e442cf 100644
--- a/gnu/packages/dunst.scm
+++ b/gnu/packages/dunst.scm
@@ -60,7 +60,7 @@
("which" ,which)))
(inputs
`(("dbus" ,dbus)
- ("gdk-pixbuf" ,gdk-pixbuf)
+ ("gdk-pixbuf" ,gdk-pixbuf+svg) ; for svg support
("glib" ,glib)
("cairo" ,cairo)
("pango" ,pango)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 9f055cfc51..11cd244deb 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -35,6 +35,7 @@
;;; Copyright © 2018 Sohom Bhattacharjee <soham.bhattacharjee15@gmail.com>
;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2018 Pierre Neidhardt <ambrevar@gmail.com>
+;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -4182,6 +4183,99 @@ errors and strict-mode warnings, smart line-wrapping within comments and
strings, and code folding.")
(license license:gpl3+)))
+(define-public emacs-nodejs-repl
+ (package
+ (name "emacs-nodejs-repl")
+ (version "0.1.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/abicky/nodejs-repl.el"
+ "/archive/" version ".tar.gz"))
+ (sha256
+ (base32
+ "0sphg1jxi3a5l0gqdp27d0qgyjaiq2p293av9zm8ksm0vwqp3fr9"))
+ (file-name (string-append name "-" version ".tar.gz"))))
+ (build-system emacs-build-system)
+ (home-page "https://github.com/abicky/nodejs-repl.el")
+ (synopsis "Node.js REPL inside Emacs")
+ (description
+ "This program is derived from comint-mode and provides the following
+features:
+
+@itemize
+@item TAB completion same as Node.js REPL
+@item file name completion in string
+@item incremental history search
+@end itemize")
+ (license license:gpl3+)))
+
+(define-public emacs-typescript-mode
+ (package
+ (name "emacs-typescript-mode")
+ (version "0.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/ananthakumaran/typescript.el"
+ "/archive/v" version ".tar.gz"))
+ (sha256
+ (base32
+ "1gqjirm8scf0wysm7x97zdfbs4qa5nqdl64jfbkd18iskv5mg3rj"))
+ (file-name (string-append name "-" version ".tar.gz"))))
+ (build-system emacs-build-system)
+ (home-page "https://github.com/ananthakumaran/typescript.el")
+ (synopsis "Emacs major mode for editing Typescript code")
+ (description
+ "This is based on Karl Landstrom's barebones @code{typescript-mode}.
+This is much more robust and works with @code{cc-mode}'s comment
+filling (mostly). The modifications to the original @code{javascript.el} mode
+mainly consisted in replacing \"javascript\" with \"typescript\"
+
+The main features of this Typescript mode are syntactic highlighting (enabled
+with @code{font-lock-mode} or @code{global-font-lock-mode}), automatic
+indentation and filling of comments and C preprocessor fontification.")
+ (license license:gpl3+)))
+
+(define-public emacs-tide
+ (package
+ (name "emacs-tide")
+ (version "2.8.3.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/ananthakumaran/tide"
+ "/archive/v" version ".tar.gz"))
+ (sha256
+ (base32
+ "1k0kzqiv1hfs0kqm37947snzhrsmand3i9chvm6a2r5lb8v9q47y"))
+ (file-name (string-append name "-" version ".tar.gz"))))
+ (build-system emacs-build-system)
+ (propagated-inputs
+ `(("emacs-dash" ,emacs-dash)
+ ("emacs-s" ,emacs-s)
+ ("emacs-flycheck" ,flycheck)
+ ("emacs-typescript-mode" ,emacs-typescript-mode)))
+ (home-page "https://github.com/ananthakumaran/tide")
+ (synopsis "Typescript IDE for Emacs")
+ (description
+ "Tide is an Interactive Development Environment (IDE) for Emacs which
+provides the following features:
+
+@itemize
+@item ElDoc
+@item Auto complete
+@item Flycheck
+@item Jump to definition, Jump to type definition
+@item Find occurrences
+@item Rename symbol
+@item Imenu
+@item Compile On Save
+@item Highlight Identifiers
+@item Code Fixes
+@item Code Refactor
+@item Organize Imports
+@end itemize")
+ (license license:gpl3+)))
+
(define-public emacs-markdown-mode
(package
(name "emacs-markdown-mode")
@@ -8423,6 +8517,10 @@ outline-mode), so there is no such thing like an outshine mode, only
(base32
"109fvivsb4r0rbqljngqrmxqvbnbkqlivczx6brrvlr7ci625lhf"))))
(build-system emacs-build-system)
+ (propagated-inputs
+ `(("emacs-seq" ,emacs-seq)
+ ("emacs-dash" ,emacs-dash)
+ ("emacs-let-alist" ,emacs-let-alist)))
(home-page "https://github.com/cpitclaudel/biblio.el")
(synopsis "Browse and import bibliographic references")
(description "This package provides an extensible Emacs package for
@@ -8457,7 +8555,8 @@ automatically fetched from well-curated sources, and formatted as BibTeX.")
("emacs-s" ,emacs-s)
("emacs-dash" ,emacs-dash)
("emacs-f" ,emacs-f)
- ("emacs-biblio" ,emacs-biblio)))
+ ("emacs-biblio" ,emacs-biblio)
+ ("emacs-ivy" ,emacs-ivy)))
(home-page "https://github.com/tmalsburg/helm-bibtex")
(synopsis "Bibliography manager based on Helm")
(description "This package provides bibliography manager for Emacs,
@@ -11317,3 +11416,50 @@ siblings and friends. This visual overview can also be used to browse your
entries. You can think of entries as nodes in a mind map, or pages in a
wiki.")
(license license:expat)))
+
+(define-public emacs-recent-addresses
+ (let ((commit "d9da58db542089a1ceb5ef29e420dbfbc4a36373")
+ (revision "0"))
+ (package
+ (name "emacs-recent-addresses")
+ (home-page "http://nschum.de/src/emacs/recent-addresses/")
+ (version (git-version "0.1" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nschum/recent-addresses.el")
+ (commit commit)))
+ (sha256
+ (base32
+ "175rvcwmkb5z7ss7q2y5178mvdvp5bhn39irz80qinlvaz8fm4nk"))
+ (file-name (git-file-name name version))))
+ (build-system emacs-build-system)
+ (synopsis "Record recently-used email addressed and auto-complete them")
+ (description
+ "@code{recent-addresses} is an Emacs allows you to quickly look up
+previously used email addresses. It can be used alongside the Gnus email
+client.")
+ (license license:gpl2+))))
+
+(define-public emacs-fold-dwim
+ (let ((commit "c46f4bb2ce91b4e307136320e72c28dd50b6cd8b")
+ (revision "0"))
+ (package
+ (name "emacs-fold-dwim")
+ (version (git-version "1.2" revision commit))
+ (home-page "https://github.com/emacsattic/fold-dwim")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference (url home-page) (commit commit)))
+ (sha256
+ (base32
+ "1yz1wis31asw6xa5maliyd1ck2q02xnnh7dc6swgj9cb4wi7k6i1"))
+ (file-name (git-file-name name version))))
+ (build-system emacs-build-system)
+ (synopsis "Unified user interface for Emacs folding modes")
+ (description
+ "DWIM stands for \"do what I mean\", as in the idea that one keystroke
+can do different things depending on the context. In this package, it means
+that, if the cursor is in a currently hidden folded construction, we want to
+show it; if it's not, we want to hide whatever fold the cursor is in.")
+ (license license:gpl2+))))
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 4caf29437f..0174224616 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -1008,7 +1008,12 @@ SPI, I2C, JTAG.")
"loadtools/defpath.c"
"loadtools/Makefile"
"miscutil/c139explore"
- "miscutil/pirexplore")
+ "miscutil/pirexplore"
+ "ffstools/tiffs-wrappers/installpath.c"
+ "rvinterf/rvtat/launchrvif.c"
+ "rvinterf/etmsync/launchrvif.c"
+ "rvinterf/libasync/launchrvif.c"
+ "uptools/atcmd/atinterf.c")
(("/opt/freecalypso/loadtools")
(string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
(("/opt/freecalypso")
@@ -1092,6 +1097,10 @@ feeding melodies to be played to it.
that can be issued through the RVTMUX (debug trace) serial channel.
This program is our test mode shell for sending Test Mode commands to targets
and displaying decoded target responses.
+@item fcup-smsend Send a short message via SMS
+@item fcup-smsendmult Send multiple short messages via SMS in one go
+@item fcup-smsendpdu Send multiple short messages given in PDU format via SMS
+@item sms-pdu-decode Decode PDU format messages
@end enumerate")
(home-page "https://www.freecalypso.org/")
(license license:public-domain)))
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 96b15b5652..afabeb0c62 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2,12 +2,12 @@
;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
+;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2016, 2017 Julian Graham <joolean@gmail.com>
+;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
@@ -225,14 +225,14 @@ PCM data.")
(define-public gzochi
(package
(name "gzochi")
- (version "0.11.1")
+ (version "0.12")
(source (origin
(method url-fetch)
(uri (string-append "mirror://savannah/gzochi/gzochi-"
version ".tar.gz"))
(sha256
(base32
- "13j1m92zhxwkaaja3lg5x0h0b28mrrawdzk9d3hd19031akfxwb3"))))
+ "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
(build-system gnu-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
@@ -1019,18 +1019,23 @@ of use.")
(license license:expat)))
(define-public openmw
+ ;; XXX The current version does not support qt 5.11, but the upcoming
+ ;; version (0.44) will do.
+ (let ((commit "5bc073603e8c7887e015a0ef41b4cefd6e688aaf")
+ (revision "1"))
(package
(name "openmw")
- (version "0.43.0")
+ (version (git-version "0.43" revision commit))
(source
(origin
- (method url-fetch)
- (uri
- (string-append "https://github.com/OpenMW/openmw/archive/"
- name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/OpenMW/openmw.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
(sha256
(base32
- "11phjx7b3mv4n295xgq25lkcwq0mgr35i5k05hf1h77y6n6jbw64"))))
+ "1sp4n3f1syvv0iz7n72wh226fyc0jh98cg8bvs574jvvqx6qn851"))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f ; No test target
@@ -1057,7 +1062,7 @@ the 2002 open-world RPG Morrowind. The engine comes with its own editor,
called OpenMW-CS which allows the user to edit or create their own original
games.")
(home-page "https://openmw.org")
- (license license:gpl3)))
+ (license license:gpl3))))
(define-public godot
(package
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 7ea22fe88f..95d7976bf8 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -787,7 +787,7 @@ programming langauage. It also contains the utility
(define-public appstream-glib
(package
(name "appstream-glib")
- (version "0.7.5")
+ (version "0.7.10")
(source (origin
(method url-fetch)
(uri (string-append "https://people.freedesktop.org/~hughsient/"
@@ -795,7 +795,7 @@ programming langauage. It also contains the utility
"appstream-glib-" version ".tar.xz"))
(sha256
(base32
- "0ps80cbqnf3q86rvz3ajqjssdgkjc9kmynqf0wxqfir7ayc9y9ag"))))
+ "08bs0hnkvdzqv9pakv1y4c4ph77rmzjq22g760w20sv7vs63nia3"))))
(build-system meson-build-system)
(native-inputs
`(("gettext" ,gettext-minimal)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 04259e8f89..dffebe92eb 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -30,6 +30,7 @@
;;; Copyright © 2017 Brendan Tildesley <brendan.tildesley@openmailbox.org>
;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Jovany Leandro G.C <bit4bit@riseup.net>
+;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2110,7 +2111,7 @@ editors, IDEs, etc.")
(package
(inherit vte)
(name "vte-ng")
- (version "0.50.2.a")
+ (version "0.52.2.a")
(native-inputs
`(("gtk-doc" ,gtk-doc)
("gperf" ,gperf)
@@ -2125,14 +2126,13 @@ editors, IDEs, etc.")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "0sv666ilid916ja6gw2d376nyyy66gvhsds8ans02x4b7gagj5sx"))))
+ "1fd65mk7c87k03vhnb2ixkjvv9nja04mfq813iyjji1b11f2sh7v"))))
(arguments
- `(#:configure-flags '("CXXFLAGS=-Wformat=0")
- #:phases (modify-phases %standard-phases
- (replace 'bootstrap
+ `(#:phases (modify-phases %standard-phases
+ (replace 'bootstrap
(lambda _
(setenv "NOCONFIGURE" "true")
- (zero? (system* "sh" "autogen.sh")))))))
+ (invoke "sh" "autogen.sh"))))))
(synopsis "Enhanced VTE terminal widget")
(description
"VTE is a library (libvte) implementing a terminal emulator widget for
@@ -6477,7 +6477,7 @@ like GNOME, Unity, Budgie, Pantheon, XFCE, Mate, etc.")
(define-public faba-icon-theme
(package
(name "faba-icon-theme")
- (version "4.1.2")
+ (version "4.3")
(source
(origin
(method url-fetch)
@@ -6486,23 +6486,8 @@ like GNOME, Unity, Budgie, Pantheon, XFCE, Mate, etc.")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "0hi2dl627ayfnihn3v6x9xzid668m4hp098hb7hrkxvahh4h9by7"))))
- (build-system gnu-build-system)
- (arguments
- '(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'patch-makefile.am
- (lambda _
- (substitute* '("Makefile.am")
- (("\\$\\(DESTDIR\\)/usr/share")
- "$(datadir)"))
- #t))
- (add-after 'unpack 'disable-configure-during-bootstrap
- (lambda _
- ;; Do not run configure as part of autogen.sh because references
- ;; to /bin are not fixed yet.
- (setenv "NOCONFIGURE" "y")
- #t)))))
+ "18ln06xl60qzvzz61zq9q72hdbfgjsza3flph8i2asyzx3dffz68"))))
+ (build-system meson-build-system)
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)))
@@ -6518,7 +6503,7 @@ Moka")
(package
(inherit faba-icon-theme)
(name "moka-icon-theme")
- (version "5.3.6")
+ (version "5.4.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/moka-project"
@@ -6527,7 +6512,7 @@ Moka")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "04axinv79qnngsxkwqzi5j9lc3hn24rjqps5ai8d42pdnfaf0x37"))))
+ "1nbwdjj268hxv9lfagd9aylily9f0hhallp841v0i3imljp84bmk"))))
(propagated-inputs
;; Moka is based on Faba by using it as a fallback icon set instead of
;; bundling it, so we need to add it as a propagated input.
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index da0c33565a..c095a966c2 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -245,14 +245,14 @@ compatible to GNU Pth.")
(define-public gnupg
(package
(name "gnupg")
- (version "2.2.8")
+ (version "2.2.9")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnupg/gnupg/gnupg-" version
".tar.bz2"))
(sha256
(base32
- "1k8dnnfs9888yp713l7kg2jg110lw47s4krx0njna6fjrsw4qyvp"))))
+ "0r11mx8nkh7ysrnshs560amha5csx8zcaggb5kxcksx1zymyly32"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)))
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 21783f2ee6..92ce504c52 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1840,3 +1840,138 @@ deliver content")
store, and deliver content. It's containe Docker Registry 2.0 and libraries
to interacting with distribution components.")
(license license:asl2.0))))
+
+(define-public go-github-com-docker-go-connections
+ (let ((commit "3ede32e2033de7505e6500d6c868c2b9ed9f169d")
+ (revision "0"))
+ (package
+ (name "go-github-com-docker-go-connections")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/docker/go-connections.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0v1pkr8apwmhyzbjfriwdrs1ihlk6pw7izm57r24mf9jdmg3fyb0"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/docker/go-connections"))
+ (home-page "https://github.com/docker/go-connections")
+ (synopsis "Networking library for Go")
+ (description
+ "This packages provides a library to work with network connections in
+the Go language. In particular it provides tools to deal with network address
+translation (NAT), proxies, sockets, and transport layer security (TLS).")
+ (license license:asl2.0))))
+
+(define-public go-github-com-docker-machine
+ (let ((commit "7b7a141da84480342357c51838be142bf183b095")
+ (revision "0"))
+ (package
+ (name "go-github-com-docker-machine")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/docker/machine.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0bavk0lvs462yh0lnmnxi9psi5qv1x3nvzmd2b0drsahlp1gxi8s"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/docker/machine"))
+ (home-page "https://github.com/docker/machine")
+ (synopsis "Machine management for a container-centric world")
+ (description
+ "@dfn{Machine} lets you create Docker hosts on your computer, on
+hosting providers, and inside your data center. It creates servers, installs
+Docker on them, then configures the Docker client to talk to them.")
+ (license license:asl2.0))))
+
+(define-public go-github-com-gorhill-cronexpr
+ (let ((commit "f0984319b44273e83de132089ae42b1810f4933b")
+ (revision "0"))
+ (package
+ (name "go-github-com-gorhill-cronexpr")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gorhill/cronexpr.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0dphhhqy3i7265znv3m8n57l80dmaq6z4hsj5kgd87qd19z8x0l2"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/gorhill/cronexpr"))
+ (home-page "https://github.com/gorhill/cronexpr")
+ (synopsis "Cron expression parser in the Go language")
+ (description
+ "This package provides a cron expression parser in the Go language.
+Given a cron expression and a time stamp, you can get the next time stamp
+which satisfies the cron expression.")
+ (license (list license:gpl3+
+ license:asl2.0)))))
+
+(define-public go-gopkg-in-check-v1
+ (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
+ (revision "0"))
+ (package
+ (name "go-gopkg-in-check-v1")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/go-check/check")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "gopkg.in/check.v1"))
+ (home-page "https://gopkg.in/check.v1")
+ (synopsis "Test framework for the Go language")
+ (description
+ "This package provides a test library for the Go language.")
+ (license license:asl2.0))))
+
+(define-public go-gopkg-in-yaml-v2
+ (let ((commit "14227de293ca979cf205cd88769fe71ed96a97e2")
+ (revision "0"))
+ (package
+ (name "go-gopkg-in-yaml-v2")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gopkg.in/yaml.v2.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "038hnrjcnjygyi3qidfrkpkakis82qg381sr495d2s40g2dwlzah"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "gopkg.in/yaml.v2"))
+ (native-inputs
+ `(("go-gopkg-in-check-v1" ,go-gopkg-in-check-v1)))
+ (home-page "https://gopkg.in/yaml.v2")
+ (synopsis "YAML reader and writer for the Go language")
+ (description
+ "This package provides a Go library for encode and decode YAML
+values.")
+ (license license:asl2.0))))
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index fffe972659..65f023a488 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2018 Alex Kost <alezost@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -408,17 +409,19 @@ visual effects work for film.")
(define-public openscenegraph
(package
(name "openscenegraph")
- (version "3.4.0")
+ (version "3.6.2")
(source
(origin
- (method url-fetch)
- (uri (string-append "http://trac.openscenegraph.org/downloads/developer_releases/"
- "OpenSceneGraph-" version ".zip"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/openscenegraph/OpenSceneGraph")
+ (commit (string-append "OpenSceneGraph-" version))))
(sha256
(base32
- "03h4wfqqk7rf3mpz0sa99gy715cwpala7964z2npd8jxfn27swjw"))
- (patches (search-patches "openscenegraph-ffmpeg3.patch"))
- (file-name (string-append name "-" version ".zip"))))
+ "03jk6lclyd4biniaw04w7j0z1spkm69f1c19i37b8v9x3zv1p1id"))
+ (file-name (string-append name "-" version "-checkout"))))
+ (properties
+ `((upstream-name . "OpenSceneGraph")))
(build-system cmake-build-system)
(arguments
`(#:tests? #f ; no test target available
@@ -430,11 +433,13 @@ visual effects work for film.")
(assoc-ref %outputs "out") "/lib:"
(assoc-ref %outputs "out") "/lib64"))))
(native-inputs
- `(("unzip" ,unzip)))
+ `(("pkg-config" ,pkg-config)
+ ("unzip" ,unzip)))
(inputs
`(("giflib" ,giflib)
("jasper" ,jasper)
("librsvg" ,librsvg)
+ ("libxrandr" ,libxrandr)
("pth" ,pth)
("qtbase" ,qtbase)
("ffmpeg" ,ffmpeg)
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 2176f07cc4..8d2dcba208 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -2487,6 +2487,31 @@ Haskell library @code{regex-base}.")
@code{libtre} (fork by Roman Cheplyaka).")
(license license:bsd-3)))
+(define-public ghc-regex-tdfa-text
+ (package
+ (name "ghc-regex-tdfa-text")
+ (version "1.0.0.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://hackage.haskell.org/package/regex-tdfa-text/"
+ "regex-tdfa-text-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0090g6lgbdm9lywpqm2d3724nnnh24nx3vnlqr96qc2w486pmmrq"))))
+ (build-system haskell-build-system)
+ (inputs
+ `(("ghc-text" ,ghc-text)
+ ("ghc-regex-base" ,ghc-regex-base)
+ ("ghc-regex-tdfa" ,ghc-regex-tdfa)))
+ (home-page
+ "http://hackage.haskell.org/package/regex-tdfa-text")
+ (synopsis "Text interface for regex-tdfa")
+ (description
+ "This provides an extra text interface for regex-tdfa.")
+ (license license:bsd-3)))
+
(define-public ghc-parsers
(package
(name "ghc-parsers")
@@ -9678,4 +9703,23 @@ serialization code.")
disk space usage.")
(license license:bsd-3)))
+(define-public ghc-xdg-basedir
+ (package
+ (name "ghc-xdg-basedir")
+ (version "0.2.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://hackage.haskell.org/package/xdg-basedir/"
+ "xdg-basedir-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0azlzaxp2dn4l1nr7shsxah2magk1szf6fx0mv75az00qsjw6qg4"))))
+ (build-system haskell-build-system)
+ (home-page "http://github.com/willdonnelly/xdg-basedir")
+ (synopsis "XDG Base Directory library for Haskell")
+ (description "This package provides a library implementing the XDG Base Directory spec.")
+ (license license:bsd-3)))
+
;;; haskell.scm ends here
diff --git a/gnu/packages/iso-codes.scm b/gnu/packages/iso-codes.scm
index 9f67cf2868..67c6dc73e5 100644
--- a/gnu/packages/iso-codes.scm
+++ b/gnu/packages/iso-codes.scm
@@ -45,7 +45,7 @@
`(("gettext" ,gettext-minimal)
("perl" ,perl)
("python" ,python-wrapper)))
- (home-page "https://pkg-isocodes.alioth.debian.org/")
+ (home-page "https://salsa.debian.org/iso-codes-team/iso-codes")
(synopsis "Various ISO standards")
(description
"This package provides lists of various ISO standards (e.g. country,
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 6c79f29837..f0dc71a283 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -402,8 +402,8 @@ It has been modified to remove all non-free binary blobs.")
;; supports qemu "virt" machine and possibly a large number of ARM boards.
;; See : https://wiki.debian.org/DebianKernel/ARMMP.
-(define %linux-libre-version "4.17.4")
-(define %linux-libre-hash "1qdywncwwaxghjidihyzvdjq7pffzlswlspjyy420ny967n818jd")
+(define %linux-libre-version "4.17.5")
+(define %linux-libre-hash "0pldqw7f4nhziw3r73l339d79aijxhy6anf1ryiy3makip6gkib1")
(define-public linux-libre
(make-linux-libre %linux-libre-version
@@ -411,8 +411,8 @@ It has been modified to remove all non-free binary blobs.")
%linux-compatible-systems
#:configuration-file kernel-config))
-(define %linux-libre-4.14-version "4.14.53")
-(define %linux-libre-4.14-hash "1bl20q85vnhbkmjj6gvqhgp379hk26rrivwmc5g5wqz46xyavk2a")
+(define %linux-libre-4.14-version "4.14.54")
+(define %linux-libre-4.14-hash "027138z7p5ld1zyrxq1xjc7x3b7wbgikh7gn2xfvwm9gn8qpazki")
(define-public linux-libre-4.14
(make-linux-libre %linux-libre-4.14-version
@@ -537,15 +537,15 @@ at login. Local and dynamic reconfiguration are its key features.")
(define-public psmisc
(package
(name "psmisc")
- (version "22.21")
+ (version "23.1")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
- version ".tar.gz"))
+ version ".tar.xz"))
(sha256
(base32
- "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
+ "0c5s94hqpwfmyswx2f96gifa6wdbpxxpkyxcrlzbxpvmrxsd911f"))))
(build-system gnu-build-system)
(inputs `(("ncurses" ,ncurses)))
(home-page "https://gitlab.com/psmisc/psmisc")
@@ -3283,7 +3283,7 @@ and copy/paste text in the console and in xterm.")
("which" ,which)
;; The tests need 'grep' with perl regexp support.
("grep" ,grep)))
- (home-page "https://btrfs.wiki.kernel.org/")
+ (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
(synopsis "Create and manage btrfs copy-on-write file systems")
(description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
aimed at implementing advanced features while focusing on fault tolerance,
@@ -3588,7 +3588,7 @@ The following service daemons are also provided:
(define-public rng-tools
(package
(name "rng-tools")
- (version "6.2")
+ (version "6.3")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/nhorman/rng-tools/"
@@ -3596,7 +3596,7 @@ The following service daemons are also provided:
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "0xy4qmfhvkr5z4jr9j55dn5gnajr2jccdp6n0xsxkipjcgag342j"))))
+ "1lc2kqw3idwmjyjnf16sqz0f4r1w7c638n4la1j1n5c3188q26bv"))))
(build-system gnu-build-system)
(arguments
`(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
diff --git a/gnu/packages/lsof.scm b/gnu/packages/lsof.scm
index 098242dc7a..8b3ebe2945 100644
--- a/gnu/packages/lsof.scm
+++ b/gnu/packages/lsof.scm
@@ -28,7 +28,7 @@
(define-public lsof
(package
(name "lsof")
- (version "4.89")
+ (version "4.91")
(source
(origin
(method url-fetch)
@@ -53,7 +53,7 @@
(string-append "ftp://ftp.mirrorservice.org/sites/"
"lsof.itap.purdue.edu/pub/tools/unix/lsof")))))
(sha256
- (base32 "061p18v0mhzq517791xkjs8a5dfynq1418a1mwxpji69zp2jzb41"))))
+ (base32 "18sh4hbl9jw2szkf0gvgan8g13f3g4c6s2q9h3zq5gsza9m99nn9"))))
(build-system gnu-build-system)
(native-inputs `(("perl" ,perl)))
(arguments
@@ -73,14 +73,16 @@
(add-after 'configure 'patch-timestamps
(lambda _
(substitute* "Makefile"
- (("`date`") "`date --date=@1`"))))
+ (("`date`") "`date --date=@1`"))
+ #t))
(add-before 'check 'disable-failing-tests
(lambda _
(substitute* "tests/Makefile"
;; Fails with ‘ERROR!!! client gethostbyaddr() failure’.
(("(STDTST=.*) LTsock" _ prefix) prefix)
;; Fails without access to a remote NFS server.
- (("(OPTTST=.*) LTnfs" _ prefix) prefix))))
+ (("(OPTTST=.*) LTnfs" _ prefix) prefix))
+ #t))
(replace 'check
(lambda _
(with-directory-excursion "tests"
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 82ea6e02de..be77ac4a63 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -48,13 +48,13 @@
(define-public lua
(package
(name "lua")
- (version "5.3.4")
+ (version "5.3.5")
(source (origin
(method url-fetch)
(uri (string-append "https://www.lua.org/ftp/lua-"
version ".tar.gz"))
(sha256
- (base32 "0320a8dg3aci4hxla380dx1ifkw8gj4gbw5c4dz41g1kh98sm0gn"))
+ (base32 "1b2qn2rv96nmbm6zab4l877bd4zq7wpwm8drwjiy2ih4jqzysbhc"))
(patches (search-patches "lua-pkgconfig.patch"
"lua-liblua-so.patch"))))
(build-system gnu-build-system)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index bf77b0a7fe..f127e27e3c 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1071,15 +1071,15 @@ which can add many functionalities to the base client.")
(define-public msmtp
(package
(name "msmtp")
- (version "1.6.6")
+ (version "1.6.8")
(source
(origin
(method url-fetch)
- (uri (string-append "mirror://sourceforge/msmtp/msmtp/" version
+ (uri (string-append "https://marlam.de/msmtp/releases/"
"/msmtp-" version ".tar.xz"))
(sha256
(base32
- "0ppvww0sb09bnsrpqnvlrn8vx231r24xn2iiwpy020mxc8gxn5fs"))))
+ "1ysrnshvwhzwmvb2walw5i9jdzlvmckj7inr0xnvb26q0jirbzsm"))))
(build-system gnu-build-system)
(inputs
`(("libidn" ,libidn)
@@ -1089,7 +1089,7 @@ which can add many functionalities to the base client.")
("gsasl" ,gsasl)))
(native-inputs
`(("pkg-config" ,pkg-config)))
- (home-page "http://msmtp.sourceforge.net/")
+ (home-page "https://marlam.de/msmtp/")
(arguments
`(#:configure-flags (list "--with-libgsasl"
"--with-libidn"
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index cdcd1225f2..1212a06eeb 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -9,7 +9,7 @@
;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
;;; Copyright © 2016, 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
-;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
@@ -1644,4 +1644,77 @@ c-toxcore and ncurses. It provides audio calls, sound and desktop
notifications, and Python scripting support.")
(license license:gpl3+)))
+(define-public libqmatrixclient
+ (package
+ (name "libqmatrixclient")
+ (version "0.3.0.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/QMatrixClient/libqmatrixclient/archive/v"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0yl7lw0s2z98xkxbklkb3i8xcd9af9qayl1zxl070d8ykl6ayqy3"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("qt" ,qt)))
+ (arguments
+ `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON")
+ #:tests? #f)) ; No tests
+ (home-page "https://matrix.org/docs/projects/sdk/libqmatrixclient.html")
+ (synopsis "Qt5 client library for the Matrix instant messaging protocol")
+ (description "libqmatrixclient is a Qt5 library to write clients for the
+Matrix instant messaging protocol. Quaternion is the reference client
+implementation. Quaternion and libqmatrixclient together form the
+QMatrixClient project.")
+ (license license:lgpl2.1+)))
+
+(define-public quaternion
+ (package
+ (name "quaternion")
+ (version "0.0.9.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/QMatrixClient/Quaternion/archive/v"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0s2mpw11s2n21ds1spf94j1p2lj2px2bv5zxldlcx81ch0rb4ng8"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("libqmatrixclient" ,libqmatrixclient)
+ ("qt" ,qt)))
+ (arguments
+ `(#:tests? #f ; No tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-libqmatrixclient-dynamic-linking
+ ;; Upstream recommends statically linking with
+ ;; libqmatrixclient. Patch the source so that we can dynamically
+ ;; link instead. In a future release, when upstream moves to
+ ;; dynamic linking, remove this phase.
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("^add_subdirectory\\(lib\\)" all)
+ (string-append "#" all)))
+ (for-each
+ (lambda (file)
+ (substitute* file
+ (("#include \"lib/([^\"]*)\"" all header)
+ (string-append "#include <" header ">"))))
+ (find-files "client" "\\.(cpp|h)$"))
+ #t)))))
+ (home-page "https://matrix.org/docs/projects/client/quaternion.html")
+ (synopsis "Graphical client for the Matrix instant messaging protocol")
+ (description "Quaternion is a Qt5 desktop client for the Matrix instant
+messaging protocol. It uses libqmatrixclient and is its reference client
+implementation. Quaternion and libqmatriclient together form the
+QMatrixClient project.")
+ (license (list license:gpl3+ ; all source code
+ license:lgpl3+)))) ; icons/breeze
+
;;; messaging.scm ends here
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index db6c22a69c..fae62d5493 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
diff --git a/gnu/packages/patches/openscenegraph-ffmpeg3.patch b/gnu/packages/patches/openscenegraph-ffmpeg3.patch
deleted file mode 100644
index 02c04a5583..0000000000
--- a/gnu/packages/patches/openscenegraph-ffmpeg3.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Description: Replace deprecated FFmpeg API
-Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-See <http://forum.openscenegraph.org/viewtopic.php?t=15832>.
---- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
-+++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
-@@ -71,7 +71,7 @@ void FFmpegDecoderVideo::open(AVStream *
- findAspectRatio();
-
- // Find out whether we support Alpha channel
-- m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P);
-+ m_alpha_channel = (m_context->pix_fmt == AV_PIX_FMT_YUVA420P);
-
- // Find out the framerate
- m_frame_rate = av_q2d(stream->avg_frame_rate);
-@@ -91,20 +91,19 @@ void FFmpegDecoderVideo::open(AVStream *
- throw std::runtime_error("avcodec_open() failed");
-
- // Allocate video frame
-- m_frame.reset(avcodec_alloc_frame());
-+ m_frame.reset(av_frame_alloc());
-
- // Allocate converted RGB frame
-- m_frame_rgba.reset(avcodec_alloc_frame());
-- m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
-+ m_frame_rgba.reset(av_frame_alloc());
-+ m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height()));
- m_buffer_rgba[1].resize(m_buffer_rgba[0].size());
-
- // Assign appropriate parts of the buffer to image planes in m_frame_rgba
-- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], PIX_FMT_RGB24, width(), height());
-+ avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height());
-
- // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame.
- m_context->opaque = this;
-- m_context->get_buffer = getBuffer;
-- m_context->release_buffer = releaseBuffer;
-+ m_context->get_buffer2 = getBuffer;
- }
-
-
-@@ -263,8 +262,8 @@ int FFmpegDecoderVideo::convert(AVPictur
- #ifdef USE_SWSCALE
- if (m_swscale_ctx==0)
- {
-- m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
-- src_width, src_height, (PixelFormat) dst_pix_fmt,
-+ m_swscale_ctx = sws_getContext(src_width, src_height, (AVPixelFormat) src_pix_fmt,
-+ src_width, src_height, (AVPixelFormat) dst_pix_fmt,
- /*SWS_BILINEAR*/ SWS_BICUBIC, NULL, NULL, NULL);
- }
-
-@@ -311,14 +310,14 @@ void FFmpegDecoderVideo::publishFrame(co
- AVPicture * const dst = (AVPicture *) m_frame_rgba.get();
-
- // Assign appropriate parts of the buffer to image planes in m_frame_rgba
-- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
-+ avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height());
-
- // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine
-
-- if (m_context->pix_fmt == PIX_FMT_YUVA420P)
-+ if (m_context->pix_fmt == AV_PIX_FMT_YUVA420P)
- yuva420pToRgba(dst, src, width(), height());
- else
-- convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height());
-+ convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height());
-
- // Wait 'delay' seconds before publishing the picture.
- int i_delay = static_cast<int>(delay * 1000000 + 0.5);
-@@ -345,7 +344,7 @@ void FFmpegDecoderVideo::publishFrame(co
-
- void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height)
- {
-- convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
-+ convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
-
- const size_t bpp = 4;
-
-@@ -363,31 +362,28 @@ void FFmpegDecoderVideo::yuva420pToRgba(
- }
- }
-
--
--
--int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture)
-+int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture, int flags)
- {
-+ AVBufferRef *ref;
- const FFmpegDecoderVideo * const this_ = reinterpret_cast<const FFmpegDecoderVideo*>(context->opaque);
-
-- const int result = avcodec_default_get_buffer(context, picture);
-+ const int result = avcodec_default_get_buffer2(context, picture, flags);
- int64_t * p_pts = reinterpret_cast<int64_t*>( av_malloc(sizeof(int64_t)) );
-
- *p_pts = this_->m_packet_pts;
- picture->opaque = p_pts;
-
-+ ref = av_buffer_create((uint8_t *)picture->opaque, sizeof(int64_t), FFmpegDecoderVideo::freeBuffer, picture->buf[0], flags);
-+ picture->buf[0] = ref;
-+
- return result;
- }
-
--
--
--void FFmpegDecoderVideo::releaseBuffer(AVCodecContext * const context, AVFrame * const picture)
-+void FFmpegDecoderVideo::freeBuffer(void *opaque, uint8_t *data)
- {
-- if (picture != 0)
-- av_freep(&picture->opaque);
--
-- avcodec_default_release_buffer(context, picture);
-+ AVBufferRef *ref = (AVBufferRef *)opaque;
-+ av_buffer_unref(&ref);
-+ av_free(data);
- }
-
--
--
- } // namespace osgFFmpeg
---- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
-+++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
-@@ -94,8 +94,8 @@ private:
- int src_pix_fmt, int src_width, int src_height);
-
-
-- static int getBuffer(AVCodecContext * context, AVFrame * picture);
-- static void releaseBuffer(AVCodecContext * context, AVFrame * picture);
-+ static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags);
-+ static void freeBuffer(void * opaque, uint8_t *data);
-
- PacketQueue & m_packets;
- FFmpegClocks & m_clocks;
---- a/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
-+++ b/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
-@@ -19,7 +19,7 @@ extern "C"
- #include <libavutil/pixdesc.h>
- }
-
--inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
-+inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
-
-
- namespace osgFFmpeg {
---- a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp 2016-02-18 21:25:39.627923629 +0000
-+++ b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp 2016-02-18 21:26:17.071140100 +0000
-@@ -227,8 +227,7 @@
- if (avcodec_open2(m_context, p_codec, NULL) < 0)
- throw std::runtime_error("avcodec_open() failed");
-
-- m_context->get_buffer = avcodec_default_get_buffer;
-- m_context->release_buffer = avcodec_default_release_buffer;
-+ m_context->get_buffer2 = avcodec_default_get_buffer2;
-
- }
-
diff --git a/gnu/packages/patches/rust-bootstrap-stage0-test.patch b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
new file mode 100644
index 0000000000..e8484903e5
--- /dev/null
+++ b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
@@ -0,0 +1,55 @@
+Bootstrap tests failed with local stage0 cargo and rustc
+Backported changes from https://github.com/rust-lang/rust/pull/51977
+
+From 0834d9d771e912f51deca6c25699e44734624546 Mon Sep 17 00:00:00 2001
+From: Nikolai Merinov <nikolai.merinov@member.fsf.org>
+Date: Mon, 2 Jul 2018 01:45:35 +0500
+Subject: [PATCH] bootstrap: tests should use rustc from config.toml
+
+Tests should always use "rustc" and "cargo" from config.toml instead
+of assuming that stage0 binaries was downloaded to build directory.
+---
+ src/bootstrap/bootstrap.py | 2 ++
+ src/bootstrap/config.rs | 6 ++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
+index 487440becf..1701f7b83a 100644
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -788,6 +788,8 @@ def bootstrap(help_triggered):
+ env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
+ env["BOOTSTRAP_PYTHON"] = sys.executable
+ env["BUILD_DIR"] = build.build_dir
++ env["CARGO"] = build.cargo()
++ env["RUSTC"] = build.rustc()
+ run(args, env=env, verbose=build.verbose)
+
+
+diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
+index 6dd6291be2..d1a0deb583 100644
+--- a/src/bootstrap/config.rs
++++ b/src/bootstrap/config.rs
+@@ -23,7 +23,6 @@ use std::cmp;
+
+ use num_cpus;
+ use toml;
+-use util::exe;
+ use cache::{INTERNER, Interned};
+ use flags::Flags;
+ pub use flags::Subcommand;
+@@ -362,9 +361,8 @@ impl Config {
+ config.src = Config::path_from_python("SRC");
+ config.out = Config::path_from_python("BUILD_DIR");
+
+- let stage0_root = config.out.join(&config.build).join("stage0/bin");
+- config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
+- config.initial_cargo = stage0_root.join(exe("cargo", &config.build));
++ config.initial_rustc = Config::path_from_python("RUSTC");
++ config.initial_cargo = Config::path_from_python("CARGO");
+
+ config
+ }
+--
+2.17.1
+
diff --git a/gnu/packages/patches/rust-coresimd-doctest.patch b/gnu/packages/patches/rust-coresimd-doctest.patch
new file mode 100644
index 0000000000..bfa0ab224b
--- /dev/null
+++ b/gnu/packages/patches/rust-coresimd-doctest.patch
@@ -0,0 +1,21 @@
+Doctest coresimd::x86::__m256 failed on processors withouth "avx" feature.
+Backported patch with changes from https://github.com/rust-lang-nursery/stdsimd/issues/481
+
+--- rustc-1.26.2-src-orig/src/stdsimd/coresimd/x86/mod.rs 1970-01-01 05:00:00.000000000 +0500
++++ rustc-1.26.2-src/src/stdsimd/coresimd/x86/mod.rs 2018-06-22 00:01:55.142026720 +0500
+@@ -293,13 +293,13 @@
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+- /// # #[target_feature(enable = "sse")]
++ /// # #[target_feature(enable = "avx")]
+ /// # unsafe fn foo() {
+ /// let eight_zeros = _mm256_setzero_ps();
+ /// let eight_ones = _mm256_set1_ps(1.0);
+ /// let eight_floats = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ /// # }
+- /// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
++ /// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
+ /// # }
+ /// ```
+ pub struct __m256(f32, f32, f32, f32, f32, f32, f32, f32);
diff --git a/gnu/packages/patches/syncthing-fix-crash.patch b/gnu/packages/patches/syncthing-fix-crash.patch
new file mode 100644
index 0000000000..d27e543982
--- /dev/null
+++ b/gnu/packages/patches/syncthing-fix-crash.patch
@@ -0,0 +1,72 @@
+Avoid a crash:
+
+https://github.com/syncthing/syncthing/issues/5002
+
+Patch copied from upstream source repository:
+
+https://github.com/syncthing/syncthing/commit/35a75a95dc6383b2d73ab645f1407f7907ec1a2c
+
+From 35a75a95dc6383b2d73ab645f1407f7907ec1a2c Mon Sep 17 00:00:00 2001
+From: Jakob Borg <jakob@kastelo.net>
+Date: Wed, 13 Jun 2018 19:07:52 +0200
+Subject: [PATCH] lib/model: Don't panic when rechecking file (fixes #5002)
+ (#5003)
+
+---
+ lib/model/model.go | 2 +-
+ lib/model/model_test.go | 26 ++++++++++++++++++++++++++
+ 2 files changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/lib/model/model.go b/lib/model/model.go
+index 5a9146e0..302f06c5 100644
+--- a/lib/model/model.go
++++ b/lib/model/model.go
+@@ -1373,7 +1373,7 @@ func (m *Model) recheckFile(deviceID protocol.DeviceID, folderFs fs.Filesystem,
+ return
+ }
+
+- if blockIndex > len(cf.Blocks) {
++ if blockIndex >= len(cf.Blocks) {
+ l.Debugf("%v recheckFile: %s: %q / %q i=%d: block index too far", m, deviceID, folder, name, blockIndex)
+ return
+ }
+diff --git a/lib/model/model_test.go b/lib/model/model_test.go
+index 295eafc1..456bbc4a 100644
+--- a/lib/model/model_test.go
++++ b/lib/model/model_test.go
+@@ -3608,6 +3608,32 @@ func TestIssue4903(t *testing.T) {
+ }
+ }
+
++func TestIssue5002(t *testing.T) {
++ // recheckFile should not panic when given an index equal to the number of blocks
++
++ db := db.OpenMemory()
++ m := NewModel(defaultCfgWrapper, protocol.LocalDeviceID, "syncthing", "dev", db, nil)
++ m.AddFolder(defaultFolderConfig)
++ m.StartFolder("default")
++
++ m.ServeBackground()
++ defer m.Stop()
++
++ if err := m.ScanFolder("default"); err != nil {
++ t.Error(err)
++ }
++
++ file, ok := m.CurrentFolderFile("default", "foo")
++ if !ok {
++ t.Fatal("test file should exist")
++ }
++ nBlocks := len(file.Blocks)
++
++ m.recheckFile(protocol.LocalDeviceID, defaultFolderConfig.Filesystem(), "default", "foo", nBlocks-1, []byte{1, 2, 3, 4})
++ m.recheckFile(protocol.LocalDeviceID, defaultFolderConfig.Filesystem(), "default", "foo", nBlocks, []byte{1, 2, 3, 4}) // panic
++ m.recheckFile(protocol.LocalDeviceID, defaultFolderConfig.Filesystem(), "default", "foo", nBlocks+1, []byte{1, 2, 3, 4})
++}
++
+ func addFakeConn(m *Model, dev protocol.DeviceID) *fakeConnection {
+ fc := &fakeConnection{id: dev, model: m}
+ m.AddConnection(fc, protocol.HelloResult{})
+--
+2.18.0
+
diff --git a/gnu/packages/patches/xapian-revert-5489fb2f8.patch b/gnu/packages/patches/xapian-revert-5489fb2f8.patch
new file mode 100644
index 0000000000..7b78e2abb5
--- /dev/null
+++ b/gnu/packages/patches/xapian-revert-5489fb2f8.patch
@@ -0,0 +1,23 @@
+Revert this upstream commit which breaks a test case in "notmuch":
+
+https://git.xapian.org/?p=xapian;a=commitdiff;h=5489fb2f838c0f0b0a593b4c17df282a93a1fe5a
+
+See the notmuch FAQ entry:
+
+https://notmuchmail.org/faq/#index12h2
+
+This should be fixed for later releases.
+
+diff --git a/backends/glass/glass_postlist.cc b/xapian-core/backends/glass/glass_postlist.cc
+index 80e578b85..a47f14a68 100644
+--- a/backends/glass/glass_postlist.cc
++++ b/backends/glass/glass_postlist.cc
+@@ -759,7 +759,7 @@ GlassPostList::open_nearby_postlist(const std::string & term_,
+ (void)need_pos;
+ if (term_.empty())
+ RETURN(NULL);
+- if (!this_db.get() || this_db->postlist_table.is_modified())
++ if (!this_db.get() || this_db->postlist_table.is_writable())
+ RETURN(NULL);
+ RETURN(new GlassPostList(this_db, term_, cursor->clone()));
+ }
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
index 90e6ab1c1c..1acab0de71 100644
--- a/gnu/packages/php.scm
+++ b/gnu/packages/php.scm
@@ -318,7 +318,7 @@
("libxpm" ,libxpm)
("libxslt" ,libxslt)
("libx11" ,libx11)
- ("oniguruma" ,oniguruma)
+ ("oniguruma" ,oniguruma-5)
("openldap" ,openldap)
("openssl" ,openssl)
("pcre" ,pcre)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 642d7529b6..0fdc53bdca 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -2218,14 +2218,14 @@ environments and back.")
(define-public python-pyyaml
(package
(name "python-pyyaml")
- (version "3.12")
+ (version "3.13")
(source
(origin
(method url-fetch)
(uri (pypi-uri "PyYAML" version))
(sha256
(base32
- "1aqjl8dk9amd4zr99n8v2qxzgmr2hdvqfma4zh7a41rj6336c9sr"))))
+ "1gx603g484z46cb74j9rzr6sjlh2vndxayicvlyhxdz98lhhkwry"))))
(build-system python-build-system)
(inputs
`(("libyaml" ,libyaml)))
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 7fcc795b6f..bb6fea99a0 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -157,14 +157,15 @@ in turn be used to build the final Rust.")
(license license:asl2.0)))
-(define (rust-source version hash)
+(define* (rust-source version hash #:key (patches '()))
(origin
(method url-fetch)
(uri (string-append "https://static.rust-lang.org/dist/"
"rustc-" version "-src.tar.gz"))
(sha256 (base32 hash))
(modules '((guix build utils)))
- (snippet '(begin (delete-file-recursively "src/llvm") #t))))
+ (snippet '(begin (delete-file-recursively "src/llvm") #t))
+ (patches (map search-patch patches))))
(define-public rust-1.19
(package
@@ -203,20 +204,29 @@ in turn be used to build the final Rust.")
(("fn test_process_mask") "#[allow(unused_attributes)]
#[ignore]
fn test_process_mask"))
- ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
- ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
- (delete-file-recursively "src/test/run-make/linker-output-non-utf8")
- (substitute* "src/librustc_back/dynamic_lib.rs"
- ;; This test is known to fail on aarch64 and powerpc64le:
- ;; https://github.com/rust-lang/rust/issues/45410
- (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
- ;; nm doesn't recognize the file format because of the
- ;; nonstandard sections used by the Rust compiler, but readelf
- ;; ignores them.
- (substitute* "src/test/run-make/atomic-lock-free/Makefile"
- (("\tnm ")
- "\treadelf -c "))
#t)))
+ (add-after 'patch-tests 'patch-aarch64-test
+ (lambda* _
+ (substitute* "src/librustc_back/dynamic_lib.rs"
+ ;; This test is known to fail on aarch64 and powerpc64le:
+ ;; https://github.com/rust-lang/rust/issues/45410
+ (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
+ #t))
+ (add-after 'patch-tests 'use-readelf-for-tests
+ (lambda* _
+ ;; nm doesn't recognize the file format because of the
+ ;; nonstandard sections used by the Rust compiler, but readelf
+ ;; ignores them.
+ (substitute* "src/test/run-make/atomic-lock-free/Makefile"
+ (("\tnm ")
+ "\treadelf -c "))
+ #t))
+ (add-after 'patch-tests 'remove-unsupported-tests
+ (lambda* _
+ ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
+ ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
+ (delete-file-recursively "src/test/run-make/linker-output-non-utf8")
+ #t))
(add-after 'patch-source-shebangs 'patch-cargo-checksums
(lambda* _
(substitute* "src/Cargo.lock"
@@ -279,13 +289,14 @@ safety and thread safety guarantees.")
;; Dual licensed.
(license (list license:asl2.0 license:expat))))
-(define (rust-bootstrapped-package base-rust version checksum)
- "Bootstrap rust VERSION with source checksum CHECKSUM using BASE-RUST."
+(define* (rust-bootstrapped-package base-rust version checksum
+ #:key (patches '()))
+ "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST."
(package
(inherit base-rust)
(version version)
(source
- (rust-source version checksum))
+ (rust-source version checksum #:patches patches))
(native-inputs
(alist-replace "cargo-bootstrap" (list base-rust "cargo")
(alist-replace "rustc-bootstrap" (list base-rust)
@@ -410,7 +421,12 @@ safety and thread safety guarantees.")
(substitute* "src/tools/cargo/tests/test.rs"
(("fn cargo_test_env") "#[ignore]\nfn cargo_test_env"))
#t))
- (add-after 'patch-cargo-tests 'fix-mtime-bug
+ (add-after 'patch-cargo-tests 'ignore-glibc-2.27-incompatible-test
+ ;; https://github.com/rust-lang/rust/issues/47863
+ (lambda _
+ (substitute* "src/test/run-pass/out-of-stack.rs"
+ (("// ignore-android") "// ignore-test\n// ignore-android"))))
+ (add-after 'ignore-glibc-2.27-incompatible-test 'fix-mtime-bug
(lambda* _
(substitute* "src/build_helper/lib.rs"
;; Bug in Rust code.
@@ -452,10 +468,10 @@ localstatedir = \"var/lib\"
default-linker = \"" gcc "/bin/gcc" "\"
channel = \"stable\"
rpath = true
-# There is 2 failed codegen tests:
-# codegen/mainsubprogram.rs and codegen/mainsubprogramstart.rs
-# This tests required patched LLVM
-codegen-tests = false
+" ;; There are 2 failed codegen tests:
+ ;; codegen/mainsubprogram.rs and codegen/mainsubprogramstart.rs
+ ;; These tests require a patched LLVM
+"codegen-tests = false
[target." ,(nix-system->gnu-triplet-for-rust) "]
llvm-config = \"" llvm "/bin/llvm-config" "\"
cc = \"" gcc "/bin/gcc" "\"
@@ -513,45 +529,26 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
(substitute-keyword-arguments (package-arguments base-rust)
((#:phases phases)
`(modify-phases ,phases
- (replace 'patch-tests
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((bash (assoc-ref inputs "bash")))
- (substitute* "src/libstd/process.rs"
- ;; The newline is intentional.
- ;; There's a line length "tidy" check in Rust which would
- ;; fail otherwise.
- (("\"/bin/sh\"") (string-append "\n\"" bash "/bin/sh\"")))
- (substitute* "src/libstd/net/tcp.rs"
- ;; There is no network in build environment
- (("fn connect_timeout_unroutable")
- "#[ignore]\nfn connect_timeout_unroutable"))
- ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00222.html>
- (substitute* "src/libstd/sys/unix/process/process_common.rs"
- (("fn test_process_mask") "#[allow(unused_attributes)]
- #[ignore]
- fn test_process_mask"))
- ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
- ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
- (delete-file-recursively "src/test/run-make/linker-output-non-utf8")
- (substitute* "src/librustc_metadata/dynamic_lib.rs"
- ;; This test is known to fail on aarch64 and powerpc64le:
- ;; https://github.com/rust-lang/rust/issues/45410
- (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
- #t)))
+ (delete 'use-readelf-for-tests)
+ (replace 'patch-aarch64-test
+ (lambda* _
+ (substitute* "src/librustc_metadata/dynamic_lib.rs"
+ ;; This test is known to fail on aarch64 and powerpc64le:
+ ;; https://github.com/rust-lang/rust/issues/45410
+ (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
+ #t))
(delete 'fix-mtime-bug))))))))
-(define-public rust
- (let ((base-rust rust-1.24))
+(define-public rust-1.25
+ (let ((base-rust
+ (rust-bootstrapped-package rust-1.24 "1.25.0"
+ "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf")))
(package
(inherit base-rust)
- (version "1.25.0")
- (source
- (rust-source version
- "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf"))
- (native-inputs
- (alist-replace "cargo-bootstrap" (list base-rust "cargo")
- (alist-replace "rustc-bootstrap" (list base-rust)
- (package-native-inputs base-rust))))
+ (inputs
+ ;; Use LLVM 6.0
+ (alist-replace "llvm" (list llvm)
+ (package-inputs base-rust)))
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
((#:phases phases)
@@ -560,4 +557,78 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
(lambda* _
(substitute* "src/tools/cargo/tests/generate-lockfile.rs"
;; This test wants to update the crate index.
- (("fn no_index_update") "#[ignore]\nfn no_index_update")))))))))))
+ (("fn no_index_update") "#[ignore]\nfn no_index_update"))))
+ (add-after 'configure 'enable-codegen-tests
+ (lambda* _
+ (substitute* "config.toml"
+ (("codegen-tests = false") ""))))
+ (delete 'ignore-glibc-2.27-incompatible-test))))))))
+
+(define-public rust-1.26
+ (let ((base-rust
+ (rust-bootstrapped-package rust-1.25 "1.26.2"
+ "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv"
+ #:patches '("rust-coresimd-doctest.patch"))))
+ (package
+ (inherit base-rust)
+ (arguments
+ (substitute-keyword-arguments (package-arguments base-rust)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; binaryen was replaced with LLD project from LLVM
+ (delete 'dont-build-native)
+ (replace 'remove-unsupported-tests
+ (lambda* _
+ ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
+ ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
+ (delete-file-recursively "src/test/run-make-fulldeps/linker-output-non-utf8")
+ #t))
+ (replace 'patch-cargo-tests
+ (lambda* _
+ (substitute* "src/tools/cargo/tests/testsuite/build.rs"
+ (("/usr/bin/env") (which "env"))
+ ;; Guix llvm is compiled without asmjs-unknown-emscripten.
+ (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs"))
+ (substitute* "src/tools/cargo/tests/testsuite/death.rs"
+ ;; This is stuck when built in container.
+ (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone"))
+ ;; Prints test output in the wrong order when built on
+ ;; i686-linux.
+ (substitute* "src/tools/cargo/tests/testsuite/test.rs"
+ (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env"))
+ #t))
+ (add-after 'patch-cargo-tests 'disable-cargo-test-for-nightly-channel
+ (lambda* _
+ ;; This test failed to work on "nightly" channel builds
+ ;; https://github.com/rust-lang/cargo/issues/5648
+ (substitute* "src/tools/cargo/tests/testsuite/resolve.rs"
+ (("fn test_resolving_minimum_version_with_transitive_deps")
+ "#[ignore]\nfn test_resolving_minimum_version_with_transitive_deps"))
+ #t))
+ (replace 'patch-cargo-index-update
+ (lambda* _
+ (substitute* "src/tools/cargo/tests/testsuite/generate_lockfile.rs"
+ ;; This test wants to update the crate index.
+ (("fn no_index_update") "#[ignore]\nfn no_index_update"))
+ #t)))))))))
+
+(define-public rust
+ (let ((base-rust
+ (rust-bootstrapped-package rust-1.26 "1.27.0"
+ "089d7rhw55zpvnw71dj8vil6qrylvl4xjr4m8bywjj83d4zq1f9c"
+ #:patches
+ '("rust-coresimd-doctest.patch"
+ "rust-bootstrap-stage0-test.patch"))))
+ (package
+ (inherit base-rust)
+ (arguments
+ (substitute-keyword-arguments (package-arguments base-rust)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'install 'mkdir-prefix-paths
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; As result of https://github.com/rust-lang/rust/issues/36989
+ ;; `prefix' directory should exist before `install' call
+ (mkdir-p (assoc-ref outputs "out"))
+ (mkdir-p (assoc-ref outputs "cargo"))
+ #t)))))))))
diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm
index 0ce46056f5..64017224a7 100644
--- a/gnu/packages/samba.scm
+++ b/gnu/packages/samba.scm
@@ -236,14 +236,14 @@ Desktops into Active Directory environments using the winbind daemon.")
(define-public talloc
(package
(name "talloc")
- (version "2.1.13")
+ (version "2.1.14")
(source (origin
(method url-fetch)
(uri (string-append "https://www.samba.org/ftp/talloc/talloc-"
version ".tar.gz"))
(sha256
(base32
- "0iv09iv385x69gfzvassq6m3y0rd8ncylls95dm015xdy3drkww4"))))
+ "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di"))))
(build-system gnu-build-system)
(arguments
'(#:phases
@@ -306,14 +306,14 @@ destructors. It is the core memory allocator used in Samba.")
(define-public tevent
(package
(name "tevent")
- (version "0.9.36")
+ (version "0.9.37")
(source (origin
(method url-fetch)
(uri (string-append "https://www.samba.org/ftp/tevent/tevent-"
version ".tar.gz"))
(sha256
(base32
- "0k1v4vnlzpf7h3p4khaw8a7damrc68g136bf2xzys08nzpinnaxx"))))
+ "1q77vbjic2bb79li2a54ffscnrnwwww55fbpry2kgh7acpnlb0qn"))))
(build-system gnu-build-system)
(arguments
'(#:phases
@@ -341,14 +341,14 @@ many event types, including timers, signals, and the classic file descriptor eve
(define-public ldb
(package
(name "ldb")
- (version "1.4.0")
+ (version "1.3.3")
(source (origin
(method url-fetch)
(uri (string-append "https://www.samba.org/ftp/ldb/ldb-"
version ".tar.gz"))
(sha256
(base32
- "1d591ny4j4s409s2afjv4fn7inqlclr0zlyclw3619rkbaixlzm8"))
+ "14gsrm7dvyjpbpnc60z75j6fz2p187abm2h353lq95kx2bv70c1b"))
(modules '((guix build utils)))
(snippet
'(begin
@@ -361,10 +361,7 @@ many event types, including timers, signals, and the classic file descriptor eve
#t))))
(build-system gnu-build-system)
(arguments
- '(;; LMDB is only supported on 64-bit systems, yet the test suite
- ;; requires it.
- #:tests? (assoc-ref %build-inputs "lmdb")
- #:phases
+ '(#:phases
(modify-phases %standard-phases
(replace 'configure
;; ldb use a custom configuration script that runs waf.
@@ -384,10 +381,7 @@ many event types, including timers, signals, and the classic file descriptor eve
`(("talloc" ,talloc)
("tdb" ,tdb)))
(inputs
- `(,@(if (target-64bit?)
- `(("lmdb" ,lmdb))
- '())
- ("popt" ,popt)
+ `(("popt" ,popt)
("tevent" ,tevent)))
(synopsis "LDAP-like embedded database")
(home-page "https://ldb.samba.org/")
diff --git a/gnu/packages/search.scm b/gnu/packages/search.scm
index e9e74817f2..386092b358 100644
--- a/gnu/packages/search.scm
+++ b/gnu/packages/search.scm
@@ -46,14 +46,15 @@
(define-public xapian
(package
(name "xapian")
- (version "1.4.5")
+ (version "1.4.6")
;; Note: When updating Xapian, remember to update xapian-bindings below.
(source (origin
(method url-fetch)
(uri (string-append "https://oligarchy.co.uk/xapian/" version
"/xapian-core-" version ".tar.xz"))
+ (patches (search-patches "xapian-revert-5489fb2f8.patch"))
(sha256
- (base32 "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5"))))
+ (base32 "166qpfq7pvyrj2w2x07v31ypvqg6c2xyvds5sms9h4g2sg0z23hy"))))
(build-system gnu-build-system)
(inputs `(("zlib" ,zlib)
("util-linux" ,util-linux)))
@@ -91,7 +92,7 @@ rich set of boolean query operators.")
"/xapian-bindings-" version ".tar.xz"))
(sha256
(base32
- "0cwx39764w24xd25w271had4w78lnw1dgz36yvlw1g3i19rqcy34"))))
+ "0z5ma66n742241ys037i3k66c6lvsywviqf33vqsf4jb7j03qsbi"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags '("--with-python3")
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 14e83b5861..4c0bceedf6 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -24,6 +24,7 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix licenses)
+ #:use-module (gnu packages)
#:use-module (gnu packages golang))
(define-public syncthing
@@ -35,6 +36,7 @@
(uri (string-append "https://github.com/syncthing/syncthing"
"/releases/download/v" version
"/syncthing-source-v" version ".tar.gz"))
+ (patches (search-patches "syncthing-fix-crash.patch"))
(sha256
(base32
"0bxkm5jlj6l4gai23bg0y31brr80r9qllh1rdg29pahjn0c2b4ml"))
diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 5dec41428b..355683df8a 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -338,7 +338,7 @@ as existing hashing techniques, with provably negligible risk of collisions.")
(define-public oniguruma
(package
(name "oniguruma")
- (version "5.9.6")
+ (version "6.8.2")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/kkos/"
@@ -346,7 +346,7 @@ as existing hashing techniques, with provably negligible risk of collisions.")
"/onig-" version ".tar.gz"))
(sha256
(base32
- "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m"))))
+ "00s9gjgb3srn5sbmx4x9bssn52mi04d868ghizssdhjlddgxmsmd"))))
(build-system gnu-build-system)
(home-page "https://github.com/kkos/oniguruma")
(synopsis "Regular expression library")
@@ -355,6 +355,20 @@ characteristic of this library is that different character encoding for every
regular expression object can be specified.")
(license license:bsd-2)))
+;; PHP < 7.3.0 requires this old version. Remove once no longer needed.
+(define-public oniguruma-5
+ (package
+ (inherit oniguruma)
+ (version "5.9.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/kkos/"
+ "oniguruma/releases/download/v" version
+ "/onig-" version ".tar.gz"))
+ (sha256
+ (base32
+ "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m"))))))
+
(define-public antiword
(package
(name "antiword")
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 2bd59ae95f..6cb3354204 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -419,7 +419,7 @@ everything from small to very large projects with speed and efficiency.")
(define-public libgit2
(package
(name "libgit2")
- (version "0.26.4")
+ (version "0.26.5")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/libgit2/libgit2/"
@@ -427,7 +427,7 @@ everything from small to very large projects with speed and efficiency.")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "15ybzypyggx64ba7i0zxnnbvzh7z34fcrkwk2xj54kmv1dha4br9"))
+ "1adhq7pk9zdj85i5j4xzimq39qy6wpsi4h9fb8vc8jsncr8qmqjj"))
(patches (search-patches "libgit2-mtime-0.patch"))
;; Remove bundled software.
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 737844d8fa..1cc0d5dfde 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2410,15 +2410,16 @@ of modern, widely supported codecs.")
(define-public openh264
(package
(name "openh264")
- (version "1.7.0")
+ (version "1.8.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/cisco/"
- name "/archive/v" version ".tar.gz"))
+ name "/releases/download/v"
+ version "/Source.Code.tar.gz.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "0gv571bqkxk7ic64dmavs1q8nr7p59mcf4ibqp4lc070gn6w61ww"))))
+ "0niha3wnn1jsndvz9vfwy2wyql8mp9j6v75vjsipy0idwan5yzgf"))))
(build-system gnu-build-system)
(native-inputs
`(("nasm" ,nasm)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 3d83a2185e..06d0fec0b0 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -10,7 +10,7 @@
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org>
@@ -752,6 +752,14 @@ style API.")
(base32
"0nmcqpaiq4pv7dymyg3n3jsd57yhp5npxl26a1hzw3m3lmj37drz"))))
(build-system cmake-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'patch-source-shebangs 'patch-tests
+ (lambda _
+ (substitute* "test/parsing/run_tests.sh"
+ (("`which echo`") (which "echo")))
+ #t)))))
(home-page "https://lloyd.github.io/yajl/")
(synopsis "C library for parsing JSON")
(description
diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 91b37556a0..2de4ff5d94 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -223,7 +223,7 @@ integrate Windows applications into your desktop.")
(define-public wine-staging-patchset-data
(package
(name "wine-staging-patchset-data")
- (version "3.11")
+ (version "3.12")
(source
(origin
(method url-fetch)
@@ -232,7 +232,7 @@ integrate Windows applications into your desktop.")
(file-name (string-append name "-" version ".zip"))
(sha256
(base32
- "1sd9chv919y0wfqcshasl82899isvq9rik4h8d44g2cf4m9zzhvi"))))
+ "1hjs36jw8k1d22c713wzwvyhfrb8mi85dpk9wpsggnnw2x57hzs0"))))
(build-system trivial-build-system)
(native-inputs
`(("bash" ,bash)
@@ -279,7 +279,7 @@ integrate Windows applications into your desktop.")
(file-name (string-append name "-" version ".tar.xz"))
(sha256
(base32
- "0zlhkz6aybkr9jg8za9x56fp92q10df0abadn9bsa8ryparr5d15"))))
+ "0zvqmd0018wvlxz4xbm5sbv7770j3l14q0ilpgs0jy49srcw116v"))))
(inputs `(("autoconf" ,autoconf) ; for autoreconf
("gtk+" ,gtk+)
("libva" ,libva)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 8b316af211..3e8f9fe4a7 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -2447,7 +2447,7 @@ including most mice, keyboards, tablets and touchscreens.")
(define-public xf86-input-libinput
(package
(name "xf86-input-libinput")
- (version "0.27.1")
+ (version "0.28.0")
(source (origin
(method url-fetch)
(uri (string-append
@@ -2455,7 +2455,7 @@ including most mice, keyboards, tablets and touchscreens.")
name "-" version ".tar.bz2"))
(sha256
(base32
- "1riflw6dc8fp5d74i7zfgsss0zz3z3lsj6zn2lzjm5kgmp2qvbfl"))))
+ "189h8vl0005yizwrs4d0sng6j8lwkd3xi1zwqg8qavn2bw34v691"))))
(build-system gnu-build-system)
(arguments
'(#:configure-flags
diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm
index d882c232cf..8c96b70731 100644
--- a/gnu/services/herd.scm
+++ b/gnu/services/herd.scm
@@ -45,6 +45,7 @@
live-service-requirement
live-service-running
+ with-shepherd-action
current-services
unload-services
unload-service
@@ -168,6 +169,8 @@ return #f."
(define-syntax-rule (with-shepherd-action service (action args ...)
result body ...)
+ "Invoke ACTION on SERVICE with the given ARGS, and evaluate BODY with RESULT
+bound to the action's result."
(invoke-action service action (list args ...)
(lambda (result) body ...)))
diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm
index 5bee02a587..5757bf8cf6 100644
--- a/gnu/services/mcron.scm
+++ b/gnu/services/mcron.scm
@@ -60,29 +60,71 @@
(define (job-file job)
(scheme-file "mcron-job" job))
+(define (shepherd-schedule-action mcron files)
+ "Return a Shepherd action that runs MCRON with '--schedule' for the given
+files."
+ (shepherd-action
+ (name 'schedule)
+ (documentation
+ "Display jobs that are going to be scheduled.")
+ (procedure
+ #~(lambda* (_ #:optional (n "5"))
+ ;; XXX: This is a global side effect.
+ (setenv "GUILE_AUTO_COMPILE" "0")
+
+ ;; Run 'mcron' in a pipe so we can explicitly redirect its output to
+ ;; 'current-output-port', which at this stage is bound to the client
+ ;; connection.
+ (let ((pipe (open-pipe* OPEN_READ
+ #$(file-append mcron "/bin/mcron")
+ (string-append "--schedule=" n)
+ #$@files)))
+ (let loop ()
+ (match (read-line pipe 'concat)
+ ((? eof-object?)
+ (catch 'system-error
+ (lambda ()
+ (zero? (close-pipe pipe)))
+ (lambda args
+ ;; There's with race between the SIGCHLD handler, which
+ ;; could call 'waitpid' before 'close-pipe' above does. If
+ ;; we get ECHILD, that means we lost the race, but that's
+ ;; fine.
+ (or (= ECHILD (system-error-errno args))
+ (apply throw args)))))
+ (line
+ (display line)
+ (loop)))))))))
+
(define mcron-shepherd-services
(match-lambda
(($ <mcron-configuration> mcron ()) ;nothing to do!
'())
(($ <mcron-configuration> mcron jobs)
- (list (shepherd-service
- (provision '(mcron))
- (requirement '(user-processes))
- (modules `((srfi srfi-1)
- (srfi srfi-26)
- ,@%default-modules))
- (start #~(make-forkexec-constructor
- (list (string-append #$mcron "/bin/mcron")
- #$@(map job-file jobs))
+ (let ((files (map job-file jobs)))
+ (list (shepherd-service
+ (provision '(mcron))
+ (requirement '(user-processes))
+ (modules `((srfi srfi-1)
+ (srfi srfi-26)
+ (ice-9 popen) ;for the 'schedule' action
+ (ice-9 rdelim)
+ (ice-9 match)
+ ,@%default-modules))
+ (start #~(make-forkexec-constructor
+ (list (string-append #$mcron "/bin/mcron") #$@files)
+
+ ;; Disable auto-compilation of the job files and set a
+ ;; sane value for 'PATH'.
+ #:environment-variables
+ (cons* "GUILE_AUTO_COMPILE=0"
+ "PATH=/run/current-system/profile/bin"
+ (remove (cut string-prefix? "PATH=" <>)
+ (environ)))))
+ (stop #~(make-kill-destructor))
- ;; Disable auto-compilation of the job files and set a
- ;; sane value for 'PATH'.
- #:environment-variables
- (cons* "GUILE_AUTO_COMPILE=0"
- "PATH=/run/current-system/profile/bin"
- (remove (cut string-prefix? "PATH=" <>)
- (environ)))))
- (stop #~(make-kill-destructor)))))))
+ (actions
+ (list (shepherd-schedule-action mcron files)))))))))
(define mcron-service-type
(service-type (name 'mcron)
diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm
index 49a65db4b5..aa3b63a0e4 100644
--- a/gnu/services/monitoring.scm
+++ b/gnu/services/monitoring.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
+;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -26,7 +27,9 @@
#:use-module (guix records)
#:use-module (ice-9 match)
#:export (darkstat-configuration
- darkstat-service-type))
+ prometheus-node-exporter-configuration
+ darkstat-service-type
+ prometheus-node-exporter-service-type))
;;;
@@ -89,3 +92,36 @@ HTTP.")
(const %darkstat-accounts))
(service-extension shepherd-root-service-type
(compose list darkstat-shepherd-service))))))
+
+(define-record-type* <prometheus-node-exporter-configuration>
+ prometheus-node-exporter-configuration
+ make-prometheus-node-exporter-configuration
+ prometheus-node-exporter-configuration?
+ (package prometheus-node-exporter-configuration-package
+ (default go-github-com-prometheus-node-exporter))
+ (web-listen-address prometheus-node-exporter-web-listen-address
+ (default ":9100")))
+
+(define prometheus-node-exporter-shepherd-service
+ (match-lambda
+ (( $ <prometheus-node-exporter-configuration>
+ package web-listen-address)
+ (shepherd-service
+ (documentation "Prometheus node exporter.")
+ (provision '(prometheus-node-exporter))
+ (requirement '(networking))
+ (start #~(make-forkexec-constructor
+ (list #$(file-append package "/bin/node_exporter")
+ "--web.listen-address" #$web-listen-address)))
+ (stop #~(make-kill-destructor))))))
+
+(define prometheus-node-exporter-service-type
+ (service-type
+ (name 'prometheus-node-exporter)
+ (description
+ "Run @command{node_exporter} to serve hardware and OS metrics to
+prometheus.")
+ (extensions
+ (list (service-extension
+ shepherd-root-service-type
+ (compose list prometheus-node-exporter-shepherd-service))))))
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 6ca53faa3d..4cd2249841 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -49,6 +49,12 @@
shepherd-service-auto-start?
shepherd-service-modules
+ shepherd-action
+ shepherd-action?
+ shepherd-action-name
+ shepherd-action-documentation
+ shepherd-action-procedure
+
%default-modules
shepherd-service-file
@@ -146,11 +152,20 @@ DEFAULT is given, use it as the service's default value."
(start shepherd-service-start) ;g-expression (procedure)
(stop shepherd-service-stop ;g-expression (procedure)
(default #~(const #f)))
+ (actions shepherd-service-actions ;list of <shepherd-action>
+ (default '()))
(auto-start? shepherd-service-auto-start? ;Boolean
(default #t))
(modules shepherd-service-modules ;list of module names
(default %default-modules)))
+(define-record-type* <shepherd-action>
+ shepherd-action make-shepherd-action
+ shepherd-action?
+ (name shepherd-action-name) ;symbol
+ (procedure shepherd-action-procedure) ;gexp
+ (documentation shepherd-action-documentation)) ;string
+
(define (shepherd-service-canonical-name service)
"Return the 'canonical name' of SERVICE."
(first (shepherd-service-provision service)))
@@ -223,7 +238,13 @@ stored."
#:requires '#$(shepherd-service-requirement service)
#:respawn? '#$(shepherd-service-respawn? service)
#:start #$(shepherd-service-start service)
- #:stop #$(shepherd-service-stop service))))))
+ #:stop #$(shepherd-service-stop service)
+ #:actions
+ (make-actions
+ #$@(map (match-lambda
+ (($ <shepherd-action> name proc doc)
+ #~(#$name #$doc #$proc)))
+ (shepherd-service-actions service))))))))
(define (shepherd-configuration-file services)
"Return the shepherd configuration file for SERVICES."
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 0efb4a6e55..f27064af85 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -632,6 +632,13 @@ non-ASCII names from /tmp.")
(wait-for-file "/root/witness-touch" marionette
#:read '(@ (ice-9 rdelim) read-string)))
+ ;; Make sure the 'schedule' action is accepted.
+ (test-equal "schedule action"
+ '(#t) ;one value, #t
+ (marionette-eval '(with-shepherd-action 'mcron ('schedule) result
+ result)
+ marionette))
+
(test-end)
(exit (= (test-runner-fail-count (test-runner-current)) 0)))))
diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm
new file mode 100644
index 0000000000..67899987ce
--- /dev/null
+++ b/gnu/tests/monitoring.scm
@@ -0,0 +1,97 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu tests monitoring)
+ #:use-module (gnu services)
+ #:use-module (gnu services monitoring)
+ #:use-module (gnu services networking)
+ #:use-module (gnu system vm)
+ #:use-module (gnu tests)
+ #:use-module (guix gexp)
+ #:export (%test-prometheus-node-exporter))
+
+
+;;;
+;;; Prometheus Node Exporter
+;;;
+
+(define* (run-prometheus-node-exporter-server-test name test-os)
+ "Run tests in %PROMETHEUS-NODE-EXPORTER-OS, which has prometheus-node-exporter running."
+ (define os
+ (marionette-operating-system
+ test-os
+ #:imported-modules '((gnu services herd))))
+
+ (define vm
+ (virtual-machine
+ (operating-system os)
+ (port-forwardings '((8080 . 9100)))))
+
+ (define test
+ (with-imported-modules '((gnu build marionette))
+ #~(begin
+ (use-modules (srfi srfi-11)
+ (srfi srfi-64)
+ (gnu build marionette)
+ (web client)
+ (web response))
+
+ (define marionette
+ (make-marionette (list #$vm)))
+
+ (mkdir #$output)
+ (chdir #$output)
+
+ (test-begin #$name)
+
+ (test-assert "prometheus-node-exporter running"
+ (marionette-eval
+ '(begin
+ (use-modules (gnu services herd))
+ (match (start-service 'prometheus-node-exporter)
+ (#f #f)
+ (('service response-parts ...)
+ (match (assq-ref response-parts 'running)
+ ((pid) (number? pid))))))
+ marionette))
+
+ (test-equal "http-get"
+ 200
+ (begin
+ (wait-for-tcp-port 9100 marionette)
+ (let-values (((response text)
+ (http-get "http://localhost:8080")))
+ (response-code response))))
+
+ (test-end)
+ (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+
+ (gexp->derivation (string-append name "-test") test))
+
+(define %prometheus-node-exporter-os
+ (simple-operating-system
+ (dhcp-client-service)
+ (service prometheus-node-exporter-service-type
+ (prometheus-node-exporter-configuration))))
+
+(define %test-prometheus-node-exporter
+ (system-test
+ (name "prometheus-node-exporter")
+ (description "Connect to a running prometheus-node-exporter server.")
+ (value (run-prometheus-node-exporter-server-test
+ name %prometheus-node-exporter-os))))
diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index 268d59c1be..26519ce5a6 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -66,7 +66,7 @@
(format #t "running \"runhaskell Setup.hs\" with command ~s \
and parameters ~s~%"
command params)
- (zero? (apply system* "runhaskell" setup-file command params)))
+ (apply invoke "runhaskell" setup-file command params))
(error "no Setup.hs nor Setup.lhs found"))))
(define* (configure #:key outputs inputs tests? (configure-flags '())
@@ -114,7 +114,8 @@ and parameters ~s~%"
(setenv "CONFIG_SHELL" "sh"))
(run-setuphs "configure" params)
- (setenv "GHC_PACKAGE_PATH" ghc-path)))
+ (setenv "GHC_PACKAGE_PATH" ghc-path)
+ #t))
(define* (build #:rest empty)
"Build a given Haskell package."
diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
index 819688a913..df785c85a7 100644
--- a/guix/build/profiles.scm
+++ b/guix/build/profiles.scm
@@ -89,7 +89,7 @@ definitions for all the SEARCH-PATHS."
# When GUIX_PROFILE is undefined, the various environment variables refer
# to this specific profile generation.
\n" port)
- (let ((variables (evaluate-search-paths (cons $PATH search-paths)
+ (let ((variables (evaluate-search-paths search-paths
(list output))))
(for-each (write-environment-variable-definition port)
(map (abstract-profile output) variables))))))
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 153b29bd42..cc3613f6f6 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -23,6 +24,7 @@
#:use-module (guix derivations)
#:use-module (guix grafts)
#:use-module (guix utils)
+ #:use-module (rnrs bytevectors)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
@@ -334,7 +336,7 @@ appears."
(%plain-file name content references)
plain-file?
(name plain-file-name) ;string
- (content plain-file-content) ;string
+ (content plain-file-content) ;string or bytevector
(references plain-file-references)) ;list (currently unused)
(define (plain-file name content)
@@ -349,8 +351,10 @@ This is the declarative counterpart of 'text-file'."
(define-gexp-compiler (plain-file-compiler (file <plain-file>) system target)
;; "Compile" FILE by adding it to the store.
(match file
- (($ <plain-file> name content references)
- (text-file name content references))))
+ (($ <plain-file> name (and (? string?) content) references)
+ (text-file name content references))
+ (($ <plain-file> name (and (? bytevector?) content) references)
+ (binary-file name content references))))
(define-record-type <computed-file>
(%computed-file name gexp guile options)
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index c2a7a33b6a..3634f4bb27 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; This file is part of GNU Guix.
@@ -82,13 +82,14 @@
(define %package-list-url
(string->uri
- (string-append %gnumaint-base-url "gnupackages.txt")))
+ (string-append %gnumaint-base-url "rec/gnupackages.rec")))
(define %package-description-url
;; This file contains package descriptions in recutils format.
- ;; See <https://lists.gnu.org/archive/html/guix-devel/2013-10/msg00071.html>.
+ ;; See <https://lists.gnu.org/archive/html/guix-devel/2013-10/msg00071.html>
+ ;; and <https://lists.gnu.org/archive/html/guix-devel/2018-06/msg00362.html>.
(string->uri
- (string-append %gnumaint-base-url "pkgblurbs.txt")))
+ (string-append %gnumaint-base-url "rec/pkgblurbs.rec")))
(define-record-type* <gnu-package-descriptor>
gnu-package-descriptor
@@ -121,7 +122,12 @@ to fetch the list of GNU packages over HTTP."
(if (null? alist)
(reverse result)
(loop (recutils->alist port)
- (cons alist result)))))
+
+ ;; Ignore things like "%rec" (info "(recutils) Record
+ ;; Descriptors").
+ (if (assoc-ref alist "package")
+ (cons alist result)
+ result)))))
(define official-description
(let ((db (read-records (fetch %package-description-url #:text? #t))))
@@ -148,12 +154,12 @@ to fetch the list of GNU packages over HTTP."
(alist->record `(("description" . ,(official-description name))
,@alist)
make-gnu-package-descriptor
- (list "package" "mundane-name" "copyright-holder"
+ (list "package" "mundane_name" "copyright_holder"
"savannah" "fsd" "language" "logo"
- "doc-category" "doc-summary" "description"
- "doc-url"
- "download-url")
- '("doc-url" "language"))))
+ "doc_category" "doc_summary" "description"
+ "doc_url"
+ "download_url")
+ '("doc_url" "language"))))
(let* ((port (fetch %package-list-url #:text? #t))
(lst (read-records port)))
(close-port port)
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 09130e4498..4cd09cac29 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -139,8 +139,8 @@ to the stack."
"Generate a parser for Cabal files."
(lalr-parser
;; --- token definitions
- (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION TRUE FALSE
- (right: IF FLAG EXEC TEST-SUITE SOURCE-REPO BENCHMARK LIB OCURLY)
+ (CCURLY VCCURLY OPAREN CPAREN TEST ID VERSION RELATION TRUE FALSE -ANY -NONE
+ (right: IF FLAG EXEC TEST-SUITE CUSTOM-SETUP SOURCE-REPO BENCHMARK LIB OCURLY)
(left: OR)
(left: PROPERTY AND)
(right: ELSE NOT))
@@ -150,6 +150,7 @@ to the stack."
(sections source-repo) : (append $1 (list $2))
(sections executables) : (append $1 $2)
(sections test-suites) : (append $1 $2)
+ (sections custom-setup) : (append $1 $2)
(sections benchmarks) : (append $1 $2)
(sections lib-sec) : (append $1 (list $2))
() : '())
@@ -172,6 +173,7 @@ to the stack."
(ts-sec) : (list $1))
(ts-sec (TEST-SUITE OCURLY exprs CCURLY) : `(section test-suite ,$1 ,$3)
(TEST-SUITE open exprs close) : `(section test-suite ,$1 ,$3))
+ (custom-setup (CUSTOM-SETUP exprs) : (list `(section custom-setup ,$1 ,$2)))
(benchmarks (benchmarks bm-sec) : (append $1 (list $2))
(bm-sec) : (list $1))
(bm-sec (BENCHMARK OCURLY exprs CCURLY) : `(section benchmark ,$1 ,$3)
@@ -211,6 +213,10 @@ to the stack."
(FALSE) : 'false
(TEST OPAREN ID RELATION VERSION CPAREN)
: `(,$1 ,(string-append $3 " " $4 " " $5))
+ (TEST OPAREN ID -ANY CPAREN)
+ : `(,$1 ,(string-append $3 " -any"))
+ (TEST OPAREN ID -NONE CPAREN)
+ : `(,$1 ,(string-append $3 " -none"))
(TEST OPAREN ID RELATION VERSION AND RELATION VERSION CPAREN)
: `(and (,$1 ,(string-append $3 " " $4 " " $5))
(,$1 ,(string-append $3 " " $7 " " $8)))
@@ -349,6 +355,9 @@ matching a string against the created regexp."
(define is-test-suite (make-rx-matcher "^test-suite +([a-z0-9_-]+)"
regexp/icase))
+(define is-custom-setup (make-rx-matcher "^(custom-setup)"
+ regexp/icase))
+
(define is-benchmark (make-rx-matcher "^benchmark +([a-z0-9_-]+)"
regexp/icase))
@@ -362,13 +371,17 @@ matching a string against the created regexp."
(define (is-false s) (string-ci=? s "false"))
+(define (is-any s) (string-ci=? s "-any"))
+
+(define (is-none s) (string-ci=? s "-none"))
+
(define (is-and s) (string=? s "&&"))
(define (is-or s) (string=? s "||"))
(define (is-id s port)
(let ((cabal-reserved-words
- '("if" "else" "library" "flag" "executable" "test-suite"
+ '("if" "else" "library" "flag" "executable" "test-suite" "custom-setup"
"source-repository" "benchmark"))
(spaces (read-while (cut char-set-contains? char-set:blank <>) port))
(c (peek-char port)))
@@ -392,8 +405,11 @@ matching a string against the created regexp."
(define (lex-version loc port)
(make-lexical-token 'VERSION loc
- (read-while char-numeric? port
- (cut char=? #\. <>) char-numeric?)))
+ (read-while (lambda (x)
+ (or (char-numeric? x)
+ (char=? x #\*)
+ (char=? x #\.)))
+ port)))
(define* (read-while is? port #:optional
(is-if-followed-by? (lambda (c) #f))
@@ -435,6 +451,8 @@ string with the read characters."
(define (lex-test-suite ts-rx-res loc) (lex-rx-res ts-rx-res 'TEST-SUITE loc))
+(define (lex-custom-setup ts-rx-res loc) (lex-rx-res ts-rx-res 'CUSTOM-SETUP loc))
+
(define (lex-benchmark bm-rx-res loc) (lex-rx-res bm-rx-res 'BENCHMARK loc))
(define (lex-lib loc) (make-lexical-token 'LIB loc #f))
@@ -447,6 +465,10 @@ string with the read characters."
(define (lex-false loc) (make-lexical-token 'FALSE loc #f))
+(define (lex-any loc) (make-lexical-token '-ANY loc #f))
+
+(define (lex-none loc) (make-lexical-token '-NONE loc #f))
+
(define (lex-and loc) (make-lexical-token 'AND loc #f))
(define (lex-or loc) (make-lexical-token 'OR loc #f))
@@ -514,6 +536,8 @@ LOC is the current port location."
((is-test w port) (lex-test w loc))
((is-true w) (lex-true loc))
((is-false w) (lex-false loc))
+ ((is-any w) (lex-any loc))
+ ((is-none w) (lex-none loc))
((is-and w) (lex-and loc))
((is-or w) (lex-or loc))
((is-id w port) (lex-id w loc))
@@ -529,6 +553,7 @@ the current port location."
((is-src-repo s) => (cut lex-src-repo <> loc))
((is-exec s) => (cut lex-exec <> loc))
((is-test-suite s) => (cut lex-test-suite <> loc))
+ ((is-custom-setup s) => (cut lex-custom-setup <> loc))
((is-benchmark s) => (cut lex-benchmark <> loc))
((is-lib s) (lex-lib loc))
((is-else s) (lex-else loc))
@@ -658,6 +683,12 @@ If #f use the function 'port-filename' to obtain it."
(name cabal-test-suite-name)
(dependencies cabal-test-suite-dependencies)) ; list of <cabal-dependency>
+(define-record-type <cabal-custom-setup>
+ (make-cabal-custom-setup name dependencies)
+ cabal-custom-setup?
+ (name cabal-custom-setuo-name)
+ (dependencies cabal-custom-setup-dependencies)) ; list of <cabal-dependency>
+
(define (cabal-flags->alist flag-list)
"Retrun an alist associating the flag name to its default value from a
list of <cabal-flag> objects."
@@ -694,13 +725,20 @@ the ordering operation and the version."
(let* ((with-ver-matcher-fn (make-rx-matcher
"([a-zA-Z0-9_-]+) *([<>=]+) *([0-9.]+) *"))
(without-ver-matcher-fn (make-rx-matcher "([a-zA-Z0-9_-]+)"))
+ (without-ver-matcher-fn-2 (make-rx-matcher "([a-zA-Z0-9_-]+) (-any|-none)"))
(name (or (and=> (with-ver-matcher-fn spec)
(cut match:substring <> 1))
+ (and=> (without-ver-matcher-fn-2 spec)
+ (cut match:substring <> 1))
(match:substring (without-ver-matcher-fn spec) 1)))
- (operator (and=> (with-ver-matcher-fn spec)
- (cut match:substring <> 2)))
- (version (and=> (with-ver-matcher-fn spec)
- (cut match:substring <> 3))))
+ (operator (or (and=> (with-ver-matcher-fn spec)
+ (cut match:substring <> 2))
+ (and=> (without-ver-matcher-fn-2 spec)
+ (cut match:substring <> 2))))
+ (version (or (and=> (with-ver-matcher-fn spec)
+ (cut match:substring <> 3))
+ (and=> (without-ver-matcher-fn-2 spec)
+ (cut match:substring <> 2)))))
(values name operator version)))
(define (impl haskell)
@@ -716,6 +754,8 @@ the ordering operation and the version."
((string= spec-op ">") (version>? comp-ver spec-ver))
((string= spec-op "<=") (not (version>? comp-ver spec-ver)))
((string= spec-op "<") (not (version>=? comp-ver spec-ver)))
+ ((string= spec-op "-any") #t)
+ ((string= spec-op "-none") #f)
(else
(raise (condition
(&message (message "Failed to evaluate 'impl' test."))))))
@@ -728,7 +768,6 @@ the ordering operation and the version."
(let ((value (or (assoc-ref env name)
(assoc-ref (cabal-flags->alist (cabal-flags)) name))))
(if (eq? value 'false) #f #t)))
-
(define (eval sexp)
(match sexp
(() '())
@@ -755,6 +794,8 @@ the ordering operation and the version."
;; no need to evaluate flag parameters
(('section 'flag name parameters)
(list 'section 'flag name parameters))
+ (('section 'custom-setup parameters)
+ (list 'section 'custom-setup parameters))
;; library does not have a name parameter
(('section 'library parameters)
(list 'section 'library (eval parameters)))
@@ -795,12 +836,15 @@ See the manual for limitations.")))))))
(define (make-cabal-section sexp section-type)
"Given an SEXP as produced by 'read-cabal', produce a list of objects
pertaining to SECTION-TYPE sections. SECTION-TYPE must be one of:
-'executable, 'flag, 'test-suite, 'source-repository or 'library."
+'executable, 'flag, 'test-suite, 'custom-setup, 'source-repository or
+'library."
(filter-map (cut match <>
(('section (? (cut equal? <> section-type)) name parameters)
(case section-type
((test-suite) (make-cabal-test-suite
name (dependencies parameters)))
+ ((custom-setup) (make-cabal-custom-setup
+ name (dependencies parameters "setup-depends")))
((executable) (make-cabal-executable
name (dependencies parameters)))
((source-repository) (make-cabal-source-repository
@@ -843,10 +887,10 @@ to be added between the values found in different key/value pairs."
(define dependency-name-version-rx
(make-regexp "([a-zA-Z0-9_-]+) *(.*)"))
-(define (dependencies key-values-list)
+(define* (dependencies key-values-list #:optional (key "build-depends"))
"Return a list of 'cabal-dependency' objects for the dependencies found in
KEY-VALUES-LIST."
- (let ((deps (string-tokenize (lookup-join key-values-list "build-depends" ",")
+ (let ((deps (string-tokenize (lookup-join key-values-list key ",")
(char-set-complement (char-set #\,)))))
(map (lambda (d)
(let ((rx-result (regexp-exec dependency-name-version-rx d)))
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 646163fb7b..ea576b5e4a 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -33,7 +34,8 @@
#:use-module (guix base32)
#:use-module (guix build-system ruby)
#:export (gem->guix-package
- %gem-updater))
+ %gem-updater
+ gem-recursive-import))
(define (rubygems-fetch name)
"Return an alist representation of the RubyGems metadata for the package NAME,
@@ -115,29 +117,30 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
((license) (license->symbol license))
(_ `(list ,@(map license->symbol licenses)))))))
-(define* (gem->guix-package package-name #:optional version)
+(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
"Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
`package' s-expression corresponding to that package, or #f on failure."
(let ((package (rubygems-fetch package-name)))
(and package
- (let ((name (assoc-ref package "name"))
- (version (assoc-ref package "version"))
- (hash (assoc-ref package "sha"))
- (synopsis (assoc-ref package "info")) ; nothing better to use
- (description (beautify-description
- (assoc-ref package "info")))
- (home-page (assoc-ref package "homepage_uri"))
- (dependencies (map (lambda (dep)
- (let ((name (assoc-ref dep "name")))
- (if (string=? name "bundler")
- "bundler" ; special case, no prefix
- (ruby-package-name name))))
- (assoc-ref* package "dependencies"
- "runtime")))
- (licenses (map string->license
- (assoc-ref package "licenses"))))
- (make-gem-sexp name version hash home-page synopsis
- description dependencies licenses)))))
+ (let* ((name (assoc-ref package "name"))
+ (version (assoc-ref package "version"))
+ (hash (assoc-ref package "sha"))
+ (synopsis (assoc-ref package "info")) ; nothing better to use
+ (description (beautify-description
+ (assoc-ref package "info")))
+ (home-page (assoc-ref package "homepage_uri"))
+ (dependencies-names (map (lambda (dep) (assoc-ref dep "name"))
+ (assoc-ref* package "dependencies" "runtime")))
+ (dependencies (map (lambda (dep)
+ (if (string=? dep "bundler")
+ "bundler" ; special case, no prefix
+ (ruby-package-name dep)))
+ dependencies-names))
+ (licenses (map string->license
+ (assoc-ref package "licenses"))))
+ (values (make-gem-sexp name version hash home-page synopsis
+ description dependencies licenses)
+ dependencies-names)))))
(define (guix-package->gem-name package)
"Given a PACKAGE built from rubygems.org, return the name of the
@@ -192,3 +195,8 @@ package on RubyGems."
(description "Updater for RubyGem packages")
(pred gem-package?)
(latest latest-release)))
+
+(define* (gem-recursive-import package-name #:optional version)
+ (recursive-import package-name '()
+ #:repo->guix-package gem->guix-package
+ #:guix-name ruby-package-name))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
new file mode 100644
index 0000000000..f252bdc31a
--- /dev/null
+++ b/guix/import/opam.scm
@@ -0,0 +1,193 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (guix import opam)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 vlist)
+ #:use-module ((ice-9 rdelim) #:select (read-line))
+ #:use-module (srfi srfi-1)
+ #:use-module (web uri)
+ #:use-module (guix http-client)
+ #:use-module (guix utils)
+ #:use-module (guix import utils)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:export (opam->guix-package))
+
+(define (opam-urls)
+ "Fetch the urls.txt file from the opam repository and returns the list of
+URLs it contains."
+ (let ((port (http-fetch/cached (string->uri "https://opam.ocaml.org/urls.txt"))))
+ (let loop ((result '()))
+ (let ((line (read-line port)))
+ (if (eof-object? line)
+ (begin
+ (close port)
+ result)
+ (loop (cons line result)))))))
+
+(define (vhash-ref hashtable key default)
+ (match (vhash-assoc key hashtable)
+ (#f default)
+ ((_ . x) x)))
+
+(define (hashtable-update hashtable line)
+ "Parse @var{line} to get the name and version of the package and adds them
+to the hashtable."
+ (let* ((line (string-split line #\ )))
+ (match line
+ ((url foo ...)
+ (if (equal? url "repo")
+ hashtable
+ (match (string-split url #\/)
+ ((type name1 versionstr foo ...)
+ (if (equal? type "packages")
+ (match (string-split versionstr #\.)
+ ((name2 versions ...)
+ (let ((version (string-join versions ".")))
+ (if (equal? name1 name2)
+ (let ((curr (vhash-ref hashtable name1 '())))
+ (vhash-cons name1 (cons version curr) hashtable))
+ hashtable)))
+ (_ hashtable))
+ hashtable))
+ (_ hashtable))))
+ (_ hashtable))))
+
+(define (urls->hashtable urls)
+ "Transform urls.txt in a hashtable whose keys are package names and values
+the list of available versions."
+ (let ((hashtable vlist-null))
+ (let loop ((urls urls) (hashtable hashtable))
+ (match urls
+ (() hashtable)
+ ((url rest ...) (loop rest (hashtable-update hashtable url)))))))
+
+(define (latest-version versions)
+ "Find the most recent version from a list of versions."
+ (match versions
+ ((first rest ...)
+ (let loop ((versions rest) (m first))
+ (match versions
+ (() m)
+ ((first rest ...)
+ (loop rest (if (version>? m first) m first))))))))
+
+(define (fetch-package-url uri)
+ "Fetch and parse the url file. Return the URL the package can be downloaded
+from."
+ (let ((port (http-fetch uri)))
+ (let loop ((result #f))
+ (let ((line (read-line port)))
+ (if (eof-object? line)
+ (begin
+ (close port)
+ result)
+ (let* ((line (string-split line #\ )))
+ (match line
+ ((key value rest ...)
+ (if (member key '("archive:" "http:"))
+ (loop (string-trim-both value #\"))
+ (loop result))))))))))
+
+(define (fetch-package-metadata uri)
+ "Fetch and parse the opam file. Return an association list containing the
+homepage, the license and the list of inputs."
+ (let ((port (http-fetch uri)))
+ (let loop ((result '()) (dependencies? #f))
+ (let ((line (read-line port)))
+ (if (eof-object? line)
+ (begin
+ (close port)
+ result)
+ (let* ((line (string-split line #\ )))
+ (match line
+ ((key value ...)
+ (let ((dependencies?
+ (if dependencies?
+ (not (equal? key "]"))
+ (equal? key "depends:")))
+ (val (string-trim-both (string-join value "") #\")))
+ (cond
+ ((equal? key "homepage:")
+ (loop (cons `("homepage" . ,val) result) dependencies?))
+ ((equal? key "license:")
+ (loop (cons `("license" . ,val) result) dependencies?))
+ ((and dependencies? (not (equal? val "[")))
+ (match (string-split val #\{)
+ ((val rest ...)
+ (let ((curr (assoc-ref result "inputs"))
+ (new (string-trim-both
+ val (list->char-set '(#\] #\[ #\")))))
+ (loop (cons `("inputs" . ,(cons new (if curr curr '()))) result)
+ (if (string-contains val "]") #f dependencies?))))))
+ (else (loop result dependencies?))))))))))))
+
+(define (string->license str)
+ (cond
+ ((equal? str "MIT") '(license:expat))
+ ((equal? str "GPL2") '(license:gpl2))
+ ((equal? str "LGPLv2") '(license:lgpl2))
+ (else `())))
+
+(define (ocaml-name->guix-name name)
+ (cond
+ ((equal? name "ocamlfind") "ocaml-findlib")
+ ((string-prefix? "ocaml" name) name)
+ ((string-prefix? "conf-" name) (substring name 5))
+ (else (string-append "ocaml-" name))))
+
+(define (dependencies->inputs dependencies)
+ "Transform the list of dependencies in a list of inputs."
+ (if (not dependencies)
+ '()
+ (map (lambda (input)
+ (list input (list 'unquote (string->symbol input))))
+ (map ocaml-name->guix-name dependencies))))
+
+(define (opam->guix-package name)
+ (let* ((hashtable (urls->hashtable (opam-urls)))
+ (versions (vhash-ref hashtable name #f)))
+ (unless (eq? versions #f)
+ (let* ((version (latest-version versions))
+ (package-url (string-append "https://opam.ocaml.org/packages/" name
+ "/" name "." version "/"))
+ (url-url (string-append package-url "url"))
+ (opam-url (string-append package-url "opam"))
+ (source-url (fetch-package-url url-url))
+ (metadata (fetch-package-metadata opam-url))
+ (dependencies (assoc-ref metadata "inputs"))
+ (inputs (dependencies->inputs dependencies)))
+ (call-with-temporary-output-file
+ (lambda (temp port)
+ (and (url-fetch source-url temp)
+ `(package
+ (name ,(ocaml-name->guix-name name))
+ (version ,version)
+ (source
+ (origin
+ (method url-fetch)
+ (uri ,source-url)
+ (sha256 (base32 ,(guix-hash-url temp)))))
+ (build-system ocaml-build-system)
+ ,@(if (null? inputs)
+ '()
+ `((inputs ,(list 'quasiquote inputs))))
+ (home-page ,(assoc-ref metadata "homepage"))
+ (synopsis "")
+ (description "")
+ (license ,@(string->license (assoc-ref metadata "license")))))))))))
diff --git a/guix/profiles.scm b/guix/profiles.scm
index e6b77e8d38..d2a794b187 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -91,6 +91,7 @@
manifest-lookup
manifest-installed?
manifest-matching-entries
+ manifest-search-paths
manifest-transaction
manifest-transaction?
@@ -109,6 +110,7 @@
ca-certificate-bundle
%default-profile-hooks
profile-derivation
+ profile-search-paths
generation-number
generation-numbers
@@ -545,6 +547,14 @@ no match.."
(filter matches? (manifest-entries manifest)))
+(define (manifest-search-paths manifest)
+ "Return the list of search path specifications that apply to MANIFEST,
+including the search path specification for $PATH."
+ (delete-duplicates
+ (cons $PATH
+ (append-map manifest-entry-search-paths
+ (manifest-entries manifest)))))
+
;;;
;;; Manifest transactions.
@@ -1367,8 +1377,7 @@ are cross-built for TARGET."
(map sexp->search-path-specification
(delete-duplicates
'#$(map search-path-specification->sexp
- (append-map manifest-entry-search-paths
- (manifest-entries manifest))))))
+ (manifest-search-paths manifest)))))
(build-profile #$output '#$inputs
#:symlink #$(if relative-symlinks?
@@ -1392,6 +1401,19 @@ are cross-built for TARGET."
;; to have no substitute to offer.
#:substitutable? #f)))
+(define* (profile-search-paths profile
+ #:optional (manifest (profile-manifest profile))
+ #:key (getenv (const #f)))
+ "Read the manifest of PROFILE and evaluate the values of search path
+environment variables required by PROFILE; return a list of
+specification/value pairs. If MANIFEST is not #f, it is assumed to be the
+manifest of PROFILE, which avoids rereading it.
+
+Use GETENV to determine the current settings and report only settings not
+already effective."
+ (evaluate-search-paths (manifest-search-paths manifest)
+ (list profile) getenv))
+
(define (profile-regexp profile)
"Return a regular expression that matches PROFILE's name and number."
(make-regexp (string-append "^" (regexp-quote (basename profile))
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index f8a9702b30..1c04800e42 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2018 David Thompson <davet@gnu.org>
-;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Mike Gerwitz <mtg@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -49,11 +49,6 @@
#:use-module (srfi srfi-98)
#:export (guix-environment))
-(define (evaluate-profile-search-paths profile search-paths)
- "Evaluate SEARCH-PATHS, a list of search-path specifications, for the
-directories in PROFILE, the store path of a profile."
- (evaluate-search-paths search-paths (list profile)))
-
;; Protect some env vars from purification. Borrowed from nix-shell.
(define %precious-variables
'("HOME" "USER" "LOGNAME" "DISPLAY" "TERM" "TZ" "PAGER"))
@@ -70,8 +65,8 @@ as 'HOME' and 'USER' are left untouched."
(((names . _) ...)
names)))))
-(define (create-environment profile paths pure?)
- "Set the environment variables specified by PATHS for PROFILE. When PURE?
+(define* (create-environment profile manifest #:key pure?)
+ "Set the environment variables specified by MANIFEST for PROFILE. When PURE?
is #t, unset the variables in the current environment. Otherwise, augment
existing environment variables with additional search paths."
(when pure? (purify-environment))
@@ -84,53 +79,41 @@ existing environment variables with additional search paths."
(string-append value separator current)
value)
value)))))
- (evaluate-profile-search-paths profile paths))
+ (profile-search-paths profile manifest))
;; Give users a way to know that they're in 'guix environment', so they can
;; adjust 'PS1' accordingly, for instance. Set it to PROFILE so users can
;; conveniently access its contents.
(setenv "GUIX_ENVIRONMENT" profile))
-(define (show-search-paths profile search-paths pure?)
- "Display SEARCH-PATHS applied to PROFILE. When PURE? is #t, do not augment
-existing environment variables with additional search paths."
+(define* (show-search-paths profile manifest #:key pure?)
+ "Display the search paths of MANIFEST applied to PROFILE. When PURE? is #t,
+do not augment existing environment variables with additional search paths."
(for-each (match-lambda
((search-path . value)
(display
(search-path-definition search-path value
#:kind (if pure? 'exact 'prefix)))
(newline)))
- (evaluate-profile-search-paths profile search-paths)))
+ (profile-search-paths profile manifest)))
-(define (strip-input-name input)
- "Remove the name element from the tuple INPUT."
+(define (input->manifest-entry input)
+ "Return a manifest entry for INPUT, or #f if INPUT does not correspond to a
+package."
(match input
- ((_ package) package)
- ((_ package output)
- (list package output))))
-
-(define (package+propagated-inputs package output)
- "Return the union of PACKAGE's OUTPUT and its transitive propagated inputs."
- (cons (list package output)
- (map strip-input-name
- (package-transitive-propagated-inputs package))))
-
-(define (package-or-package+output? expr)
- "Return #t if EXPR is a package or a 2 element list consisting of a package
-and an output string."
- (match expr
- ((or (? package?) ; bare package object
- ((? package?) (? string?))) ; package+output tuple
- #t)
- (_ #f)))
+ ((_ (? package? package))
+ (package->manifest-entry package))
+ ((_ (? package? package) output)
+ (package->manifest-entry package output))
+ (_
+ #f)))
(define (package-environment-inputs package)
- "Return a list of the transitive input packages for PACKAGE."
+ "Return a list of manifest entries corresponding to the transitive input
+packages for PACKAGE."
;; Remove non-package inputs such as origin records.
- (filter package-or-package+output?
- (map strip-input-name
- (bag-transitive-inputs
- (package->bag package)))))
+ (filter-map input->manifest-entry
+ (bag-transitive-inputs (package->bag package))))
(define (show-help)
(display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
@@ -287,55 +270,50 @@ COMMAND or an interactive shell in that environment.\n"))
(_ memo)))
'() alist))
-(define (compact lst)
- "Remove all #f elements from LST."
- (filter identity lst))
-
(define (options/resolve-packages opts)
- "Return OPTS with package specification strings replaced by actual
-packages."
- (define (package->output package mode)
- (match package
- ((? package?)
- (list mode package "out"))
- (((? package? package) (? string? output))
- (list mode package output))))
+ "Return OPTS with package specification strings replaced by manifest entries
+for the corresponding packages."
+ (define (manifest-entry=? e1 e2)
+ (and (eq? (manifest-entry-item e1) (manifest-entry-item e2))
+ (string=? (manifest-entry-output e1)
+ (manifest-entry-output e2))))
(define (packages->outputs packages mode)
(match packages
- ((? package-or-package+output? package) ; single package
- (list (package->output package mode)))
- (((? package-or-package+output?) ...) ; many packages
- (map (cut package->output <> mode) packages))))
-
- (define (manifest->outputs manifest)
- (map (lambda (entry)
- (cons 'ad-hoc-package ; manifests are implicitly ad-hoc
- (if (package? (manifest-entry-item entry))
- (list (manifest-entry-item entry)
- (manifest-entry-output entry))
- ;; Direct store paths have no output.
- (list (manifest-entry-item entry)))))
- (manifest-entries manifest)))
-
- (compact
- (append-map (match-lambda
- (('package mode (? string? spec))
- (let-values (((package output)
- (specification->package+output spec)))
- (list (list mode package output))))
- (('expression mode str)
- ;; Add all the outputs of the package STR evaluates to.
- (packages->outputs (read/eval str) mode))
- (('load mode file)
- ;; Add all the outputs of the package defined in FILE.
- (let ((module (make-user-module '())))
- (packages->outputs (load* file module) mode)))
- (('manifest . file)
- (let ((module (make-user-module '((guix profiles) (gnu)))))
- (manifest->outputs (load* file module))))
- (_ '(#f)))
- opts)))
+ ((? package? package)
+ (if (eq? mode 'ad-hoc-package)
+ (list (package->manifest-entry package))
+ (package-environment-inputs package)))
+ (((? package? package) (? string? output))
+ (if (eq? mode 'ad-hoc-package)
+ (list (package->manifest-entry package output))
+ (package-environment-inputs package)))
+ ((lst ...)
+ (append-map (cut packages->outputs <> mode) lst))))
+
+ (manifest
+ (delete-duplicates
+ (append-map (match-lambda
+ (('package 'ad-hoc-package (? string? spec))
+ (let-values (((package output)
+ (specification->package+output spec)))
+ (list (package->manifest-entry package output))))
+ (('package 'package (? string? spec))
+ (package-environment-inputs
+ (specification->package+output spec)))
+ (('expression mode str)
+ ;; Add all the outputs of the package STR evaluates to.
+ (packages->outputs (read/eval str) mode))
+ (('load mode file)
+ ;; Add all the outputs of the package defined in FILE.
+ (let ((module (make-user-module '())))
+ (packages->outputs (load* file module) mode)))
+ (('manifest . file)
+ (let ((module (make-user-module '((guix profiles) (gnu)))))
+ (manifest-entries (load* file module))))
+ (_ '()))
+ opts)
+ manifest-entry=?)))
(define* (build-environment derivations opts)
"Build the DERIVATIONS required by the environment using the build options
@@ -350,11 +328,10 @@ in OPTS."
(return #f)
(built-derivations derivations)))))
-(define (inputs->profile-derivation inputs system bootstrap?)
- "Return the derivation for a profile consisting of INPUTS for SYSTEM.
-BOOTSTRAP? specifies whether to use the bootstrap Guile to build the
-profile."
- (profile-derivation (packages->manifest inputs)
+(define (manifest->derivation manifest system bootstrap?)
+ "Return the derivation for a profile of MANIFEST.
+BOOTSTRAP? specifies whether to use the bootstrap Guile to build the profile."
+ (profile-derivation manifest
#:system system
;; Packages can have conflicting inputs, or explicit
@@ -397,32 +374,34 @@ and suitable for 'exit'."
(define exit/status (compose exit status->exit-code))
(define primitive-exit/status (compose primitive-exit status->exit-code))
-(define (launch-environment command inputs paths pure?)
+(define* (launch-environment command profile manifest
+ #:key pure?)
"Run COMMAND in a new environment containing INPUTS, using the native search
paths defined by the list PATHS. When PURE?, pre-existing environment
variables are cleared before setting the new ones."
;; Properly handle SIGINT, so pressing C-c in an interactive terminal
;; application works.
(sigaction SIGINT SIG_DFL)
- (create-environment inputs paths pure?)
+ (create-environment profile manifest #:pure? pure?)
(match command
((program . args)
(apply execlp program program args))))
-(define (launch-environment/fork command inputs paths pure?)
- "Run COMMAND in a new process with an environment containing INPUTS, using
-the native search paths defined by the list PATHS. When PURE?, pre-existing
-environment variables are cleared before setting the new ones."
+(define* (launch-environment/fork command profile manifest #:key pure?)
+ "Run COMMAND in a new process with an environment containing PROFILE, with
+the search paths specified by MANIFEST. When PURE?, pre-existing environment
+variables are cleared before setting the new ones."
(match (primitive-fork)
- (0 (launch-environment command inputs paths pure?))
+ (0 (launch-environment command profile manifest
+ #:pure? pure?))
(pid (match (waitpid pid)
((_ . status) status)))))
(define* (launch-environment/container #:key command bash user user-mappings
- profile paths link-profile? network?)
+ profile manifest link-profile? network?)
"Run COMMAND within a container that features the software in PROFILE.
-Environment variables are set according to PATHS, a list of native search
-paths. The global shell is BASH, a file name for a GNU Bash binary in the
+Environment variables are set according to the search paths of MANIFEST.
+The global shell is BASH, a file name for a GNU Bash binary in the
store. When NETWORK?, access to the host system network is permitted.
USER-MAPPINGS, a list of file system mappings, contains the user-specified
host file systems to mount inside the container. If USER is not #f, each
@@ -514,7 +493,7 @@ will be used for the passwd entry. LINK-PROFILE? creates a symbolic link from
(primitive-exit/status
;; A container's environment is already purified, so no need to
;; request it be purified again.
- (launch-environment command profile paths #f)))
+ (launch-environment command profile manifest #:pure? #f)))
#:namespaces (if network?
(delq 'net %namespaces) ; share host network
%namespaces)))))))
@@ -671,25 +650,8 @@ message if any test fails."
;; within the container.
'("/bin/sh")
(list %default-shell))))
- (packages (options/resolve-packages opts))
- (mappings (pick-all opts 'file-system-mapping))
- (inputs (delete-duplicates
- (append-map (match-lambda
- (('ad-hoc-package package output)
- (package+propagated-inputs package
- output))
- (('package package _)
- (package-environment-inputs package)))
- packages)))
- (paths (delete-duplicates
- (cons $PATH
- (append-map (match-lambda
- ((or ((? package? p) _ ...)
- (? package? p))
- (package-native-search-paths p))
- (_ '()))
- inputs))
- eq?)))
+ (manifest (options/resolve-packages opts))
+ (mappings (pick-all opts 'file-system-mapping)))
(when container? (assert-container-features))
@@ -714,8 +676,8 @@ message if any test fails."
(mlet* %store-monad ((bash (environment-bash container?
bootstrap?
system))
- (prof-drv (inputs->profile-derivation
- inputs system bootstrap?))
+ (prof-drv (manifest->derivation
+ manifest system bootstrap?))
(profile -> (derivation->output-path prof-drv))
(gc-root -> (assoc-ref opts 'gc-root)))
@@ -734,7 +696,7 @@ message if any test fails."
((assoc-ref opts 'dry-run?)
(return #t))
((assoc-ref opts 'search-paths)
- (show-search-paths profile paths pure?)
+ (show-search-paths profile manifest #:pure? pure?)
(return #t))
(container?
(let ((bash-binary
@@ -747,11 +709,11 @@ message if any test fails."
#:user user
#:user-mappings mappings
#:profile profile
- #:paths paths
+ #:manifest manifest
#:link-profile? link-prof?
#:network? network?)))
(else
(return
(exit/status
- (launch-environment/fork command profile
- paths pure?)))))))))))))
+ (launch-environment/fork command profile manifest
+ #:pure? pure?)))))))))))))
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index f8cb85700d..0b326e1049 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -75,7 +75,7 @@ rather than \\n."
;;;
(define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" "gem"
- "cran" "crate" "texlive" "json"))
+ "cran" "crate" "texlive" "json" "opam"))
(define (resolve-importer name)
(let ((module (resolve-interface
diff --git a/guix/scripts/import/gem.scm b/guix/scripts/import/gem.scm
index 349a0a072a..b6d9ccaae4 100644
--- a/guix/scripts/import/gem.scm
+++ b/guix/scripts/import/gem.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
+;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-37)
+ #:use-module (srfi srfi-41)
#:use-module (ice-9 match)
#:use-module (ice-9 format)
#:export (guix-import-gem))
@@ -44,6 +46,9 @@ Import and convert the RubyGems package for PACKAGE-NAME.\n"))
-h, --help display this help and exit"))
(display (G_ "
-V, --version display version information and exit"))
+ (display (G_ "
+ -r, --recursive generate package expressions for all Gem packages\
+ that are not yet in Guix"))
(newline)
(show-bug-report-information))
@@ -56,6 +61,9 @@ Import and convert the RubyGems package for PACKAGE-NAME.\n"))
(option '(#\V "version") #f #f
(lambda args
(show-version-and-exit "guix import pypi")))
+ (option '(#\r "recursive") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'recursive #t result)))
%standard-import-options))
@@ -81,11 +89,20 @@ Import and convert the RubyGems package for PACKAGE-NAME.\n"))
(reverse opts))))
(match args
((package-name)
- (let ((sexp (gem->guix-package package-name)))
- (unless sexp
- (leave (G_ "failed to download meta-data for package '~a'~%")
- package-name))
- sexp))
+ (if (assoc-ref opts 'recursive)
+ (map (match-lambda
+ ((and ('package ('name name) . rest) pkg)
+ `(define-public ,(string->symbol name)
+ ,pkg))
+ (_ #f))
+ (reverse
+ (stream->list
+ (gem-recursive-import package-name 'rubygems))))
+ (let ((sexp (gem->guix-package package-name)))
+ (unless sexp
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ package-name))
+ sexp)))
(()
(leave (G_ "too few arguments~%")))
((many ...)
diff --git a/guix/scripts/import/opam.scm b/guix/scripts/import/opam.scm
new file mode 100644
index 0000000000..b549878742
--- /dev/null
+++ b/guix/scripts/import/opam.scm
@@ -0,0 +1,92 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts import opam)
+ #:use-module (guix ui)
+ #:use-module (guix utils)
+ #:use-module (guix scripts)
+ #:use-module (guix import opam)
+ #:use-module (guix scripts import)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-37)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 format)
+ #:export (guix-import-opam))
+
+
+;;;
+;;; Command-line options.
+;;;
+
+(define %default-options
+ '())
+
+(define (show-help)
+ (display (G_ "Usage: guix import opam PACKAGE-NAME
+Import and convert the opam package for PACKAGE-NAME.\n"))
+ (display (G_ "
+ -h, --help display this help and exit"))
+ (display (G_ "
+ -V, --version display version information and exit"))
+ (newline)
+ (show-bug-report-information))
+
+(define %options
+ ;; Specification of the command-line options.
+ (cons* (option '(#\h "help") #f #f
+ (lambda args
+ (show-help)
+ (exit 0)))
+ (option '(#\V "version") #f #f
+ (lambda args
+ (show-version-and-exit "guix import opam")))
+ %standard-import-options))
+
+
+;;;
+;;; Entry point.
+;;;
+
+(define (guix-import-opam . args)
+ (define (parse-options)
+ ;; Return the alist of option values.
+ (args-fold* args %options
+ (lambda (opt name arg result)
+ (leave (G_ "~A: unrecognized option~%") name))
+ (lambda (arg result)
+ (alist-cons 'argument arg result))
+ %default-options))
+
+ (let* ((opts (parse-options))
+ (args (filter-map (match-lambda
+ (('argument . value)
+ value)
+ (_ #f))
+ (reverse opts))))
+ (match args
+ ((package-name)
+ (let ((sexp (opam->guix-package package-name)))
+ (unless sexp
+ (leave (G_ "failed to download meta-data for package '~a'~%")
+ package-name))
+ sexp))
+ (()
+ (leave (G_ "too few arguments~%")))
+ ((many ...)
+ (leave (G_ "too many arguments~%"))))))
diff --git a/guix/store.scm b/guix/store.scm
index bac42f2738..cc5c24a77d 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -77,6 +78,7 @@
add-data-to-store
add-text-to-store
add-to-store
+ binary-file
build-things
build
query-failed-paths
@@ -1362,7 +1364,18 @@ taking the store as its first argument."
;; Store monad operators.
;;
-(define* (text-file name text
+(define* (binary-file name
+ data ;bytevector
+ #:optional (references '()))
+ "Return as a monadic value the absolute file name in the store of the file
+containing DATA, a bytevector. REFERENCES is a list of store items that the
+resulting text file refers to; it defaults to the empty list."
+ (lambda (store)
+ (values (add-data-to-store store name data references)
+ store)))
+
+(define* (text-file name
+ text ;string
#:optional (references '()))
"Return as a monadic value the absolute file name in the store of the file
containing TEXT, a string. REFERENCES is a list of store items that the
diff --git a/guix/ui.scm b/guix/ui.scm
index 6a5feaa953..29c0b2b9ce 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1428,7 +1428,7 @@ DURATION-RELATION with the current time."
(format #t "~a~%" header)))))
(define (display-profile-content-diff profile gen1 gen2)
- "Display the changed packages in PROFILE GEN2 compared to generation GEN2."
+ "Display the changed packages in PROFILE GEN2 compared to generation GEN1."
(define (equal-entry? first second)
(string= (manifest-entry-item first) (manifest-entry-item second)))
diff --git a/tests/gem.scm b/tests/gem.scm
index a39e8ba514..4220170ff0 100644
--- a/tests/gem.scm
+++ b/tests/gem.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -23,10 +24,11 @@
#:use-module (guix hash)
#:use-module (guix tests)
#:use-module ((guix build utils) #:select (delete-file-recursively))
+ #:use-module (srfi srfi-41)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match))
-(define test-json
+(define test-foo-json
"{
\"name\": \"foo\",
\"version\": \"1.0.0\",
@@ -42,6 +44,34 @@
\"licenses\": [\"MIT\", \"Apache 2.0\"]
}")
+(define test-bar-json
+ "{
+ \"name\": \"bar\",
+ \"version\": \"1.0.0\",
+ \"sha\": \"f3676eafca9987cb5fe263df1edf2538bf6dafc712b30e17be3543a9680547a8\",
+ \"info\": \"Another cool gem\",
+ \"homepage_uri\": \"https://example.com\",
+ \"dependencies\": {
+ \"runtime\": [
+ { \"name\": \"bundler\" },
+ ]
+ },
+ \"licenses\": [\"MIT\", \"Apache 2.0\"]
+}")
+
+(define test-bundler-json
+ "{
+ \"name\": \"bundler\",
+ \"version\": \"1.14.2\",
+ \"sha\": \"3bb53e03db0a8008161eb4c816ccd317120d3c415ba6fee6f90bbc7f7eec8690\",
+ \"info\": \"Ruby gem bundler\",
+ \"homepage_uri\": \"https://bundler.io/\",
+ \"dependencies\": {
+ \"runtime\": []
+ },
+ \"licenses\": [\"MIT\"]
+}")
+
(test-begin "gem")
(test-assert "gem->guix-package"
@@ -50,8 +80,8 @@
(lambda (url . rest)
(match url
("https://rubygems.org/api/v1/gems/foo.json"
- (values (open-input-string test-json)
- (string-length test-json)))
+ (values (open-input-string test-foo-json)
+ (string-length test-foo-json)))
(_ (error "Unexpected URL: " url)))))
(match (gem->guix-package "foo")
(('package
@@ -76,4 +106,76 @@
(x
(pk 'fail x #f)))))
+(test-assert "gem-recursive-import"
+ ;; Replace network resources with sample data.
+ (mock ((guix http-client) http-fetch
+ (lambda (url . rest)
+ (match url
+ ("https://rubygems.org/api/v1/gems/foo.json"
+ (values (open-input-string test-foo-json)
+ (string-length test-foo-json)))
+ ("https://rubygems.org/api/v1/gems/bar.json"
+ (values (open-input-string test-bar-json)
+ (string-length test-bar-json)))
+ ("https://rubygems.org/api/v1/gems/bundler.json"
+ (values (open-input-string test-bundler-json)
+ (string-length test-bundler-json)))
+ (_ (error "Unexpected URL: " url)))))
+ (match (stream->list (gem-recursive-import "foo"))
+ ((('package
+ ('name "ruby-foo")
+ ('version "1.0.0")
+ ('source
+ ('origin
+ ('method 'url-fetch)
+ ('uri ('rubygems-uri "foo" 'version))
+ ('sha256
+ ('base32
+ "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk"))))
+ ('build-system 'ruby-build-system)
+ ('propagated-inputs
+ ('quasiquote
+ (("bundler" ('unquote 'bundler))
+ ("ruby-bar" ('unquote 'ruby-bar)))))
+ ('synopsis "A cool gem")
+ ('description "This package provides a cool gem")
+ ('home-page "https://example.com")
+ ('license ('list 'license:expat 'license:asl2.0)))
+ ('package
+ ('name "ruby-bundler")
+ ('version "1.14.2")
+ ('source
+ ('origin
+ ('method 'url-fetch)
+ ('uri ('rubygems-uri "bundler" 'version))
+ ('sha256
+ ('base32
+ "1446xiz7zg0bz7kgx9jv84y0s4hpsg61dj5l3qb0i00avc1kxd9v"))))
+ ('build-system 'ruby-build-system)
+ ('synopsis "Ruby gem bundler")
+ ('description "Ruby gem bundler")
+ ('home-page "https://bundler.io/")
+ ('license 'license:expat))
+ ('package
+ ('name "ruby-bar")
+ ('version "1.0.0")
+ ('source
+ ('origin
+ ('method 'url-fetch)
+ ('uri ('rubygems-uri "bar" 'version))
+ ('sha256
+ ('base32
+ "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk"))))
+ ('build-system 'ruby-build-system)
+ ('propagated-inputs
+ ('quasiquote
+ (('"bundler" ('unquote 'bundler)))))
+ ('synopsis "Another cool gem")
+ ('description "Another cool gem")
+ ('home-page "https://example.com")
+ ('license ('list 'license:expat 'license:asl2.0))))
+ #t)
+ (x
+ (pk 'fail x #f)))))
+
(test-end "gem")
diff --git a/tests/hackage.scm b/tests/hackage.scm
index a4de8be91e..e17851a213 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -69,6 +69,65 @@ library
mtl >= 2.0 && < 3
")
+;; Check "-any", "-none" when name is different.
+(define test-cabal-4
+ "name: foo
+version: 1.0.0
+homepage: http://test.org
+synopsis: synopsis
+description: description
+license: BSD3
+library
+ if impl(ghcjs -any)
+ Build-depends: ghc-a
+ if impl(ghc>=7.2&&<7.6)
+ Build-depends: ghc-b
+ if impl(ghc == 7.8)
+ Build-depends:
+ HTTP >= 4000.2.5 && < 4000.3,
+ mtl >= 2.0 && < 3
+")
+
+;; Check "-any", "-none".
+(define test-cabal-5
+ "name: foo
+version: 1.0.0
+homepage: http://test.org
+synopsis: synopsis
+description: description
+license: BSD3
+library
+ if impl(ghc == 7.8)
+ Build-depends:
+ HTTP >= 4000.2.5 && < 4000.3,
+ if impl(ghc -any)
+ Build-depends: mtl >= 2.0 && < 3
+ if impl(ghc>=7.2&&<7.6)
+ Build-depends: ghc-b
+")
+
+;; Check "custom-setup".
+(define test-cabal-6
+ "name: foo
+build-type: Custom
+version: 1.0.0
+homepage: http://test.org
+synopsis: synopsis
+description: description
+license: BSD3
+custom-setup
+ setup-depends: base >= 4.7 && < 5,
+ Cabal >= 1.24,
+ haskell-gi == 0.21.*
+library
+ if impl(ghc>=7.2&&<7.6)
+ Build-depends: ghc-b
+ if impl(ghc == 7.8)
+ Build-depends:
+ HTTP >= 4000.2.5 && < 4000.3,
+ mtl >= 2.0 && < 3
+")
+
;; A fragment of a real Cabal file with minor modification to check precedence
;; of 'and' over 'or', missing final newline, spaces between keywords and
;; parentheses and between key and column.
@@ -139,6 +198,18 @@ library
(eval-test-with-cabal test-cabal-3
#:cabal-environment '(("impl" . "ghc-7.8"))))
+(test-assert "hackage->guix-package test 4"
+ (eval-test-with-cabal test-cabal-4
+ #:cabal-environment '(("impl" . "ghc-7.8"))))
+
+(test-assert "hackage->guix-package test 5"
+ (eval-test-with-cabal test-cabal-5
+ #:cabal-environment '(("impl" . "ghc-7.8"))))
+
+(test-assert "hackage->guix-package test 6"
+ (eval-test-with-cabal test-cabal-6
+ #:cabal-environment '(("impl" . "ghc-7.8"))))
+
(test-assert "read-cabal test 1"
(match (call-with-input-string test-read-cabal-1 read-cabal)
((("name" ("test-me"))
diff --git a/tests/opam.scm b/tests/opam.scm
new file mode 100644
index 0000000000..26832174a8
--- /dev/null
+++ b/tests/opam.scm
@@ -0,0 +1,118 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (test-opam)
+ #:use-module (guix import opam)
+ #:use-module (guix base32)
+ #:use-module (guix hash)
+ #:use-module (guix tests)
+ #:use-module ((guix build utils) #:select (delete-file-recursively mkdir-p which))
+ #:use-module (srfi srfi-64)
+ #:use-module (web uri)
+ #:use-module (ice-9 match))
+
+(define test-url-file
+ "http: \"https://example.org/foo-1.0.0.tar.gz\"
+checksum: \"ac8920f39a8100b94820659bc2c20817\"")
+
+(define test-source-hash
+ "")
+
+(define test-urls
+ "repo ac8920f39a8100b94820659bc2c20817 0o644
+packages/foo/foo.1.0.0/url ac8920f39a8100b94820659bc2c20817 0o644
+packages/foo/foo.1.0.0/opam ac8920f39a8100b94820659bc2c20817 0o644
+packages/foo/foo.1.0.0/descr ac8920f39a8100b94820659bc2c20817 0o644")
+
+(define test-opam-file
+"opam-version: 1.2
+maintainer: \"Alice Doe\"
+authors: \"Alice Doe, John Doe\"
+homepage: \"https://example.org/\"
+bug-reports: \"https://example.org/bugs\"
+license: \"MIT\"
+dev-repo: \"https://example.org/git\"
+build: [
+ \"ocaml\" \"pkg/pkg.ml\" \"build\" \"--pinned\" \"%{pinned}%\"
+]
+build-test: [
+ \"ocaml\" \"pkg/pkg.ml\" \"build\" \"--pinned\" \"%{pinned}%\" \"--tests\" \"true\"
+]
+depends: [
+ \"alcotest\" {test & >= \"0.7.2\"}
+ \"ocamlbuild\" {build & >= \"0.9.2\"}
+]")
+
+(test-begin "opam")
+
+(test-assert "opam->guix-package"
+ ;; Replace network resources with sample data.
+ (mock ((guix import utils) url-fetch
+ (lambda (url file-name)
+ (match url
+ ("https://example.org/foo-1.0.0.tar.gz"
+ (begin
+ (mkdir-p "foo-1.0.0")
+ (system* "tar" "czvf" file-name "foo-1.0.0/")
+ (delete-file-recursively "foo-1.0.0")
+ (set! test-source-hash
+ (call-with-input-file file-name port-sha256))))
+ (_ (error "Unexpected URL: " url)))))
+ (mock ((guix http-client) http-fetch/cached
+ (lambda (url . rest)
+ (match (uri->string url)
+ ("https://opam.ocaml.org/urls.txt"
+ (values (open-input-string test-urls)
+ (string-length test-urls)))
+ (_ (error "Unexpected URL: " url)))))
+ (mock ((guix http-client) http-fetch
+ (lambda (url . rest)
+ (match url
+ ("https://opam.ocaml.org/packages/foo/foo.1.0.0/url"
+ (values (open-input-string test-url-file)
+ (string-length test-url-file)))
+ ("https://opam.ocaml.org/packages/foo/foo.1.0.0/opam"
+ (values (open-input-string test-opam-file)
+ (string-length test-opam-file)))
+ (_ (error "Unexpected URL: " url)))))
+ (match (opam->guix-package "foo")
+ (('package
+ ('name "ocaml-foo")
+ ('version "1.0.0")
+ ('source ('origin
+ ('method 'url-fetch)
+ ('uri "https://example.org/foo-1.0.0.tar.gz")
+ ('sha256
+ ('base32
+ (? string? hash)))))
+ ('build-system 'ocaml-build-system)
+ ('inputs
+ ('quasiquote
+ (("ocamlbuild" ('unquote 'ocamlbuild))
+ ("ocaml-alcotest" ('unquote 'ocaml-alcotest)))))
+ ('home-page "https://example.org/")
+ ('synopsis "")
+ ('description "")
+ ('license 'license:expat))
+ (string=? (bytevector->nix-base32-string
+ test-source-hash)
+ hash))
+ (x
+ (pk 'fail x #f)))))))
+
+(test-end "opam")