diff --git a/HACKING b/HACKING index 1e742c8454..41838ee816 100644 --- a/HACKING +++ b/HACKING @@ -2,141 +2,20 @@ #+TITLE: Hacking GNU Guix and Its Incredible Distro -Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès -Copyright © 2013 Nikita Karetnikov -Copyright © 2014 Pierre-Antoine Rault +Copyright © 2012, 2013, 2014 Ludovic Courtès +Copyright © 2015 Mathieu Lirzin Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Contributing -* Building from Git +See the manual for useful hacking informations, either by running -When building Guix from a checkout, the following packages are required in -addition to those mentioned in the installation instructions: + info -f doc/guix.info "(guix) Contributing" - - [[http://www.gnu.org/software/autoconf/][GNU Autoconf]] - - [[http://www.gnu.org/software/automake/][GNU Automake]] - - [[http://www.gnu.org/software/gettext/][GNU Gettext]] - - [[http://www.graphviz.org/][Graphviz]] - - [[http://www.gnu.org/software/help2man/][GNU Help2man]] (optional) - -Run ‘./bootstrap’ to download the Nix daemon source code and to generate the -build system infrastructure using autoconf. It reports an error if an -inappropriate version of the above packages is being used. - -If you get an error like this one: - - configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES - -it probably means that Autoconf couldn’t find ‘pkg.m4’, which is provided by -pkg-config. Make sure that ‘pkg.m4’ is available. For instance, if you -installed Automake in ‘/usr/local’, it wouldn’t look for ‘.m4’ files in -‘/usr/share’. So you have to invoke the following command in that case - - $ export ACLOCAL_PATH=/usr/share/aclocal - -See “info '(automake) Macro Search Path'” for more information. - -Then, run ‘./configure’ as usual. - -Finally, you have to invoke ‘make check’ to run tests. If anything fails, -take a look at “info '(guix) Installation'” or send a message to -. - -* Running Guix before it is installed - -See the same-named section in the manual. - -* The Perfect Setup - -The Perfect Setup to hack on Guix is basically the perfect setup used -for Guile hacking (info "(guile) Using Guile in Emacs"). First, you -need more than an editor, you need [[http://www.gnu.org/software/emacs][Emacs]], empowered by the wonderful -[[http://nongnu.org/geiser/][Geiser]]. - -Geiser allows for interactive and incremental development from within -Emacs: code compilation and evaluation from within buffers, access to -on-line documentation (docstrings), context-sensitive completion, M-. to -jump to an object definition, a REPL to try out your code, and more. - -To actually edit the code, Emacs already has a neat Scheme mode. But in -addition to that, you must not miss [[http://www.emacswiki.org/emacs/ParEdit][Paredit]]. It provides facilities to -directly operate on the syntax tree, such as raising an s-expression or -wrapping it, swallowing or rejecting the following s-expression, etc. - -* Submitting Patches - -Development is done using the Git distributed version control system. Thus, -access to the repository is not strictly necessary. We welcome contributions -in the form of patches as produced by ‘git format-patch’ sent to -guix-devel@gnu.org. Please write commit logs in the [[http://www.gnu.org/prep/standards/html_node/Change-Logs.html#Change-Logs][GNU ChangeLog -format]]; you can check the commit history for examples. - -Before submitting a patch that adds or modifies a package definition, please -run ‘guix lint PACKAGE’, where PACKAGE is the name of the new or modified -package, and fix any errors it reports. In addition, please make sure the -package builds on your platform, using ‘guix build’. You may also want to -check that dependent package (if applicable) are not affected by the change; -‘guix refresh --list-dependent PACKAGE’ will help you do that. - -When posting a patch to the mailing list, use "[PATCH] ..." as a subject. You -may use your email client or the ‘git send-mail’ command. - -As you become a regular contributor, you may find it convenient to have write -access to the repository (see below.) - -* Coding Style - -In general our code follows the [[info:standards][GNU Coding Standards]] (GCS). However, the GCS -do not say much about Scheme, so here are some additional rules. - -** Programming Paradigm - -Scheme code in Guix is written in a purely functional style. One exception is -code that involves input/output, and procedures that implement low-level -concepts, such as the ‘memoize’ procedure. - -** Modules - -Guile modules that are meant to be used on the builder side must live in the -(guix build …) name space. They must not refer to other Guix or GNU modules. -However, it is OK for a “host-side” module to use a build-side module. - -Modules that deal with the broader GNU system should be in the (gnu …) name -space rather than (guix …). - -** Data Types and Pattern Matching - -The tendency in classical Lisp is to use lists to represent everything, and -then to browse them “by hand” using ‘car’, ‘cdr’, ‘cadr’, and co. There are -several problems with that style, notably the fact that it is hard to read, -error-prone, and a hindrance to proper type error reports. - -Guix code should define appropriate data types (for instance, using -‘define-record-type*’) rather than abuse lists. In addition, it should use -pattern matching, via Guile’s (ice-9 match) module, especially when matching -lists. - -** Formatting Code - -When writing Scheme code, we follow common wisdom among Scheme programmers. -In general, we follow the [[http://mumble.net/~campbell/scheme/style.txt][Riastradh's Lisp Style Rules]]. This document happens -to describe the conventions mostly used in Guile’s code too. It is very -thoughtful and well written, so please do read it. - -Some special forms introduced in Guix, such as the ‘substitute*’ macro, have -special indentation rules. These are defined in the .dir-locals.el file, -which Emacs automatically uses. If you do not use Emacs, please make sure to -let your editor know the rules. - -We require all top-level procedures to carry a docstring. This requirement -can be relaxed for simple private procedures in the (guix build …) name space, -though. - -Procedures should not have more than four positional parameters. Use keyword -parameters for procedures that take more than four parameters. +or by checking the [[http://www.gnu.org/software/guix/manual/guix.html#Contributing][web copy of the manual]]. * Commit Access diff --git a/README b/README index 4d3367ed8f..df528222e9 100644 --- a/README +++ b/README @@ -46,8 +46,8 @@ See the manual for the installation instructions, either by running or by checking the [[http://www.gnu.org/software/guix/manual/guix.html#Installation][web copy of the manual]]. -For information on installation from a Git checkout, please see the ‘HACKING’ -file. +For information on installation from a Git checkout, please see the section +"Building from Git" in the manual. * Installing Guix from Guix diff --git a/configure.ac b/configure.ac index 50b65fdac1..2c8b9f076c 100644 --- a/configure.ac +++ b/configure.ac @@ -179,7 +179,7 @@ AC_CACHE_SAVE m4_include([config-daemon.ac]) dnl `dot' (from the Graphviz package) is only needed for maintainers. -dnl See `HACKING' for more info. +dnl See `Building from Git' in the manual for more info. AM_MISSING_PROG([DOT], [dot]) dnl Manual pages. diff --git a/doc.am b/doc.am index 14343ceacb..de232a87a4 100644 --- a/doc.am +++ b/doc.am @@ -19,6 +19,7 @@ info_TEXINFOS = doc/guix.texi EXTRA_DIST += \ + doc/contributing.texi \ doc/emacs.texi \ doc/fdl-1.3.texi \ doc/images/bootstrap-graph.dot \ diff --git a/doc/contributing.texi b/doc/contributing.texi new file mode 100644 index 0000000000..536f223da4 --- /dev/null +++ b/doc/contributing.texi @@ -0,0 +1,216 @@ +@node Contributing +@chapter Contributing + +This project is a cooperative effort, and we need your help to make it +grow! Please get in touch with us on @email{guix-devel@@gnu.org} and +@code{#guix} on the Freenode IRC network. We welcome ideas, bug +reports, patches, and anything that may be helpful to the project. We +particularly welcome help on packaging (@pxref{Packaging Guidelines}). + +@menu +* Building from Git:: The latest and greatest. +* Running Guix Before It Is Installed:: Hacker tricks. +* The Perfect Setup:: The right tools. +* Coding Style:: Hygiene of the contributor. +* Submitting Patches:: Share your work. +@end menu + +@node Building from Git +@section Building from Git + +If you want to hack Guix itself, it is recommended to use the latest +version from the Git repository. When building Guix from a checkout, +the following packages are required in addition to those mentioned in +the installation instructions (@pxref{Requirements}). + +@itemize +@item @url{http://gnu.org/software/autoconf/, GNU Autoconf}; +@item @url{http://gnu.org/software/automake/, GNU Automake}; +@item @url{http://gnu.org/software/gettext/, GNU Gettext}; +@item @url{http://www.graphviz.org/, Graphviz}; +@item @url{http://www.gnu.org/software/help2man/, GNU Help2man (optional)}. +@end itemize + +Run @command{./bootstrap} to download the Nix daemon source code and to +generate the build system infrastructure using autoconf. It reports an +error if an inappropriate version of the above packages is being used. + +@noindent +If you get an error like this one: + +@example +configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES +@end example + +it probably means that Autoconf couldn’t find @file{pkg.m4}, which is +provided by @command{pkg-config}. Make sure that @file{pkg.m4} is +available. For instance, if you installed Automake in +@file{/usr/local}, it wouldn’t look for @file{.m4} files in +@file{/usr/share}. So you have to invoke the following command in that +case + +@example +export ACLOCAL_PATH=/usr/share/aclocal +@end example + +See @pxref{Macro Search Path,,, automake, The GNU Automake Manual} for +more information. + +Then, run @command{./configure} as usual. + +Finally, you have to invoke @code{make check} to run tests. If anything +fails, take a look at installation instructions (@pxref{Installation}) +or send a message to the @email{guix-devel@@gnu.org, mailing list}. + + +@node Running Guix Before It Is Installed +@section Running Guix Before It Is Installed + +In order to keep a sane working environment, you will find it useful to +test the changes made in your local source tree checkout without +actually installing them. So that you can distinguish between your +``end-user'' hat and your ``motley'' costume. + +To that end, all the command-line tools can be used even if you have not +run @code{make install}. To do that, prefix each command with +@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the +top build tree of Guix), as in: + +@example +$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild +$ ./pre-inst-env guix build hello +@end example + +@noindent +Similarly, for a Guile session using the Guix modules: + +@example +$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' +@end example + +The @command{pre-inst-env} script sets up all the environment variables +necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}. + + +@node The Perfect Setup +@section The Perfect Setup + +The Perfect Setup to hack on Guix is basically the perfect setup used +for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile Reference +Manual}). First, you need more than an editor, you need +@url{http://www.gnu.org/software/emacs, Emacs}, empowered by the +wonderful @url{http://nongnu.org/geiser/, Geiser}. + +Geiser allows for interactive and incremental development from within +Emacs: code compilation and evaluation from within buffers, access to +on-line documentation (docstrings), context-sensitive completion, +@kbd{M-.} to jump to an object definition, a REPL to try out your code, +and more (@pxref{Introduction,,, geiser, Geiser User Manual}). For +convenient Guix development, make sure to augment Guile’s load path so +that it finds source files from your checkout: + +@lisp +;; @r{Assuming the Guix checkout is in ~/src/guix.} +(add-to-list 'geiser-guile-load-path "~/src/guix") +@end lisp + +To actually edit the code, Emacs already has a neat Scheme mode. But in +addition to that, you must not miss +@url{http://www.emacswiki.org/emacs/ParEdit, Paredit}. It provides +facilities to directly operate on the syntax tree, such as raising an +s-expression or wrapping it, swallowing or rejecting the following +s-expression, etc. + + +@node Coding Style +@section Coding Style + +In general our code follows the GNU Coding Standards (@pxref{Top,,, +standards, GNU Coding Standards}). However, they do not say much about +Scheme, so here are some additional rules. + +@menu +* Programming Paradigm:: How to compose your elements. +* Modules:: Where to store your code? +* Data Types and Pattern Matching:: Implementing data structures. +* Formatting Code:: Writing conventions. +@end menu + +@node Programming Paradigm +@subsection Programming Paradigm + +Scheme code in Guix is written in a purely functional style. One +exception is code that involves input/output, and procedures that +implement low-level concepts, such as the @code{memoize} procedure. + +@node Modules +@subsection Modules + +Guile modules that are meant to be used on the builder side must live in +the @code{(guix build @dots{})} name space. They must not refer to +other Guix or GNU modules. However, it is OK for a ``host-side'' module +to use a build-side module. + +Modules that deal with the broader GNU system should be in the +@code{(gnu @dots{})} name space rather than @code{(guix @dots{})}. + +@node Data Types and Pattern Matching +@subsection Data Types and Pattern Matching + +The tendency in classical Lisp is to use lists to represent everything, +and then to browse them ``by hand'' using @code{car}, @code{cdr}, +@code{cadr}, and co. There are several problems with that style, +notably the fact that it is hard to read, error-prone, and a hindrance +to proper type error reports. + +Guix code should define appropriate data types (for instance, using +@code{define-record-type*}) rather than abuse lists. In addition, it +should use pattern matching, via Guile’s @code{(ice-9 match)} module, +especially when matching lists. + +@node Formatting Code +@subsection Formatting Code + +When writing Scheme code, we follow common wisdom among Scheme +programmers. In general, we follow the +@url{http://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp +Style Rules}. This document happens to describe the conventions mostly +used in Guile’s code too. It is very thoughtful and well written, so +please do read it. + +Some special forms introduced in Guix, such as the @code{substitute*} +macro, have special indentation rules. These are defined in the +@file{.dir-locals.el} file, which Emacs automatically uses. If you do +not use Emacs, please make sure to let your editor know the rules. + +We require all top-level procedures to carry a docstring. This +requirement can be relaxed for simple private procedures in the +@code{(guix build @dots{})} name space, though. + +Procedures should not have more than four positional parameters. Use +keyword parameters for procedures that take more than four parameters. + + +@node Submitting Patches +@section Submitting Patches + +Development is done using the Git distributed version control system. +Thus, access to the repository is not strictly necessary. We welcome +contributions in the form of patches as produced by @code{git +format-patch} sent to the @email{guix-devel@@gnu.org, mailing list}. +Please write commit logs in the ChangeLog format (@pxref{Change Logs,,, +standards, GNU Coding Standards}); you can check the commit history for +examples. + +Before submitting a patch that adds or modifies a package definition, +please run @code{guix lint @var{package}}, where @var{package} is the +name of the new or modified package, and fix any errors it reports +(@pxref{Invoking guix lint}). In addition, please make sure the package +builds on your platform, using @code{guix build @var{package}}. You may +also want to check that dependent package (if applicable) are not +affected by the change; @code{guix refresh --list-dependent +@var{package}} will help you do that (@pxref{Invoking guix refresh}). + +When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as a +subject. You may use your email client or the @command{git send-mail} +command. diff --git a/doc/guix.texi b/doc/guix.texi index be7a292f08..46dccb8e2b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13,6 +13,8 @@ Copyright @copyright{} 2012, 2013, 2014, 2015 Ludovic Courtès@* Copyright @copyright{} 2013, 2014 Andreas Enge@* Copyright @copyright{} 2013 Nikita Karetnikov@* +Copyright @copyright{} 2015 Mathieu Lirzin@* +Copyright @copyright{} 2014 Pierre-Antoine Rault@* Copyright @copyright{} 2015 Taylan Ulrich Bayırlı/Kammer Permission is granted to copy, distribute and/or modify this document @@ -88,7 +90,6 @@ Installation * Running the Test Suite:: Testing Guix. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. -* Running Guix Before It Is Installed:: Hacker tricks. Setting Up the Daemon @@ -177,6 +178,21 @@ Packaging Guidelines * Perl Modules:: Little pearls. * Fonts:: Fond of fonts. +Contributing + +* Building from Git:: The latest and greatest. +* Running Guix Before It Is Installed:: Hacker tricks. +* The Perfect Setup:: The right tools. +* Coding Style:: Hygiene of the contributor. +* Submitting Patches:: Share your work. + +Coding Style + +* Programming Paradigm:: How to compose your elements. +* Modules:: Where to store your code? +* Data Types and Pattern Matching:: Implementing data structures. +* Formatting Code:: Writing conventions. + @end detailmenu @end menu @@ -253,7 +269,6 @@ instead, you want to install the complete GNU operating system, * Running the Test Suite:: Testing Guix. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. -* Running Guix Before It Is Installed:: Hacker tricks. @end menu @node Binary Installation @@ -847,44 +862,6 @@ useful in exceptional circumstances, such as if you need to run several daemons on the same machine. @end table -@node Running Guix Before It Is Installed -@section Running Guix Before It Is Installed - -If you are hacking Guix itself---which is a good idea!---you will find -it useful to test the changes made in your local source tree checkout -without actually installing them. - -To that end, all the command-line tools can be used even if you have not -run @command{make install}. To do that, prefix each command with -@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the -top build tree of Guix), as in: - -@example -$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild -$ ./pre-inst-env guix build hello -@end example - -@noindent -Similarly, for a Guile session using the Guix modules: - -@example -$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' -@end example - -The @command{pre-inst-env} script sets up all the environment variables -necessary to support this, including @code{PATH} and -@code{GUILE_LOAD_PATH}. - -If you are hacking Guix from Emacs using the wonderful Geiser -(@pxref{Introduction,,, geiser, Geiser User Manual}), make sure to -augment Guile's load path so that it finds source files from your -checkout: - -@lisp -;; Assuming the Guix checkout is in ~/src/guix. -(add-to-list 'geiser-guile-load-path "~/src/guix") -@end lisp - @c ********************************************************************* @node Package Management @@ -3438,6 +3415,13 @@ candidates: guix build guile --with-source=../guile-2.0.9.219-e1bb7.tar.xz @end example +@dots{} or to build from a checkout in a pristine environment: + +@example +$ git clone git://git.sv.gnu.org/guix.git +$ guix build guix --with-source=./guix +@end example + @item --no-grafts Do not ``graft'' packages. In practice, this means that package updates available as grafts are not applied. @xref{Security Updates}, for more @@ -6781,22 +6765,8 @@ Second, some of the required packages could fail to build for that platform. Lastly, the generated binaries could be broken for some reason. - @c ********************************************************************* -@node Contributing -@chapter Contributing - -This project is a cooperative effort, and we need your help to make it -grow! Please get in touch with us on @email{guix-devel@@gnu.org} and -@code{#guix} on the Freenode IRC network. We welcome ideas, bug -reports, patches, and anything that may be helpful to the project. We -particularly welcome help on packaging (@pxref{Packaging Guidelines}). - -Please see the -@url{http://git.savannah.gnu.org/cgit/guix.git/tree/HACKING, -@file{HACKING} file} that comes with the Guix source code for practical -details about contributions. - +@include contributing.texi @c ********************************************************************* @node Acknowledgments diff --git a/gnu-system.am b/gnu-system.am index 5f2b6d912e..3a34f5f746 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -59,6 +59,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/cdrom.scm \ gnu/packages/certs.scm \ gnu/packages/check.scm \ + gnu/packages/ci.scm \ gnu/packages/cmake.scm \ gnu/packages/code.scm \ gnu/packages/commencement.scm \ @@ -196,6 +197,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/lxqt.scm \ gnu/packages/lynx.scm \ gnu/packages/m4.scm \ + gnu/packages/machine-learning.scm \ gnu/packages/man.scm \ gnu/packages/mail.scm \ gnu/packages/make-bootstrap.scm \ @@ -454,6 +456,8 @@ dist_patch_DATA = \ gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ gnu/packages/patches/hop-bigloo-4.0b.patch \ gnu/packages/patches/hop-linker-flags.patch \ + gnu/packages/patches/hydra-automake-1.15.patch \ + gnu/packages/patches/hydra-disable-darcs-test.patch \ gnu/packages/patches/irrlicht-mesa-10.patch \ gnu/packages/patches/jbig2dec-ignore-testtest.patch \ gnu/packages/patches/kmod-module-directory.patch \ @@ -510,6 +514,7 @@ dist_patch_DATA = \ gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \ gnu/packages/patches/perl-module-pluggable-search.patch \ gnu/packages/patches/perl-net-amazon-s3-moose-warning.patch \ + gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ gnu/packages/patches/perl-tk-x11-discover.patch \ gnu/packages/patches/petsc-fix-threadcomm.patch \ @@ -524,6 +529,7 @@ dist_patch_DATA = \ gnu/packages/patches/pybugz-encode-error.patch \ gnu/packages/patches/pybugz-stty.patch \ gnu/packages/patches/pyqt-configure.patch \ + gnu/packages/patches/python-disable-ssl-test.patch \ gnu/packages/patches/python-fix-tests.patch \ gnu/packages/patches/python-libffi-mips-n32-fix.patch \ gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a96ce9cdfb..960264bc2d 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -152,14 +152,14 @@ (define-public pies (define-public inetutils (package (name "inetutils") - (version "1.9.3") + (version "1.9.4") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/inetutils/inetutils-" version ".tar.gz")) (sha256 (base32 - "06dshajjpyi9sxi7qfki9gnp5r3nxvyvf81r81gx0x2qkqzqcxlj")))) + "05n65k4ixl85dc6rxc51b1b732gnmm8xnqi424dy9f1nz7ppb3xy")))) (build-system gnu-build-system) (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux, ;; which is currently missing. diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index fdc783a455..3b2d4e1022 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -1031,6 +1031,57 @@ (define-public rubberband tempo and pitch of an audio recording independently of one another.") (license license:gpl2+))) +(define-public rtmidi + (package + (name "rtmidi") + (version "2.1.0") + (source (origin + (method url-fetch) + (uri + (string-append "https://github.com/powertab/rtmidi/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0d49lapnmdgmjxh4vw57h6xk74nn5r0zwysv7jbd7m8kqhpq5rjj")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no "check" target + #:phases (modify-phases %standard-phases + (add-before + 'configure 'autoconf + (lambda _ (zero? (system* "autoreconf" "-vfi")))) + (add-before + 'build 'fix-makefile + (lambda _ + (substitute* "Makefile" + (("/bin/ln") "ln") + (("RtMidi.h RtError.h") "RtMidi.h")) + #t)) + (add-before + 'install 'make-target-dirs + (lambda _ + (let ((out (assoc-ref %outputs "out"))) + (mkdir-p (string-append out "/bin")) + (mkdir (string-append out "/lib")) + (mkdir (string-append out "/include"))) + #t))))) + (inputs + `(("jack" ,jack-1) + ("alsa-lib" ,alsa-lib))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config))) + (home-page "https://github.com/powertab/rtmidi") + (synopsis "Cross-platform MIDI library for C++") + (description + "RtMidi is a set of C++ classes (RtMidiIn, RtMidiOut, and API specific +classes) that provide a common cross-platform API for realtime MIDI +input/output.") + (license license:expat))) + (define-public sratom (package (name "sratom") diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 24ff90cc5c..f2b4d95b95 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -95,7 +95,6 @@ (define* (autoconf-wrapper #:optional (autoconf autoconf)) only be used internally---users should not end up distributing `configure' files with a system-specific shebang." (package (inherit autoconf) - (location (source-properties->location (current-source-location))) (name (string-append (package-name autoconf) "-wrapper")) (build-system trivial-build-system) (inputs `(("guile" diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c7836f173e..7175ecf41d 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -34,6 +34,7 @@ (define-module (gnu packages bioinformatics) #:use-module (gnu packages file) #:use-module (gnu packages java) #:use-module (gnu packages linux) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages maths) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) @@ -438,6 +439,76 @@ (define-public clipper "CLIPper is a tool to define peaks in CLIP-seq datasets.") (license license:gpl2))) +(define-public couger + (package + (name "couger") + (version "1.8.2") + (source (origin + (method url-fetch) + (uri (string-append + "http://couger.oit.duke.edu/static/assets/COUGER" + version ".zip")) + (sha256 + (base32 + "04p2b14nmhzxw5h72mpzdhalv21bx4w9b87z0wpw0xzxpysyncmq")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (copy-recursively "src" (string-append out "/src")) + (mkdir (string-append out "/bin")) + ;; Add "src" directory to module lookup path. + (substitute* "couger" + (("from argparse") + (string-append "import sys\nsys.path.append(\"" + out "\")\nfrom argparse"))) + (copy-file "couger" (string-append out "/bin/couger"))) + #t)) + (add-after + 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Make sure 'couger' runs with the correct PYTHONPATH. + (let* ((out (assoc-ref outputs "out")) + (path (getenv "PYTHONPATH"))) + (wrap-program (string-append out "/bin/couger") + `("PYTHONPATH" ":" prefix (,path)))) + #t))))) + (inputs + `(("python" ,python-2) + ("python2-pillow" ,python2-pillow) + ("python2-numpy" ,python2-numpy) + ("python2-scipy" ,python2-scipy) + ("python2-matplotlib" ,python2-matplotlib))) + (propagated-inputs + `(("r" ,r) + ("libsvm" ,libsvm) + ("randomjungle" ,randomjungle))) + (native-inputs + `(("unzip" ,unzip))) + (home-page "http://couger.oit.duke.edu") + (synopsis "Identify co-factors in sets of genomic regions") + (description + "COUGER can be applied to any two sets of genomic regions bound by +paralogous TFs (e.g., regions derived from ChIP-seq experiments) to identify +putative co-factors that provide specificity to each TF. The framework +determines the genomic targets uniquely-bound by each TF, and identifies a +small set of co-factors that best explain the in vivo binding differences +between the two TFs. + +COUGER uses classification algorithms (support vector machines and random +forests) with features that reflect the DNA binding specificities of putative +co-factors. The features are generated either from high-throughput TF-DNA +binding data (from protein binding microarray experiments), or from large +collections of DNA motifs.") + (license license:gpl3+))) + (define-public clustal-omega (package (name "clustal-omega") @@ -1030,6 +1101,27 @@ (define-public miso that a read originated from a particular isoform.") (license license:gpl2))) +(define-public orfm + (package + (name "orfm") + (version "0.3.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/wwood/OrfM/releases/download/v" + version "/orfm-" version ".tar.gz")) + (sha256 + (base32 + "00jqvlspj9662ni9r4n1snxfnwkzc02i46g5nk1kwjshi6v3vgg3")))) + (build-system gnu-build-system) + (inputs `(("zlib" ,zlib))) + (synopsis "Simple and not slow open reading frame (ORF) caller") + (description + "An ORF caller finds stretches of DNA that when translated are not +interrupted by stop codons. OrfM finds and prints these ORFs.") + (home-page "https://github.com/wwood/OrfM") + (license license:lgpl3+))) + (define-public python2-pbcore (package (name "python2-pbcore") @@ -1331,7 +1423,7 @@ (define-public samtools-0.1 (define-public ngs-sdk (package (name "ngs-sdk") - (version "1.1.0") + (version "1.1.1") (source (origin (method url-fetch) @@ -1341,7 +1433,7 @@ (define-public ngs-sdk (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "09fakv9w87lfg9g70kwzmnryqdjj1sz2c7kw01i6drjf787gkjhw")))) + "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f ; not supported @@ -1351,20 +1443,6 @@ (define-public ngs-sdk 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - ;; Only replace the version suffix, not the version number in the - ;; directory name; fixed in commit 46d4509fa8 (no release yet). - (substitute* "setup/konfigure.perl" - (((string-append "\\$\\(subst " - "(\\$\\(VERSION[^\\)]*\\))," - "(\\$\\([^\\)]+\\))," - "(\\$\\([^\\)]+\\)|\\$\\@)" - "\\)") - _ pattern replacement target) - (string-append "$(patsubst " - "%" pattern "," - "%" replacement "," - target ")"))) - ;; The 'configure' script doesn't recognize things like ;; '--enable-fast-install'. (zero? (system* "./configure" diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 5349ede0fa..e0ee7c4d4f 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -113,18 +113,17 @@ (define-public cppunit (define-public catch-framework (package (name "catch") - (version "1.0.53") ;Sub-minor is the build number + (version "1.1.3") ;Sub-minor is the build number (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/philsquared/Catch") - ;; Semi-arbitrary. Contains mostly documentation fixes - ;; since build 53. - (commit "b9ec8a1"))) + ;; Semi-arbitrary. + (commit "c51e86819d"))) (file-name (string-append name "-" version)) (sha256 (base32 - "05iijiwjwcjbza7qamwd32d0jypi0lpywmilmmj2xh280mcl4dbd")))) + "0kgi7wxxysgjbpisqfj4dj0k19cyyai92f001zi8gzkybd4fkgv5")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm new file mode 100644 index 0000000000..b68e0dce3b --- /dev/null +++ b/gnu/packages/ci.scm @@ -0,0 +1,182 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Eric Bavier +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages ci) + #:use-module ((guix licenses) #:prefix l:) + #:use-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages docbook) + #:use-module (gnu packages compression) + #:use-module (gnu packages databases) + #:use-module (gnu packages guile) + #:use-module (gnu packages mail) + #:use-module (gnu packages openssl) + #:use-module (gnu packages package-management) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages version-control) + #:use-module (gnu packages web) + #:use-module (gnu packages xml) + #:use-module (gnu packages zip) + #:use-module (guix build-system gnu)) + +(define-public hydra + (let ((commit "4c0e3e4")) + (package + (name "hydra") + (version (string-append "20150407." commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/NixOS/hydra") + (commit commit))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "08vc76xb7f42hh65j7qvjf58hw36aki5ml343170pq94vk75b1nh")) + (patches (map search-patch + '("hydra-automake-1.15.patch" + ;; TODO: Remove once we have a darcs input + "hydra-disable-darcs-test.patch"))))) + (build-system gnu-build-system) + (native-inputs + `(("unzip" ,unzip) + ("pkg-config" ,pkg-config) + ;; For documentation + ("dblatex" ,dblatex) + ("xsltproc" ,libxslt) + ("docbook-xsl" ,docbook-xsl) + ;; For bootstrap + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ;; For tests + ("git" ,git) + ("subversion" ,subversion) + ("mercurial" ,mercurial) + ("bazaar" ,bazaar))) + (inputs + `(("perl" ,perl) + ("guile" ,guile-2.0) + ("openssl" ,openssl) + ("bzip2" ,bzip2) + ("gzip" ,gzip) + ("sed" ,sed) + ("starman" ,starman) + ("git" ,git) + ("subversion" ,subversion) + ("mercurial" ,mercurial) + ("bazaar" ,bazaar) + ("nix" ,nix) + ;; Lots o' perl modules... + ("perl-catalyst-action-rest" ,perl-catalyst-action-rest) + ("perl-catalyst-authentication-store-dbix-class" + ,perl-catalyst-authentication-store-dbix-class) + ("perl-catalyst-devel" ,perl-catalyst-devel) + ("perl-catalyst-dispatchtype-regex" ,perl-catalyst-dispatchtype-regex) + ("perl-catalyst-plugin-accesslog" ,perl-catalyst-plugin-accesslog) + ("perl-catalyst-plugin-authorization-roles" + ,perl-catalyst-plugin-authorization-roles) + ("perl-catalyst-plugin-captcha" ,perl-catalyst-plugin-captcha) + ("perl-catalyst-plugin-session-state-cookie" + ,perl-catalyst-plugin-session-state-cookie) + ("perl-catalyst-plugin-session-store-fastmmap" + ,perl-catalyst-plugin-session-store-fastmmap) + ("perl-catalyst-plugin-stacktrace" ,perl-catalyst-plugin-stacktrace) + ("perl-catalyst-traitfor-request-proxybase" + ,perl-catalyst-traitfor-request-proxybase) + ("perl-catalyst-view-download" ,perl-catalyst-view-download) + ("perl-catalyst-view-json" ,perl-catalyst-view-json) + ("perl-catalyst-view-tt" ,perl-catalyst-view-tt) + ("perl-catalystx-roleapplicator" ,perl-catalystx-roleapplicator) + ("perl-catalystx-script-server-starman" + ,perl-catalystx-script-server-starman) + ("perl-crypt-randpasswd" ,perl-crypt-randpasswd) + ("perl-data-dump" ,perl-data-dump) + ("perl-datetime" ,perl-datetime) + ("perl-dbd-pg" ,perl-dbd-pg) + ("perl-dbd-sqlite" ,perl-dbd-sqlite) + ("perl-digest-sha1" ,perl-digest-sha1) + ("perl-email-mime" ,perl-email-mime) + ("perl-email-sender" ,perl-email-sender) + ("perl-file-slurp" ,perl-file-slurp) + ("perl-io-compress" ,perl-io-compress) + ("perl-ipc-run" ,perl-ipc-run) + ("perl-json-any" ,perl-json-any) + ("perl-json-xs" ,perl-json-xs) + ("perl-libwww" ,perl-libwww) + ("perl-lwp-protocol-https" ,perl-lwp-protocol-https) + ("perl-net-amazon-s3" ,perl-net-amazon-s3) + ("perl-padwalker" ,perl-padwalker) + ("perl-readonly" ,perl-readonly) + ("perl-set-scalar" ,perl-set-scalar) + ("perl-sql-splitstatement" ,perl-sql-splitstatement) + ("perl-sys-hostname-long" ,perl-sys-hostname-long) + ("perl-text-diff" ,perl-text-diff) + ("perl-text-table" ,perl-text-table) + ("perl-xml-simple" ,perl-xml-simple))) + (arguments + `(#:configure-flags + (let ((docbook (assoc-ref %build-inputs "docbook-xsl"))) + (list (string-append "--with-docbook-xsl=" + docbook "/xml/xsl/docbook-xsl-" + ,(package-version docbook-xsl)) + (string-append "--docdir=" %output + "/doc/hydra-" ,version))) + #:phases (modify-phases %standard-phases + (add-after + 'unpack 'bootstrap + (lambda _ (zero? (system* "autoreconf" "-vfi")))) + (add-before + 'check 'check-setup + (lambda _ (setenv "LOGNAME" "test.log"))) + (add-after + 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (file) + (wrap-program file + `("PATH" ":" prefix + (,(string-append out "/bin") + ,@(map (lambda (i) + (string-append (assoc-ref inputs i) + "/bin")) + '("subversion" "git" "bazaar" + "mercurial" "coreutils" "gzip" + "sed" "unzip" "nix")))) + `("PERL5LIB" ":" prefix + (,(string-append out "/libexec/hydra/lib") + ,@(search-path-as-string->list + (getenv "PERL5LIB")))) + `("HYDRA_RELEASE" = (,,version)) + `("HYDRA_HOME" = + (,(string-append out "/libexec/hydra"))) + `("NIX_RELEASE" = (,,(package-version nix))))) + (find-files (string-append out "/bin") + ".*")))))))) + (home-page "https://nixos.org/hydra") + (synopsis "Continuous build system") + (description + "Hydra is a tool for continuous integration testing and software +release that uses a purely functional language to describe build jobs and +their dependencies.") + (license l:gpl3+)))) diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index 9d2bde829d..97261d6c79 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Ludovic Courtès ;;; Copyright © 2015 Andreas Enge +;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,9 +23,12 @@ (define-module (gnu packages code) #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) + #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages emacs) + #:use-module (gnu packages gcc) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) #:use-module (gnu packages perl) @@ -225,3 +229,63 @@ (define-public the-silver-searcher files, but compared to grep is much faster and respects files like .gitignore, .hgignore, etc.") (license license:asl2.0))) + +(define-public withershins + (package + (name "withershins") + (version "0.1") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/cameronwhite/withershins/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh")))) + (build-system cmake-build-system) + (arguments + `(#:out-of-source? #f + #:modules ((guix build utils) + (guix build cmake-build-system) + (ice-9 popen) + (ice-9 rdelim)) + #:phases + (modify-phases %standard-phases + (add-after + 'unpack 'find-libiberty + (lambda _ + (let ((plugin (let* ((port (open-input-pipe + "gcc -print-file-name=plugin")) + (str (read-line port))) + (close-pipe port) + str))) + (substitute* "cmake/FindIberty.cmake" + (("/usr/include") (string-append plugin "/include")) + (("libiberty.a iberty") (string-append "NAMES libiberty.a iberty\nPATHS \"" + (assoc-ref %build-inputs "gcc") + "/lib" "\""))) + #t))) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/lib")) + (mkdir (string-append out "/include")) + (copy-file "src/withershins.hpp" + (string-append out "/include/withershins.hpp")) + (copy-file "src/libwithershins.a" + (string-append out "/lib/libwithershins.a"))) + #t))))) + (home-page "https://github.com/cameronwhite/withershins") + (inputs + `(("gcc" ,gcc-4.8 "lib") ;for libiberty.a + ("binutils" ,binutils) ;for libbfd + ("zlib" ,zlib))) + (synopsis "C++11 library for generating stack traces") + (description + "Withershins is a simple cross-platform C++11 library for generating +stack traces.") + ;; Sources are released under Expat license, but since BFD is licensed + ;; under the GPLv3+ the combined work is GPLv3+ as well. + (license license:gpl3+))) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 14af09395a..db91bec5da 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -65,7 +65,6 @@ (define gnu-make-boot0 (package-with-bootstrap-guile (package (inherit gnu-make) (name "make-boot0") - (location (source-properties->location (current-source-location))) (arguments `(#:guile ,%bootstrap-guile #:implicit-inputs? #f @@ -93,7 +92,6 @@ (define diffutils-boot0 ,@%bootstrap-inputs) #:guile %bootstrap-guile))) (package (inherit p) - (location (source-properties->location (current-source-location))) (arguments `(#:tests? #f ; the test suite needs diffutils ,@(package-arguments p))))))) @@ -552,7 +550,6 @@ (define-public gcc-final ;; The final GCC. (package (inherit gcc-boot0) (name "gcc") - (location (source-properties->location (current-source-location))) ;; XXX: Currently #:allowed-references applies to all the outputs but the ;; "debug" output contains disallowed references, notably diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index e5e21045e0..9c27483466 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -38,7 +38,6 @@ (define-module (gnu packages cross-base) (define (cross p target) (package (inherit p) - (location (source-properties->location (current-source-location))) (name (string-append (package-name p) "-cross-" target)) (arguments (substitute-keyword-arguments (package-arguments p) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index fbddff1cf6..0f71c77bf2 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -123,7 +123,6 @@ (define-public emacs-no-x ;; This is the version that you should use as an input to packages that just ;; need to byte-compile .el files. (package (inherit emacs) - (location (source-properties->location (current-source-location))) (name "emacs-no-x") (synopsis "The extensible, customizable, self-documenting text editor (console only)") @@ -138,7 +137,6 @@ (define-public emacs-no-x (define-public emacs-no-x-toolkit (package (inherit emacs) - (location (source-properties->location (current-source-location))) (name "emacs-no-x-toolkit") (synopsis "The extensible, customizable, self-documenting text editor (without an X toolkit)" ) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 4af1d13495..4599f4d234 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -1854,6 +1854,40 @@ (define-public glib-networking library.") (license license:lgpl2.0+))) +(define-public librest + (package + (name "librest") + (version "0.7.93") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/rest/" + (version-major+minor version) "/" + "rest-" version ".tar.xz")) + (sha256 + (base32 + "05mj10hhiik23ai8w4wkk5vhsp7hcv24bih5q3fl82ilam268467")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; tests require internet connection + #:configure-flags + '("--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"))) + (native-inputs + `(("glib-mkenums" ,glib "bin") + ("gobject-introspection" ,gobject-introspection) + ("pkg-config" ,pkg-config))) + (propagated-inputs + ;; rest-0.7.pc refers to all these. + `(("glib" ,glib) + ("libsoup" ,libsoup) + ("libxml2" ,libxml2))) + (home-page "http://www.gtk.org/") + (synopsis "RESTful web api query library") + (description + "This library was designed to make it easier to access web services that +claim to be \"RESTful\". It includes convenience wrappers for libsoup and +libxml to ease remote use of the RESTful API.") + (license license:lgpl2.1+))) + (define-public libsoup (package (name "libsoup") diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 5724bc8348..2044ef0501 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -190,14 +190,14 @@ (define-public npth (define-public gnupg (package (name "gnupg") - (version "2.1.4") + (version "2.1.5") (source (origin (method url-fetch) (uri (string-append "mirror://gnupg/gnupg/gnupg-" version ".tar.bz2")) (sha256 (base32 - "1c3c89b7ziknz6h1dnwmfjhgyy28g982rcncrhmhylb8v3npw4k4")))) + "0k5818r847zplbrwjp6i48s6xb5zy44rny2kmbisd6y3c1qml45m")))) (build-system gnu-build-system) (inputs `(("bzip2" ,bzip2) diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index ac87de540e..75bbb24479 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -144,7 +144,7 @@ (define-public ghc (ghc-bootstrap-prefix (string-append ghc-bootstrap-path "/usr" ))) (alist-cons-after - 'unpack-bin 'unpack-and-fix-testsuite + 'unpack-bin 'unpack-testsuite-and-fix-bins (lambda* (#:key inputs outputs #:allow-other-keys) (with-directory-excursion ".." (copy-file (assoc-ref inputs "ghc-testsuite") @@ -155,7 +155,9 @@ (define-public ghc "testsuite/timeout/timeout.py" "testsuite/timeout/timeout.hs" "testsuite/tests/rename/prog006/Setup.lhs" - "testsuite/tests/programs/life_space_leak/life.test") + "testsuite/tests/programs/life_space_leak/life.test" + "libraries/process/System/Process/Internals.hs" + "libraries/unix/cbits/execvpe.c") (("/bin/sh") (which "sh")) (("/bin/rm") "rm")) #t) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index ea8de9e2cf..aa8cd2cf51 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -610,6 +610,9 @@ (define-public icedtea7 (modules '((guix build utils))) (snippet '(substitute* "Makefile.in" + ;; link against libgcj to avoid linker error + (("-o native-ecj") + "-lgcj -o native-ecj") ;; do not leak information about the build host (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"") "DISTRIBUTION_ID=\"\\\"guix\\\"\""))))) @@ -627,15 +630,7 @@ (define-public icedtea7 #:locale "C" ,@(substitute-keyword-arguments (package-arguments icedtea6) ((#:configure-flags flags) - `(let ((jdk (assoc-ref %build-inputs "icedtea6")) - (ant (assoc-ref %build-inputs "ant"))) - `("--disable-bootstrap" - "--without-rhino" - "--enable-nss" - "--enable-system-lcms" - "--disable-downloading" - ,(string-append "--with-ant-home=" ant) - ,(string-append "--with-jdk-home=" jdk)))) + `(delete "--with-openjdk-src-dir=./openjdk" ,flags)) ((#:phases phases) `(modify-phases ,phases (replace @@ -677,30 +672,37 @@ (define-public icedtea7 (replace 'set-additional-paths (lambda* (#:key inputs #:allow-other-keys) - (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk" - (("ALSA_INCLUDE=/usr/include/alsa/version.h") - (string-append "ALSA_INCLUDE=" - (assoc-ref inputs "alsa-lib") - "/include/alsa/version.h"))) - (setenv "CC" "gcc") - (setenv "CPATH" - (string-append (assoc-ref inputs "libxrender") - "/include/X11/extensions" ":" - (assoc-ref inputs "libxtst") - "/include/X11/extensions" ":" - (assoc-ref inputs "libxinerama") - "/include/X11/extensions" ":" - (or (getenv "CPATH") ""))) - (setenv "ALT_OBJCOPY" (which "objcopy")) - (setenv "ALT_CUPS_HEADERS_PATH" - (string-append (assoc-ref inputs "cups") - "/include")) - (setenv "ALT_FREETYPE_HEADERS_PATH" - (string-append (assoc-ref inputs "freetype") - "/include")) - (setenv "ALT_FREETYPE_LIB_PATH" - (string-append (assoc-ref inputs "freetype") - "/lib")))) + (let (;; Get target-specific include directory so that + ;; libgcj-config.h is found when compiling hotspot. + (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include")) + (str (read-line port))) + (close-pipe port) + str))) + (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk" + (("ALSA_INCLUDE=/usr/include/alsa/version.h") + (string-append "ALSA_INCLUDE=" + (assoc-ref inputs "alsa-lib") + "/include/alsa/version.h"))) + (setenv "CC" "gcc") + (setenv "CPATH" + (string-append gcjinclude ":" + (assoc-ref inputs "libxrender") + "/include/X11/extensions" ":" + (assoc-ref inputs "libxtst") + "/include/X11/extensions" ":" + (assoc-ref inputs "libxinerama") + "/include/X11/extensions" ":" + (or (getenv "CPATH") ""))) + (setenv "ALT_OBJCOPY" (which "objcopy")) + (setenv "ALT_CUPS_HEADERS_PATH" + (string-append (assoc-ref inputs "cups") + "/include")) + (setenv "ALT_FREETYPE_HEADERS_PATH" + (string-append (assoc-ref inputs "freetype") + "/include")) + (setenv "ALT_FREETYPE_LIB_PATH" + (string-append (assoc-ref inputs "freetype") + "/lib"))))) (add-after 'unpack 'fix-x11-extension-include-path (lambda* (#:key inputs #:allow-other-keys) @@ -733,7 +735,6 @@ (define-public icedtea7 (delete 'patch-patches)))))) (native-inputs `(("ant" ,ant) - ("icedtea6" ,icedtea6 "jdk") ("openjdk-drop" ,(drop "openjdk" "03gxqn17cxwl1nspnwigacaqd28p02d45f396j5f4kkbzfnbl0ak")) @@ -756,4 +757,4 @@ (define-public icedtea7 ,(drop "hotspot" "1yqxfd2jwbm5y41wscyfx8h0fr3h8ny2g2mda5iwd8sikxsaj96p")) ,@(fold alist-delete (package-native-inputs icedtea6) - '("openjdk6-src" "ant-bootstrap" "gcj"))))))) + '("openjdk6-src" "ant-bootstrap"))))))) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm new file mode 100644 index 0000000000..cfeb1daf63 --- /dev/null +++ b/gnu/packages/machine-learning.scm @@ -0,0 +1,146 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Ricardo Wurmus +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages machine-learning) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages boost) + #:use-module (gnu packages compression) + #:use-module (gnu packages gcc) + #:use-module (gnu packages maths) + #:use-module (gnu packages python) + #:use-module (gnu packages xml)) + +(define-public libsvm + (package + (name "libsvm") + (version "3.20") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/cjlin1/libsvm/archive/v" + (string-delete #\. version) ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1jpjlql3frjza7zxzrqqr2firh44fjb8fqsdmvz6bjz7sb47zgp4")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no "check" target + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin/"))) + (mkdir-p bin) + (for-each (lambda (file) + (copy-file file (string-append bin file))) + '("svm-train" + "svm-predict" + "svm-scale"))) + #t))))) + (home-page "http://www.csie.ntu.edu.tw/~cjlin/libsvm/") + (synopsis "Library for Support Vector Machines") + (description + "LIBSVM is a machine learning library for support vector +classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and +distribution estimation (one-class SVM). It supports multi-class +classification.") + (license license:bsd-3))) + +(define-public python-libsvm + (package (inherit libsvm) + (name "python-libsvm") + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no "check" target + #:make-flags '("-C" "python") + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace + 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((site (string-append (assoc-ref outputs "out") + "/lib/python" + (string-take + (string-take-right + (assoc-ref inputs "python") 5) 3) + "/site-packages/"))) + (substitute* "python/svm.py" + (("../libsvm.so.2") "libsvm.so.2")) + (mkdir-p site) + (for-each (lambda (file) + (copy-file file (string-append site (basename file)))) + (find-files "python" "\\.py")) + (copy-file "libsvm.so.2" + (string-append site "libsvm.so.2"))) + #t))))) + (inputs + `(("python" ,python))) + (synopsis "Python bindings of libSVM"))) + +(define-public randomjungle + (package + (name "randomjungle") + (version "2.1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "http://www.imbs-luebeck.de/imbs/sites/default/files/u59/" + "randomjungle-" version ".tar_.gz")) + (sha256 + (base32 + "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list (string-append "--with-boost=" + (assoc-ref %build-inputs "boost"))) + #:phases + (modify-phases %standard-phases + (add-before + 'configure 'set-CXXFLAGS + (lambda _ + (setenv "CXXFLAGS" "-fpermissive ") + #t))))) + (inputs + `(("boost" ,boost) + ("gsl" ,gsl) + ("libxml2" ,libxml2) + ("zlib" ,zlib))) + (native-inputs + `(("gfortran" ,gfortran-4.8))) + (home-page "http://www.imbs-luebeck.de/imbs/de/node/227/") + (synopsis "Implementation of the Random Forests machine learning method") + (description + "Random Jungle is an implementation of Random Forests. It is supposed to +analyse high dimensional data. In genetics, it can be used for analysing big +Genome Wide Association (GWA) data. Random Forests is a powerful machine +learning method. Most interesting features are variable selection, missing +value imputation, classifier creation, generalization error estimation and +sample proximities between pairs of cases.") + (license license:gpl3+))) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 9eb868a118..62398dfde3 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -601,7 +601,6 @@ (define %guile-static-stripped (define (tarball-package pkg) "Return a package containing a tarball of PKG." (package (inherit pkg) - (location (source-properties->location (current-source-location))) (name (string-append (package-name pkg) "-tarball")) (build-system trivial-build-system) (native-inputs `(("tar" ,tar) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 4d837c85e2..6fbe6fd27d 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -560,7 +560,6 @@ (define-public petsc (define-public petsc-complex (package (inherit petsc) - (location (source-properties->location (current-source-location))) (name "petsc-complex") (arguments (substitute-keyword-arguments (package-arguments petsc) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 5795ecbb0d..a42d5c35c5 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -22,9 +22,15 @@ (define-module (gnu packages music) #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) #:use-module (gnu packages) #:use-module (gnu packages audio) + #:use-module (gnu packages base) ;libbdf + #:use-module (gnu packages boost) #:use-module (gnu packages bison) + #:use-module (gnu packages code) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) #:use-module (gnu packages docbook) #:use-module (gnu packages flex) #:use-module (gnu packages fonts) @@ -45,9 +51,11 @@ (define-module (gnu packages music) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages qt) #:use-module (gnu packages rsync) #:use-module (gnu packages texinfo) #:use-module (gnu packages texlive) + #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xiph) #:use-module (gnu packages zip)) @@ -224,6 +232,96 @@ (define-public solfege your own lessons.") (license license:gpl3+))) +(define-public powertabeditor + (package + (name "powertabeditor") + (version "2.0.0-alpha7") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/powertab/powertabeditor/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1yp6ck2r72c2pfq31z1kpw1j639rndrifj85l3cbj2kdf8rdzhkk")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove bundled sources for external libraries + (delete-file-recursively "external") + (substitute* "CMakeLists.txt" + (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "") + ;; TODO: tests cannot be built: + ;; test/test_main.cpp:28:12: error: ‘Session’ is not a member of ‘Catch’ + (("add_subdirectory\\(test\\)") "") + (("add_subdirectory\\(external\\)") "")) + (substitute* "test/CMakeLists.txt" + (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "")) + + ;; Add install target + (substitute* "source/CMakeLists.txt" + (("qt5_use_modules") + (string-append + "install(TARGETS powertabeditor " + "RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)\n" + "install(FILES data/tunings.json DESTINATION " + "${CMAKE_INSTALL_PREFIX}/share/powertabeditor/)\n" + "qt5_use_modules"))) + #t)))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no "check" target + #:modules ((guix build cmake-build-system) + (guix build utils) + (ice-9 match)) + #:configure-flags + ;; CMake appears to lose the RUNPATH for some reason, so it has to be + ;; explicitly set with CMAKE_INSTALL_RPATH. + (list (string-append "-DCMAKE_INSTALL_RPATH=" + (string-join (map (match-lambda + ((name . directory) + (string-append directory "/lib"))) + %build-inputs) ";"))) + #:phases + (modify-phases %standard-phases + (add-before + 'configure 'remove-third-party-libs + (lambda* (#:key inputs #:allow-other-keys) + ;; Link with required static libraries, because we're not + ;; using the bundled version of withershins. + (substitute* '("source/CMakeLists.txt" + "test/CMakeLists.txt") + (("target_link_libraries\\((powertabeditor)" _ target) + (string-append "target_link_libraries(" target " " + (assoc-ref inputs "binutils") + "/lib/libbfd.a " + (assoc-ref inputs "gcc") + "/lib/libiberty.a " + "dl"))) + #t))))) + (inputs + `(("boost" ,boost) + ("alsa-lib" ,alsa-lib) + ("qt" ,qt) + ("withershins" ,withershins) + ("gcc" ,gcc-4.8 "lib") ;for libiberty.a (for withershins) + ("binutils" ,binutils) ;for -lbfd and -liberty (for withershins) + ("timidity" ,timidity++) + ("pugixml" ,pugixml) + ("rtmidi" ,rtmidi) + ("rapidjson" ,rapidjson) + ("zlib" ,zlib))) + (native-inputs + `(("catch" ,catch-framework) + ("pkg-config" ,pkg-config))) + (home-page "http://powertabs.net") + (synopsis "Guitar tablature editor") + (description + "Power Tab Editor 2.0 is the successor to the famous original Power Tab +Editor. It is compatible with Power Tab Editor 1.7 and Guitar Pro.") + (license license:gpl3+))) + (define-public tuxguitar (package (name "tuxguitar") diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 1ed7a7a1f2..dec51a1e04 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -29,14 +29,14 @@ (define-module (gnu packages openssl) (define-public openssl (package (name "openssl") - (version "1.0.2a") + (version "1.0.2b") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version ".tar.gz")) (sha256 (base32 - "0jijgzf72659pikms2bc5w31h78xrd1h5zp2r01an2h340y3kdhm")) + "0gwf4fy1yqmai6wph0g9lh09iarwxaa70hm7jm0rf1qakz68im6m")) (patches (list (search-patch "openssl-runpath.patch"))))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) @@ -91,7 +91,10 @@ (define-public perl-net-ssleay "Net-SSLeay-" version ".tar.gz")) (sha256 (base32 - "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p")))) + "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p")) + (patches + ;; XXX Try removing this patch for perl-net-ssleay > 1.68 + (list (search-patch "perl-net-ssleay-disable-ede-test.patch"))))) (build-system perl-build-system) (inputs `(("openssl" ,openssl))) (arguments diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index db05969139..7f6ec56151 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -38,6 +38,7 @@ (define-module (gnu packages package-management) #:use-module (gnu packages perl) #:use-module (gnu packages curl) #:use-module (gnu packages web) + #:use-module (gnu packages man) #:use-module (gnu packages emacs) #:use-module (gnu packages openssl) #:use-module (gnu packages bdw-gc)) @@ -74,31 +75,46 @@ (define-public guix-0.8.2 (string-append "--with-libgcrypt-prefix=" (assoc-ref %build-inputs "libgcrypt"))) - #:phases (alist-cons-before - 'configure 'copy-bootstrap-guile - (lambda* (#:key system inputs #:allow-other-keys) - (define (boot-guile-version arch) - (if (string=? "armhf" arch) - "2.0.11" - "2.0.9")) + #:phases (modify-phases %standard-phases + (add-before + 'configure 'copy-bootstrap-guile + (lambda* (#:key system inputs #:allow-other-keys) + (define (boot-guile-version arch) + (if (string=? "armhf" arch) + "2.0.11" + "2.0.9")) - (define (copy arch) - (let ((guile (assoc-ref inputs - (string-append "boot-guile/" - arch))) - (target (string-append "gnu/packages/bootstrap/" - arch "-linux/" - "/guile-" - (boot-guile-version arch) - ".tar.xz"))) - (copy-file guile target))) + (define (copy arch) + (let ((guile (assoc-ref inputs + (string-append "boot-guile/" + arch))) + (target (string-append "gnu/packages/bootstrap/" + arch "-linux/" + "/guile-" + (boot-guile-version arch) + ".tar.xz"))) + (copy-file guile target))) - (copy "i686") - (copy "x86_64") - (copy "mips64el") - (copy "armhf") - #t) - %standard-phases))) + (copy "i686") + (copy "x86_64") + (copy "mips64el") + (copy "armhf") + #t)) + (add-after + 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Make sure the 'guix' command finds GnuTLS and + ;; Guile-JSON automatically. + (let* ((out (assoc-ref outputs "out")) + (json (assoc-ref inputs "guile-json")) + (gnutls (assoc-ref inputs "gnutls")) + (path (string-append + json "/share/guile/site/2.0:" + gnutls "/share/guile/site/2.0"))) + (wrap-program (string-append out "/bin/guix") + `("GUILE_LOAD_PATH" ":" prefix (,path)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,path))) + #t)))))) (native-inputs `(("pkg-config" ,pkg-config) ("emacs" ,emacs-no-x))) ;for guix.el (inputs @@ -150,7 +166,7 @@ (define guix-devel ;; ;; Note: use a short commit id; when using the long one, the limit on socket ;; file names is exceeded while running the tests. - (let ((commit "c2ee19e")) + (let ((commit "a43b55f")) (package (inherit guix-0.8.2) (version (string-append "0.8.2." commit)) (source (origin @@ -160,7 +176,8 @@ (define guix-devel (commit commit))) (sha256 (base32 - "1gwc1gypgscxg2m3n2vd0mw4dmxr7vsisqgh3y0lr05q9z5742sj")))) + "1r0l8gfh5nxc1j0sqj8ywkg280k9qbj7zsk33z84rvl7l0nwnk88")) + (file-name (string-append "guix-" version "-checkout")))) (arguments (substitute-keyword-arguments (package-arguments guix-0.8.2) ((#:phases phases) @@ -180,6 +197,7 @@ (define guix-devel ("gettext" ,gnu-gettext) ("texinfo" ,texinfo) ("graphviz" ,graphviz) + ("help2man" ,help2man) ,@(package-native-inputs guix-0.8.2)))))) (define-public guix guix-devel) diff --git a/gnu/packages/patches/hydra-automake-1.15.patch b/gnu/packages/patches/hydra-automake-1.15.patch new file mode 100644 index 0000000000..0d8fa98519 --- /dev/null +++ b/gnu/packages/patches/hydra-automake-1.15.patch @@ -0,0 +1,63 @@ +This patch takes a slightly different approach to solving the issue reported +at https://github.com/NixOS/hydra/issues/200. This fix allows us to use +Automake's parallel test harness. + +--- source/configure.ac.orig 1969-12-31 18:00:01.000000000 -0600 ++++ source/configure.ac 2015-04-15 10:58:15.974679278 -0500 +@@ -33,7 +33,7 @@ + fi + ]) + +-NEED_PROG(perl, perl) ++NEED_PROG([PERL], perl) + + NEED_PROG([NIX_STORE_PROGRAM], [nix-store]) + +--- source/tests/Makefile.am.orig 1969-12-31 18:00:01.000000000 -0600 ++++ source/tests/Makefile.am 2015-04-15 11:00:35.846682904 -0500 +@@ -1,19 +1,20 @@ +-TESTS_ENVIRONMENT = \ +- BZR_HOME="$(abs_builddir)/data" \ +- HYDRA_DBI="dbi:SQLite:db.sqlite" \ +- HYDRA_DATA="$(abs_builddir)/data" \ +- HYDRA_HOME="$(top_srcdir)/src" \ +- HYDRA_CONFIG= \ +- NIX_REMOTE= \ +- NIX_CONF_DIR="$(abs_builddir)/nix/etc/nix" \ +- NIX_STATE_DIR="$(abs_builddir)/nix/var/nix" \ +- NIX_MANIFESTS_DIR="$(abs_builddir)/nix/var/nix/manifests" \ +- NIX_STORE_DIR="$(abs_builddir)/nix/store" \ +- NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \ +- NIX_BUILD_HOOK= \ +- PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB" \ +- PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/c:$$PATH \ +- perl -w ++AM_TESTS_ENVIRONMENT = \ ++ BZR_HOME="$(abs_builddir)/data"; export BZR_HOME; \ ++ HYDRA_DBI="dbi:SQLite:db.sqlite"; export HYDRA_DBI; \ ++ HYDRA_DATA="$(abs_builddir)/data"; export HYDRA_DATA; \ ++ HYDRA_HOME="$(top_srcdir)/src"; export HYDRA_HOME; \ ++ HYDRA_CONFIG=; export HYDRA_CONFIG; \ ++ NIX_REMOTE=; export NIX_REMOTE; \ ++ NIX_CONF_DIR="$(abs_builddir)/nix/etc/nix"; export NIX_CONF_DIR; \ ++ NIX_STATE_DIR="$(abs_builddir)/nix/var/nix"; export NIX_STATE_DIR; \ ++ NIX_MANIFESTS_DIR="$(abs_builddir)/nix/var/nix/manifests"; export NIX_MANIFESTS_DIR; \ ++ NIX_STORE_DIR="$(abs_builddir)/nix/store"; export NIX_STORE_DIR; \ ++ NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix"; export NIX_LOG_DIR; \ ++ NIX_BUILD_HOOK=; export NIX_BUILD_HOOK; \ ++ PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB"; export PERL5LIB; \ ++ PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/c:$$PATH; export PATH; ++LOG_COMPILER = $(PERL) ++AM_LOG_FLAGS = -w + + EXTRA_DIST = \ + $(wildcard *.pm) \ +@@ -33,7 +34,7 @@ + check_SCRIPTS = db.sqlite repos + + db.sqlite: $(top_srcdir)/src/sql/hydra-sqlite.sql +- $(TESTS_ENVIRONMENT) $(top_srcdir)/src/script/hydra-init ++ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) $(top_srcdir)/src/script/hydra-init + + repos: dirs + diff --git a/gnu/packages/patches/hydra-disable-darcs-test.patch b/gnu/packages/patches/hydra-disable-darcs-test.patch new file mode 100644 index 0000000000..5d8e015b08 --- /dev/null +++ b/gnu/packages/patches/hydra-disable-darcs-test.patch @@ -0,0 +1,25 @@ +--- hydra-20150407.4c0e3e4/tests/evaluation-tests.pl 2015-04-15 12:00:19.000000000 -0500 ++++ hydra-20150407.4c0e3e4/tests/evaluation-tests.pl 2015-04-17 08:53:04.940301471 -0500 +@@ -7,7 +7,7 @@ + + my $db = Hydra::Model::DB->new; + +-use Test::Simple tests => 72; ++use Test::Simple tests => 68; + + hydra_setup($db); + +@@ -103,13 +103,6 @@ + uri => "$jobsBaseUri/hg-repo", + update => getcwd . "/jobs/hg-update.sh" + }, +- { +- name => "darcs", +- nixexpr => "darcs-input.nix", +- type => "darcs", +- uri => "$jobsBaseUri/darcs-repo", +- update => getcwd . "/jobs/darcs-update.sh" +- } + ); + + foreach my $scm ( @scminputs ) { diff --git a/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch b/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch new file mode 100644 index 0000000000..16f136fb54 --- /dev/null +++ b/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch @@ -0,0 +1,23 @@ +Disable a test that fails with openssl-1.0.2b. + +--- Net-SSLeay-1.68/t/local/33_x509_create_cert.t.orig 2014-06-07 02:01:39.000000000 -0400 ++++ Net-SSLeay-1.68/t/local/33_x509_create_cert.t 2015-06-12 03:38:57.620286888 -0400 +@@ -2,7 +2,7 @@ + + use strict; + use warnings; +-use Test::More tests => 123; ++use Test::More tests => 122; + use Net::SSLeay qw/MBSTRING_ASC MBSTRING_UTF8 EVP_PK_RSA EVP_PKT_SIGN EVP_PKT_ENC/; + use File::Spec; + use utf8; +@@ -101,7 +101,8 @@ + like(my $key_pem3 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg1), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); + + ok(my $alg2 = Net::SSLeay::EVP_get_cipherbyname("DES-EDE3-OFB"), "EVP_get_cipherbyname"); +- like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); ++ # This test fails with openssl-1.0.2b ++ #like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); + + is(Net::SSLeay::X509_NAME_print_ex($name), "O=Company Name,C=UK,CN=Common name text X509", "X509_NAME_print_ex"); + diff --git a/gnu/packages/patches/python-disable-ssl-test.patch b/gnu/packages/patches/python-disable-ssl-test.patch new file mode 100644 index 0000000000..e351c77505 --- /dev/null +++ b/gnu/packages/patches/python-disable-ssl-test.patch @@ -0,0 +1,12 @@ +Disable a test that fails with openssl-1.0.2b. + +--- Lib/test/test_ssl.py.orig 2015-02-25 06:27:45.000000000 -0500 ++++ Lib/test/test_ssl.py 2015-06-12 03:14:09.395212502 -0400 +@@ -2718,6 +2718,7 @@ + chatty=True, connectionchatty=True) + self.assertIs(stats['compression'], None) + ++ @unittest.skipIf(True, "openssl 1.0.2b complains: dh key too small") + def test_dh_params(self): + # Check we can get a connection with ephemeral Diffie-Hellman + context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 45ca94b279..3d28455405 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -4106,6 +4106,28 @@ (define-public perl-set-infinite (description "Set::Infinite is a set theory module for infinite sets.") (license (package-license perl)))) +(define-public perl-set-object + (package + (name "perl-set-object") + (version "1.35") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/R/RU/RURBAN/" + "Set-Object-" version ".tar.gz")) + (sha256 + (base32 + "1rqf11274s3h17jgbimmg47k4fmayifajqwaa6lgm0z5qdy4v6hq")))) + (build-system perl-build-system) + (propagated-inputs + `(("perl-moose" ,perl-moose) + ("perl-test-leaktrace" ,perl-test-leaktrace))) + (home-page "http://search.cpan.org/dist/Set-Object") + (synopsis "Unordered collections of Perl Objects") + (description "Set::Object provides efficient sets, unordered collections +of Perl objects without duplicates for scalars and references.") + (license artistic2.0))) + (define-public perl-set-scalar (package (name "perl-set-scalar") diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 914c2dc23c..232a785778 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -207,7 +207,9 @@ (define-public python (method url-fetch) (uri (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) - (patches (list (search-patch "python-fix-tests.patch"))) + (patches (list (search-patch "python-fix-tests.patch") + ;; XXX Try removing this patch for python > 3.4.3 + (search-patch "python-disable-ssl-test.patch"))) (patch-flags '("-p0")) (sha256 (base32 diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index e77bad76d6..94d9970ea6 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -259,6 +259,27 @@ (define-public json-c parse JSON formatted strings back into the C representation of JSON objects.") (license l:x11))) +(define-public rapidjson + (package + (name "rapidjson") + (version "1.0.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/miloyip/rapidjson/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0rl6s0vg5y1dhh9vfl1lqay3sxf69sxjh0czxrjmasn7ng91wwf3")))) + (build-system cmake-build-system) + (home-page "https://github.com/miloyip/rapidjson") + (synopsis "JSON parser/generator for C++ with both SAX/DOM style API") + (description + "RapidJSON is a fast JSON parser/generator for C++ with both SAX/DOM +style API.") + (license l:expat))) + (define-public libwebsockets (package (name "libwebsockets") @@ -704,6 +725,41 @@ (define-public perl-catalyst-action-rest regular method.") (license (package-license perl)))) +(define-public perl-catalyst-authentication-store-dbix-class + (package + (name "perl-catalyst-authentication-store-dbix-class") + (version "0.1506") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/" + "Catalyst-Authentication-Store-DBIx-Class-" + version ".tar.gz")) + (sha256 + (base32 + "0i5ja7690fs9nhxcij6lw51j804sm8s06m5mvk1n8pi8jljrymvw")))) + (build-system perl-build-system) + (native-inputs + `(("perl-catalyst-plugin-authorization-roles" + ,perl-catalyst-plugin-authorization-roles) + ("perl-catalyst-plugin-session-state-cookie" + ,perl-catalyst-plugin-session-state-cookie) + ("perl-dbd-sqlite" ,perl-dbd-sqlite) + ("perl-test-www-mechanize-catalyst" ,perl-test-www-mechanize-catalyst))) + (propagated-inputs + `(("perl-catalyst-runtime" ,perl-catalyst-runtime) + ("perl-catalyst-plugin-authentication" + ,perl-catalyst-plugin-authentication) + ("perl-dbix-class" ,perl-dbix-class) + ("perl-catalyst-model-dbic-schema" ,perl-catalyst-model-dbic-schema))) + (home-page + "http://search.cpan.org/dist/Catalyst-Authentication-Store-DBIx-Class") + (synopsis "Storage class for Catalyst authentication using DBIx::Class") + (description "The Catalyst::Authentication::Store::DBIx::Class class +provides access to authentication information stored in a database via +DBIx::Class.") + (license (package-license perl)))) + (define-public perl-catalyst-component-instancepercontext (package (name "perl-catalyst-component-instancepercontext") @@ -905,6 +961,35 @@ (define-public perl-catalyst-plugin-authentication system authorises them to do).") (license (package-license perl)))) +(define-public perl-catalyst-plugin-authorization-roles + (package + (name "perl-catalyst-plugin-authorization-roles") + (version "0.09") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BO/BOBTFISH/" + "Catalyst-Plugin-Authorization-Roles-" + version ".tar.gz")) + (sha256 + (base32 + "0l83lkwmq0lngwh8b1rv3r719pn8w1gdbyhjqm74rnd0wbjl8h7f")))) + (build-system perl-build-system) + (native-inputs + `(("perl-test-exception" ,perl-test-exception))) + (propagated-inputs + `(("perl-catalyst-plugin-authentication" + ,perl-catalyst-plugin-authentication) + ("perl-catalyst-runtime" ,perl-catalyst-runtime) + ("perl-set-object" ,perl-set-object) + ("perl-universal-isa" ,perl-universal-isa))) + (home-page + "http://search.cpan.org/dist/Catalyst-Plugin-Authorization-Roles") + (synopsis "Role-based authorization for Catalyst") + (description "Catalyst::Plugin::Authorization::Roles provides role-based +authorization for Catalyst based on Catalyst::Plugin::Authentication.") + (license (package-license perl)))) + (define-public perl-catalyst-plugin-captcha (package (name "perl-catalyst-plugin-captcha") diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 59b73d2aa5..c4ec33e2d7 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013, 2015 Andreas Enge ;;; Copyright © 2015 Eric Bavier ;;; Copyright © 2015 Sou Bunnbu +;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,6 +32,7 @@ (define-module (gnu packages xml) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) #:use-module (guix build-system python) @@ -368,6 +370,41 @@ (define-public perl-xml-dom that conforms to the API of the Document Object Model.") (home-page "http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm"))) +(define-public pugixml + (package + (name "pugixml") + (version "1.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/zeux/pugixml/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:out-of-source? #f + #:phases (modify-phases %standard-phases + (add-before + 'configure 'chdir + (lambda _ + (chdir "scripts") + #t))))) + (home-page "http://pugixml.org") + (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support") + (description + "pugixml is a C++ XML processing library, which consists of a DOM-like +interface with rich traversal/modification capabilities, a fast XML parser +which constructs the DOM tree from an XML file/buffer, and an XPath 1.0 +implementation for complex data-driven tree queries. Full Unicode support is +also available, with Unicode interface variants and conversions between +different Unicode encodings which happen automatically during +parsing/saving.") + (license license:expat))) + (define-public xmlto (package (name "xmlto") diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 27d8ecdefc..e8a36b3def 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -269,7 +269,8 @@ (define (normal-tty tty) (guix-service #:authorize-hydra-key? #t) ;; Start udev so that useful device nodes are available. - (udev-service) + ;; Use device-mapper rules for cryptsetup & co. + (udev-service #:rules (list lvm2)) ;; Add the 'cow-store' service, which users have to start manually ;; since it takes the installation directory as an argument. diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index da664e5422..05b6e6f680 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -160,12 +160,10 @@ (define (static-libgcc-package p) "A version of P linked with `-static-gcc'." (package-with-extra-configure-variable p "LDFLAGS" "-static-libgcc")) -(define* (static-package p #:optional (loc (current-source-location)) - #:key (strip-all? #t)) +(define* (static-package p #:key (strip-all? #t)) "Return a statically-linked version of package P. If STRIP-ALL? is true, use `--strip-all' as the arguments to `strip'." (package (inherit p) - (location (source-properties->location loc)) (arguments (let ((a (default-keyword-arguments (package-arguments p) '(#:configure-flags '() diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index d382ee403d..c0cb789581 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -166,13 +166,13 @@ (define* (register #:key name system inputs outputs #:allow-other-keys) (package-name-version haskell) "/package.conf.d")) (id-rx (make-regexp "^id: *(.*)$")) - (lib-rx (make-regexp "lib.*\\.(a|so)")) - (config-file (string-append config-dir "/" name ".conf")) + (config-file (string-append out "/" name ".conf")) (params (list (string-append "--gen-pkg-config=" config-file)))) - (unless (null? (find-files lib lib-rx)) + (run-setuphs "register" params) + ;; The conf file is created only when there is a library to register. + (when (file-exists? config-file) (mkdir-p config-dir) - (run-setuphs "register" params) (let ((config-file-name+id (call-with-ascii-input-file config-file (cut grep id-rx <>)))) (rename-file config-file diff --git a/guix/download.scm b/guix/download.scm index 6b0349402a..3f7f7badce 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -282,14 +282,15 @@ (define builder ))))) (define* (download-to-store store url #:optional (name (basename url)) - #:key (log (current-error-port))) + #:key (log (current-error-port)) recursive?) "Download from URL to STORE, either under NAME or URL's basename if -omitted. Write progress reports to LOG." +omitted. Write progress reports to LOG. RECURSIVE? has the same effect as +the same-named parameter of 'add-to-store'." (define uri (string->uri url)) (if (or (not uri) (memq (uri-scheme uri) '(file #f))) - (add-to-store store name #f "sha256" + (add-to-store store name recursive? "sha256" (if uri (uri-path uri) url)) (call-with-temporary-output-file (lambda (temp port) @@ -298,6 +299,6 @@ (define uri (build:url-fetch url temp #:mirrors %mirrors)))) (close port) (and result - (add-to-store store name #f "sha256" temp))))))) + (add-to-store store name recursive? "sha256" temp))))))) ;;; download.scm ends here diff --git a/guix/packages.scm b/guix/packages.scm index cbe6127f28..5a280857ea 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -240,7 +240,8 @@ (define-record-type* (location package-location (default (and=> (current-source-location) - source-properties->location)))) + source-properties->location)) + (innate))) (set-record-type-printer! (lambda (package port) diff --git a/guix/profiles.scm b/guix/profiles.scm index 28150affb6..5c19c95d42 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -500,7 +500,10 @@ (define db-dir (string-append #$output "/" db-subdir)) (define (conf-files top) - (find-files (string-append top "/" db-subdir) "\\.conf$")) + (let ((db (string-append top "/" db-subdir))) + (if (file-exists? db) + (find-files db "\\.conf$") + '()))) (define (copy-conf-file conf) (let ((base (basename conf))) @@ -509,7 +512,8 @@ (define (copy-conf-file conf) (system* (string-append #+ghc "/bin/ghc-pkg") "init" db-dir) (for-each copy-conf-file (append-map conf-files - '#$(manifest-inputs manifest))) + (delete-duplicates + '#$(manifest-inputs manifest)))) (let ((success (zero? (system* (string-append #+ghc "/bin/ghc-pkg") "recache" diff --git a/guix/records.scm b/guix/records.scm index db59a99052..0d35a747b0 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -42,106 +42,123 @@ (define-syntax record-error (format #f fmt args ...) form)))) -(eval-when (expand load eval) - ;; This procedure is a syntactic helper used by 'define-record-type*', hence - ;; 'eval-when'. +(define-syntax make-syntactic-constructor + (syntax-rules () + "Make the syntactic constructor NAME for TYPE, that calls CTOR, and +expects all of EXPECTED fields to be initialized. DEFAULTS is the list of +FIELD/DEFAULT-VALUE tuples, THUNKED is the list of identifiers of thunked +fields, and DELAYED is the list of identifiers of delayed fields." + ((_ type name ctor (expected ...) + #:thunked thunked + #:delayed delayed + #:innate innate + #:defaults defaults) + (define-syntax name + (lambda (s) + (define (record-inheritance orig-record field+value) + ;; Produce code that returns a record identical to ORIG-RECORD, + ;; except that values for the FIELD+VALUE alist prevail. + (define (field-inherited-value f) + (and=> (find (lambda (x) + (eq? f (car (syntax->datum x)))) + field+value) + car)) - (define* (make-syntactic-constructor type name ctor fields - #:key (thunked '()) (defaults '()) - (delayed '())) - "Make the syntactic constructor NAME for TYPE, that calls CTOR, and expects -all of FIELDS to be initialized. DEFAULTS is the list of FIELD/DEFAULT-VALUE -tuples, THUNKED is the list of identifiers of thunked fields, and DELAYED is -the list of identifiers of delayed fields." - (with-syntax ((type type) - (name name) - (ctor ctor) - (expected fields) - (defaults defaults)) - #`(define-syntax name - (lambda (s) - (define (record-inheritance orig-record field+value) - ;; Produce code that returns a record identical to ORIG-RECORD, - ;; except that values for the FIELD+VALUE alist prevail. - (define (field-inherited-value f) - (and=> (find (lambda (x) - (eq? f (car (syntax->datum x)))) - field+value) - car)) + ;; Make sure there are no unknown field names. + (let* ((fields (map (compose car syntax->datum) field+value)) + (unexpected (lset-difference eq? fields '(expected ...)))) + (when (pair? unexpected) + (record-error 'name s "extraneous field initializers ~a" + unexpected))) - ;; Make sure there are no unknown field names. - (let* ((fields (map (compose car syntax->datum) field+value)) - (unexpected (lset-difference eq? fields 'expected))) - (when (pair? unexpected) - (record-error 'name s "extraneous field initializers ~a" - unexpected))) + #`(make-struct type 0 + #,@(map (lambda (field index) + (or (field-inherited-value field) + (if (innate-field? field) + (wrap-field-value + field (field-default-value field)) + #`(struct-ref #,orig-record + #,index)))) + '(expected ...) + (iota (length '(expected ...)))))) - #`(make-struct type 0 - #,@(map (lambda (field index) - (or (field-inherited-value field) - #`(struct-ref #,orig-record - #,index))) - 'expected - (iota (length 'expected))))) + (define (thunked-field? f) + (memq (syntax->datum f) 'thunked)) - (define (thunked-field? f) - (memq (syntax->datum f) '#,thunked)) + (define (delayed-field? f) + (memq (syntax->datum f) 'delayed)) - (define (delayed-field? f) - (memq (syntax->datum f) '#,delayed)) + (define (innate-field? f) + (memq (syntax->datum f) 'innate)) - (define (wrap-field-value f value) - (cond ((thunked-field? f) - #`(lambda () #,value)) - ((delayed-field? f) - #`(delay #,value)) - (else value))) + (define (wrap-field-value f value) + (cond ((thunked-field? f) + #`(lambda () #,value)) + ((delayed-field? f) + #`(delay #,value)) + (else value))) - (define (field-bindings field+value) - ;; Return field to value bindings, for use in 'let*' below. - (map (lambda (field+value) - (syntax-case field+value () - ((field value) - #`(field - #,(wrap-field-value #'field #'value))))) - field+value)) + (define default-values + ;; List of symbol/value tuples. + (map (match-lambda + ((f v) + (list (syntax->datum f) v))) + #'defaults)) - (syntax-case s (inherit #,@fields) - ((_ (inherit orig-record) (field value) (... ...)) - #`(let* #,(field-bindings #'((field value) (... ...))) - #,(record-inheritance #'orig-record - #'((field value) (... ...))))) - ((_ (field value) (... ...)) - (let ((fields (map syntax->datum #'(field (... ...)))) - (dflt (map (match-lambda - ((f v) - (list (syntax->datum f) v))) - #'defaults))) + (define (field-default-value f) + (car (assoc-ref default-values (syntax->datum f)))) - (define (field-value f) - (or (and=> (find (lambda (x) - (eq? f (car (syntax->datum x)))) - #'((field value) (... ...))) - car) - (let ((value - (car (assoc-ref dflt (syntax->datum f))))) - (wrap-field-value f value)))) + (define (field-bindings field+value) + ;; Return field to value bindings, for use in 'let*' below. + (map (lambda (field+value) + (syntax-case field+value () + ((field value) + #`(field + #,(wrap-field-value #'field #'value))))) + field+value)) - (let ((fields (append fields (map car dflt)))) - (cond ((lset= eq? fields 'expected) - #`(let* #,(field-bindings - #'((field value) (... ...))) - (ctor #,@(map field-value 'expected)))) - ((pair? (lset-difference eq? fields 'expected)) - (record-error 'name s - "extraneous field initializers ~a" - (lset-difference eq? fields - 'expected))) - (else - (record-error 'name s - "missing field initializers ~a" - (lset-difference eq? 'expected - fields))))))))))))) + (syntax-case s (inherit expected ...) + ((_ (inherit orig-record) (field value) (... ...)) + #`(let* #,(field-bindings #'((field value) (... ...))) + #,(record-inheritance #'orig-record + #'((field value) (... ...))))) + ((_ (field value) (... ...)) + (let ((fields (map syntax->datum #'(field (... ...))))) + (define (field-value f) + (or (and=> (find (lambda (x) + (eq? f (car (syntax->datum x)))) + #'((field value) (... ...))) + car) + (wrap-field-value f (field-default-value f)))) + + (let ((fields (append fields (map car default-values)))) + (cond ((lset= eq? fields '(expected ...)) + #`(let* #,(field-bindings + #'((field value) (... ...))) + (ctor #,@(map field-value '(expected ...))))) + ((pair? (lset-difference eq? fields + '(expected ...))) + (record-error 'name s + "extraneous field initializers ~a" + (lset-difference eq? fields + '(expected ...)))) + (else + (record-error 'name s + "missing field initializers ~a" + (lset-difference eq? + '(expected ...) + fields))))))))))))) + +(define-syntax-rule (define-field-property-predicate predicate property) + "Define PREDICATE as a procedure that takes a syntax object and, when passed +a field specification, returns the field name if it has the given PROPERTY." + (define (predicate s) + (syntax-case s (property) + ((field (property values (... ...)) _ (... ...)) + #'field) + ((field _ properties (... ...)) + (predicate #'(field properties (... ...)))) + (_ #f)))) (define-syntax define-record-type* (lambda (s) @@ -154,7 +171,8 @@ (define-record-type* thing make-thing thing? (name thing-name (default \"chbouib\")) (port thing-port - (default (current-output-port)) (thunked))) + (default (current-output-port)) (thunked)) + (loc thing-location (innate) (default (current-source-location)))) This example defines a macro 'thing' that can be used to instantiate records of this type: @@ -180,33 +198,20 @@ (define-record-type* thing make-thing (thing (inherit x) (name \"bar\")) This expression returns a new object equal to 'x' except for its 'name' -field." +field and its 'loc' field---the latter is marked as \"innate\", so it is not +inherited." (define (field-default-value s) (syntax-case s (default) ((field (default val) _ ...) (list #'field #'val)) - ((field _ options ...) - (field-default-value #'(field options ...))) + ((field _ properties ...) + (field-default-value #'(field properties ...))) (_ #f))) - (define (delayed-field? s) - ;; Return the field name if the field defined by S is delayed. - (syntax-case s (delayed) - ((field (delayed) _ ...) - #'field) - ((field _ options ...) - (delayed-field? #'(field options ...))) - (_ #f))) - - (define (thunked-field? s) - ;; Return the field name if the field defined by S is thunked. - (syntax-case s (thunked) - ((field (thunked) _ ...) - #'field) - ((field _ options ...) - (thunked-field? #'(field options ...))) - (_ #f))) + (define-field-property-predicate delayed-field? delayed) + (define-field-property-predicate thunked-field? thunked) + (define-field-property-predicate innate-field? innate) (define (wrapped-field? s) (or (thunked-field? s) (delayed-field? s))) @@ -215,7 +220,7 @@ (define (wrapped-field-accessor-name field) ;; Return the name (an unhygienic syntax object) of the "real" ;; getter for field, which is assumed to be a wrapped field. (syntax-case field () - ((field get options ...) + ((field get properties ...) (let* ((getter (syntax->datum #'get)) (real-getter (symbol-append '% getter '-real))) (datum->syntax #'get real-getter))))) @@ -224,7 +229,7 @@ (define (field-spec->srfi-9 field) ;; Convert a field spec of our style to a SRFI-9 field spec of the ;; form (field get). (syntax-case field () - ((name get options ...) + ((name get properties ...) #`(name #,(if (wrapped-field? field) (wrapped-field-accessor-name field) @@ -252,12 +257,13 @@ (define (delayed-field-accessor-definition field) (syntax-case s () ((_ type syntactic-ctor ctor pred - (field get options ...) ...) - (let* ((field-spec #'((field get options ...) ...)) + (field get properties ...) ...) + (let* ((field-spec #'((field get properties ...) ...)) (thunked (filter-map thunked-field? field-spec)) (delayed (filter-map delayed-field? field-spec)) + (innate (filter-map innate-field? field-spec)) (defaults (filter-map field-default-value - #'((field options ...) ...)))) + #'((field properties ...) ...)))) (with-syntax (((field-spec* ...) (map field-spec->srfi-9 field-spec)) ((thunked-field-accessor ...) @@ -277,13 +283,14 @@ (define-record-type type (ctor field ...) pred field-spec* ...) - (begin thunked-field-accessor ... - delayed-field-accessor ...) - #,(make-syntactic-constructor #'type #'syntactic-ctor #'ctor - #'(field ...) - #:thunked thunked - #:delayed delayed - #:defaults defaults)))))))) + thunked-field-accessor ... + delayed-field-accessor ... + (make-syntactic-constructor type syntactic-ctor ctor + (field ...) + #:thunked #,thunked + #:delayed #,delayed + #:innate #,innate + #:defaults #,defaults)))))))) (define* (alist->record alist make keys #:optional (multiple-value-keys '())) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 2307f76b42..7fd05da189 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -77,19 +77,26 @@ (define (tarball-base-name file-name) ;; Return the "base" of FILE-NAME, removing '.tar.gz' or similar ;; extensions. ;; TODO: Factorize. - (cond ((numeric-extension? file-name) + (cond ((not (file-extension file-name)) + file-name) + ((numeric-extension? file-name) file-name) ((string=? (file-extension file-name) "tar") (file-sans-extension file-name)) + ((file-extension file-name) + (tarball-base-name (file-sans-extension file-name))) (else - (tarball-base-name (file-sans-extension file-name))))) + file-name))) (let ((base (tarball-base-name (basename uri)))) (let-values (((name version) (package-name->name+version base))) (package (inherit p) (version (or version (package-version p))) - (source (download-to-store store uri)))))) + + ;; Use #:recursive? #t to allow for directories. + (source (download-to-store store uri + #:recursive? #t)))))) ;;; diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 42178091e6..007fde1606 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -232,20 +232,22 @@ (define (handle-argument arg result) (alist-cons 'package arg result)) (with-error-handling - (with-store store - (let* ((opts (parse-command-line args %options (list %default-options) - #:argument-handler handle-argument)) - (pure? (assoc-ref opts 'pure)) - (ad-hoc? (assoc-ref opts 'ad-hoc?)) - (command (assoc-ref opts 'exec)) - (packages (pick-all (options/resolve-packages opts) 'package)) - (inputs (if ad-hoc? + (let* ((opts (parse-command-line args %options (list %default-options) + #:argument-handler handle-argument)) + (pure? (assoc-ref opts 'pure)) + (ad-hoc? (assoc-ref opts 'ad-hoc?)) + (command (assoc-ref opts 'exec)) + (packages (pick-all (options/resolve-packages opts) 'package)) + (inputs (if ad-hoc? (packages+propagated-inputs packages) - (packages->transitive-inputs packages))) - (drvs (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (build-inputs inputs opts))))) + (packages->transitive-inputs packages)))) + (with-store store + (define drvs + (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (build-inputs inputs opts)))) + (cond ((assoc-ref opts 'dry-run?) #t) ((assoc-ref opts 'search-paths) diff --git a/guix/tests.scm b/guix/tests.scm index 87e6cc2830..a19eda250c 100644 --- a/guix/tests.scm +++ b/guix/tests.scm @@ -63,8 +63,16 @@ (define (open-connection-for-tests) store))) +(define (random-seed) + (or (and=> (getenv "GUIX_TESTS_RANDOM_SEED") + number->string) + (logxor (getpid) (car (gettimeofday))))) + (define %seed - (seed->random-state (logxor (getpid) (car (gettimeofday))))) + (let ((seed (random-seed))) + (format (current-error-port) "random seed for tests: ~a~%" + seed) + (seed->random-state seed))) (define (random-text) "Return the hexadecimal representation of a random number." diff --git a/tests/records.scm b/tests/records.scm index a00e38db7d..800ed03827 100644 --- a/tests/records.scm +++ b/tests/records.scm @@ -56,7 +56,7 @@ (define-record-type* bar make-bar (and (match (bar (x 1) (y (+ x 1)) (z (* y 2))) (($ 1 2 4) #t)) (match (bar (x 7) (z (* x 3))) - (($ 7 42 21))) + (($ 7 42 21) #t)) (match (bar (z 21) (x (/ z 3))) (($ 7 42 21) #t))))) @@ -90,6 +90,20 @@ (define-record-type* foo make-foo (match b (($ 1 2) #t)) (equal? b c))))) +(test-assert "define-record-type* & inherit & innate" + (begin + (define-record-type* foo make-foo + foo? + (bar foo-bar (innate) (default 42))) + (let* ((a (foo (bar 1))) + (b (foo (inherit a))) + (c (foo (inherit a) (bar 3))) + (d (foo))) + (and (match a (($ 1) #t)) + (match b (($ 42) #t)) + (match c (($ 3) #t)) + (match d (($ 42) #t)))))) + (test-assert "define-record-type* & thunked" (begin (define-record-type* foo make-foo @@ -139,6 +153,22 @@ (define-record-type* foo make-foo (parameterize ((mark (cons 'a 'b))) (eq? (foo-baz y) (mark)))))))) +(test-assert "define-record-type* & thunked & innate" + (let ((mark (make-parameter #f))) + (define-record-type* foo make-foo + foo? + (bar foo-bar (thunked) (innate) (default (mark))) + (baz foo-baz (default #f))) + + (let* ((x (foo (bar 42))) + (y (foo (inherit x) (baz 'unused)))) + (and (procedure? (struct-ref x 0)) + (equal? (foo-bar x) 42) + (parameterize ((mark (cons 'a 'b))) + (eq? (foo-bar y) (mark))) + (parameterize ((mark (cons 'a 'b))) + (eq? (foo-bar y) (mark))))))) + (test-assert "define-record-type* & delayed" (begin (define-record-type* foo make-foo