[PATCH] services: Add transmission-service.

2015-11-27 Thread David Thompson
My first service since the big service API rewrite.  How did I do?

>From 6f483d37bf157ee0d253d2aaa919d6900d23453c Mon Sep 17 00:00:00 2001
From: David Thompson 
Date: Fri, 27 Nov 2015 20:40:59 -0500
Subject: [PATCH] services: Add transmission-service.

* gnu/services/bittorrent.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* doc/guix.texi ("BitTorrent Services"): Document it.
---
 doc/guix.texi   |  19 +++
 gnu-system.am   |   1 +
 gnu/services/bittorrent.scm | 122 
 3 files changed, 142 insertions(+)
 create mode 100644 gnu/services/bittorrent.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index b404453..847d196 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6292,6 +6292,7 @@ declaration.
 * Desktop Services::D-Bus and desktop services.
 * Database Services::   SQL databases.
 * Web Services::Web servers.
+* BitTorrent Services:: BitTorrent services.
 * Various Services::Other services.
 @end menu
 
@@ -7013,6 +7014,24 @@ directories are created when the service is activated.
 
 @end deffn
 
+@node BitTorrent Services
+@subsubsection BitTorrent Services
+
+The @code{(gnu services bittorrent)} module provides the following service:
+
+@deffn {Scheme Procedure} transmission-service [#:transmission transmission] @
+   [#:port 9091] [#:peer-port 51413]@
+   [#:download-directory ``/var/lib/transmission/downloads'']
+
+Return a service that runs @var{transmission}, a daemon that downloads
+and shares files via the BitTorrent protocol.
+
+The daemon will serve the web user interface over @var{port}, handle
+BitTorrent tasks over @var{peer-port}, and save downloaded files to
+@var{download-directory}.
+
+@end deffn
+
 @node Various Services
 @subsubsection Various Services
 
diff --git a/gnu-system.am b/gnu-system.am
index f69645b..da1b359 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -354,6 +354,7 @@ GNU_SYSTEM_MODULES =\
   gnu/services.scm\
   gnu/services/avahi.scm			\
   gnu/services/base.scm\
+  gnu/services/bittorrent.scm			\
   gnu/services/databases.scm			\
   gnu/services/dbus.scm\
   gnu/services/desktop.scm			\
diff --git a/gnu/services/bittorrent.scm b/gnu/services/bittorrent.scm
new file mode 100644
index 000..140df53
--- /dev/null
+++ b/gnu/services/bittorrent.scm
@@ -0,0 +1,122 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu services bittorrent)
+  #:use-module (gnu services)
+  #:use-module (gnu services dmd)
+  #:use-module (gnu system shadow)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages bittorrent)
+  #:use-module (guix records)
+  #:use-module (guix gexp)
+  #:use-module (ice-9 match)
+  #:export (%transmission-state-directory
+
+transmission-configuration
+transmission-configuration?
+transmission-configuration-transmission
+transmission-configuration-port
+transmission-configuration-peer-port
+transmission-configuration-download-directory
+
+transmission-service-type
+transmission-service))
+
+;;; Commentary:
+;;;
+;;; BitTorrent services.
+;;;
+;;; Code:
+
+(define %transmission-state-directory "/var/lib/transmission")
+
+(define-record-type* 
+  transmission-configuration make-transmission-configuration
+  transmission-configuration?
+  (transmission   transmission-configuration-transmission) ; 
+  (port   transmission-configuration-port) ; integer
+  (peer-port  transmission-configuration-peer-port) ; integer
+  (download-directory transmission-configuration-download-directory)) ; string
+
+(define %transmission-accounts
+  (list (user-group (name "transmission") (system? #t))
+(user-account
+ (name "transmission")
+ (group "transmission")
+ (system? #t)
+ (comment "transmission daemon user")
+ (home-directory "/var/empty")
+ (shell #~(string-append #$shadow "/sbin/nologin")
+
+(define (transmission-activation config)
+  (let ((download-dir (transmission-configuration-download-directory config)))
+#~(begin
+(use-modules (guix build utils))

Re: Tor hidden services

2015-11-27 Thread Thompson, David
On Fri, Nov 27, 2015 at 6:59 PM, Ludovic Courtès  wrote:
> Commit adds ‘tor-hidden-service’, which can be used to specify hidden
> services quite easily.
>
> For example, to have your SSH daemon accessible over something.onion:22,
> just do:
>
>   (operating-system
> ;; …
> (services (cons* (lsh-service #:interfaces '("127.0.0.1"))
>  (tor-hidden-service "ssh" '((22 "127.0.0.1:22")))
>  (tor-service)
>  %desktop-services)))
>
> and then you can:
>
>   torify ssh something.onion
>
> from anywhere.

Wow, awesome!  I've never used a Tor hidden service before because I
never understood how things work, but this configuration looks so
simple that I don't have much excuse to not try it out.  Thanks!

- Dave



Tor hidden services

2015-11-27 Thread Ludovic Courtès
Commit adds ‘tor-hidden-service’, which can be used to specify hidden
services quite easily.

For example, to have your SSH daemon accessible over something.onion:22,
just do:

  (operating-system
;; …
(services (cons* (lsh-service #:interfaces '("127.0.0.1"))
 (tor-hidden-service "ssh" '((22 "127.0.0.1:22")))
 (tor-service)
 %desktop-services)))

and then you can:

  torify ssh something.onion

from anywhere.

Ludo’.



Re: [PATCH] substitute: Print a warning in case of store directory mismatch

2015-11-27 Thread Ludovic Courtès
Hynek Urban  skribis:

> Motivation: I was checking out guix for the first time a few days ago; I
> built it using the --with-store-dir configure option and subsequently,
> substitutes were not downloaded. I was baffled for some time because I
> thought I did everything according to the manual and yet I couldn't get
> the substitute downloads to work (with no indication why).
>
> I suppose the actual reason is quite apparent to people with some
> knowledge about guix but for a new user it is not (at least if I may
> judge from my own experience). Perhaps this patch will save someone a
> little bit of time.

I see, that makes a lot of sense.

> From cf9703770b6db07b1826a9f9082c061919b6d061 Mon Sep 17 00:00:00 2001
> From: Hynek Urban 
> Date: Thu, 26 Nov 2015 22:38:32 +0100
> Subject: [PATCH] substitute: Print a warning in case of store directory
>  mismatch.
>
> * guix/scripts/substitute.scm (fetch-narinfos): Print a warning in case
>   store directory differs between local installation and the substitute
>   server.

Commit ae4427e does the same thing slightly differently.

Thank you!

Ludo’.



Re: [PATCH]: Five R packages.

2015-11-27 Thread Kyle Meyer
Ricardo Wurmus  writes:

>> Isn't lattice already included with the main R build as a recommended
>> package?
>
> You’re right again.
>
> Is there ever a reason to upgrade the included recommended packages?  I
> know that when installing some bioconductor packages R asks whether to
> upgrade some included packages, such as MASS.  I’m not sure if it makes
> sense to offer separate packages for the latest versions of these
> modules.
>
> What do you think?  I’m not much of an R-user myself.

Hmm... I also don't spend much time in R.  I'd guess that the
recommended packages are quite stable, so the only advantage I see of
running a version of a package newer than the one included with R is
that you get rid of the prompt when using install.packages or
bioconductor.  I've always answered no to these prompts and haven't
noticed any issues (but my use of R is fairly limited, so that may not
be worth much).

In any case, I don't see these prompts as much of an issue because I'd
prefer to just use Guix for all R packages.  Why not manage bioconductor
packages with Guix as well?

-- 
Kyle



Re: ‘guix lint’ CVE checker

2015-11-27 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes:

> l...@gnu.org (Ludovic Courtès) skribis:
>
>> The libxml2/libxslt issues are actually patched, but since we didn’t
>> change the version number, the tool assumes that our packages are
>> vulnerable.  We should change version numbers in the future when
>> patching vulnerabilities.
>
> Alternately, ‘lint’ could check the package’s patches and silence the
> warning if there are patches whose name contain the offending CVE ID.

Yes, I think this is the right approach.

If changing the version number effectively disables this entire
mechanism, that seems like an inferior approach, because if more CVEs
are later discovered, we won't be notified, iiuc.  Is that right?

 Thanks,
   Mark

> That way it would still catch vulnerabilities later reported for that
> version.
>
> Thoughts?
>
> Ludo’.



Re: [PATCH 4/4] services: Add network-manager-service.

2015-11-27 Thread Ludovic Courtès
l...@gnu.org (Ludovic Courtès) skribis:

> OK, I’ll test this on my laptop and report back.

I tested, but then I’m unable to run nm-applet (I run ratpoison but it
wants a status bar or something) and I couldn’t get anything out of
nmcli.  So wired networking worked directly, but I couldn’t get wireless
to work.

Could someone try it in Xfce or something?

I used this to remove Wicd, after exporting ‘wicd-service-type’:

  (define %desktop-services-sans-wicd
(remove (lambda (service)
  (eq? wicd-service-type (service-kind service)))
%desktop-services))

and then simply added a call to ‘network-manager-service’ to my service
list.

Thanks,
Ludo’.



Re: [PATCH] openssh: install ssh-copy-id.

2015-11-27 Thread Florian Paul Schmidt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 11/27/2015 11:38 AM, Ricardo Wurmus wrote:
> This fixes bug #22024.
> 

Wow, thanks :)

Flo

- -- 
https://fps.io
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJWWIXZAAoJEA5f4Coltk8ZlksH/18HM9V/ao40QXgVw06D0lO2
8xeVcGXmCJV5Nv4S7juZQyAfGZliMZQE5W17BZy8b4wprBIFM6JlUf5sydj4a4Bh
h2nZL/jHMscgTGuQlFqeO+TVwJGNL3Oj/lUoS5zDZXNwHYFfqwU0wOoOra724pF6
UQvAgJU8oDAf9gXoK0FX+GgYQrZRyJsErTM6LGJ/ykLNrETkL7F1sjLX6TjNVhN8
4N7UahP7l6tI2658vWemHVyBdbTRPr9VDryDOx+bXMis7eIGiNc22ZvrxoGLUc2F
GfM1OpS1XBpkH4IBK9B6ZXAgJjde1nPwIReeNqhJb7/hFwLiNTrkEir0f8ed1Pg=
=U2Ow
-END PGP SIGNATURE-



Re: [PATCH] build: pull: Compile .scm files in one process.

2015-11-27 Thread Taylan Ulrich Bayırlı/Kammer
l...@gnu.org (Ludovic Courtès) writes:

> taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:
>
>> l...@gnu.org (Ludovic Courtès) writes:
>
> [...]
>
>>>?: 2 [primitive-load 
>>> "/gnu/store/d51z2xkwp1vh0dh6gqadyyzv21m0b772-guix-latest/guix/scripts/import/hackage.scm"]
>>> In ice-9/eval.scm:
>>>  453: 1 Exception thrown while printing backtrace:
>>> ERROR: In procedure package-location: Wrong type argument: Error while 
>>> printing exception.
>>>
>>> ice-9/eval.scm:387:11: In procedure eval:
>>> ice-9/eval.scm:387:11: In procedure package-version: Wrong type argument: 
>>> Error while printing exception.
>>> builder for `/gnu/store/pc1i5s6vx9yx97prhskx178gj5swxw4k-guix-latest.drv' 
>>> failed with exit code 1
>>> guix pull: error: build failed: build of 
>>> `/gnu/store/pc1i5s6vx9yx97prhskx178gj5swxw4k-guix-latest.drv' failed
>>>
>>> Any idea?
>>>
>>> To me it sounds like there are two  record type descriptors in
>>> the wild, which is why ‘package-location’ in the package record printer
>>> bails out.
>>
>> That's one of the errors that result from a "bad" order of compiling the
>> files and when the 'load' hack isn't used to work around it, which isn't
>> the case in that patch...  Indeed I can't seem to reproduce the issue.
>>
>> The attached patch below also builds on the quoted patch, removes the
>> thread-safe-port procedure, and just sets the warning port to a void
>> port.  Applied on top of the current master, it works for me.
>
> On top of current master, it fails for me in the same way as above.
>
> To be clear, I applied the patch, ran ‘make dist’, and then:
>
>   time ./pre-inst-env guix pull --url=file://$PWD/guix-0.9.0.tar.gz
>
> Are you doing the same?  The “loading” part is done sequentially, so it
> should be deterministic.

Whoops, I had not rerun the whole 'make dist' after rebasing on master,
only copied the new guix/build/pull.scm into an existing tarball (I had
gotten used to doing that because it saves time while working on a
single file), so changes in other files were missing.

After some tinkering around I realized that the problem is that our
workaround of loading files explicitly causes the package record type to
be redefined after some packages have already been defined.  More
generally, we force the top-level of many files to be re-executed after
they've already been executed as a result of a module import...

It would be great if the whole circular import problem could somehow be
solved by Guile (no idea how feasible it is).  On the meanwhile, we'll
have to work around problems introduced by workarounds. :-) Moving the
loading of guix/package.scm to the very front seems to solve the issue.
Other record types could still cause the same issue, but their relative
rarity of use hopefully makes this a non-issue.  I also moved the
loading of guix/ files before gnu/ files again, which might also help
with that.  (For package.scm it wasn't sufficient, probably because some
modules under guix/ import some gnu package modules, before package.scm
is loaded explicitly.)

One can imagine a wholly more robust version of the workaround, which
avoids the re-execution of top-levels.  A variant of load[-primitive]
that doesn't load a file again if it was already loaded would do.
That's basically what importing a module does, so scanning for module
definitions in files and importing them might work, but seems somewhat
hacky...  For now, here's the patch that just loads package.scm first.

>From dcb563f611c4fbd6e3e22106c60626f32c04f9e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 
Date: Fri, 27 Nov 2015 09:27:55 +0100
Subject: [PATCH] build: pull: Compile .scm files in one process.

* guix/build/pull.scm (call-with-process, report-build-progress)
(p-for-each): Remove.
(build-guix): Load and compile files in one process.
---
 guix/build/pull.scm | 149 +++-
 1 file changed, 55 insertions(+), 94 deletions(-)

diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 281be23..3025442 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014 Ludovic Courtès 
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 match)
   #:use-module (ice-9 format)
+  #:use-module (ice-9 threads)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
@@ -33,75 +35,10 @@
 ;;;
 ;;; Code:
 
-(define (call-with-process thunk)
-  "Run THUNK in a separate process that will return 0 if THUNK terminates
-normally, and 1 if an exception is raised."
-  (match (primitive-fork)
-(0
- (catch #t
-   (lambda ()
- (thunk)
- (primitive-exit 0))
-   (lambda (key . args)
- (print-exception (current-error-port) #f key args)
- (primi

Re: [PATCH] openssh: install ssh-copy-id.

2015-11-27 Thread Ludovic Courtès
Woow, that was fast!  :-)

Ricardo Wurmus  skribis:

> From 65c9863898e1ddc2a1443b557003f0cbc25442d8 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Fri, 27 Nov 2015 10:57:03 +0100
> Subject: [PATCH 1/2] gnu: openssh: Use modify-phases syntax.
>
> * gnu/packages/ssh.scm (openssh)[arguments]: Use modify-phases syntax.

OK!

> From baf260ebda0a70ec3c7d6f35e1c1bb64a37f0aac Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Fri, 27 Nov 2015 11:35:50 +0100
> Subject: [PATCH 2/2] gnu: openssh: Install ssh-copy-id.
>
> * gnu/packages/ssh.scm (openssh)[arguments]: Install "ssh-copy-id" and
>   documentation.

Please add “Fixes” and “Reported by” lines.

Could you check whether that increases the size of the closure?  That
would be the case if ‘ssh-copy-id’ is a Perl script for instance.

Thanks,
Ludo’.



Customizing /etc

2015-11-27 Thread Ludovic Courtès
Alex Kost  skribis:

> 宋文武 (2015-11-24 18:22 +0300) wrote:

[...]

>> So, the plan is add /etc/environment and only use /etc/profile for 2.
>> then, a sh-profile file-like configuration can be added.  WDYT?
>
> I like the idea of separating /etc/environment and /etc/profile, but my
> main concern is to have a possibility to change /etc files the way I
> want, as I explained in the reply to Ludovic.

I agree that specifying what goes into /etc is something we want to
allow (though not directly related to the /etc/profile issue.)

What about exposing the name/file-like pairs that are passed to
‘etc-service’?  That way, one could write:

  (define os
(operating-system
  ;; …
  (etc-files `(("hosts" ,(local-file "my-hosts-file"))
   ("issue" ,(plain-file "Hello!\n"))
   ("sudoers" ,(local-file "sudoers"))
   ("profile" ,(local-file "myprofile"))
   ,@(fold alist-delete
   (default-etc-files os)
   '("hosts" "issue" "sudoers" "profile"))

We may remove the ‘hosts-file’ and ‘sudoers-file’ fields, but keep
higher-level things like ‘name-service-switch’ because they’re more
convenient.

The difficulty is that some of the default files, such as /etc/hosts,
are generated as a function of the ‘operating-system’ declaration.  Thus
I think we need ‘default-etc-files’ to be a procedure as shown above,
and the ‘etc-files’ field must be thunked or delayed.  Hmm not fully
sure this is the right interface.

WDYT?

The bottom line is that /etc is not a great configuration interface
because it’s all flat and GuixSD has no idea of the meaning of those
files and their relationship.  So the preferred approach remains
configuration via services and high-level configuration objects.

Thanks,
Ludo’.



/etc/environment and /etc/profile

2015-11-27 Thread Ludovic Courtès
宋文武  skribis:

> On 2015-11-24 04:07, Alex Kost wrote:

[...]

>> Oh, no!  If there is one person (me) who wants to have a full
>> control on
>> his /etc/profile, there may be the others with the same wish.
> Sure, I think we all want (and should have) a full control.

Agreed.

> To be clear, /etc/profile contains 3 parts:
>
>  1. variables from configuration of the operating-system (LANG, TZ,
> etc.)
>  2. environment setup for system and user profiles
> (source .guix-profile/etc/profile)
>  3. hacks for making sensible defaults (LINUX_MODULE_DIRECTORY,
> ASPELL_CONF, etc).
>
> And it's only effective for POSIX login shells (bash and zsh).
>
> For 1, maybe the most important one, it's already managed, but doesn't
> work for fish and rc.  We need to move these into /etc/environment,
> which work for all shells (even emacs? :-)

Using /etc/environment sounds like a good idea!  IIUC, it requires using
pam_env, right?  Do you know exactly what it would take?

> For 2, we had build a etc/profile file for each profile's search-paths,
> here source both system and user to make most things work
> out-of-the-box.
>
> I think this is the real purpose for our /etc/profile.
> Technical, if we remove those, the result system will be the same as
> guix on foreign distros.  So, it's ok to completely replace it.
>
> (some variables (eg: MANPATH, INFOPATH, XDG_DATA_DIRS) can be set in
> each profile, and mergerd well).

Yeah, I assume it’s fine to let that one be completely overridden.  The
documentation would have to clearly explain what the default file
contains, and what’s at stake if you remove it.

> And 3, IMO is the controversial parts.
>
> the one don't related to profiles can go into /etc/environment
> (eg: LINUX_MODULE_DIRECTORY, SSL_CERT_DIR, DBUS_FATAL_WARNINGS),
> these need to be addressing by adding services?
>
> and others may go into profile (eg: ASPELL_CONF, GST_PLUGIN_PATH).

Yes.

> So, the plan is add /etc/environment and only use /etc/profile for 2.
> then, a sh-profile file-like configuration can be added.  WDYT?

Sounds like a reasonable plan to me.

I can start work in that direction, but I’m also happy if you or someone
else gives it a try.

Thanks for your very clear analysis!

Ludo’.



Re: [PATCHES] Update orfm and package test requirements.

2015-11-27 Thread Ricardo Wurmus
Hi Ben,

> +
> +(define-public ruby-systemu
> +  (package
> +(name "ruby-systemu")
> +(version "2.6.5")
> +(source
> + (origin
> +   (method url-fetch)
> +   (uri (rubygems-uri "systemu" version))
> +   (sha256
> +(base32
> + "0gmkbakhfci5wnmbfx5i54f25j9zsvbw858yg3jjhfs5n4ad1xq1"
> +(build-system ruby-build-system)
> +(arguments
> + `(#:phases
> +   (modify-phases %standard-phases
> + (add-before 'check 'patch-version
> +   (lambda _
> + (substitute* "Rakefile"
> +   (("  This.lib = lib")
> +"  This.lib = 'systemu'")
> +   ((" version = ENV\\['VERSION'\\]")
> +(string-append "version='" ,version "'"

Why is this phase needed?  Would it be enough to just

(setenv "VERSION" ,version)

> +(synopsis "Capture of stdout/stderr and handling of child processes")
> +(description
> + "Systemu can be used on any platform to return status, stdout, and 
> stderr
> +of any command.  Unlike other methods like open3/popen4 there is no danger of
> +full pipes or threading issues hanging your process or subprocess.")

Maybe “@code{open3} or @code{popen4}” instead of “open3/popen4”.

> +(home-page "https://github.com/ahoward/systemu";)
> +(license license:ruby)))

Other than that it looks good to me.


> +
> +(define-public ruby-bio-commandeer
> +  (package
> +(name "ruby-bio-commandeer")
> +(version "0.1.2")
> +(source
> + (origin
> +   (method url-fetch)
> +   (uri (rubygems-uri "bio-commandeer" version))
> +   (sha256
> +(base32
> + "061jxa6km92qfwzl058r2gp8gfcsbyr7m643nw1pxvmjdswaf6ly"
> +(build-system ruby-build-system)
> +(arguments
> + `(#:phases
> +   (modify-phases %standard-phases
> + (replace 'check
> +   ;; Run test without calling 'rake' so that jeweler is
> +   ;; not required as an input.
> +   (lambda _
> + (zero? (system* "rspec" "spec/bio-commandeer_spec.rb")))
> +(propagated-inputs
> + `(("ruby-bio-logger" ,ruby-bio-logger)
> +   ("ruby-systemu" ,ruby-systemu)))
> +(native-inputs
> + `(("bundler" ,bundler)
> +   ("ruby-rspec" ,ruby-rspec)))
> +(synopsis "Simplified running of shell commands from within Ruby")
> +(description
> + "Bio-commandeer is a dead simple opinionated method of running shell
> +commands from within Ruby.  The advantage of bio-commandeer over other 
> methods
> +of running external commands is that when something goes wrong, the error
> +message that is reported gives extra detail to ease debugging.")

I don’t really like the first sentence.  How about

   “Bio-comandeer lets you run shell commands from within Ruby.  ...”

> +(home-page
> + "http://github.com/wwood/bioruby-commandeer";)

Could you please put this on one line?

> +(license license:expat)))

Good!

> From 1fe31024e6c78ab7bbdfe7be2c2ac8f4ec1db447 Mon Sep 17 00:00:00 2001
> From: Ben Woodcroft 
> Date: Sat, 21 Nov 2015 10:37:34 +1000
> Subject: [PATCH 3/3] gnu: orfm: Update to 0.4.4.

> * gnu/packages/bioinformatics.scm (orfm): Update to 0.4.4.
> [arguments]: Run intended tests.
> [inputs]: Add inputs required for tests.

Actually, the message should say “[native-inputs]” instead of
“[inputs]”.  Other than that it looks good to me.

Thanks!

~~ Ricardo



Re: [PATCH]: Five R packages.

2015-11-27 Thread Ricardo Wurmus
Hi Kyle,

> Ricardo Wurmus  writes:
>
>> From 9b319907000ad6b1796d1887cabcf010aa806d3e Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus 
>> Date: Thu, 26 Nov 2015 16:59:08 +0100
>> Subject: [PATCH 1/5] gnu: Add r-data-table.
>>
>> * gnu/packages/statistics.scm (r-data-table): New variable.
>
> It seems data.table was already packaged under a different name in
> 0e4e03f (2015-09-26).

You are right!  I should update “r-data.table” because the license
seems to be GPL3+ not GPL2+.  

>> From 0e6557d12cba8e25aad9789b3fb4c454ce16c244 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus 
>> Date: Thu, 26 Nov 2015 17:00:26 +0100
>> Subject: [PATCH 5/5] gnu: Add r-lattice.
>>
>> * gnu/packages/statistics.scm (r-lattice): New variable.
>
> Isn't lattice already included with the main R build as a recommended
> package?

You’re right again.

Is there ever a reason to upgrade the included recommended packages?  I
know that when installing some bioconductor packages R asks whether to
upgrade some included packages, such as MASS.  I’m not sure if it makes
sense to offer separate packages for the latest versions of these
modules.

What do you think?  I’m not much of an R-user myself.

~~ Ricardo



[PATCH] Add Pandoc (and whatever it needs)

2015-11-27 Thread Ricardo Wurmus
Hi Guix,

this is the second batch of Haskell packages we need to have a Pandoc
package.  These patches apply after the other patch set I sent to the ML
yesterday.

(BTW: if you just need a simple markdown converter (with an extensible
grammar) I recommend peg-markdown.  It has very few dependencies and is
a good alternative for many applications that really just want to
convert markdown.)

~~ Ricardo

>From 053a99f042c8061633b8138ce6afe5db655d1430 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Fri, 27 Nov 2015 13:28:41 +0100
Subject: [PATCH 01/30] gnu: Add ghc-hspec-contrib.

* gnu/packages/haskell.scm (ghc-hspec-contrib): New variable.
---
 gnu/packages/haskell.scm | 24 
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index ecd687b..45c58c2 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -3435,6 +3435,30 @@ responses coming back.")
 Haskell, inspired by the Ruby library RSpec.")
 (license expat)))
 
+(define-public ghc-hspec-contrib
+  (package
+(name "ghc-hspec-contrib")
+(version "0.3.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://hackage.haskell.org/package/";
+  "hspec-contrib/hspec-contrib-"
+  version ".tar.gz"))
+  (sha256
+   (base32
+"006syw8xagfhsx06ws9ywig1qx5lk4cgl7sq6pbid1s64c72mxn4"
+(build-system haskell-build-system)
+(propagated-inputs
+ `(("ghc-hspec-core" ,ghc-hspec-core)
+   ("ghc-hunit" ,ghc-hunit)
+   ("ghc-hspec" ,ghc-hspec)
+   ("ghc-quickcheck" ,ghc-quickcheck)))
+(home-page "http://hspec.github.io/";)
+(synopsis "Contributed functionality for Hspec")
+(description
+ "This package provides contributed Hspec extensions.")
+(license expat)))
+
 (define-public ghc-hspec-expectations
   (package
 (name "ghc-hspec-expectations")
-- 
2.1.0

>From afeba9eeb7da7037cac42442bf197d964f43a0a1 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Fri, 27 Nov 2015 13:29:17 +0100
Subject: [PATCH 02/30] gnu: Add ghc-conduit.

* gnu/packages/haskell.scm (ghc-conduit): New variable.
---
 gnu/packages/haskell.scm | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 45c58c2..e75c9d2 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -5390,6 +5390,40 @@ the function @code{aesonQQ} that compile-time converts a string representation
 of a JSON value into a @code{Data.Aeson.Value}.")
 (license expat)))
 
+(define-public ghc-conduit
+  (package
+(name "ghc-conduit")
+(version "1.2.5.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://hackage.haskell.org/package/";
+  "conduit/conduit-" version ".tar.gz"))
+  (sha256
+   (base32
+"0aq6wswd5dkhdmy7sjhd99mldpq33dqpgbdcwpm94ahvckqxs7v5"
+(build-system haskell-build-system)
+(propagated-inputs
+ `(("ghc-exceptions" ,ghc-exceptions)
+   ("ghc-lifted-base" ,ghc-lifted-base)
+   ("ghc-mmorph" ,ghc-mmorph)
+   ("ghc-mtl" ,ghc-mtl)
+   ("ghc-resourcet" ,ghc-resourcet)
+   ("ghc-transformers-base" ,ghc-transformers-base)
+   ("ghc-void" ,ghc-void)))
+(native-inputs
+ `(("ghc-quickcheck" ,ghc-quickcheck)
+   ("ghc-hspec" ,ghc-hspec)
+   ("ghc-safe" ,ghc-safe)))
+(home-page "https://github.com/snoyberg/conduit";)
+(synopsis "Streaming data library ")
+(description
+ "conduit is a solution to the streaming data problem, allowing for
+production, transformation, and consumption of streams of data in constant
+memory.  It is an alternative to lazy I/O which guarantees deterministic
+resource handling, and fits in the same general solution space as
+enumerator/iteratee and pipes." )
+(license expat)))
+
 (define-public idris
   (package
 (name "idris")
-- 
2.1.0

>From ad9c02e07111554b68db7684b23038bb1b096d6b Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Fri, 27 Nov 2015 13:29:36 +0100
Subject: [PATCH 03/30] gnu: Add ghc-logging-facade.

* gnu/packages/haskell.scm (ghc-logging-facade): New variable.
---
 gnu/packages/haskell.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index e75c9d2..3824abc 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -5424,6 +5424,28 @@ resource handling, and fits in the same general solution space as
 enumerator/iteratee and pipes." )
 (license expat)))
 
+(define-public ghc-logging-facade
+  (package
+(name "ghc-logging-facade")
+(version "0.1.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://hackage.haskell.org/package/";
+ 

[PATCH] openssh: install ssh-copy-id.

2015-11-27 Thread Ricardo Wurmus
This fixes bug #22024.

>From 65c9863898e1ddc2a1443b557003f0cbc25442d8 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Fri, 27 Nov 2015 10:57:03 +0100
Subject: [PATCH 1/2] gnu: openssh: Use modify-phases syntax.

* gnu/packages/ssh.scm (openssh)[arguments]: Use modify-phases syntax.
---
 gnu/packages/ssh.scm | 39 +++
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index 2f4f8a2..26729ea 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -129,26 +129,25 @@ a server that supports the SSH-2 protocol.")
(arguments
 `(#:test-target "tests"
   #:phases
-   (alist-cons-after
-'configure 'reset-/var/empty
-(lambda* (#:key outputs #:allow-other-keys)
-  (let ((out (assoc-ref outputs "out")))
-(substitute* "Makefile"
-  (("PRIVSEP_PATH=/var/empty")
-   (string-append "PRIVSEP_PATH=" out "/var/empty")
-   (alist-cons-before
-'check 'patch-tests
-(lambda _
-  ;; remove 't-exec' regress target which requires user 'sshd'
-  (substitute* "regress/Makefile"
-(("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post)
- (string-append pre post
-   (alist-replace
-'install
-(lambda* (#:key (make-flags '()) #:allow-other-keys)
-  ;; install without host keys and system configuration files
-  (zero? (apply system* "make" "install-nosysconf" make-flags)))
-   %standard-phases)
+  (modify-phases %standard-phases
+(add-after 'configure 'reset-/var/empty
+ (lambda* (#:key outputs #:allow-other-keys)
+   (let ((out (assoc-ref outputs "out")))
+ (substitute* "Makefile"
+   (("PRIVSEP_PATH=/var/empty")
+(string-append "PRIVSEP_PATH=" out "/var/empty")))
+ #t)))
+(add-before 'check 'patch-tests
+ (lambda _
+   ;; remove 't-exec' regress target which requires user 'sshd'
+   (substitute* "regress/Makefile"
+ (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post)
+  (string-append pre post)))
+   #t))
+(replace 'install
+ (lambda* (#:key (make-flags '()) #:allow-other-keys)
+   ;; install without host keys and system configuration files
+   (zero? (apply system* "make" "install-nosysconf" make-flags)))
(synopsis "Client and server for the secure shell (ssh) protocol")
(description
 "The SSH2 protocol implemented in OpenSSH is standardised by the
-- 
2.1.0

>From baf260ebda0a70ec3c7d6f35e1c1bb64a37f0aac Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Fri, 27 Nov 2015 11:35:50 +0100
Subject: [PATCH 2/2] gnu: openssh: Install ssh-copy-id.

* gnu/packages/ssh.scm (openssh)[arguments]: Install "ssh-copy-id" and
  documentation.
---
 gnu/packages/ssh.scm | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index 26729ea..5c222a2 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -145,9 +145,19 @@ a server that supports the SSH-2 protocol.")
   (string-append pre post)))
#t))
 (replace 'install
- (lambda* (#:key (make-flags '()) #:allow-other-keys)
+ (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
;; install without host keys and system configuration files
-   (zero? (apply system* "make" "install-nosysconf" make-flags)))
+   (and (zero? (apply system* "make" "install-nosysconf" make-flags))
+(begin
+  (install-file "contrib/ssh-copy-id"
+(string-append (assoc-ref outputs "out")
+   "/bin/"))
+  (chmod (string-append (assoc-ref outputs "out")
+"/bin/ssh-copy-id") #o555)
+  (install-file "contrib/ssh-copy-id.1"
+(string-append (assoc-ref outputs "out")
+   "/share/man/man1/"))
+  #t)))
(synopsis "Client and server for the secure shell (ssh) protocol")
(description
 "The SSH2 protocol implemented in OpenSSH is standardised by the
-- 
2.1.0



Re: [PATCH] build: pull: Compile .scm files in one process.

2015-11-27 Thread Ludovic Courtès
taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> l...@gnu.org (Ludovic Courtès) writes:

[...]

>>?: 2 [primitive-load 
>> "/gnu/store/d51z2xkwp1vh0dh6gqadyyzv21m0b772-guix-latest/guix/scripts/import/hackage.scm"]
>> In ice-9/eval.scm:
>>  453: 1 Exception thrown while printing backtrace:
>> ERROR: In procedure package-location: Wrong type argument: Error while 
>> printing exception.
>>
>> ice-9/eval.scm:387:11: In procedure eval:
>> ice-9/eval.scm:387:11: In procedure package-version: Wrong type argument: 
>> Error while printing exception.
>> builder for `/gnu/store/pc1i5s6vx9yx97prhskx178gj5swxw4k-guix-latest.drv' 
>> failed with exit code 1
>> guix pull: error: build failed: build of 
>> `/gnu/store/pc1i5s6vx9yx97prhskx178gj5swxw4k-guix-latest.drv' failed
>>
>> Any idea?
>>
>> To me it sounds like there are two  record type descriptors in
>> the wild, which is why ‘package-location’ in the package record printer
>> bails out.
>
> That's one of the errors that result from a "bad" order of compiling the
> files and when the 'load' hack isn't used to work around it, which isn't
> the case in that patch...  Indeed I can't seem to reproduce the issue.
>
> The attached patch below also builds on the quoted patch, removes the
> thread-safe-port procedure, and just sets the warning port to a void
> port.  Applied on top of the current master, it works for me.

On top of current master, it fails for me in the same way as above.

To be clear, I applied the patch, ran ‘make dist’, and then:

  time ./pre-inst-env guix pull --url=file://$PWD/guix-0.9.0.tar.gz

Are you doing the same?  The “loading” part is done sequentially, so it
should be deterministic.

> Thanks for picking this up and sorry that I couldn't finish it. :-)

No problem, we’re getting there!  :-)

Ludo’.



Re: ‘guix lint’ CVE checker

2015-11-27 Thread Ludovic Courtès
l...@gnu.org (Ludovic Courtès) skribis:

> The libxml2/libxslt issues are actually patched, but since we didn’t
> change the version number, the tool assumes that our packages are
> vulnerable.  We should change version numbers in the future when
> patching vulnerabilities.

Alternately, ‘lint’ could check the package’s patches and silence the
warning if there are patches whose name contain the offending CVE ID.

That way it would still catch vulnerabilities later reported for that
version.

Thoughts?

Ludo’.



Re: [PATCH] build: pull: Compile .scm files in one process.

2015-11-27 Thread Taylan Ulrich Bayırlı/Kammer
l...@gnu.org (Ludovic Courtès) writes:

> taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:
>
>> From 78be6d09d2d4c0a563be14c66ac2a1a345ff9b1d Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>>  
>> Date: Thu, 5 Nov 2015 23:43:20 +0100
>> Subject: [PATCH] build: pull: Compile .scm files in one process.
>>
>> * guix/build/pull.scm (call-with-process, report-build-progress)
>> (p-for-each): Remove.
>> (thread-safe-port): New procedure.
>> (build-guix): Load and compile files in one process.
>
> Just tried this patch without the ‘thread-safe-port’ procedure, but I
> got this (current master):
>
> loading... 95.4% of 474 filesBacktrace:
> In ice-9/boot-9.scm:
>  157: 14 [catch #t # ...]
> In unknown file:
>?: 13 [apply-smob/1 #]
> In ice-9/boot-9.scm:
>   63: 12 [call-with-prompt prompt0 ...]
> In ice-9/eval.scm:
>  432: 11 [eval # #]
> In ice-9/boot-9.scm:
> 2401: 10 [save-module-excursion # ()>]
> 4050: 9 [#]
> 1724: 8 [%start-stack load-stack # ice-9/boot-9.scm:4041:10 ()>]
> 1729: 7 [#]
> In unknown file:
>?: 6 [primitive-load 
> "/gnu/store/hx0jk73cx50f3vpi0yyrbn0pd8ws8m0v-guix-latest-builder"]
> In ./guix/build/pull.scm:
>   47: 5 [build-guix "/gnu/store/d51z2xkwp1vh0dh6gqadyyzv21m0b772-guix-latest" 
> ...]
>   91: 4 [#]
> In ice-9/boot-9.scm:
> 2401: 3 [save-module-excursion # ./guix/build/pull.scm:92:14 ()>]
> In unknown file:
>?: 2 [primitive-load 
> "/gnu/store/d51z2xkwp1vh0dh6gqadyyzv21m0b772-guix-latest/guix/scripts/import/hackage.scm"]
> In ice-9/eval.scm:
>  453: 1 Exception thrown while printing backtrace:
> ERROR: In procedure package-location: Wrong type argument: Error while 
> printing exception.
>
> ice-9/eval.scm:387:11: In procedure eval:
> ice-9/eval.scm:387:11: In procedure package-version: Wrong type argument: 
> Error while printing exception.
> builder for `/gnu/store/pc1i5s6vx9yx97prhskx178gj5swxw4k-guix-latest.drv' 
> failed with exit code 1
> guix pull: error: build failed: build of 
> `/gnu/store/pc1i5s6vx9yx97prhskx178gj5swxw4k-guix-latest.drv' failed
>
> Any idea?
>
> To me it sounds like there are two  record type descriptors in
> the wild, which is why ‘package-location’ in the package record printer
> bails out.

That's one of the errors that result from a "bad" order of compiling the
files and when the 'load' hack isn't used to work around it, which isn't
the case in that patch...  Indeed I can't seem to reproduce the issue.

The attached patch below also builds on the quoted patch, removes the
thread-safe-port procedure, and just sets the warning port to a void
port.  Applied on top of the current master, it works for me.

Maybe you applied a different patch by accident?

Thanks for picking this up and sorry that I couldn't finish it. :-)

>From 4cb8ad8006ba359e984f4b6e765be082b7d5f9c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 
Date: Fri, 27 Nov 2015 09:27:55 +0100
Subject: [PATCH] build: pull: Compile .scm files in one process.

* guix/build/pull.scm (call-with-process, report-build-progress)
(p-for-each): Remove.
(build-guix): Load and compile files in one process.
---
 guix/build/pull.scm | 142 ++--
 1 file changed, 48 insertions(+), 94 deletions(-)

diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 281be23..e77a582 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014 Ludovic Courtès 
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 match)
   #:use-module (ice-9 format)
+  #:use-module (ice-9 threads)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
@@ -33,75 +35,10 @@
 ;;;
 ;;; Code:
 
-(define (call-with-process thunk)
-  "Run THUNK in a separate process that will return 0 if THUNK terminates
-normally, and 1 if an exception is raised."
-  (match (primitive-fork)
-(0
- (catch #t
-   (lambda ()
- (thunk)
- (primitive-exit 0))
-   (lambda (key . args)
- (print-exception (current-error-port) #f key args)
- (primitive-exit 1
-(pid
- #t)))
-
-(define* (report-build-progress total completed cont
-#:optional (log-port (current-error-port)))
-  "Report that COMPLETED out of TOTAL files have been completed, and call
-CONT."
-  (display #\cr log-port)
-  (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: i18n
-  (* 100. (/ completed total)) total)
-  (force-output log-port)
-  (cont))
-
-(define* (p-for-each proc lst
- #:optional (max-processes (current-processor-count))
- #:key (progress report-build-progress))
-  "Invoke PROC for each element of LST in a separate process, using up to
-MAX-PROCE