Re: [PATCH] Add MAFFT.

2015-07-25 Thread Ben Woodcroft

On 26/07/15 05:26, Ricardo Wurmus wrote:

Hi Ben,


+   #:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'enter-dir
+(lambda _ (chdir "core") #t))
+ ;; on advice from the MAFFT authors, do not distribute mafft-profile,
+ ;; mafft-distance mafft-homologs.rb

What does this mean?  Are they non-free software?  If so, they should be
removed in a snippet.


Sorry for the confusion. MAFFT itself is all free software, but on the 
website it allows you to download a version "with-extensions" which 
includes non-free software.


I contacted the MAFFT authors and they suggested that there was no need 
to distribute these three programs in a mafft package. I've updated the 
comment to clarify.


I'm actually a bit confused as to the difference between a snippet vs. a 
patch stage as above - when is each appropriate? Snippets are only for 
removing non-free software?





+ (add-after 'enter-dir 'patch-makefile
+(lambda _
+  (substitute* "Makefile"
+(("^SCRIPTS = mafft mafft-homologs.rb")
+ "SCRIPTS = mafft")
+(((string-append "^PROGS = dvtditr dndfast7 dndblast"
+ " sextet5 mafft-distance"))
+ "PROGS = dvtditr dndfast7 dndblast sextet5")
+(((string-append "splittbfast disttbfast tbfast "
+ "mafft-profile f2cl mccaskillwrap"))
+ "splittbfast disttbfast tbfast f2cl mccaskillwrap")

This line looks particularly unclear.  It took me a little too long to
find the difference in the replacement.  Is there a nicer regular
expression that you could use to indicate the removal of
“mafft-profile”?


I've added comments and alignment.

ben
>From ce50d7382c8f7f092faa56ff5316134417a9eca1 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
Date: Sun, 26 Jul 2015 13:01:01 +1000
Subject: [PATCH] gnu: Add mafft.

* gnu/packages/bioinformatics.scm (mafft): New variable
---
 gnu/packages/bioinformatics.scm | 59 +
 1 file changed, 54 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 38f01a8..11ef454 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -54,6 +54,54 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages zip))
 
+(define-public aragorn
+  (package
+(name "aragorn")
+(version "1.2.36")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+"http://mbio-serv2.mbioekol.lu.se/ARAGORN/Downloads/aragorn";
+version ".tgz"))
+  (sha256
+   (base32
+"1dg7jlz1qpqy88igjxd6ncs11ccsirb36qv1z01a0np4i4jh61mb"
+(build-system gnu-build-system)
+(arguments
+ `(#:tests? #f ; there are no tests
+   #:phases
+   (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+  (lambda _
+(zero? (system* "gcc"
+"-O3"
+"-ffast-math"
+"-finline-functions"
+"-o"
+"aragorn"
+(string-append "aragorn" ,version ".c")
+ (replace 'install
+  (lambda* (#:key outputs #:allow-other-keys)
+(let* ((out (assoc-ref outputs "out"))
+   (bin (string-append out "/bin"))
+   (man (string-append out "/share/man/man1")))
+  (mkdir-p bin)
+  (copy-file "aragorn"
+ (string-append bin "/aragorn"))
+  (mkdir-p man)
+  (copy-file "aragorn.1"
+ (string-append man "/aragorn.1")))
+#t)
+(home-page "http://mbio-serv2.mbioekol.lu.se/ARAGORN";)
+(synopsis "Detect tRNA, mtRNA and tmRNA genes in nucleotide sequences")
+(description
+ "Aragorn identifies transfer RNA, mitochondrial RNA and
+transfer-messenger RNA from nucleotide sequences, based on homology to known
+tRNA consensus sequences and RNA structure.  It also outputs the secondary
+structure of the predicted RNA.")
+(license license:gpl2)))
+
 (define-public bamtools
   (package
 (name "bamtools")
@@ -148,7 +196,7 @@ computational cluster.")
 (define-public bedtools
   (package
 (name "bedtools")
-(version "2.22.0")
+(version "2.24.0")
 (source (origin
   (method url-fetch)
   (uri (string-append "https://github.com/arq5x/bedtools2/archive/v";
@@ -156,7 +204,7 @@ computational cluster.")
   (

Re: [PATCH 3/3] gnu: colord: Propagate inputs.

2015-07-25 Thread 宋文武
Mark H Weaver  writes:

> 宋文武  writes:
>
>> * gnu/packages/gnome.scm (colord): Propagate inputs glib, eudev and lcms.
>> ---
>>  gnu/packages/gnome.scm | 9 ++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
>> index 11afb61..738047e 100644
>> --- a/gnu/packages/gnome.scm
>> +++ b/gnu/packages/gnome.scm
>> @@ -2181,11 +2181,14 @@ keyboard shortcuts.")
>> ("gobject-introspection" ,gobject-introspection)
>> ("libtool" ,libtool)
>> ("intltool" ,intltool)))
>> +(propagated-inputs
>> + ;; colord.pc refers to all these.
>> + `(("glib" ,glib)
>> +   ("libudev" ,eudev)
>
> I suppose it doesn't matter, but normally for 'eudev' we make the key
> string "udev".  Or did you mean to use 'libgudev' here?
colord use both GObject and C-based udev API, unless we disable gudev
in eudev, it will still use GUDEV from eudev, so I don't touch it now,
I agree use 'udev' is less confusing.
>
>> +   ("lcms" ,lcms)))
>>  (inputs
>> - `(("eudev" ,eudev)
>> -   ("dbus-glib" ,dbus-glib)
>> + `(("dbus-glib" ,dbus-glib)
>> ("libusb" ,libusb)
>> -   ("lcms" ,lcms)
>> ("sqlite" ,sqlite)
>> ("polkit" ,polkit)
>> ("sane-backends" ,sane-backends)))
Pushed, thanks for review!



guix-config.el ?

2015-07-25 Thread Mathieu Lirzin

Following the discussion for bug#21127
, I was asking
myself if it would be possible and/or desirable to have an equivalent of
"config.scm" for the Emacs interface, in order to avoid having multiple
"*.el.in" files?

--
Mathieu Lirzin




Re: [PATCH 3/3] gnu: colord: Propagate inputs.

2015-07-25 Thread Mark H Weaver
宋文武  writes:

> * gnu/packages/gnome.scm (colord): Propagate inputs glib, eudev and lcms.
> ---
>  gnu/packages/gnome.scm | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 11afb61..738047e 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -2181,11 +2181,14 @@ keyboard shortcuts.")
> ("gobject-introspection" ,gobject-introspection)
> ("libtool" ,libtool)
> ("intltool" ,intltool)))
> +(propagated-inputs
> + ;; colord.pc refers to all these.
> + `(("glib" ,glib)
> +   ("libudev" ,eudev)

I suppose it doesn't matter, but normally for 'eudev' we make the key
string "udev".  Or did you mean to use 'libgudev' here?

> +   ("lcms" ,lcms)))
>  (inputs
> - `(("eudev" ,eudev)
> -   ("dbus-glib" ,dbus-glib)
> + `(("dbus-glib" ,dbus-glib)
> ("libusb" ,libusb)
> -   ("lcms" ,lcms)
> ("sqlite" ,sqlite)
> ("polkit" ,polkit)
> ("sane-backends" ,sane-backends)))

Anyway, I'll trust your judgment here.  Please push as you see fit.

   Thank you!
  Mark



Re: [PATCH 2/3] gnu: Prefer libgudev as GUDEV (GObject bindings for libudev) provider.

2015-07-25 Thread Mark H Weaver
宋文武  writes:
> * gnu/packages/gnome.scm (upower, gnome-settings-daemon, rhythmbox)
>   gnu/packages/xfce.scm (thunar, thunar-volman): Switch to libgudev as
>   GUDEV provider.

Good, please push!

   Thanks,
 Mark



Re: [PATCH 1/3] gnu: Add libgudev.

2015-07-25 Thread Mark H Weaver
宋文武  writes:
> * gnu/packages/gnome.scm (libgudev): New variable.

Looks good to me, please push!

Thanks,
  Mark



Trying to package GNU Gama...

2015-07-25 Thread Mathieu Lirzin
Hello Guix,

I'm trying to package GNU Gama, but I'm blocking on 2 tests failing due
to file IO problems.  Maybe can someone with more experience find how to
fix that? If not I will send un updated patch with the tests disabled.

--
Mathieu Lirzin

>From 05770a3ff9dc8f763b1e75528e506ace7b0b271c Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin 
Date: Sat, 25 Jul 2015 22:47:59 +0200
Subject: [PATCH] gnu: Add gama.

* gnu/packages/maths.scm (gama): New variable.
---
 gnu/packages/maths.scm | 24 
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2fc3ce1..6915782 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -42,6 +42,7 @@
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fltk)
@@ -146,6 +147,29 @@ semiconductors.")
 (license license:gpl3+)
 (home-page "http://www.gnu.org/software/dionysus/";)))
 
+(define-public gama
+  (package
+(name "gama")
+(version "1.16")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/gama/gama-" version ".tar.gz"))
+  (sha256
+   (base32
+"17pfiz0lj1r4z6nwy6aq333vq5336raf9wwssccawawg5c3kyrqf"
+(build-system gnu-build-system)
+(inputs `(("expat"  ,expat)
+  ("sqlite" ,sqlite)))
+(native-inputs `(("xmllint" ,libxml2)))
+(synopsis "Adjustment of geodetic networks")
+(description "GNU Gama is a program for the adjustment of geodetic
+networks.  It is useful in measurements where Global Positioning System (GPS)
+is not available, such as underground.  It features the ability to adjust in
+local Cartesian coordinates as well as partial support for adjustments in
+global coordinate systems.")
+(home-page "http://www.gnu.org/software/gama/";)
+(license license:gpl3+)))
+
 (define-public gsl
   (package
 (name "gsl")
-- 
2.4.3



Re: [PATCH] python2-ansible, python-ccm and dependencies

2015-07-25 Thread Eric Dvorsak
Thank you Ricardo and Alex for taking the time to review and comment my
patch. I edited it to take your advices into account. I hope I did not miss
anything this time

Eric

2015-07-25 12:07 GMT+02:00 Ricardo Wurmus :

>
> Hi Eric,
>
> > I added the following package definitions to python.scm :
> >
> > - python2-ansible
> > - python-passlib
> > - python-py-bcrypt
> > - python-paramiko
> > - python-httplib2
> > - python-ecdsa
> > - python-ccm
>
> we normally make separate commits for separate packages.  The only
> exception is for when we add python- as well as python2-;
> they usually go together in the same commit.
>
> Please also run ‘guix lint package-name’ for each of the new packages.
> It will tell you a couple of things that you could do to improve.
>
> One thing I noticed is that the description you provide for the packages
> is the same as the synopsis.  The description, however, should provide
> more information and it should be complete sentences (with
> punctuation).
>
> Things like ‘("python-setuptools" ,python-setuptools)’ are to be placed
> in the list of ‘native-inputs’.  ‘native-inputs’ are only used at build
> time.
>
> Finally, there is no space between your definition of ‘python2-ccm’ and
> the existing definition of ‘python-pytz’.
>
> The other patch looks good to me, but it appears that this is a patch by
> Mark Weaver.  Did you submit it by accident?
>
> ~~ Ricardo
>
>
From c1dde968fb8b0384fb147b4aa4172816478da974 Mon Sep 17 00:00:00 2001
From: Eric Dvorsak 
Date: Sat, 25 Jul 2015 21:31:05 +0200
Subject: [PATCH 1/8] gnu: Add python2-pycrypto.

* gnu/packages/python.scm (python2-pycrypto): New variable.
---
 gnu/packages/python.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 7709fbd..6235b48 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -538,6 +538,9 @@ and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
 etc.).  The package is structured to make adding new modules easy.")
 (license public-domain)))
 
+(define-public python2-pycrypto
+  (package-with-python2 python-pycrypto))
+
 (define-public python-keyring
   (package
 (name "python-keyring")
-- 
2.4.3

From 80fad0306460b97e3a4de0581be1bed45d699698 Mon Sep 17 00:00:00 2001
From: Eric Dvorsak 
Date: Sat, 25 Jul 2015 21:34:19 +0200
Subject: [PATCH 2/8] gnu: Add python-ccm.

* gnu/packages/python.scm (python-ccm, python2-ccm): New variables.
---
 gnu/packages/python.scm | 28 
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 6235b48..15d62fc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -297,6 +297,34 @@ pidof, tty, taskset, pmap.")
 (define-public python2-psutil
   (package-with-python2 python-psutil))
 
+(define-public python-ccm
+  (package
+(name "python-ccm")
+(version "2.0.4.1")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://pypi.python.org/packages/source/c/ccm/ccm-";
+ version
+ ".tar.gz"))
+   (sha256
+(base32
+ "199jw221albs2iv6xczczq88fxnh0aw8hzmys8qkbzkd99dssng9"
+(build-system python-build-system)
+(native-inputs
+ `(("python-setuptools" ,python-setuptools)))
+(inputs
+ `(("python-pyyaml" ,python-pyyaml)
+   ("python-six" ,python-six)))
+(home-page "https://github.com/pcmanus/ccm";)
+(synopsis "Cassandra Cluster Manager")
+(description "A script/library to create, launch and remove an Apache Cassandra cluster on localhost.")
+(license asl2.0)))
+
+(define-public python2-ccm
+  (package-with-python2 python-ccm))
+
 (define-public python-pytz
   (package
 (name "python-pytz")
-- 
2.4.3

From 295fc4b3ccae4d0222ed74e0d6d6031170c8b56e Mon Sep 17 00:00:00 2001
From: Eric Dvorsak 
Date: Sat, 25 Jul 2015 21:35:35 +0200
Subject: [PATCH 3/8] gnu: Add python-ecdsa.

* gnu/packages/python.scm (python-ecdsa, python2-ecdsa): New variables.
---
 gnu/packages/python.scm | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 15d62fc..76eaafd 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -297,6 +297,36 @@ pidof, tty, taskset, pmap.")
 (define-public python2-psutil
   (package-with-python2 python-psutil))
 
+(define-public python-ecdsa
+  (package
+(name "python-ecdsa")
+(version "0.13")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://pypi.python.org/packages/source/e/ecdsa/ecdsa-";
+ version
+ ".tar.gz"))
+   (sha256
+(base32
+ "1yj31j0asmrx4an9xvsaj2icdmzy6pw0glfpqrrkrphwdpi1xkv4"
+(build-system python-build-system)
+(native-inputs
+ `(("python-setuptools" ,python-setuptools)))
+(inputs
+ `(("openssl" ,openssl)))
+(home

Re: warning: failed to install locale: Invalid argument

2015-07-25 Thread Ludovic Courtès
"Cook, Malcolm"  skribis:

>> "Cook, Malcolm"  skribis:
>> 
>> > With each call to guix I get
>> >
>> >warning: failed to install locale: Invalid argument
>> 
>> See
>> > Setup.html#Locales-1>.
>
> Thanks Ludo, I should have mentioned that I did do that already.  Viz:

Perfect.

> substitute: warning: failed to install locale: Invalid argument

This warning comes from the ‘guix substitute’ command, which is spawned
by ‘guix-daemon’.

So presumably LOCPATH isn’t set in the daemon’s environment (and thus in
the environment of ‘guix substitute’.)

HTH,
Ludo’.



Re: warning: guix collision encountered

2015-07-25 Thread Ludovic Courtès
"Cook, Malcolm"  skribis:

> By harmless do you mean that 
>  a) The files are checked and guaranteed to be byte-wise identical - not just 
> same name?
>  b) the file won't be deleted unless both the providing packages are gc-ed 
> (presumably via some reference counting facility?)
>  c) both
>  d) YMMV

d) That one of the ‘icon-theme.cache’ files is shadowed by another one
doesn’t alter functionality.

> By annoying do you mean
>  a) it litters up the screen with un-necessary warnings
>  b) it causes package installation to run substantially slower
>  c) both
>  c) foo

a)

:-)

Ludo’.



Re: [PATCH] Add MAFFT.

2015-07-25 Thread Ricardo Wurmus
Hi Ben,

> +   #:phases
> +   (modify-phases %standard-phases
> + (add-after 'unpack 'enter-dir
> +(lambda _ (chdir "core") #t))
> + ;; on advice from the MAFFT authors, do not distribute 
> mafft-profile,
> + ;; mafft-distance mafft-homologs.rb

What does this mean?  Are they non-free software?  If so, they should be
removed in a snippet.

> + (add-after 'enter-dir 'patch-makefile
> +(lambda _
> +  (substitute* "Makefile"
> +(("^SCRIPTS = mafft mafft-homologs.rb")
> + "SCRIPTS = mafft")
> +(((string-append "^PROGS = dvtditr dndfast7 dndblast"
> + " sextet5 mafft-distance"))
> + "PROGS = dvtditr dndfast7 dndblast sextet5")
> +(((string-append "splittbfast disttbfast tbfast "
> + "mafft-profile f2cl mccaskillwrap"))
> + "splittbfast disttbfast tbfast f2cl mccaskillwrap")

This line looks particularly unclear.  It took me a little too long to
find the difference in the replacement.  Is there a nicer regular
expression that you could use to indicate the removal of
“mafft-profile”?

> +(("^rm -f mafft-profile mafft-profile.exe") "#")
> +(("^rm -f mafft-distance mafft-distance.exe") ")#")
> +;; do not install MAN pages in libexec folder
> +(((string-append "^\t\\$\\(INSTALL\\) -m 644 \\$\\("
> + "MANPAGES\\) \\$\\(DESTDIR\\)\\$"
> + "\\(LIBDIR\\)")) "#"))
> +  #t))
> + (delete 'configure
> +(inputs
> + `(("perl" ,perl)))
> +(home-page "http://mafft.cbrc.jp/alignment/software/";)
> +(synopsis
> + "Multiple sequence alignment program for unix-like operating systems")

Please remove “for unix-like operating systems”.

> +(description
> + "MAFFT offers a range of multiple alignment methods for nucleotide and
> +protein sequences.  For instance, it offers L-INS-i (accurate; for alignment
> +of <∼200 sequences) and FFT-NS-2 (fast; for alignment of <∼30,000
> +sequences).")
> +   (license (license:non-copyleft "file://license"
> +  "See license in the distribution."

~~ Ricardo




Re: [PATCH 4/7] emacs: Add 'guix-devel-use-current-module'.

2015-07-25 Thread Mathieu Lirzin
Alex Kost  writes:

> * emacs/guix-guile.el (guix-guile-current-module): New function.
> * emacs/guix-devel.el: New file.
>   (guix-devel-use-modules, guix-devel-use-current-module): New functions.
> * doc/emacs.texi (Emacs Development): New node.  Document
>   'guix-devel-use-current-module'.

[...]

> @@ -19,7 +19,8 @@ guix package}).  Specifically, ``guix.el'' makes it easy to:
>  * Usage: Emacs Usage.Using the interface.
>  * Configuration: Emacs Configuration.Configuring the interface.
>  * Prettify Mode: Emacs Prettify. Abbreviating @file{/gnu/store/@dots{}} 
> file names.
> -* Completions: Emacs Completions.   Completing @command{guix} shell 
> command.
> +* Completions: Emacs Completions.Completing @command{guix} shell command.
> +* Development: Emacs Development.Tools for Guix developers.
>  @end menu

What do you think about integrating it in section "Contributing" instead?

> +And as always if you use a command often, it is a good idea to bind a
> +key to it, for example like this:
> +
> +@example
> +(with-eval-after-load 'scheme
> +  (define-key scheme-mode-map (kbd "C-c u")
> +'guix-devel-use-current-module))
> +@end example

I remember reading somewhere in the Emacs manual that "C-c " is
meant for user customization in the global key map (can't remember where
;)). So what suggesting "C-c C-u" which is a mode specific key binding?

--
Mathieu Lirzin



Re: [PATCH] gnu: bedtools: Update to 2.24.0.

2015-07-25 Thread Andreas Enge
Hi Ben,

thanks a lot!

I made a few small modifications and pushed:

On Sat, Jul 25, 2015 at 11:37:57PM +1000, Ben Woodcroft wrote:
> * gnu/packages/patches/bedtools-32bit-compilation.patch: New file.
> * gnu/packages/bioinformatics.scm (bedtools)[source]: Add patch.

gnu-system.am was also modified.

> +  ;; Fixed in upstream, see
> +  ;; https://github.com/arq5x/bedtools2/issues/271

I moved this into the patch, we usually mention its rationale there.

The package still compiles on x86_64, let us hope that this patch solves
the problem on the other architectures!

Andreas




Re: [PATCH 07/12] gnu: Add emacs-f.

2015-07-25 Thread Alex Kost
Federico Beffa (2015-07-24 17:18 +0300) wrote:

> +(define-public emacs-f
> +  (package
> +(name "emacs-f")
> +(version "20150605.eb094d8017")
> +(source (origin
> +  (method git-fetch)
> +  (uri (git-reference
> +(commit "eb094d8017")
> +(url "https://github.com/rejeep/f.el";)))
> +  (sha256
> +   (base32
> +"13gigb0b0n8cvwlhi17vd3ad4v70nbrqdraxcj453y3j6fpm0jn2"
> +(build-system emacs-build-system)
> +(propagated-inputs
> + `(("emacs-s" ,emacs-s) ("emacs-dash" ,emacs-dash)))

I think it is more readable to put each input on a separate line.

-- 
Alex



Re: [PATCH 11/12] gnu: python-ipython: Update to 3.2.1.

2015-07-25 Thread Alex Kost
Federico Beffa (2015-07-24 17:19 +0300) wrote:

>  (define-public python-ipython
>(package
>  (name "python-ipython")
> -(version "2.3.1")
> +(version "3.2.1")
>  (source
>   (origin
>(method url-fetch)
>(uri (string-append "https://pypi.python.org/packages/source/i/";
>"ipython/ipython-" version ".tar.gz"))
>(sha256
> -   (base32 "1764gi5m3ff481rjk336cw6i2h4zlc0nxam9rc5m8m7yl9m4d61y"
> +   (base32 "0xwin0sa9n0cabx4cq1ibf5ldsiw5dyimibla82kicz5gbpas4y9"
>  (build-system python-build-system)
>  (outputs '("out" "doc"))
> -;; FIXME: add optional dependencies when available: pyzmq, tornado, ...
> +(propagated-inputs
> + `(("python-pyzmq" ,python-pyzmq)
> +   ("python-terminado" ,python-terminado)))   
spaces^^^

(Sorry, no real comments)

-- 
Alex



Re: [PATCH 04/12] gnu: Add emacs-dash.

2015-07-25 Thread Alex Kost
My main question is about all emacs packages.  There are releases, so
why do you use 'git-fetch'?

Also I don't see patches 03 and 06.  Did you forget to send them?

-- 
Alex



Re: [PATCH] gnu: bedtools: Update to 2.24.0.

2015-07-25 Thread Ben Woodcroft



On 25/07/15 23:10, Andreas Enge wrote:


Now that 2.24.0 is in git master, could you please prepare your patch with
respect to this version? In particular, the above two lines should not
appear any more, and the commit message will have to be modified.


Attached. Lemme know if I messed up.
>From 2a09480f4ac5c02c706d39be1cdaf6e6e51f9670 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
Date: Sat, 25 Jul 2015 23:32:55 +1000
Subject: [PATCH] gnu: bedtools: settle on uint32_t signature for QuickString.

* gnu/packages/patches/bedtools-32bit-compilation.patch: New file.
* gnu/packages/bioinformatics.scm (bedtools)[source]: Add patch.
---
 gnu-system.am  |   1 +
 gnu/packages/bioinformatics.scm|   5 +-
 .../patches/bedtools-32bit-compilation.patch   | 168 +
 3 files changed, 173 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/bedtools-32bit-compilation.patch

diff --git a/gnu-system.am b/gnu-system.am
index f4e121a..d6635fe 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -392,6 +392,7 @@ dist_patch_DATA =		\
   gnu/packages/patches/avahi-localstatedir.patch		\
   gnu/packages/patches/avrdude-fix-libusb.patch			\
   gnu/packages/patches/bash-completion-directories.patch	\
+  gnu/packages/patches/bedtools-32bit-compilation.patch \
   gnu/packages/patches/bowtie-fix-makefile.patch		\
   gnu/packages/patches/bigloo-gc-shebangs.patch			\
   gnu/packages/patches/binutils-ld-new-dtags.patch		\
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 92b9394..e01e428 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -204,7 +204,10 @@ computational cluster.")
   (file-name (string-append name "-" version ".tar.gz"))
   (sha256
(base32
-"0lnxrjvs3nnmb4bmskag1wg3h2hd80przz5q3xd0bvs7vyxrvpbl"
+"0lnxrjvs3nnmb4bmskag1wg3h2hd80przz5q3xd0bvs7vyxrvpbl"))
+  ;; Fixed in upstream, see
+  ;; https://github.com/arq5x/bedtools2/issues/271
+  (patches (list (search-patch "bedtools-32bit-compilation.patch")
 (build-system gnu-build-system)
 (native-inputs `(("python" ,python-2)))
 (inputs `(("samtools" ,samtools)
diff --git a/gnu/packages/patches/bedtools-32bit-compilation.patch b/gnu/packages/patches/bedtools-32bit-compilation.patch
new file mode 100644
index 000..0a4e710
--- /dev/null
+++ b/gnu/packages/patches/bedtools-32bit-compilation.patch
@@ -0,0 +1,168 @@
+From b47dbefcb57f8e6c4fe397f64346338620740b71 Mon Sep 17 00:00:00 2001
+From: arq5x 
+Date: Wed, 15 Jul 2015 15:15:23 -0600
+Subject: [PATCH] settle on uint32_t signature for QuickString. Resolves #267
+ and #271?
+
+---
+ src/coverageFile/coverageFile.cpp | 24 
+ src/utils/general/QuickString.cpp | 27 ++-
+ src/utils/general/QuickString.h   |  6 +++---
+ 3 files changed, 29 insertions(+), 28 deletions(-)
+
+diff --git a/src/coverageFile/coverageFile.cpp b/src/coverageFile/coverageFile.cpp
+index 859cfdc..0fb544b 100644
+--- a/src/coverageFile/coverageFile.cpp
 b/src/coverageFile/coverageFile.cpp
+@@ -83,11 +83,11 @@ void CoverageFile::giveFinalReport(RecordOutputMgr *outputMgr) {
+ 		float depthPct = (float)basesAtDepth / (float)_totalQueryLen;
+ 
+ 		_finalOutput = "all\t";
+-		_finalOutput.append(depth);
++		_finalOutput.append(static_cast(depth));
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(basesAtDepth);
++		_finalOutput.append(static_cast(basesAtDepth));
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(_totalQueryLen);
++		_finalOutput.append(static_cast(_totalQueryLen));
+ 		_finalOutput.append("\t");
+ 		format(depthPct);
+ 
+@@ -138,7 +138,7 @@ size_t CoverageFile::countBasesAtDepth(size_t depth) {
+ 
+ void CoverageFile::doCounts(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ {
+-	_finalOutput = hits.size();
++	_finalOutput = static_cast(hits.size());
+ 	outputMgr->printRecord(hits.getKey(), _finalOutput);
+ }
+ 
+@@ -147,9 +147,9 @@ void CoverageFile::doPerBase(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ 	//loop through all bases in query, printing full record and metrics for each
+ 	const Record * queryRec = hits.getKey();
+ 	for (size_t i= 0; i < _queryLen; i++) {
+-		_finalOutput = i +1;
++		_finalOutput = static_cast(i+1);
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(_depthArray[i]);
++		_finalOutput.append(static_cast(_depthArray[i]));
+ 
+ 		outputMgr->printRecord(queryRec, _finalOutput);
+ 	}
+@@ -181,11 +181,11 @@ void CoverageFile::doHist(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ 		size_t numBasesAtDepth = iter->second;
+ 		float coveredBases = (float)numBasesAtDepth / (float)_queryLen;
+ 
+-		_finalOutput = depth;
++		_finalOutput = static_cast(depth);
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(numBasesAtDepth);
++		_finalOutput.appen

Re: [PATCH] gnu: bedtools: Update to 2.24.0.

2015-07-25 Thread Andreas Enge
Hello Ben,

thanks for your quick reply!

On Sat, Jul 25, 2015 at 11:02:27PM +1000, Ben Woodcroft wrote:
> -(version "2.22.0")
> +(version "2.24.0")

Now that 2.24.0 is in git master, could you please prepare your patch with
respect to this version? In particular, the above two lines should not
appear any more, and the commit message will have to be modified.

> +  ;; Fixed in upstream, see
> +  ;; https://github.com/arq5x/bedtools2/issues/271
> +  (patches (list (search-patch 
> "bedtools-32bit-compilation.patch")

You will also need to reference the patch file in gnu-system.am to include
it into the distribution.

Thanks!

Andreas




Re: [PATCH] gnu: bedtools: Update to 2.24.0.

2015-07-25 Thread Ben Woodcroft



On 25/07/15 22:57, Ben Woodcroft wrote:

gnu: bedtools: Update to 2.24.0.

* gnu/packages/bioinformatics.scm (bedtools): Update to 2.24.0.


Sorry try this instead.
>From 8220fe64f34a77a2307c9f0caca69decaf9f7b61 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
Date: Sat, 25 Jul 2015 22:58:08 +1000
Subject: [PATCH] gnu: bedtools: Update to 2.24.0.

* gnu/packages/bioinformatics.scm (bedtools): Update to 2.24.0.
---
 gnu/packages/bioinformatics.scm|   7 +-
 .../patches/bedtools-32bit-compilation.patch   | 168 +
 2 files changed, 173 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/bedtools-32bit-compilation.patch

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 78cd3ce..738d559 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -148,7 +148,7 @@ computational cluster.")
 (define-public bedtools
   (package
 (name "bedtools")
-(version "2.22.0")
+(version "2.24.0")
 (source (origin
   (method url-fetch)
   (uri (string-append "https://github.com/arq5x/bedtools2/archive/v";
@@ -156,7 +156,10 @@ computational cluster.")
   (file-name (string-append name "-" version ".tar.gz"))
   (sha256
(base32
-"16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"
+"0lnxrjvs3nnmb4bmskag1wg3h2hd80przz5q3xd0bvs7vyxrvpbl"))
+  ;; Fixed in upstream, see
+  ;; https://github.com/arq5x/bedtools2/issues/271
+  (patches (list (search-patch "bedtools-32bit-compilation.patch")
 (build-system gnu-build-system)
 (native-inputs `(("python" ,python-2)))
 (inputs `(("samtools" ,samtools)
diff --git a/gnu/packages/patches/bedtools-32bit-compilation.patch b/gnu/packages/patches/bedtools-32bit-compilation.patch
new file mode 100644
index 000..0a4e710
--- /dev/null
+++ b/gnu/packages/patches/bedtools-32bit-compilation.patch
@@ -0,0 +1,168 @@
+From b47dbefcb57f8e6c4fe397f64346338620740b71 Mon Sep 17 00:00:00 2001
+From: arq5x 
+Date: Wed, 15 Jul 2015 15:15:23 -0600
+Subject: [PATCH] settle on uint32_t signature for QuickString. Resolves #267
+ and #271?
+
+---
+ src/coverageFile/coverageFile.cpp | 24 
+ src/utils/general/QuickString.cpp | 27 ++-
+ src/utils/general/QuickString.h   |  6 +++---
+ 3 files changed, 29 insertions(+), 28 deletions(-)
+
+diff --git a/src/coverageFile/coverageFile.cpp b/src/coverageFile/coverageFile.cpp
+index 859cfdc..0fb544b 100644
+--- a/src/coverageFile/coverageFile.cpp
 b/src/coverageFile/coverageFile.cpp
+@@ -83,11 +83,11 @@ void CoverageFile::giveFinalReport(RecordOutputMgr *outputMgr) {
+ 		float depthPct = (float)basesAtDepth / (float)_totalQueryLen;
+ 
+ 		_finalOutput = "all\t";
+-		_finalOutput.append(depth);
++		_finalOutput.append(static_cast(depth));
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(basesAtDepth);
++		_finalOutput.append(static_cast(basesAtDepth));
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(_totalQueryLen);
++		_finalOutput.append(static_cast(_totalQueryLen));
+ 		_finalOutput.append("\t");
+ 		format(depthPct);
+ 
+@@ -138,7 +138,7 @@ size_t CoverageFile::countBasesAtDepth(size_t depth) {
+ 
+ void CoverageFile::doCounts(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ {
+-	_finalOutput = hits.size();
++	_finalOutput = static_cast(hits.size());
+ 	outputMgr->printRecord(hits.getKey(), _finalOutput);
+ }
+ 
+@@ -147,9 +147,9 @@ void CoverageFile::doPerBase(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ 	//loop through all bases in query, printing full record and metrics for each
+ 	const Record * queryRec = hits.getKey();
+ 	for (size_t i= 0; i < _queryLen; i++) {
+-		_finalOutput = i +1;
++		_finalOutput = static_cast(i+1);
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(_depthArray[i]);
++		_finalOutput.append(static_cast(_depthArray[i]));
+ 
+ 		outputMgr->printRecord(queryRec, _finalOutput);
+ 	}
+@@ -181,11 +181,11 @@ void CoverageFile::doHist(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ 		size_t numBasesAtDepth = iter->second;
+ 		float coveredBases = (float)numBasesAtDepth / (float)_queryLen;
+ 
+-		_finalOutput = depth;
++		_finalOutput = static_cast(depth);
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(numBasesAtDepth);
++		_finalOutput.append(static_cast(numBasesAtDepth));
+ 		_finalOutput.append("\t");
+-		_finalOutput.append(_queryLen);
++		_finalOutput.append(static_cast(_queryLen));
+ 		_finalOutput.append("\t");
+ 		format(coveredBases);
+ 
+@@ -199,11 +199,11 @@ void CoverageFile::doDefault(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
+ 	size_t nonZeroBases = _queryLen - countBasesAtDepth(0);
+ 	float coveredBases = (float)nonZeroBases / (float)_queryLen;
+ 
+-	_finalOutput = hits.size();
++	_finalOutput = static_cast(hits.size());
+ 	_finalOutput.append("\t");

Re: [PATCH] getifaddrs wrapper

2015-07-25 Thread Ludovic Courtès
Hi Rohan,

Sorry for the delay.  Commit e7f5691 adds the ‘getifaddrs’ bindings
under the name ‘network-interfaces’ (there was already a procedure with
that name, which I’ve renamed to ‘network-interface-names’ in b89e740.)

I ended up doing things differently from your patch, notably because I
was willing to get more support from ‘define-c-struct’, which led me to
find a couple of shortcomings that needed to be fixed (apologies for not
noticing these earlier!).

I’ve written tests which, unlike yours, do not use the ‘ifconfig’
command, mostly because there are several ‘ifconfig’ implementations so
I doubt we can reliably parse their output, and because I don’t want
tests to introduce an additional dependency.

Anyway, now one can do things like this:

--8<---cut here---start->8---
scheme@(guile-user)> ,use(guix build syscalls)
scheme@(guile-user)> ,use(srfi srfi-1)
scheme@(guile-user)> (network-interfaces)
$13 = (# # # # # 
# #)
scheme@(guile-user)> (filter (lambda (i)
   (= AF_INET6 (sockaddr:fam (interface-address 
i
 (network-interfaces))
$14 = (# #)
--8<---cut here---end--->8---

Pretty neat, no?  :-)

Note that family 17 is AF_PACKET.  Currently libguile does not support
AF_PACKET, which means we cannot do much with these addresses.

Comments & bug reports welcome!

Thanks again for your earlier work on this.  Even if the final patch is
different, your work and the discussions we’ve had have been helpful in
getting things into shape.

Ludo’.



Re: [PATCH] gnu: bedtools: Update to 2.24.0.

2015-07-25 Thread Ben Woodcroft

On 25/07/15 19:02, Andreas Enge wrote:

Hello,

unfortunately, it seems to fail in 32 bit (i686 and mips):
http://hydra.gnu.org/eval/105733#tabs-new

with lots of messages of the kind

In file included from ../../utils//general/BedtoolsTypes.h:20:0,
  from ContextBase.h:21,
  from ContextIntersect.h:11,
  from ContextIntersect.cpp:8:
../../utils//general/QuickString.h:41:15: error: ‘QuickString& 
QuickString::operator=(size_t)’ cannot be overloaded
   QuickString &operator = (size_t);
Helpfully this is fixed in upstream though it hasn't yet made it to a 
release. Attached is a new patch that hopefully will help.


ben
>From 47519e0145298c00e4bfa672d92b9f700d12f5ad Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
Date: Sat, 25 Jul 2015 22:54:19 +1000
Subject: [PATCH] gnu: bedtools: Update to 2.24.0.

* gnu/packages/bioinformatics.scm (bedtools): Update to 2.24.0.
---
 gnu/packages/bioinformatics.scm | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 78cd3ce..738d559 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -148,7 +148,7 @@ computational cluster.")
 (define-public bedtools
   (package
 (name "bedtools")
-(version "2.22.0")
+(version "2.24.0")
 (source (origin
   (method url-fetch)
   (uri (string-append "https://github.com/arq5x/bedtools2/archive/v";
@@ -156,7 +156,10 @@ computational cluster.")
   (file-name (string-append name "-" version ".tar.gz"))
   (sha256
(base32
-"16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"
+"0lnxrjvs3nnmb4bmskag1wg3h2hd80przz5q3xd0bvs7vyxrvpbl"))
+  ;; Fixed in upstream, see
+  ;; https://github.com/arq5x/bedtools2/issues/271
+  (patches (list (search-patch "bedtools-32bit-compilation.patch")
 (build-system gnu-build-system)
 (native-inputs `(("python" ,python-2)))
 (inputs `(("samtools" ,samtools)
-- 
2.4.3



Re: [PATCH] python2-ansible, python-ccm and dependencies

2015-07-25 Thread Ricardo Wurmus

Hi Eric,

> I added the following package definitions to python.scm :
>
> - python2-ansible
> - python-passlib
> - python-py-bcrypt
> - python-paramiko
> - python-httplib2
> - python-ecdsa
> - python-ccm

we normally make separate commits for separate packages.  The only
exception is for when we add python- as well as python2-;
they usually go together in the same commit.

Please also run ‘guix lint package-name’ for each of the new packages.
It will tell you a couple of things that you could do to improve.

One thing I noticed is that the description you provide for the packages
is the same as the synopsis.  The description, however, should provide
more information and it should be complete sentences (with
punctuation).

Things like ‘("python-setuptools" ,python-setuptools)’ are to be placed
in the list of ‘native-inputs’.  ‘native-inputs’ are only used at build
time.

Finally, there is no space between your definition of ‘python2-ccm’ and
the existing definition of ‘python-pytz’.

The other patch looks good to me, but it appears that this is a patch by
Mark Weaver.  Did you submit it by accident?

~~ Ricardo




Re: [PATCH] python2-ansible, python-ccm and dependencies

2015-07-25 Thread Alex Kost
Eric Dvorsak (2015-07-24 19:21 +0300) wrote:

> I added the following package definitions to python.scm :
>
> - python2-ansible
> - python-passlib
> - python-py-bcrypt
> - python-paramiko
> - python-httplib2
> - python-ecdsa
> - python-ccm
>
> This is my first commit ever so if I did something wrong or missed a
> step in the process please let me know so I can improve for the next
> ones.
>
> Eric Dvorsak.

Hello and welcome!  We prefer a single patch per package and the commit
messages should look like this:

--8<---cut here---start->8---
gnu: Add python2-ansible.

* gnu/packages/python.scm (python2-ansible): New variable.
--8<---cut here---end--->8---

See also other python commits.

And some quick notes:

> +(home-page "http://ansible.com/";)
> +(synopsis "Radically simple IT automation")
> +(description "Radically simple IT automation")

Please, add periods in the end of descriptions.  And usually
descriptions should be more verbose than synopses.

> +(license gpl3)))

'gpl3+'.  'gpl3' shouldn't even work in this module.

> +(home-page "http://passlib.googlecode.com";)

This page says the project has moved.  Perhaps
?

> +(synopsis
> + "Comprehensive password hashing framework supporting over 30 schemes")
> +(description
> + "Comprehensive password hashing framework supporting over 30 schemes")
> +(license bsd-3))
> +  )

   (license bsd-3)))

Please do not put a single parenthesis on a separate line.

> +(define-public python-paramiko
> +  (package
> +(name "python-paramiko")
> +(version "1.15.2")
> +(source
> + (origin
> +   (method url-fetch)
> +   (uri (string-append
> + "https://pypi.python.org/packages/source/p/paramiko/paramiko-";
> + version
> + ".tar.gz"))
> +   (sha256
> +(base32
> + "0mbfzm9zlrz6mla9xakrm8wkll3x035f9rj3c5pbgjzfldqscmjg"
> +(build-system python-build-system)
> +(inputs
> + `(("python-ecdsa" ,python-ecdsa)
> +   ("python-pycrypto" ,python-pycrypto)
> +   ("python-setuptools" ,python-setuptools)))
> +(propagated-inputs
> + `(("python2-pycrypto" ,python2-pycrypto)))

Did you mean "python-pycrypto" (not "python2-pycrypto")?

-- 
Alex



Re: [PATCH] gnu: bedtools: Update to 2.24.0.

2015-07-25 Thread Andreas Enge
Hello,

unfortunately, it seems to fail in 32 bit (i686 and mips):
   http://hydra.gnu.org/eval/105733#tabs-new
   
with lots of messages of the kind
   In file included from ../../utils//general/BedtoolsTypes.h:20:0,
 from ContextBase.h:21,
 from ContextIntersect.h:11,
 from ContextIntersect.cpp:8:
../../utils//general/QuickString.h:41:15: error: ‘QuickString& 
QuickString::operator=(size_t)’ cannot be overloaded
  QuickString &operator = (size_t);

Andreas




[PATCH 5/7] ui: Add 'show-derivation-outputs'.

2015-07-25 Thread Alex Kost
* guix/scripts/build.scm (guix-build): Extract code from here and move to...
* guix/ui.scm (show-derivation-outputs): ... here.  New procedure.
---
 guix/scripts/build.scm |  9 +
 guix/ui.scm| 11 ++-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index d593b5a..f169853 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -490,14 +490,7 @@ arguments with packages that use the specified source."
  roots))
   ((not (assoc-ref opts 'dry-run?))
(and (build-derivations store drv)
-(for-each (lambda (d)
-(format #t "~{~a~%~}"
-(map (match-lambda
-  ((out-name . out)
-   (derivation->output-path
-d out-name)))
- (derivation-outputs d
-  drv)
+(for-each show-derivation-outputs drv)
 (for-each (cut register-root store <> <>)
   (map (lambda (drv)
  (map cdr
diff --git a/guix/ui.scm b/guix/ui.scm
index 28d4b97..f17eae9 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès 
 ;;; Copyright © 2013 Mark H Weaver 
 ;;; Copyright © 2013 Nikita Karetnikov 
-;;; Copyright © 2014 Alex Kost 
+;;; Copyright © 2014, 2015 Alex Kost 
 ;;; Copyright © 2014 Deck Pickard 
 ;;;
 ;;; This file is part of GNU Guix.
@@ -57,6 +57,7 @@
 show-bug-report-information
 string->number*
 size->number
+show-derivation-outputs
 show-what-to-build
 show-what-to-build*
 show-manifest-transaction
@@ -489,6 +490,14 @@ error."
  (leave (_ "expression ~s does not evaluate to a package~%")
 str
 
+(define (show-derivation-outputs derivation)
+  "Show outputs of DERIVATION."
+  (format #t "~{~a~%~}"
+  (map (match-lambda
+ ((out-name . out)
+  (derivation->output-path derivation out-name)))
+   (derivation-outputs derivation
+
 (define* (show-what-to-build store drv
  #:key dry-run? (use-substitutes? #t))
   "Show what will or would (depending on DRY-RUN?) be built in realizing the
-- 
2.4.3




[PATCH 6/7] guix build: Add 'build-package'.

2015-07-25 Thread Alex Kost
* guix/scripts/build.scm (build-package): New procedure.
---
 guix/scripts/build.scm | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index f169853..b710b59 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès 
 ;;; Copyright © 2013 Mark H Weaver 
+;;; Copyright © 2015 Alex Kost 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -39,9 +40,20 @@
 set-build-options-from-command-line
 set-build-options-from-command-line*
 show-build-options-help
-
+build-package
 guix-build))
 
+(define (build-package package . build-options)
+  "Build PACKAGE using BUILD-OPTIONS."
+  (with-store store
+(let* ((drv (run-with-store store
+  (package->derivation package)))
+   (drvs (list drv)))
+  (apply set-build-options store build-options)
+  (show-what-to-build store drvs)
+  (build-derivations store drvs)
+  (show-derivation-outputs drv
+
 (define (register-root store paths root)
   "Register ROOT as an indirect GC root for all of PATHS."
   (let* ((root (string-append (canonicalize-path (dirname root))
-- 
2.4.3




[PATCH 0/7] Add "guix-devel-…" commands.

2015-07-25 Thread Alex Kost
Rather big patchset but only a couple of additions.

[PATCH 1/7] emacs: Move guile related code to "guix-guile.el".
[PATCH 2/7] emacs: Move code for evaluating to "guix-geiser.el".
[PATCH 3/7] emacs: Add code to call guile procedures.
[PATCH 4/7] emacs: Add 'guix-devel-use-current-module'.
[PATCH 5/7] ui: Add 'show-derivation-outputs'.
[PATCH 6/7] guix build: Add 'build-package'.
[PATCH 7/7] emacs: Add 'guix-devel-use-current-module'.

Patches 1, 2 and 5 are just for some auxiliary code reorganizing.

Patch 6 adds 'build-package' procedure to (guix scripts build) module,
which is probably not the best place for it, but since it uses (guix ui)
module to show some output, I don't know what module is more suitable.

And finally, I'm afraid building guix package in a Geiser REPL may not
be very useful because of 
(you have wait for the REPL command to be finished before continuing to
edit .scm-file).

Anyway, Ludovic, is that what you meant?:


-- 
Alex



[PATCH 3/7] emacs: Add code to call guile procedures.

2015-07-25 Thread Alex Kost
* emacs/guix-guile.el (guix-guile-make-call-expression): New function.
* emacs/guix-geiser.el (guix-geiser-call, guix-geiser-call-in-repl): New
  functions.
---
 emacs/guix-geiser.el | 13 +
 emacs/guix-guile.el  |  7 +++
 2 files changed, 20 insertions(+)

diff --git a/emacs/guix-geiser.el b/emacs/guix-geiser.el
index 1f0cf72..14f48c9 100644
--- a/emacs/guix-geiser.el
+++ b/emacs/guix-geiser.el
@@ -24,6 +24,7 @@
 ;;; Code:
 
 (require 'geiser-mode)
+(require 'guix-guile)
 
 (defun guix-geiser-repl ()
   "Return the current Geiser REPL."
@@ -62,6 +63,18 @@ Return elisp expression of the first result value of 
evaluation."
 (geiser--go-to-repl))
   (geiser-repl--send str))
 
+(defun guix-geiser-call (proc &rest args)
+  "Call (PROC ARGS ...) synchronously using the current Geiser REPL.
+PROC and ARGS should be strings."
+  (guix-geiser-eval
+   (apply #'guix-guile-make-call-expression proc args)))
+
+(defun guix-geiser-call-in-repl (proc &rest args)
+  "Call (PROC ARGS ...) in the current Geiser REPL.
+PROC and ARGS should be strings."
+  (guix-geiser-eval-in-repl
+   (apply #'guix-guile-make-call-expression proc args)))
+
 (provide 'guix-geiser)
 
 ;;; guix-geiser.el ends here
diff --git a/emacs/guix-guile.el b/emacs/guix-guile.el
index 112262e..87af192 100644
--- a/emacs/guix-guile.el
+++ b/emacs/guix-guile.el
@@ -24,6 +24,13 @@
 
 ;;; Code:
 
+(defun guix-guile-make-call-expression (proc &rest args)
+  "Return \"(PROC ARGS ...)\" string.
+PROC and ARGS should be strings."
+  (format "(%s %s)"
+  proc
+  (mapconcat #'identity args " ")))
+
 (defun guix-make-guile-expression (fun &rest args)
   "Return string containing a guile expression for calling FUN with ARGS."
   (format "(%S %s)" fun
-- 
2.4.3




[PATCH 2/7] emacs: Move code for evaluating to "guix-geiser.el".

2015-07-25 Thread Alex Kost
* emacs/guix-backend.el: Adjust commentary. Move "eval" code to ...
  (guix-eval): Remove.
  (guix-eval-read, guix-eval-in-repl): Adjust to use new functions.
* emacs/guix-geiser.el: ...here.  New file.
  (guix-geiser-eval, guix-geiser-eval-read, guix-geiser-eval-in-repl):
  New functions.
---
 emacs/guix-backend.el | 39 --
 emacs/guix-geiser.el  | 67 +++
 2 files changed, 77 insertions(+), 29 deletions(-)
 create mode 100644 emacs/guix-geiser.el

diff --git a/emacs/guix-backend.el b/emacs/guix-backend.el
index 7e55bea..8ccfaa6 100644
--- a/emacs/guix-backend.el
+++ b/emacs/guix-backend.el
@@ -1,6 +1,6 @@
-;;; guix-backend.el --- Communication with Geiser
+;;; guix-backend.el --- Making and using Guix REPL
 
-;; Copyright © 2014 Alex Kost 
+;; Copyright © 2014, 2015 Alex Kost 
 
 ;; This file is part of GNU Guix.
 
@@ -19,9 +19,10 @@
 
 ;;; Commentary:
 
-;; This file provides the code for interacting with Guile using Geiser.
+;; This file provides the code for interacting with Guile using Guix REPL
+;; (Geiser REPL with some guix-specific additions).
 
-;; By default (if `guix-use-guile-server' is non-nil) 2 Geiser REPLs are
+;; By default (if `guix-use-guile-server' is non-nil) 2 Guix REPLs are
 ;; started.  The main one (with "guile --listen" process) is used for
 ;; "interacting" with a user - for showing a progress of
 ;; installing/deleting Guix packages.  The second (internal) REPL is
@@ -53,6 +54,7 @@
 
 (require 'geiser-mode)
 (require 'guix-emacs)
+(require 'guix-geiser)
 
 (defvar guix-load-path
   (file-name-directory (or load-file-name
@@ -315,28 +317,10 @@ additional internal REPL if it exists."
 (defvar guix-operation-buffer nil
   "Buffer from which the latest Guix operation was performed.")
 
-(defun guix-eval (str &optional wrap)
-  "Evaluate guile expression STR.
-If WRAP is non-nil, wrap STR into (begin ...) form.
-Return a list of strings with result values of evaluation."
-  (with-current-buffer (guix-get-repl-buffer 'internal)
-(let* ((wrapped (if wrap (geiser-debug--wrap-region str) str))
-   (code `(:eval (:scm ,wrapped)))
-   (ret (geiser-eval--send/wait code)))
-  (if (geiser-eval--retort-error ret)
-  (error "Error in evaluating guile expression: %s"
- (geiser-eval--retort-output ret))
-(cdr (assq 'result ret))
-
 (defun guix-eval-read (str &optional wrap)
-  "Evaluate guile expression STR.
-For the meaning of WRAP, see `guix-eval'.
-Return elisp expression of the first result value of evaluation."
-  ;; Parsing scheme code with elisp `read' is probably not the best idea.
-  (read (replace-regexp-in-string
- "#f\\|#" "nil"
- (replace-regexp-in-string
-  "#t" "t" (car (guix-eval str wrap))
+  "Evaluate STR with guile expression using Guix REPL.
+See `guix-geiser-eval-read' for details."
+  (guix-geiser-eval-read str wrap (guix-get-repl-buffer 'internal)))
 
 (defun guix-eval-in-repl (str &optional operation-buffer operation-type)
   "Switch to Guix REPL and evaluate STR with guile expression there.
@@ -350,10 +334,7 @@ successful executing of the current operation,
   (setq guix-repl-operation-p t
 guix-repl-operation-type operation-type
 guix-operation-buffer operation-buffer)
-  (let ((repl (guix-get-repl-buffer)))
-(with-current-buffer repl
-  (geiser-repl--send str))
-(geiser-repl--switch-to-buffer repl)))
+  (guix-geiser-eval-in-repl str (guix-get-repl-buffer)))
 
 (provide 'guix-backend)
 
diff --git a/emacs/guix-geiser.el b/emacs/guix-geiser.el
new file mode 100644
index 000..1f0cf72
--- /dev/null
+++ b/emacs/guix-geiser.el
@@ -0,0 +1,67 @@
+;;; guix-geiser.el --- Interacting with Geiser
+
+;; Copyright © 2015 Alex Kost 
+
+;; 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 this program.  If not, see .
+
+;;; Commentary:
+
+;; This file provides functions to evaluate guile code using Geiser.
+
+;;; Code:
+
+(require 'geiser-mode)
+
+(defun guix-geiser-repl ()
+  "Return the current Geiser REPL."
+  (or geiser-repl--repl
+  (geiser-repl--repl/impl 'guile)
+  (error "Geiser REPL not found")))
+
+(defun guix-geiser-eval (str &optional wrap repl)
+  "Evaluate STR with guile expression using Geiser REPL.
+If REPL is nil, use the current Geiser REPL.
+If WRAP is non-nil, wrap STR into (be

[PATCH 4/7] emacs: Add 'guix-devel-use-current-module'.

2015-07-25 Thread Alex Kost
* emacs/guix-guile.el (guix-guile-current-module): New function.
* emacs/guix-devel.el: New file.
  (guix-devel-use-modules, guix-devel-use-current-module): New functions.
* doc/emacs.texi (Emacs Development): New node.  Document
  'guix-devel-use-current-module'.
---
 doc/emacs.texi  | 29 -
 emacs/guix-devel.el | 44 
 emacs/guix-guile.el | 13 +
 3 files changed, 85 insertions(+), 1 deletion(-)
 create mode 100644 emacs/guix-devel.el

diff --git a/doc/emacs.texi b/doc/emacs.texi
index 180037a..6920bef 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -19,7 +19,8 @@ guix package}).  Specifically, ``guix.el'' makes it easy to:
 * Usage: Emacs Usage.  Using the interface.
 * Configuration: Emacs Configuration.  Configuring the interface.
 * Prettify Mode: Emacs Prettify.   Abbreviating @file{/gnu/store/@dots{}} 
file names.
-* Completions: Emacs Completions.   Completing @command{guix} shell 
command.
+* Completions: Emacs Completions.  Completing @command{guix} shell command.
+* Development: Emacs Development.  Tools for Guix developers.
 @end menu
 
 @node Emacs Initial Setup
@@ -554,3 +555,29 @@ something:
 @item @code{guix lint --checkers=synopsis,des}@key{TAB}
 
 @end itemize
+
+
+@node Emacs Development
+@subsection Development
+
+This section describes some additional commands for Guix developers who
+use Geiser to work with guile code.
+
+@table @kbd
+
+@item M-x guix-devel-use-current-module
+Use the current guile module.  Often after opening a scheme file, you
+want to use a module it defines, so you switch to the Geiser REPL and
+write @code{,use (some module)} there.  You may just use this command
+instead.
+
+@end table
+
+And as always if you use a command often, it is a good idea to bind a
+key to it, for example like this:
+
+@example
+(with-eval-after-load 'scheme
+  (define-key scheme-mode-map (kbd "C-c u")
+'guix-devel-use-current-module))
+@end example
diff --git a/emacs/guix-devel.el b/emacs/guix-devel.el
new file mode 100644
index 000..e99b289
--- /dev/null
+++ b/emacs/guix-devel.el
@@ -0,0 +1,44 @@
+;;; guix-devel.el --- Development tools
+
+;; Copyright © 2015 Alex Kost 
+
+;; 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 this program.  If not, see .
+
+;;; Commentary:
+
+;; This file provides commands useful for developing Guix (or even arbitrary
+;; guile code) with Geiser.
+
+;;; Code:
+
+(require 'guix-guile)
+(require 'guix-geiser)
+
+(defun guix-devel-use-modules (&rest modules)
+  "Use guile MODULES."
+  (apply #'guix-geiser-call "use-modules" modules))
+
+;;;###autoload
+(defun guix-devel-use-current-module ()
+  "Use the current guile module."
+  (interactive)
+  (let ((module (guix-guile-current-module)))
+(guix-devel-use-modules module)
+(message "Using %s module." module)))
+
+(provide 'guix-devel)
+
+;;; guix-devel.el ends here
diff --git a/emacs/guix-guile.el b/emacs/guix-guile.el
index 87af192..ffa8848 100644
--- a/emacs/guix-guile.el
+++ b/emacs/guix-guile.el
@@ -24,6 +24,19 @@
 
 ;;; Code:
 
+(require 'geiser-guile)
+
+(defun guix-guile-current-module ()
+  "Return string with current guile module.
+Return nil, if current buffer does not define a module."
+  ;; Modified version of `geiser-guile--get-module'.
+  (save-excursion
+(geiser-syntax--pop-to-top)
+(when (or (re-search-backward geiser-guile--module-re nil t)
+  (looking-at geiser-guile--library-re)
+  (re-search-forward geiser-guile--module-re nil t))
+  (match-string-no-properties 1
+
 (defun guix-guile-make-call-expression (proc &rest args)
   "Return \"(PROC ARGS ...)\" string.
 PROC and ARGS should be strings."
-- 
2.4.3




[PATCH 7/7] emacs: Add 'guix-devel-use-current-module'.

2015-07-25 Thread Alex Kost
Suggested by Ludovic Courtès .

* emacs/guix-guile.el (guix-guile-definition-regexp): New variable.
  (guix-guile-current-definition): New function.
* emacs/guix-devel.el (guix-devel-build-current-package-definition): New
  command.
* doc/emacs.texi (Emacs Development): Document it.
---
 doc/emacs.texi  |  6 ++
 emacs/guix-devel.el |  9 +
 emacs/guix-guile.el | 17 +
 3 files changed, 32 insertions(+)

diff --git a/doc/emacs.texi b/doc/emacs.texi
index 6920bef..5f1584c 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -571,6 +571,12 @@ want to use a module it defines, so you switch to the 
Geiser REPL and
 write @code{,use (some module)} there.  You may just use this command
 instead.
 
+@item M-x guix-devel-build-current-package-definition
+Build package defined by the current variable definition.  If you
+modified the current package definition, don't forget to reevaluate it
+before calling this command (for example, with @kbd{C-M-x} (@pxref{To
+eval or not to eval,,, geiser, Geiser User Manual})).
+
 @end table
 
 And as always if you use a command often, it is a good idea to bind a
diff --git a/emacs/guix-devel.el b/emacs/guix-devel.el
index e99b289..1d3f381 100644
--- a/emacs/guix-devel.el
+++ b/emacs/guix-devel.el
@@ -39,6 +39,15 @@
 (guix-devel-use-modules module)
 (message "Using %s module." module)))
 
+;;;###autoload
+(defun guix-devel-build-current-package-definition ()
+  "Build package defined by the current top-level variable definition."
+  (interactive)
+  (guix-devel-use-modules "(guix scripts build)"
+  (guix-guile-current-module))
+  (guix-geiser-call-in-repl "build-package"
+(guix-guile-current-definition)))
+
 (provide 'guix-devel)
 
 ;;; guix-devel.el ends here
diff --git a/emacs/guix-guile.el b/emacs/guix-guile.el
index ffa8848..aa5d747 100644
--- a/emacs/guix-guile.el
+++ b/emacs/guix-guile.el
@@ -26,6 +26,23 @@
 
 (require 'geiser-guile)
 
+(defvar guix-guile-definition-regexp
+  (rx bol "(define"
+  (zero-or-one "*")
+  (zero-or-one "-public")
+  (one-or-more space)
+  (zero-or-one "(")
+  (group (one-or-more (or word (syntax symbol)
+  "Regexp used to find the guile definition.")
+
+(defun guix-guile-current-definition ()
+  "Return string with name of the current top-level guile definition."
+  (save-excursion
+(beginning-of-defun)
+(if (looking-at guix-guile-definition-regexp)
+(match-string-no-properties 1)
+  (error "Couldn't find the current definition"
+
 (defun guix-guile-current-module ()
   "Return string with current guile module.
 Return nil, if current buffer does not define a module."
-- 
2.4.3




[PATCH 1/7] emacs: Move guile related code to "guix-guile.el".

2015-07-25 Thread Alex Kost
* emacs/guix-backend.el (guix-make-guile-expression): Move to...
* emacs/guix-guile.el: ... here.  New file.
* emacs/guix-base.el: Use it.
---
 emacs/guix-backend.el | 18 --
 emacs/guix-base.el|  1 +
 emacs/guix-guile.el   | 47 +++
 3 files changed, 48 insertions(+), 18 deletions(-)
 create mode 100644 emacs/guix-guile.el

diff --git a/emacs/guix-backend.el b/emacs/guix-backend.el
index 73a429b..7e55bea 100644
--- a/emacs/guix-backend.el
+++ b/emacs/guix-backend.el
@@ -315,24 +315,6 @@ additional internal REPL if it exists."
 (defvar guix-operation-buffer nil
   "Buffer from which the latest Guix operation was performed.")
 
-(defun guix-make-guile-expression (fun &rest args)
-  "Return string containing a guile expression for calling FUN with ARGS."
-  (format "(%S %s)" fun
-  (mapconcat
-   (lambda (arg)
- (cond
-  ((null arg) "'()")
-  ((or (eq arg t)
-   ;; An ugly hack to separate 'false' from nil
-   (equal arg 'f)
-   (keywordp arg))
-   (concat "#" (prin1-to-string arg t)))
-  ((or (symbolp arg) (listp arg))
-   (concat "'" (prin1-to-string arg)))
-  (t (prin1-to-string arg
-   args
-   " ")))
-
 (defun guix-eval (str &optional wrap)
   "Evaluate guile expression STR.
 If WRAP is non-nil, wrap STR into (begin ...) form.
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index fe89584..8b4ea5c 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -30,6 +30,7 @@
 (require 'cl-lib)
 (require 'guix-profiles)
 (require 'guix-backend)
+(require 'guix-guile)
 (require 'guix-utils)
 (require 'guix-history)
 (require 'guix-messages)
diff --git a/emacs/guix-guile.el b/emacs/guix-guile.el
new file mode 100644
index 000..112262e
--- /dev/null
+++ b/emacs/guix-guile.el
@@ -0,0 +1,47 @@
+;;; guix-guile.el --- Auxiliary tools for working with guile code
+
+;; Copyright © 2015 Alex Kost 
+
+;; 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 this program.  If not, see .
+
+;;; Commentary:
+
+;; This file provides functions for parsing guile code, making guile
+;; expressions, etc.
+
+;;; Code:
+
+(defun guix-make-guile-expression (fun &rest args)
+  "Return string containing a guile expression for calling FUN with ARGS."
+  (format "(%S %s)" fun
+  (mapconcat
+   (lambda (arg)
+ (cond
+  ((null arg) "'()")
+  ((or (eq arg t)
+   ;; An ugly hack to separate 'false' from nil.
+   (equal arg 'f)
+   (keywordp arg))
+   (concat "#" (prin1-to-string arg t)))
+  ((or (symbolp arg) (listp arg))
+   (concat "'" (prin1-to-string arg)))
+  (t (prin1-to-string arg
+   args
+   " ")))
+
+(provide 'guix-guile)
+
+;;; guix-guile.el ends here
-- 
2.4.3