inside the Guile REPL

2015-06-16 Thread Pjotr Prins
I have started to document how to use Guix from the Guile REPL.
Tips/hints wanted from experienced hackers! This is not only to keep
my memory fresh, it may be useful for others.

  
https://github.com/pjotrp/guix-notes/blob/master/HACKING.org#debugging-the-package

If this is covered elsewhere I would like to know. I find the Guix
documentation itself accurate, but maybe a little terse ;). Using
Org-mode is probably the way to do it, though I find Ludo's work on

  
https://en.wikisource.org/wiki/Functional_Package_Management_with_Guix/Build_expressions_and_package_descriptions

to be quite useful.

Pj.




Preparing for core-updates merge

2015-06-16 Thread Ludovic Courtès
Hello!

I think we can soon get core-updates built entirely so we can merge it
afterwards.

Any objections?

Can someone confirm that everything is OK on armhf?  (Mark tested a few
days ago, so I guess this should be OK.)

Thanks,
Ludo’.



Re: [PATCH] Add Faust and Guitarix.

2015-06-16 Thread Ludovic Courtès
Mark H Weaver  skribis:

> Alex Kost  writes:
>
>> Ricardo Wurmus (2015-06-14 19:32 +0300) wrote:
>>
>> [...]
>>> +(build-system gnu-build-system)
>>> +(arguments
>>> + `(#:make-flags (list (string-append "prefix=" (assoc-ref %outputs 
>>> "out")))
>>
>> I think it is clearer to use just '%output':
>>
>> `(#:make-flags (list (string-append "prefix=" %output)))
>
> I've been wondering about this as well.  It seems that Ludovic often
> (usually?) writes (assoc-ref %outputs "out"), and I wonder why.  One
> possible reason is that it makes it obvious how to get the filename of
> other outputs.

Right, I usually avoid %output (singular) because it’s a special case of
%outputs, so I prefer using %outputs.

Ludo’.



Re: guix environment

2015-06-16 Thread Ludovic Courtès
Pjotr Prins  skribis:

> On Mon, Jun 15, 2015 at 03:22:55PM -0400, Thompson, David wrote:
>> On Mon, Jun 15, 2015 at 3:10 PM, Pjotr Prins  
>> wrote:
>> > On Mon, Jun 15, 2015 at 09:10:15AM -0400, Thompson, David wrote:
>> >> On Mon, Jun 15, 2015 at 2:55 AM, Pjotr Prins  
>> >> wrote:
>> >> >
>> >> > Would it be OK to add some RUBY paths?
>> >>
>> >> What additional Ruby search paths are needed?  We already have $GEM_PATH.
>> >
>> > $GEM_HOME
>> 
>> This one doesn't make sense because it specifies where gems are to be
>> installed.  Store items are immutable, so one cannot install gems into
>> them.
>
> We still provide the gem tool ;). If we set this value to something
> sensible (relative to $HOME) people can still use gems. The current
> default setting is not good because it does not provide isolation.

I don’t know Ruby, but this seems to be a variable that the *user* must
set, regardless of whether they use Guix or not, no?

Ludo’.



[PATCH] Add idr.

2015-06-16 Thread Ricardo Wurmus
>From 815a5e24f43f61c4beb243d98beb0659bbd74b3a Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Tue, 16 Jun 2015 11:33:26 +0200
Subject: [PATCH] gnu: Add idr.

* gnu/packages/bioinformatics.scm (idr): New variable.
---
 gnu/packages/bioinformatics.scm | 40 
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index eb15d40..ac4c50d 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1061,6 +1061,46 @@ data.  It also provides the bgzip, htsfile, and tabix utilities.")
 ;; the rest is released under the Expat license
 (license (list license:expat license:bsd-3
 
+(define-public idr
+  (package
+(name "idr")
+(version "2.0.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+"https://github.com/nboley/idr/archive/";
+version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"1k3x44biak00aiv3hpm1yd6nn4hhp7n0qnbs3zh2q9sw7qr1qj5r"
+(build-system python-build-system)
+(arguments
+ `(#:phases
+   (modify-phases %standard-phases
+ (add-after
+  'install 'wrap-program
+  (lambda* (#:key outputs #:allow-other-keys)
+(let ((out (assoc-ref %outputs "out"))
+  (path (getenv "PYTHONPATH")))
+  (wrap-program (string-append out "/bin/idr")
+`("PYTHONPATH" ":" prefix (,path
+#t)
+(inputs
+ `(("python-scipy" ,python-scipy)
+   ("python-numpy" ,python-numpy)
+   ("python-matplotlib" ,python-matplotlib)))
+(native-inputs
+ `(("python-cython" ,python-cython)
+   ("python-setuptools" ,python-setuptools)))
+(home-page "https://github.com/nboley/idr";)
+(synopsis "Tool to measure the irreproducible discovery rate (IDR)")
+(description
+ "The IDR (Irreproducible Discovery Rate) framework is a unified approach
+to measure the reproducibility of findings identified from replicate
+experiments and provide highly stable thresholds based on reproducibility.")
+(license license:gpl3+)))
+
 (define-public macs
   (package
 (name "macs")
-- 
2.1.0




Re: [PATCH] Libressl

2015-06-16 Thread Ludovic Courtès
Mark H Weaver  skribis:

> Andreas Enge  writes:

[...]

>> the next question would be whether we should switch
>> all inputs from openssl to libressl. I tried it for fetchmail, and it works
>> just the same.
>
> I would be in favor of trying this in core-updates.

I think this should rather be tried in a specific libressl branch, so
that issues are clearly identified.

But yeah, if that works well, it probably makes sense to switch to
LibreSSL by default.

Thanks,
Ludo’.



decoding error

2015-06-16 Thread Federico Beffa
Hi,

in a package for AUCTeX that I'm preparing, I'm trying to replace any
reference to '/bin/sh' in '.el' files with

(with-directory-excursion el-dir
  (substitute* (find-files "." "\\.el$") (("/bin/sh") (which "sh"

A particular file causes Guile to produce the following error:

ice-9/boot-9.scm:106:20: Throw to key `decoding-error' with args
`("scm_getc" "input decoding error" 84 #)'.

This appears to be due to the following characters: "«" "»". The build
environment includes (by default):

export LC_ALL="en_US.UTF-8"
export LOCPATH="/gnu/store/...-glibc-utf8-locales-2.21/lib/locale"

Emacs says that the file is encoded with iso-8859-1-unix, so I've
tried unsetting the above two variables or setting '(setenv "LC_ALL"
"C")' or '(setlocale LC_ALL "C")' with no effect.

Any suggestion?

Thanks,
Fede



Re: guix environment

2015-06-16 Thread Pjotr Prins
On Tue, Jun 16, 2015 at 09:59:46AM +0200, Ludovic Courtès wrote:
> >> > $GEM_HOME
> >> 
> >> This one doesn't make sense because it specifies where gems are to be
> >> installed.  Store items are immutable, so one cannot install gems into
> >> them.
> >
> > We still provide the gem tool ;). If we set this value to something
> > sensible (relative to $HOME) people can still use gems. The current
> > default setting is not good because it does not provide isolation.
> 
> I don’t know Ruby, but this seems to be a variable that the *user* must
> set, regardless of whether they use Guix or not, no?

The current default points inside the Guix store. Which is (and should
be) read-only

- INSTALLATION DIRECTORY: 
/gnu/store/c13v73jxmj2nir2xjqaz5259zywsa9zi-ruby-2.1.6/lib/ruby/gems/2.1.0

On Debian it is

- INSTALLATION DIRECTORY: /var/lib/gems/1.9.1

(so, by default, you need sudo to run gem)

My proposal is to have it user based and isolated, e.g.,

- INSTALLATION DIRECTORY: 
$HOME/.gem/c13v73jxmj2nir2xjqaz5259zywsa9zi-ruby-2.1.6/2.1.0

Which is similar to what rvm does.

The latter is what a user normally will set (or something similar).

Question is whether it belongs with the Guix package or not. The
current default makes no sense, unless you want to prevent a user from
installing modules and confuse him ;). 

Think my solution similar to what we do with emacs.  Emacs allows for
installation of modules in $HOME.

Pj.




Re: decoding error

2015-06-16 Thread Ricardo Wurmus
> in a package for AUCTeX that I'm preparing, I'm trying to replace any
> reference to '/bin/sh' in '.el' files with
>
> (with-directory-excursion el-dir
>   (substitute* (find-files "." "\\.el$") (("/bin/sh") (which "sh"
>
> A particular file causes Guile to produce the following error:
>
> ice-9/boot-9.scm:106:20: Throw to key `decoding-error' with args
> `("scm_getc" "input decoding error" 84 #)'.

How about this:

(with-directory-excursion el-dir
  (with-fluids ((%default-port-encoding #f))
(substitute* (find-files "." "\\.el$") (("/bin/sh") (which "sh")

~~ Ricardo



Re: decoding error

2015-06-16 Thread Federico Beffa
On Tue, Jun 16, 2015 at 12:07 PM, Ricardo Wurmus
 wrote:
> How about this:
>
> (with-directory-excursion el-dir
>   (with-fluids ((%default-port-encoding #f))
> (substitute* (find-files "." "\\.el$") (("/bin/sh") (which "sh")

That did the trick.

Thanks!
Fede



Re: decoding error

2015-06-16 Thread Ludovic Courtès
Federico Beffa  skribis:

> Emacs says that the file is encoded with iso-8859-1-unix

In that case the solution is to tell Guile to use ISO-8859-1 as the
default encoding where you fiddle with that file:

  (paramaterize ((%default-port-encoding "ISO-8859-1"))
(substitute* ...))

(This is equivalent to what Ricardo suggested, but making the encoding
name explicit is clearer in this case.)

Ludo’.



Re: guix environment

2015-06-16 Thread Ludovic Courtès
Pjotr Prins  skribis:

> On Tue, Jun 16, 2015 at 09:59:46AM +0200, Ludovic Courtès wrote:
>> >> > $GEM_HOME
>> >> 
>> >> This one doesn't make sense because it specifies where gems are to be
>> >> installed.  Store items are immutable, so one cannot install gems into
>> >> them.
>> >
>> > We still provide the gem tool ;). If we set this value to something
>> > sensible (relative to $HOME) people can still use gems. The current
>> > default setting is not good because it does not provide isolation.
>> 
>> I don’t know Ruby, but this seems to be a variable that the *user* must
>> set, regardless of whether they use Guix or not, no?
>
> The current default points inside the Guix store. Which is (and should
> be) read-only
>
> - INSTALLATION DIRECTORY: 
> /gnu/store/c13v73jxmj2nir2xjqaz5259zywsa9zi-ruby-2.1.6/lib/ruby/gems/2.1.0
>
> On Debian it is
>
> - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
>
> (so, by default, you need sudo to run gem)
>
> My proposal is to have it user based and isolated, e.g.,
>
> - INSTALLATION DIRECTORY: 
> $HOME/.gem/c13v73jxmj2nir2xjqaz5259zywsa9zi-ruby-2.1.6/2.1.0

I suppose this would require patching Ruby, but why not.

Another option would be to do like Debian, which is presumably what
upstream intended, and which boils down to configuring Ruby with
--localstatedir=/var or similar.

Thoughts?

Ludo’.



Re: inside the Guile REPL

2015-06-16 Thread Ludovic Courtès
Pjotr Prins  skribis:

> I have started to document how to use Guix from the Guile REPL.
> Tips/hints wanted from experienced hackers! This is not only to keep
> my memory fresh, it may be useful for others.
>
>   
> https://github.com/pjotrp/guix-notes/blob/master/HACKING.org#debugging-the-package

Nice work!

I think it would be nice to see what could be folded into the manual.

The “Defining Packages” section attempts to get the reader started with
writing package definitions, also giving references to the various tools
(‘guix import’, ‘guix hash’, etc.)  Do you think there are things that
could be presented differently or added to that section?

The API, things like bags, and using the REPL are largely undocumented
in the manual.  Regarding the REPL, we probably don’t want to duplicate
what’s already in the Guile manual.

However, I agree that giving an example of how to use the REPL
specifically with Guix would be welcome.  Would you like to propose a
patch?  This could be a section below “Defining Packages” with the
transcript of a simple REPL session and cross-references to the relevant
parts of the Guile manual.

The part about patches should be mostly covered by the new “Submitting
Patches” section of the manual, but again, improvements are always
welcome!

Thanks,
Ludo’.



Re: matplotlib broken

2015-06-16 Thread Ludovic Courtès
Federico Beffa  skribis:

> l...@gnu.org (Ludovic Courtès) writes:
>
>> I don’t know if I’m missing something, but when I type ‘matplotlib’ at
>> the prompt, I get:
>>
>> /gnu/store/g4m8q73cq4lym3v1ag7pnk5zv49mdifs-python-matplotlib-1.4.2/lib/python3.4/site-packages/matplotlib-1.4.2-py3.4-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py
>>  in ()
>>  19 except ValueError:
>>  20 raise ImportError(
>> ---> 21 "Gtk3 backend requires the GObject introspection bindings 
>> for Gtk 3 "
>>  22 "to be installed.")
>>  23
>>
>> ImportError: Gtk3 backend requires the GObject introspection bindings for 
>> Gtk 3 to be installed.
>>
>> This may well be related to : Because Guix
>> has incomplete dependency information, it might GC some of the things
>> that these eggs refer to, and so things may or may not work depending on
>> whether they have been GC’d.
>
> To solve this error I think you need to set
> export GI_TYPELIB_PATH="$HOME/.guix-profile/lib/girepository-1.0"
> We should probably add a search path specification for that.

Oh right.  It’s actually in gobject-introspection, which makes sense but
is inconvenient in this case.  Not sure how to handle it.

> For me it does display a window as expected, but it doesn't show the
> curve (line in this case).

Indeed, in:

  guix environment --pure --ad-hoc gobject-introspection pango gtk+ 
python-ipython -E ipython

I get the behavior you describe, and the console shows alarming
warnings like:

  TypeError: Couldn't find foreign struct converter for 'cairo.Context'

which explains the blank page, I guess.  If Python’s FFI uses GIR files,
then that’s probably because it couldn’t find Cairo’s GIR files in
$GI_TYPELIB_PATH?

My 2¢,
Ludo’.



Re: inside the Guile REPL

2015-06-16 Thread Amirouche Boubekki

On 2015-06-16 09:04, Pjotr Prins wrote:

I have started to document how to use Guix from the Guile REPL.
Tips/hints wanted from experienced hackers! This is not only to keep
my memory fresh, it may be useful for others.


https://github.com/pjotrp/guix-notes/blob/master/HACKING.org#debugging-the-package

If this is covered elsewhere I would like to know. I find the Guix
documentation itself accurate, but maybe a little terse ;). Using
Org-mode is probably the way to do it, though I find Ludo's work on


https://en.wikisource.org/wiki/Functional_Package_Management_with_Guix/Build_expressions_and_package_descriptions

to be quite useful.


Both resource are super useful. Thanks both of you.


Pj.


--
Amirouche ~ amz3 ~ http://www.hyperdev.fr



Help needed with security updates for Qt

2015-06-16 Thread Mark H Weaver
Hi,

Qt includes bundled copies of a *lot* of stuff.  Among other things, it
bundles Chromium, which also bundles a lot of stuff.  Someone who cares
about Qt needs to be on top of security updates for the things it
bundles.

Better yet, we should try to get it to use our system copies of
libraries whenever possible.

I'm aware of security updates for Chromium since the versions of Qt in
Guix were released.  There are probably many others as well.

If we make a separate Chromium package, then beware that there will
probably be FSDG issues that need to be addressed, e.g. offering to
install non-free software like flash, video codecs or plugins.  It may
be that we need to address these issues even if we don't make a separate
Chromium package, depending on how Qt uses it.

There's also stuff like this:

  "chromium: unconditionally downloads binary blob"
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786909

It's a big hairy mess, and to be honest I don't want to touch Qt with a
ten foot pole.  Someone who cares about Qt needs to get on top of this.

Any takers?

  Mark



[PATCH] Add Blast+.

2015-06-16 Thread Ricardo Wurmus
>From 81cbb9bfa523d56c68d5f9f4feed3676edb5a414 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Tue, 16 Jun 2015 16:24:24 +0200
Subject: [PATCH] gnu: Add Blast+.

* gnu/packages/bioinformatics.scm (blast+): New variable.
---
 gnu/packages/bioinformatics.scm | 156 
 1 file changed, 156 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index ac4c50d..4a55040 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -31,6 +31,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpio)
   #:use-module (gnu packages file)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
@@ -294,6 +295,161 @@ into separate processes; and more.")
 (inputs
  `(("python2-numpy" ,python2-numpy)
 
+(define-public blast+
+  (package
+(name "blast+")
+(version "2.2.30")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+"ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/";
+version "/ncbi-blast-" version "+-src.tar.gz"))
+  (sha256
+   (base32
+"0h0fj5cpx6zpfwixgx5f5xbr4rn3cnai0x3j7grrg50vr18jvxr6"
+(build-system gnu-build-system)
+(arguments
+ `(;; There are three(!) tests for this massive library, and all fail with
+   ;; "unparsable timing stats".
+   ;; ERR [127] --  [util/regexp] test_pcre.sh (unparsable timing stats)
+   ;; ERR [127] --  [serial/datatool] datatool.sh (unparsable timing stats)
+   ;; ERR [127] --  [serial/datatool] datatool_xml.sh (unparsable timing stats)
+   #:tests? #f
+   #:out-of-source? #t
+   #:parallel-build? #f ; not supported
+   #:phases
+   (modify-phases %standard-phases
+ (add-before
+  'configure 'set-HOME
+  ;; $HOME needs to be set at some point during the configure phase
+  (lambda _ (setenv "HOME" "/tmp") #t))
+ (add-after
+  'unpack 'enter-dir
+  (lambda _ (chdir "c++") #t))
+ (add-after
+  'enter-dir 'fix-build-system
+  (lambda _
+;; Proceed even though the weird build system says that generated
+;; files are out of date
+(setenv "NCBICXX_RECONF_POLICY" "warn")
+
+;; Remove bundled bzip2 and zlib
+(delete-file-recursively "src/util/compress/bzip2")
+(delete-file-recursively "src/util/compress/zlib")
+(substitute* "src/util/compress/Makefile.in"
+  (("bzip2 zlib api") "api"))
+
+;; Remove useless msbuild directory
+(delete-file-recursively "src/build-system/project_tree_builder/msbuild")
+
+;; Some of the files we're patching are
+;; ISO-8859-1-encoded, so choose it as the default
+;; encoding so the byte encoding is preserved.
+(with-fluids ((%default-port-encoding #f))
+  (substitute* (find-files "src/build-system" "config.*")
+(("LN_S=/bin/\\$LN_S") (string-append "LN_S=" (which "ln")))
+(("/bin/sh") (which "bash"))
+(("^PATH=.*") "")))
+
+;; fix static and generated shebangs
+(substitute* (find-files "scripts/common/check" "\\.sh")
+  (("/bin/sh") (which "bash")))
+
+;; rewrite "/var/tmp" in check script
+(substitute* "scripts/common/check/check_make_unix.sh"
+  (("/var/tmp") (string-append (getcwd) "/build/build")))
+
+;; fix path to "echo"
+(substitute* '("src/build-system/Makefile.rules_with_autodep.in"
+   "src/build-system/Makefile.meta.gmake=no"
+   "src/build-system/Makefile.meta_r"
+   "src/build-system/Makefile.requirements")
+  (("/bin/echo") (which "echo")))
+
+;; fix path to "basename"
+(substitute* '("src/build-system/Makefile.in.top")
+  (("/usr/bin/basename") (which "basename")))
+
+;; fix path to "mv"
+(substitute* '("src/build-system/Makefile.rules_with_autodep.in"
+   "src/build-system/Makefile.meta_p")
+  (("/bin/mv") (which "mv")))
+
+;; fix path to "rm"
+(substitute* '("src/build-system/Makefile.mk.in"
+   "src/build-system/Makefile.meta.in"
+   "scripts/common/impl/run_with_lock.sh")
+  (("/bin/rm") (which "rm")))
+
+;; fix path to "cp"
+(substitute* '("src/build-system/Makefile.configurables.real"
+   "src/build-system/Makefile.mk.in"
+   "src/build-system/configure"
+   "src/build-s

Re: guix environment

2015-06-16 Thread Pjotr Prins
On Tue, Jun 16, 2015 at 01:23:23PM +0200, Ludovic Courtès wrote:
> > On Debian it is
> >
> > - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
> >
> > (so, by default, you need sudo to run gem)
> >
> > My proposal is to have it user based and isolated, e.g.,
> >
> > - INSTALLATION DIRECTORY: 
> > $HOME/.gem/c13v73jxmj2nir2xjqaz5259zywsa9zi-ruby-2.1.6/2.1.0
> 
> I suppose this would require patching Ruby, but why not.
> 
> Another option would be to do like Debian, which is presumably what
> upstream intended, and which boils down to configuring Ruby with
> --localstatedir=/var or similar.

I prefer defaulting to $HOME. It is easier to teach a sysadmin
different then an end-user ;)

This way gems will work out-of-the-box.

Pj.




Re: inside the Guile REPL

2015-06-16 Thread Pjotr Prins
On Tue, Jun 16, 2015 at 01:38:18PM +0200, Ludovic Courtès wrote:
> I think it would be nice to see what could be folded into the manual.

Let me continue for a while. I am writing up what I am discovering -
and I am enjoying it. Every time I am confirmed that using Guile was a
smart move. I'll try and do it in such a way that it is something of a
tutorial.

In one or two months we can cherry-pick what is there and we can fold
the useful parts into the main Guix docs. 

Pj.



Re: [PATCH] Add idr.

2015-06-16 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> From 815a5e24f43f61c4beb243d98beb0659bbd74b3a Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Tue, 16 Jun 2015 11:33:26 +0200
> Subject: [PATCH] gnu: Add idr.
>
> * gnu/packages/bioinformatics.scm (idr): New variable.

[...]

> +  'install 'wrap-program
> +  (lambda* (#:key outputs #:allow-other-keys)
> +(let ((out (assoc-ref %outputs "out"))
> +  (path (getenv "PYTHONPATH")))
> +  (wrap-program (string-append out "/bin/idr")
> +`("PYTHONPATH" ":" prefix (,path

Taking $PYTHONPATH as is has the effect of keeping a reference to Cython
and to setuptools, which may not be what you want, given that they are
listed as ‘native-inputs’.

Should it instead explicitly list SciPy, NumPy, and Matplotlib?

Thanks,
Ludo’.



Re: [PATCH] Add Faust and Guitarix.

2015-06-16 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> From 7d0f4d6702cf6ed370e534862244fb65c414f46d Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Sun, 14 Jun 2015 15:00:37 +0200
> Subject: [PATCH 1/3] gnu: Add Faust.
>
> * gnu/packages/audio.scm (faust): New variable.

[...]

> +  'unpack 'remove-prebuilt-library
> +  (lambda _
> +(delete-file 
> "architecture/android/libs/armeabi-v7a/libfaust_dsp.so")

This should go in a snippet IMO.

Otherwise OK.

> From 790dba434e51ded7e5fe791b7577886f011b00a9 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Sun, 14 Jun 2015 15:01:08 +0200
> Subject: [PATCH 2/3] gnu: Add zita-resampler.
>
> * gnu/packages/audio.scm (zita-resampler): New variable.

OK.

> From eecb83dd2a9ad9faf5016a6381c7fb2072b51aa1 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Sun, 14 Jun 2015 17:15:08 +0200
> Subject: [PATCH 3/3] gnu: Add Guitarix.
>
> * gnu/packages/audio.scm (guitarix): New variable.

[...]

> +;; dsp2cc fails for src/faust/tonestack_engl.dsp, so we use the
> +;; generated C++ files rather than compiling them from Faust sources.
> +"--no-faust"

I think it deserves a FIXME.  (It’s OK for now, but the eventual goal
should be to build those from source as well.)

> +(native-search-paths
> + (list (search-path-specification
> +(variable "LV2_PATH")
> +(files '("lib/lv2")

Shouldn’t it be in LV2 itself instead?

> +(home-page "http://guitarix.org/";)
> +(synopsis "Virtual guitar amplifier")
> +(description "Guitarix is a virtual guitar amplifier running JACK.")

Could you expound a bit, for instance using the second paragraph on the
web page?

(And then make sure to have the GuixSD logo listed next to Debian et
al. in their “Install” section.  ;-))

Thank you, and happy guitar playing!  :-)

Ludo’.



Re: [PATCH] gnu: Add ruby 1.8.7 package

2015-06-16 Thread Pjotr Prins
Anything wrong with this patch?

On Sun, Jun 14, 2015 at 10:36:40AM +0200, Pjotr Prins wrote:
> From be945cf4d65ab77eb8bd7a462aa0b7d24877ba74 Mon Sep 17 00:00:00 2001
> From: pjotrp 
> Date: Sat, 13 Jun 2015 13:22:10 +0200
> Subject: [PATCH] gnu: Add ruby 2.1.6
> 
> * gnu/packages/ruby.scm (ruby-2.1): New variable.
> ---
>  gnu/packages/ruby.scm |   28 
>  1 file changed, 28 insertions(+)
> 
> diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
> index 9943de7..f0c645e 100644
> --- a/gnu/packages/ruby.scm
> +++ b/gnu/packages/ruby.scm
> @@ -87,6 +87,34 @@ a focus on simplicity and productivity.")
>  (home-page "https://ruby-lang.org";)
>  (license license:ruby)))
>  
> +(define-public ruby-2.1
> +  (package (inherit ruby)
> +(version "2.1.6")
> +(source
> + (origin
> +   (method url-fetch)
> +   (uri (string-append "http://cache.ruby-lang.org/pub/ruby/";
> +   (version-major+minor version)
> +   "/ruby-" version ".tar.bz2"))
> +   (sha256
> +(base32
> + "1sbcmbhadcxk0509svwxbm2vvgmpf3xjxr1397bgp9x46nz36lkv"
> +(native-search-paths '())
> +(arguments
> + `(#:test-target "test"
> +   #:parallel-tests? #f
> +   #:phases
> +(alist-cons-before
> + 'configure 'replace-bin-sh
> + (lambda _
> +   (substitute* '("Makefile.in"
> +  "ext/pty/pty.c"
> +  "io.c"
> +  "lib/mkmf.rb"
> +  "process.c")
> + (("/bin/sh") (which "sh"
> + %standard-phases)
> +
>  (define-public ruby-1.8
>(package (inherit ruby)
>  (version "1.8.7-p374")
> -- 
> 1.7.10.4
> 


-- 



Re: emacs packages

2015-06-16 Thread Ludovic Courtès
Federico Beffa  skribis:

> To be concrete about what I'm proposing, attached you find:
>
> - An ELPA package importer
> - An 'emacs-build-system'

Sounds very useful to me!

> There are a lot of Emacs packages. For this reason I would like to
> propose to prefix them with 'emacs-' as we do with Python, ...

Sounds good.  I think I prefer ‘emacs-’ to ‘el-’ because that’s probably
what people expect.

> To make those packages automatically available in Emacs without the
> need for any code in the user '.emacs' file, I would suggest to
> include in our Emacs package site initialization file some custom code
> (to activate our ELPA emacs packages) such as the one in the attached
> 'guix-elpa.el' file.

guix.el already takes care of that (info "(guix) Emacs Initial Setup"),
so that should be enough.

Some random comments:

> ;; Path relative to 'out' where we install ELPA packages.  We avoid the
> ;; ".../elpa" path as Emacs expects to find the ELPA repository
> ;; 'archive-contents' file and the archive signature.
> (define guix-elpa-packages-path "/share/emacs/site-lisp/guix.d")

Rather %install-suffix (“path” is used exclusively to refer to search
paths in GNU.)

> (define* (build #:key outputs inputs #:allow-other-keys)
>   "Compile .el files."
>   (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs"))
>  (out (assoc-ref outputs "out"))
>  (name-ver (store-dir->elpa-name-version out))
>  (el-dir (string-append out guix-elpa-packages-path "/" name-ver)))

Please align the lets.  :-)

>   (fold (lambda (f s)
>   (and s (zero? (system* emacs "--batch" "-Q" "-L" el-dir
>  "-f" "batch-byte-compile" f
> #t (find-files "." "\\.el$")

Should probably use ‘emacs-batch-eval’ from (guix build emacs-utils),
and perhaps define ‘emacs-byte-compile’ there.

> (define* (copy #:key outputs #:allow-other-keys)
>   "Copy the package content to the installation directory."

s/copy/install/ ?

> ;; from (guix utils).  Should we put it in (guix build utils)?
> (define (package-name->name+version name)
>   "Given NAME, a package name like \"foo-0.9.1b\", return two values:

Yes, should probably be moved to (guix build utils) eventually.

Thanks for the great initiative!

Ludo’.



Re: [PATCH] gnu: Add ruby 1.8.7 package

2015-06-16 Thread Thompson, David
On Tue, Jun 16, 2015 at 11:46 AM, Pjotr Prins  wrote:
> Anything wrong with this patch?
>
> On Sun, Jun 14, 2015 at 10:36:40AM +0200, Pjotr Prins wrote:
>> From be945cf4d65ab77eb8bd7a462aa0b7d24877ba74 Mon Sep 17 00:00:00 2001
>> From: pjotrp 
>> Date: Sat, 13 Jun 2015 13:22:10 +0200
>> Subject: [PATCH] gnu: Add ruby 2.1.6
>>
>> * gnu/packages/ruby.scm (ruby-2.1): New variable.
>> ---
>>  gnu/packages/ruby.scm |   28 
>>  1 file changed, 28 insertions(+)
>>
>> diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
>> index 9943de7..f0c645e 100644
>> --- a/gnu/packages/ruby.scm
>> +++ b/gnu/packages/ruby.scm
>> @@ -87,6 +87,34 @@ a focus on simplicity and productivity.")
>>  (home-page "https://ruby-lang.org";)
>>  (license license:ruby)))
>>
>> +(define-public ruby-2.1
>> +  (package (inherit ruby)
>> +(version "2.1.6")
>> +(source
>> + (origin
>> +   (method url-fetch)
>> +   (uri (string-append "http://cache.ruby-lang.org/pub/ruby/";
>> +   (version-major+minor version)
>> +   "/ruby-" version ".tar.bz2"))
>> +   (sha256
>> +(base32
>> + "1sbcmbhadcxk0509svwxbm2vvgmpf3xjxr1397bgp9x46nz36lkv"
>> +(native-search-paths '())
>> +(arguments
>> + `(#:test-target "test"
>> +   #:parallel-tests? #f
>> +   #:phases
>> +(alist-cons-before
>> + 'configure 'replace-bin-sh
>> + (lambda _
>> +   (substitute* '("Makefile.in"
>> +  "ext/pty/pty.c"
>> +  "io.c"
>> +  "lib/mkmf.rb"
>> +  "process.c")
>> + (("/bin/sh") (which "sh"
>> + %standard-phases)
>> +
>>  (define-public ruby-1.8
>>(package (inherit ruby)
>>  (version "1.8.7-p374")
>> --
>> 1.7.10.4
>>

Sorry for the delay.  The only thing I noticed is that you need to add
the native search paths into this recipe, changing 2.2 to 2.1 in the
path directory.

Could you submit an updated patch?  I will test and merge after.  FYI,
I've begun work on a helper procedure to make it easy to make variants
of gem packages that use a different Ruby.  That patch should come
pretty soon.

- Dave



Re: decoding error

2015-06-16 Thread Federico Beffa
On Tue, Jun 16, 2015 at 1:20 PM, Ludovic Courtès  wrote:
>   (paramaterize ((%default-port-encoding "ISO-8859-1"))
> (substitute* ...))
>
> (This is equivalent to what Ricardo suggested, but making the encoding
> name explicit is clearer in this case.)

Agreed,
Thanks!

Fede



Re: emacs packages

2015-06-16 Thread Pjotr Prins
Awesome developments!

On Tue, Jun 16, 2015 at 06:00:44PM +0200, Ludovic Courtès wrote:
> Federico Beffa  skribis:
> 
> > To be concrete about what I'm proposing, attached you find:
> >
> > - An ELPA package importer
> > - An 'emacs-build-system'
> 
> Sounds very useful to me!
> 
> > There are a lot of Emacs packages. For this reason I would like to
> > propose to prefix them with 'emacs-' as we do with Python, ...
> 
> Sounds good.  I think I prefer ‘emacs-’ to ‘el-’ because that’s probably
> what people expect.
> 
> > To make those packages automatically available in Emacs without the
> > need for any code in the user '.emacs' file, I would suggest to
> > include in our Emacs package site initialization file some custom code
> > (to activate our ELPA emacs packages) such as the one in the attached
> > 'guix-elpa.el' file.
> 
> guix.el already takes care of that (info "(guix) Emacs Initial Setup"),
> so that should be enough.
> 
> Some random comments:
> 
> > ;; Path relative to 'out' where we install ELPA packages.  We avoid the
> > ;; ".../elpa" path as Emacs expects to find the ELPA repository
> > ;; 'archive-contents' file and the archive signature.
> > (define guix-elpa-packages-path "/share/emacs/site-lisp/guix.d")
> 
> Rather %install-suffix (“path” is used exclusively to refer to search
> paths in GNU.)
> 
> > (define* (build #:key outputs inputs #:allow-other-keys)
> >   "Compile .el files."
> >   (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs"))
> >  (out (assoc-ref outputs "out"))
> >  (name-ver (store-dir->elpa-name-version out))
> >  (el-dir (string-append out guix-elpa-packages-path "/" name-ver)))
> 
> Please align the lets.  :-)
> 
> >   (fold (lambda (f s)
> >   (and s (zero? (system* emacs "--batch" "-Q" "-L" el-dir
> >  "-f" "batch-byte-compile" f
> > #t (find-files "." "\\.el$")
> 
> Should probably use ‘emacs-batch-eval’ from (guix build emacs-utils),
> and perhaps define ‘emacs-byte-compile’ there.
> 
> > (define* (copy #:key outputs #:allow-other-keys)
> >   "Copy the package content to the installation directory."
> 
> s/copy/install/ ?
> 
> > ;; from (guix utils).  Should we put it in (guix build utils)?
> > (define (package-name->name+version name)
> >   "Given NAME, a package name like \"foo-0.9.1b\", return two values:
> 
> Yes, should probably be moved to (guix build utils) eventually.
> 
> Thanks for the great initiative!
> 
> Ludo’.
> 

-- 



Re: emacs packages

2015-06-16 Thread Mark H Weaver
Federico Beffa  writes:

> (define* (build #:key outputs inputs #:allow-other-keys)
>   "Compile .el files."
>   (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs"))
>  (out (assoc-ref outputs "out"))
>  (name-ver (store-dir->elpa-name-version out))
>  (el-dir (string-append out guix-elpa-packages-path "/" name-ver)))
> (setenv "SHELL" "sh")
> (with-directory-excursion el-dir
>   (fold (lambda (f s)
>   (and s (zero? (system* emacs "--batch" "-Q" "-L" el-dir
>  "-f" "batch-byte-compile" f
> #t (find-files "." "\\.el$")

FYI, this pattern of using 'fold' with 'and' and a boolean seed would be
more transparent if handled by 'every' from (srfi srfi-1):

  (every (lambda (f)
   (zero? (system* emacs "--batch" "-Q" "-L" el-dir
   "-f" "batch-byte-compile" f)))
 (find-files "." "\\.el$"))

However, this won't be needed here if you use 'emacs-batch-eval' or add
'emacs-byte-compile' as suggested by Ludovic, which I agree is the right
approach.

 Thanks!
   Mark



Re: matplotlib broken

2015-06-16 Thread Federico Beffa
On Tue, Jun 16, 2015 at 1:50 PM, Ludovic Courtès  wrote:
>>> I don’t know if I’m missing something, but when I type ‘matplotlib’ at
>>> the prompt, I get:
>>>
>>> /gnu/store/g4m8q73cq4lym3v1ag7pnk5zv49mdifs-python-matplotlib-1.4.2/lib/python3.4/site-packages/matplotlib-1.4.2-py3.4-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py
>>>  in ()
>>>  19 except ValueError:
>>>  20 raise ImportError(
>>> ---> 21 "Gtk3 backend requires the GObject introspection bindings 
>>> for Gtk 3 "
>>>  22 "to be installed.")
>>>  23
>>>

I didn't get that error, so I deleted ~/.ipython and now I get it :-/

I guess one option would be to use another back-end.  One of the
supported back-ends is TkAgg which requires Tkinter which is a library
coming with python itself. However, to get the library we need to
compile python with Tk. We had a discussion about this a few month
back. I'm not sure if the work was not finished because people prefer
to have a smallish python, or because of technical difficulties.

Still another back-end is WXAgg, but currently we lack wxPython. If
the dependency tree is not too deep, this may be the easiest route to
a working (again) matplotlib.

Regards,
Fede



Re: Update on GuixSD containers

2015-06-16 Thread Thompson, David
On Sat, Jun 13, 2015 at 4:19 PM, Ludovic Courtès  wrote:
> "Thompson, David"  skribis:
>
>> On Sat, Jun 13, 2015 at 9:06 AM, Ludovic Courtès  wrote:
>>> "Thompson, David"  skribis:
>>>
 On Fri, Jun 12, 2015 at 11:12 AM, Ludovic Courtès  wrote:
> "Thompson, David"  skribis:
>
>> Yeah, our daemon would do the same thing.  We could maybe even have a
>> little Guile library that allows one to evaluate arbitrary scheme code
>> from within the container. :)
>
> Actually, something quite easily feasible would be this:
>
>   (eval-in-container #~(system* #$evil-program
> #$(local-file "important-data.txt"))
>  #:networking? #f)
>
> ... where the container’s store would be populated with just
> EVIL-PROGRAM and the local file.
>
> Food for thought...

 Ooooh yeah!  That would be cool.  Though I think we should still spawn
 a dmd process as PID 1 to deal with reaping zombie processes.  We
 could generate a single service that runs the gexp script.  How does
 that sound?
>>>
>>> Wouldn’t it be enough to have the Guile process that evaluates the
>>> expression be PID 1 in the container, as is the case in guix-daemon
>>> containers?
>>
>> Sure, it would work, but my concern is that a long-running process on
>> a user's machine could create and orphan tons of child processes and
>> nothing would be able to clean them up until the PID namespace is
>> garbage collected.
>
> My understanding was that killing a container’s PID 1 (from the outside)
> effectively killed all the processes of that PID name space.  Isn’t it
> the case?

Yes, that is the case.  That triggers the "garbage collection" of that
namespace, if you will.  My point is that, without a proper PID 1 that
can DTRT with orphaned processes, a long running process in a
container could potentially create a ton of orphaned child processes
with no way for them to be reaped without killing PID 1.  I wouldn't
be very happy if a program that I was running in a sandbox was
polluting the process list.  I don't think this is a concern for the
build daemon because the build process is a (relatively) short-lived
process, but running something like a web browser could go on for
days, weeks, etc.

> (The daemon works around that by running processes under a separate UID
> and doing kill(-1, SIGKILL) under that UID.)

So, PID 1 in the build container forks and changes the UID or
something?  Sorry, I'm a bit lost right now.

Thanks for trying to explain.

- Dave



Re: Complete './pre-inst-env guix ...'

2015-06-16 Thread Alex Kost
Ludovic Courtès (2015-06-15 23:16 +0300) wrote:

> Alex Kost  skribis:
>
>> So (analogously to 'pcomplete/sudo') the following function may be used
>> to complete "pre-inst-env" properly:
>>
>> (defun pcomplete/pre-inst-env ()
>>   (pcmpl-args-pcomplete
>>(pcmpl-args-make-argspecs
>> `((argument 0 (("COMMAND" nil))
>> :subparser pcmpl-args-command-subparser)
>
> Indeed, that works like a charm, thanks!
>
> Now, the fact that ‘pre-inst-env’ is not mentioned in this function is
> puzzling.  It doesn’t take the function name into account, does it?

Yes, that's how 'pcomplete' works.  To make a completion for some "foo"
command, you define 'pcomplete/foo' function and that's all.

-- 
Alex



Re: inside the Guile REPL

2015-06-16 Thread Mark H Weaver
Pjotr Prins  writes:

> I have started to document how to use Guix from the Guile REPL.
> Tips/hints wanted from experienced hackers! This is not only to keep
> my memory fresh, it may be useful for others.
>
>   
> https://github.com/pjotrp/guix-notes/blob/master/HACKING.org#debugging-the-package

I have a few comments and corrections to offer:

* Several of the code examples have extra close parens at the end which
  are highlighted in red when viewing in a web browser.

* In the Scheme world, we prefer to use the word "procedure" instead of
  "function", to reflect the fact that it is not merely a mapping from
  inputs to outputs but can perform side effects as well.

* In "Hash colon (#:) notation", you write "The #: signifies a symbol or
  literal keyword syntax [...]".  Keywords are distinct from symbols, so
  you shouldn't say it's a symbol.

* In "Percentage (%) notation", it would be good to mention that it is
  merely a convention, like '_' in C.  Scheme treats '%' exactly the
  same as any other letter.

* In "Key-values":
   * 'build-system' is not a method, but rather a record constructor.
   * 'name', 'description', and 'lower' are not functions but rather
 field names.

* In "Defining a function", it might be worth mentioning that 'define'
  can be used to bind identifiers to any value, not just procedures.
  Most prominently, we use it to define packages, build systems, etc.

* In "Defining a variable":
   * 'let' and 'let*' are not functions, but rather special forms.
   * Regarding the difference between 'let' and 'let*', what you wrote
 is true, but the more important difference between let and let* is
 that let* allows the initializers of later variables to refer to
 the earlier variables, whereas the initializers of let only see
 variables outside of the let.  For example:

  (let ((a 1) (b 2))
(let ((b a) (a b))
  (list a b)))

 returns (2 1), but if the inner let is replaced with let*, then it
 will return (1 1).

* In "Inside functions", you write "Backquote is like quote, but only
  selected subexpressions are evaluated".  This would seem to suggest
  that 'quote' evaluates all subexpressions.  Removing the word "only"
  might help.  Also, the actual name for this construct is 'quasiquote',
  and it might be good to use that name since it is what can be found in
  the Guile manual and on the web.

  Also, You assume the reader knows the shorthand forms of how 'quote'
  and 'quasiquote' are normally written.  The comma is also a shorthand
  for 'unquote', and it would be good to mention that, since it's a good
  name for it and may aid understanding.  It would also be good if the
  first example showed the outer quasiquote, since unquote is not valid
  outside of quasiquote.  ",@" is shorthand for unquote-splicing.

* In "More about Guile/scheme", I don't think it's accurate to say that
  Guile is a "minimalistic" implementation.  It's moderately large for a
  Scheme implementation.

* In "Renaming and moving files", it would be good to show the newer
  'modify-phases' syntax instead.

* In "Starting the daemon", it might be worth mentioning that it should
  be run as root, but that the actual build processes are run as
  unprivileged build users.

* In "From the command line", you gave a suggested command:

./pre-inst-env guix --load-path ./gnu

  I'm not sure what you're trying to do there.  When I run that command,
  it says "unrecognized option '--load-path'".  Maybe you meant
  something like this:

./pre-inst-env guix package --load-path=./gnu [...]

  but that's not right either, because the  passed to --load-path
  should be such that module (gnu packages foo) is located in
  /gnu/packages/foo.scm.  Anyway, it's not needed because
  ./pre-inst-env automatically adds the right paths to access the
  packages within ./gnu/packages/*.scm.

That's all for now, I'll try to review the rest later.

Anyway, this is a great start.  Thanks for working on it!

  Mark



Re: Using symlinks in 'local-file'

2015-06-16 Thread Alex Kost
Ludovic Courtès (2015-06-15 23:44 +0300) wrote:

> Alex Kost  skribis:
>
>> If one uses a relative symlink in 'local-file', it will lead to a broken
>> symlink in the store as illustrated in the attached example.  So I think
>> it either:
>>
>> - should be documented explicitly that 'local-file' adds a specified
>>   file to the store blindly, which may lead to the problem with a broken
>>   symlink.
>>
>> - or 'local-file' (or a deeper procedure) should take care of that case
>>   and dereference a symlink if needed.
>>
>> WDYT?
>
> Actually, this only happens with #:recursive? #t, which is currently the
> default.
>
> With #:recursive? #f, you get an error:
>
>
> scheme@(guile-user)> ,enter-store-monad
> store-monad@(guile-user) [1]> (gexp->derivation "foo" #~(symlink 
> #$(local-file "/tmp/symlink1" #:recursive? #f) #$output))
> guix/store.scm:604:22: In procedure add-to-store:
> guix/store.scm:604:22: Throw to key `srfi-34' with args `(# &nix-protocol-error [message: "regular file expected" status: 1] 30c5ab0>)'.
>
> So I think we should first make #:recursive? default to #f, since that’s
> what we want by default, and optionally have the  gexp
> expander resolve symlinks.
>
> WDYT?

I agree, getting an error is better than a broken link, so I'm for
making (#:recursive? #f) a default.  And resolving symlinks would
probably be even better.

>> (define (call-derivation drv)
>>   (apply system*
>>  (cons (derivation-builder drv)
>>(derivation-builder-arguments drv
>
> This is quite original.  ;-)

I suppose that's a polite version of "That's not how it should be done".
I just don't know what the proper way to "call" derivation is :-)

-- 
Alex



Re: Preparing for core-updates merge

2015-06-16 Thread Ludovic Courtès
It’s building now!

It may be that some of your favorite packages will fail to build with
4.9, so keep an eye on it.

Ludo’.



Re: emacs packages

2015-06-16 Thread Federico Beffa
On Tue, Jun 16, 2015 at 6:24 PM, Mark H Weaver  wrote:
> FYI, this pattern of using 'fold' with 'and' and a boolean seed would be
> more transparent if handled by 'every' from (srfi srfi-1):
>
>   (every (lambda (f)
>(zero? (system* emacs "--batch" "-Q" "-L" el-dir
>"-f" "batch-byte-compile" f)))
>  (find-files "." "\\.el$"))

Thanks for the comment. I saw the form 'every' in the past, but 'fold'
always come first to my mind.  Probably because it took me more
neurons to understand how to use it :-)

> However, this won't be needed here if you use 'emacs-batch-eval' or add
> 'emacs-byte-compile' as suggested by Ludovic, which I agree is the right
> approach.

What do you think about the attached implementation?

Thanks,
Fede
From d5c33d5237bb371ab3bea88eb78a9ccac583de1d Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Tue, 16 Jun 2015 21:09:57 +0200
Subject: [PATCH] build: emacs-utils: Add 'emacs-byte-compile'.

* guix/build/emacs-utils.scm (emacs-byte-compile): New procedure.
---
 guix/build/emacs-utils.scm | 12 
 1 file changed, 12 insertions(+)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 0cff28b..88eda78 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -22,6 +22,7 @@
 emacs-batch-eval
 emacs-batch-edit-file
 emacs-generate-autoloads
+emacs-byte-compile
 emacs-substitute-sexps
 emacs-substitute-variables))
 
@@ -57,6 +58,17 @@
   (update-directory-autoloads ,directory
 (emacs-batch-eval expr)))
 
+(define (emacs-byte-compile files)
+  "Byte compile FILES, a list of file names."
+  (if (pair? files)
+  (for-each (lambda (f)
+  (let ((expr `(let ()
+ (push ,(dirname f) load-path)
+ (byte-compile-file ,f
+(emacs-batch-eval expr)))
+files)
+  (error "emacs-byte-compile failed: not a list of files!" files)))
+
 (define-syntax emacs-substitute-sexps
   (syntax-rules ()
 "Substitute the S-expression immediately following the first occurrence of
-- 
2.2.1



guix edit

2015-06-16 Thread Ludovic Courtès
While looking at another package manager for ideas to steal, I found
this one to be a good candidate:

  guix edit gcc-4.8

will open $EDITOR (aka. “emacsclient”) on the definition of that
package.  This is pretty handy for developers (even when otherwise using
Geiser, I think.)

For “regular users,” it’s less useful because most of the time it will
open an immutable file.  However, I envision a --clone option that would
create a file with a module declaration and a template like:

  (define my-gcc
(package (inherit gcc)
  ;; Complete here...
  )

(This part is left as an exercise to the reader.)

WDYT?

If there are no objections, I’ll commit the attached version with
appropriate documentation.

Thanks,
Ludo’.

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ludovic Courtès 
;;;
;;; 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 (guix scripts edit)
  #:use-module (guix ui)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-37)
  #:export (%editor
guix-edit))

(define %options
  (list (option '(#\h "help") #f #f
(lambda args
  (show-help)
  (exit 0)))
(option '(#\V "version") #f #f
(lambda args
  (show-version-and-exit "guix edit")

(define (show-help)
  (display (_ "Usage: guix edit PACKAGE...
Start $EDITOR to edit the definitions of PACKAGE...\n"))
  (newline)
  (display (_ "
  -h, --help display this help and exit"))
  (display (_ "
  -V, --version  display version information and exit"))
  (newline)
  (show-bug-report-information))

(define %editor
  (make-parameter (or (getenv "EDITOR") "emacsclient")))


(define (guix-edit . args)
  (with-error-handling
(let* ((specs(parse-command-line args %options '(())
 #:argument-handler cons))
   (packages (map specification->package specs)))
  (for-each (lambda (package)
  (unless (package-location package)
(leave (_ "source location of package '~a' is unknown~%")
   (package-full-name package
packages)
  (apply execlp (%editor) (%editor)
 (append-map (lambda (package)
   (let ((loc (package-location package)))
 (list (string-append "+"
  (number->string
   (location-line loc)))
   (location-file loc
 packages)


Re: guix edit

2015-06-16 Thread Thompson, David
On Tue, Jun 16, 2015 at 4:26 PM, Ludovic Courtès  wrote:
> While looking at another package manager for ideas to steal, I found
> this one to be a good candidate:
>
>   guix edit gcc-4.8
>
> will open $EDITOR (aka. “emacsclient”) on the definition of that
> package.  This is pretty handy for developers (even when otherwise using
> Geiser, I think.)

Looks good to me!

- Dave



Re: guix edit

2015-06-16 Thread Amirouche Boubekki

On 2015-06-16 22:26, l...@gnu.org wrote:

While looking at another package manager for ideas to steal, I found
this one to be a good candidate:

  guix edit gcc-4.8

will open $EDITOR (aka. “emacsclient”) on the definition of that
package.  This is pretty handy for developers (even when otherwise 
using

Geiser, I think.)

For “regular users,” it’s less useful because most of the time it will
open an immutable file.


It's nice, even in read-only mode, to explore how guix is made.


However, I envision a --clone option that would
create a file with a module declaration and a template like:

  (define my-gcc
(package (inherit gcc)
  ;; Complete here...
  )

(This part is left as an exercise to the reader.)

WDYT?


A usecase, I have in mind from experience, is being in vm/container and 
having to edit the recipe for that specific vm *but* that recipe is in 
the main normal repository. Like for instance, gcc for a specific 
target. `guix edit gcc:4.5' should open or clone the correct recipe.





Thanks,
Ludo’.


--
Amirouche ~ amz3 ~ http://www.hyperdev.fr



Re: [PATCH] Add Blast+.

2015-06-16 Thread Mark H Weaver
Ricardo Wurmus  writes:

> From 81cbb9bfa523d56c68d5f9f4feed3676edb5a414 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Tue, 16 Jun 2015 16:24:24 +0200
> Subject: [PATCH] gnu: Add Blast+.
>
> * gnu/packages/bioinformatics.scm (blast+): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 156 
> 
>  1 file changed, 156 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index ac4c50d..4a55040 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm
> @@ -31,6 +31,7 @@
>#:use-module (gnu packages base)
>#:use-module (gnu packages boost)
>#:use-module (gnu packages compression)
> +  #:use-module (gnu packages cpio)
>#:use-module (gnu packages file)
>#:use-module (gnu packages java)
>#:use-module (gnu packages linux)
> @@ -294,6 +295,161 @@ into separate processes; and more.")
>  (inputs
>   `(("python2-numpy" ,python2-numpy)
>  
> +(define-public blast+
> +  (package
> +(name "blast+")
> +(version "2.2.30")
> +(source (origin
> +  (method url-fetch)
> +  (uri (string-append
> +"ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/";
> +version "/ncbi-blast-" version "+-src.tar.gz"))
> +  (sha256
> +   (base32
> +"0h0fj5cpx6zpfwixgx5f5xbr4rn3cnai0x3j7grrg50vr18jvxr6"
> +(build-system gnu-build-system)
> +(arguments
> + `(;; There are three(!) tests for this massive library, and all fail 
> with
> +   ;; "unparsable timing stats".
> +   ;; ERR [127] --  [util/regexp] test_pcre.sh (unparsable timing 
> stats)
> +   ;; ERR [127] --  [serial/datatool] datatool.sh (unparsable timing 
> stats)
> +   ;; ERR [127] --  [serial/datatool] datatool_xml.sh (unparsable 
> timing stats)
> +   #:tests? #f

Just a guess, but maybe this is because you replaced "/bin/date" with
"echo -n 0".  How about replacing it with "date -d @0" instead?

It would be great to get the tests working, even if we have to disable
some of them.  Otherwise we have no way of knowing that we're not
distributing broken garbage :)

> +   #:out-of-source? #t
> +   #:parallel-build? #f ; not supported
> +   #:phases
> +   (modify-phases %standard-phases
> + (add-before
> +  'configure 'set-HOME
> +  ;; $HOME needs to be set at some point during the configure phase
> +  (lambda _ (setenv "HOME" "/tmp") #t))
> + (add-after
> +  'unpack 'enter-dir
> +  (lambda _ (chdir "c++") #t))
> + (add-after
> +  'enter-dir 'fix-build-system
> +  (lambda _
> +;; Proceed even though the weird build system says that generated
> +;; files are out of date
> +(setenv "NCBICXX_RECONF_POLICY" "warn")
> +
> +;; Remove bundled bzip2 and zlib
> +(delete-file-recursively "src/util/compress/bzip2")
> +(delete-file-recursively "src/util/compress/zlib")
> +(substitute* "src/util/compress/Makefile.in"
> +  (("bzip2 zlib api") "api"))
> +
> +;; Remove useless msbuild directory
> +(delete-file-recursively 
> "src/build-system/project_tree_builder/msbuild")
> +
> +;; Some of the files we're patching are
> +;; ISO-8859-1-encoded, so choose it as the default
> +;; encoding so the byte encoding is preserved.
> +(with-fluids ((%default-port-encoding #f))
> +  (substitute* (find-files "src/build-system" "config.*")

"^config"

> +(("LN_S=/bin/\\$LN_S") (string-append "LN_S=" (which "ln")))
> +(("/bin/sh") (which "bash"))

(which "sh") might be better.  Bash behaves differently when it's
invoked as 'sh'.

> +(("^PATH=.*") "")))
> +
> +;; fix static and generated shebangs
> +(substitute* (find-files "scripts/common/check" "\\.sh")

"\\.sh$"

> +  (("/bin/sh") (which "bash")))

(which "sh")

> +
> +;; rewrite "/var/tmp" in check script
> +(substitute* "scripts/common/check/check_make_unix.sh"
> +  (("/var/tmp") (string-append (getcwd) "/build/build")))

Or maybe just "/tmp" ?

> +
> +;; fix path to "echo"
> +(substitute* '("src/build-system/Makefile.rules_with_autodep.in"
> +   "src/build-system/Makefile.meta.gmake=no"
> +   "src/build-system/Makefile.meta_r"
> +   "src/build-system/Makefile.requirements")
> +  (("/bin/echo") (which "echo")))
> +
> +;; fix path to "basename"
> +(substitute* '("src/build-system/Makefile.in.top")
> +  (("/usr/bin/basename") (which "basename")))
> +
> +;; fix path to "mv"
> +(substitute* '

[PATCH] gnu: cross-base: Build the correct cross-mig.

2015-06-16 Thread Manolis Ragkousis
With this patch, cross-mig is built the correct way.
From eece3c8f30d0eb5ad939106e08e621120b83c3b6 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Tue, 16 Jun 2015 22:47:16 +0300
Subject: [PATCH] gnu: cross-base: Build the correct cross-mig.

* gnu/packages/cross-base.scm (xmig): Pass '--target=' instead of
  '--host=' and set the CROSS_CPATH.
* gnu/packages/hurd.scm (hurd-minimal): Move #:configure-flags
  from here...
  (hurd-headers): ...to here. Change '--build' to '--host'.
---
 gnu/packages/cross-base.scm | 13 ++---
 gnu/packages/hurd.scm   | 68 -
 2 files changed, 39 insertions(+), 42 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index e54bee4..6e9d544 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -310,10 +310,15 @@ XBINUTILS and the cross tool chain."
 (package (inherit mig)
   (name (string-append "mig-cross"))
   (arguments
-   (substitute-keyword-arguments (package-arguments mig)
- ((#:configure-flags flags)
-  `(cons ,(string-append "--host=" target)
- ,flags
+   `(#:phases (alist-cons-before
+   'configure 'set-cross-headers-path
+   (lambda* (#:key inputs #:allow-other-keys)
+ (let ((mach (assoc-ref inputs "cross-gnumach-headers")))
+   (setenv "CROSS_CPATH"
+   (string-append mach "/include"
+   %standard-phases)
+ #:configure-flags (list ,(string-append "--target=" target))
+ ,@(package-arguments mig)))
 
   (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)))
   (native-inputs `(("cross-gcc" ,xgcc)
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index d6b58ed..43e8b1d 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -21,6 +21,7 @@
   #:use-module (guix download)
   #:use-module (guix packages)
   #:use-module (gnu packages)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages bison)
@@ -125,10 +126,17 @@ communication.")
;; that.
,@(if (%current-target-system)
  '()
- '("--build=i686-pc-gnu"))
+ '("--host=i686-pc-gnu"))
 
;; Reduce set of dependencies.
-   "--without-parted")
+   "--disable-ncursesw"
+   "--disable-test"
+   "--without-libbz2"
+   "--without-libz"
+   "--without-parted"
+   ;; Skip the clnt_create check because it expects
+   ;; a working glibc causing a circular dependency.
+   "ac_cv_search_clnt_create=no")
 
#:tests? #f))
 (home-page "http://www.gnu.org/software/hurd/hurd.html";)
@@ -147,42 +155,26 @@ Library and other user programs.")
("mig" ,mig)))
 
 (arguments
- `(#:phases (alist-replace
- 'install
- (lambda* (#:key outputs #:allow-other-keys)
-   (let ((out (assoc-ref outputs "out")))
- ;; We need to copy libihash.a to the output directory manually,
- ;; since there is no target for that in the makefile.
- (mkdir-p (string-append out "/include"))
- (copy-file "libihash/ihash.h"
-(string-append out "/include/ihash.h"))
- (mkdir-p (string-append out "/lib"))
- (copy-file "libihash/libihash.a"
-(string-append out "/lib/libihash.a"))
- #t))
- (alist-replace
-  'build
-  (lambda _
-(zero? (system* "make" "-Clibihash" "libihash.a")))
-  (alist-cons-before
-   'configure 'bootstrap
-   (lambda _
- (zero? (system* "autoreconf" "-vfi")))
-   %standard-phases)))
-   #:configure-flags '(;; Pretend we're on GNU/Hurd; 'configure' wants
-   ;; that.
-   "--host=i686-pc-gnu"
-
-   ;; Reduce set of dependencies.
-   "--disable-ncursesw"
-   "--disable-test"
-   "--without-libbz2"
-   "--without-libz"
-   "--without-parted"
-   ;; Skip the clnt_create check because it expects
-   ;; a working glibc causing a circular dependency.
-   "ac_cv_search_clnt_create=no

Guix package steps

2015-06-16 Thread Daniel Pimentel

Hi guix,

I tried create new packages (ipcalc, nmap, xfburn and others) but 
without success.


My steps (based on talk GNU Guix packaging by Andreas Enge):
0. Git clone guix repository by savannah;
1. Copy gnu/package/indent.scm to mypackage.scm in this same folder;
2. Add module to gnu-system.am
3. Download mypackage;
4. Edit mypackage.scm and add hash, license and other information;
5. ./pre-inst-env guix build mypackage -K
6. Erro: bash: ./pre-inst-env: No such file or directory

But there is pre-inst-env.in only. The script pre-inst-env not exist in 
repository. So where is pre-inst-env?


Thanks for help and sorry for my noob question kkk.

--
Daniel Pimentel (d4n1)
GnuPG (0B1A1914)
FSF (13054)



[PATCH] Add diamond

2015-06-16 Thread Ben Woodcroft

Hi,

I'm quite new, so I strongly suspect there might be fixups required, but 
it works on my box. Well, it works on my setup in an isolated .scm file, 
but I wasn't sure how to test after I had patched bioinformatics.scm 
i.e. I expected the following to work. Thanks, there's a couple more 
patches (and questions..) to submit once I've learned from this one.


ben@u:~/git/guix$ GUIX_PACKAGE_PATH=/home/ben/git/guix guix package -i 
diamond --verbose -K

warning: failed to install locale: Invalid argument
;;; note: source file /home/ben/git/guix/gnu/packages/base.scm
;;;   newer than compiled 
/home/ben/.config/guix/latest/gnu/packages/base.go

;;; note: source file /home/ben/git/guix/gnu/packages/acl.scm
;;;   newer than compiled 
/home/ben/.config/guix/latest/gnu/packages/acl.go

...
guix package: warning: failed to load '(build-aux build-self)':
ERROR: no code for module (build-aux build-self)
guix package: warning: failed to load '(build-aux 
check-available-binaries)': exception thrown: #[message: "python-disable-ssl-test.patch: patch not found"] 23501e0>

checking final inputs for 'x86_64-linux'...
substitute: warning: failed to install locale: Invalid argument
checking final inputs for 'i686-linux'...
checking final inputs for 'mips64el-linux'...
guix package: warning: failed to load '(build-aux 
check-final-inputs-self-contained)':

ERROR: no code for module (build-aux check-final-inputs-self-contained)
guix package: warning: failed to load '(build-aux download)':
guix package: warning: failed to load '(build-aux build-self)':
ERROR: Wrong number of arguments to #
guix package: warning: failed to load '(build-aux 
check-available-binaries)': exception thrown: #[message: "python-disable-ssl-test.patch: patch not found"] 689fda0>
guix package: warning: failed to load '(build-aux 
check-final-inputs-self-contained)':

ERROR: no code for module (build-aux check-final-inputs-self-contained)
guix package: warning: failed to load '(build-aux download)':
Backtrace:
In ice-9/boot-9.scm:
1724: 19 [%start-stack load-stack ...]
1729: 18 [#]
In unknown file:
   ?: 17 [primitive-load "/usr/local/bin/guix"]
In guix/ui.scm:
1015: 16 [run-guix-command package "-i" "diamond" "--verbose" "-K"]
In ice-9/boot-9.scm:
 157: 15 [catch srfi-34 # ...]
 157: 14 [catch system-error ...]
In guix/scripts/package.scm:
1045: 13 [#]
 904: 12 [process-actions (# # # # ...)]
 656: 11 [options->installable (# # # # ...) #< entries: #>]
In srfi/srfi-1.scm:
 664: 10 [filter-map #guix/scripts/package.scm:656:16 (expr)> ...]

In guix/scripts/package.scm:
 662: 9 [# #]
 347: 8 [specification->package+output "diamond" "out"]
In gnu/packages.scm:
 259: 7 [find-best-packages-by-name "diamond" #f]
In guix/utils.scm:
 428: 6 [#]
In gnu/packages.scm:
 208: 5 [fold-packages #(p r)> #]

In srfi/srfi-1.scm:
 481: 4 [fold-right #(spec result)> ...]

In gnu/packages.scm:
 182: 3 [# 
"/home/ben/git/guix" ...]

In srfi/srfi-1.scm:
 664: 2 [filter-map #(file)> #]

In gnu/packages.scm:
 170: 1 [# 
match-error ...]

In unknown file:
   ?: 0 [display-error #f # ...]

ERROR: In procedure display-error:
ERROR: Wrong number of arguments to #

>From e24f4de21ee3c367c38e431626f4796795eb9e18 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
Date: Wed, 17 Jun 2015 11:49:27 +1000
Subject: [PATCH] gnu: Add diamond.

* gnu/packages/bioinformatics.scm (diamond): New variable.
---
 gnu/packages/bioinformatics.scm | 46 +
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 0d8a6d5..94db812 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -28,6 +28,7 @@
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
@@ -615,6 +616,51 @@ file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
 other types of unwanted sequence from high-throughput sequencing reads.")
 (license license:expat)))
 
+(define-public diamond
+  (package
+(name "diamond")
+(version "0.7.9")
+(source (origin
+  (method url-fetch)
+  (uri
+   (string-append
+"https://github.com/bbuchfink/diamond/archive/v"; version ".tar.gz"))
+  (sha256
+   (base32
+"0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"
+(build-system gnu-build-system)
+(arguments
+ '(#:tests? #f ;no "check" target
+		#:phases
+		(alist-cons-after
+		 'unpack 'enter-source-dir
+		 (lambda _ (chdir "src"))
+		 (alist-replace
+		  'install
+		  (lambda* (#:key outputs #:allow-other-keys)
+			   (let ((bin (string-append
+   (assoc-ref outputs "out") "/bin")))
+			 (mkdir-p bin)
+			 (copy-file "../bin/diamond" (string-append bin "/

Re: Guix package steps

2015-06-16 Thread Mark H Weaver
Daniel Pimentel  writes:

> I tried create new packages (ipcalc, nmap, xfburn and others) but
> without success.
>
> My steps (based on talk GNU Guix packaging by Andreas Enge):
> 0. Git clone guix repository by savannah;
> 1. Copy gnu/package/indent.scm to mypackage.scm in this same folder;
> 2. Add module to gnu-system.am
> 3. Download mypackage;
> 4. Edit mypackage.scm and add hash, license and other information;
> 5. ./pre-inst-env guix build mypackage -K
> 6. Erro: bash: ./pre-inst-env: No such file or directory
>
> But there is pre-inst-env.in only. The script pre-inst-env not exist
> in repository. So where is pre-inst-env?

You have to build guix before you can run it.  See
doc/contributing.texi, especially the "Building from Git" section.
Also, you should pass --localstatedir=/var to ./configure.

 Mark



Re: [PATCH] Add diamond

2015-06-16 Thread Mark H Weaver
Ben Woodcroft  writes:

> I'm quite new, so I strongly suspect there might be fixups required,
> but it works on my box. Well, it works on my setup in an isolated .scm
> file, but I wasn't sure how to test after I had patched
> bioinformatics.scm i.e. I expected the following to work. Thanks,
> there's a couple more patches (and questions..) to submit once I've
> learned from this one.
>
> ben@u:~/git/guix$ GUIX_PACKAGE_PATH=/home/ben/git/guix guix package -i 
> diamond --verbose -K

If you modified the files in the git repo directly, then just do this:

  ./pre-inst-env guix build -K diamond

and if that succeeds:

  ./pre-inst-env guix package -i diamond

GUIX_PACKAGE_PATH is only needed if you're _not_ working from a git
repo, and in that case you want to point it to a directory that contains
_only_ *.scm files with your out-of-tree package descriptions, nothing
else.

The problem you ran into is that Guix will attempt to load every *.scm
file in that directory tree looking for package descriptions, and it
does not cope well with other things being in there like build-aux/*.scm

  Mark



Re: [PATCH] Add diamond

2015-06-16 Thread Mark H Weaver
Ben Woodcroft  writes:

> From e24f4de21ee3c367c38e431626f4796795eb9e18 Mon Sep 17 00:00:00 2001
> From: Ben Woodcroft 
> Date: Wed, 17 Jun 2015 11:49:27 +1000
> Subject: [PATCH] gnu: Add diamond.
>
> * gnu/packages/bioinformatics.scm (diamond): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 46 
> +
>  1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index 0d8a6d5..94db812 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm

Please add a copyright line for yourself to the top of the file.

> @@ -28,6 +28,7 @@
>#:use-module (guix build-system python)
>#:use-module (guix build-system trivial)
>#:use-module (gnu packages)
> +  #:use-module (gnu packages algebra)
>#:use-module (gnu packages base)
>#:use-module (gnu packages boost)
>#:use-module (gnu packages compression)
> @@ -615,6 +616,51 @@ file formats including SAM/BAM, Wiggle/BigWig, BED, 
> GFF/GTF, VCF.")
>  other types of unwanted sequence from high-throughput sequencing reads.")
>  (license license:expat)))
>  
> +(define-public diamond
> +  (package
> +(name "diamond")
> +(version "0.7.9")
> +(source (origin
> +  (method url-fetch)
> +  (uri
> +   (string-append
> +"https://github.com/bbuchfink/diamond/archive/v"; version 
> ".tar.gz"))

Please add:

  (file-name (string-append name "-" version ".tar.gz"))

to this 'origin' form, because otherwise the filename of the source
tarball in the store will be /gnu/store/…-v0.7.9.tar.gz without the name
of the package.  By default it is named based on the last path component
of the source URI.

> +  (sha256
> +   (base32
> +"0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"

It would be good to remove the pre-compiled binary by adding the
following snippet to the 'origin' form:

--8<---cut here---start->8---
  (snippet '(begin
  (delete-file "bin/diamond")
  #t))
--8<---cut here---end--->8---

> +(build-system gnu-build-system)
> +(arguments
> + '(#:tests? #f ;no "check" target
> + #:phases

Please use spaces instead of tabs, and align "#:phases" directly under
"#:tests?".

> + (alist-cons-after
> +  'unpack 'enter-source-dir
> +  (lambda _ (chdir "src"))

Phase procedures should return a boolean indicating whether the phase
succeeded, but the return value of 'chdir' is unspecified.  So you
should add #t after (chdir "src").

> +  (alist-replace
> +   'install
> +   (lambda* (#:key outputs #:allow-other-keys)
> +(let ((bin (string-append
> +(assoc-ref outputs "out") "/bin")))
> +  (mkdir-p bin)
> +  (copy-file "../bin/diamond" (string-append bin 
> "/diamond"

Our convention is to have the body of a lambda indented two columns more
than the lambda itself, so the open paren of the 'let' should be under
the 'a' in 'lambda'.  Add #t to the end.  Please try to keep lines <= 80
columns.

> +   (alist-delete 'configure %standard-phases)

It would also be good to use our new and improved 'modify-phases'
syntax.  Search for it in gnu/packages/*.scm for examples.

> +(native-inputs
> + `(("bc" ,bc)))
> +(inputs
> + `(("boost" ,boost)
> +   ("zlib" ,zlib)))
> +(home-page "https://github.com/bbuchfink/diamond";)
> +(synopsis "Accelerated BLAST compatible local sequence aligner")
> +(description
> + "DIAMOND is a BLAST-compatible local aligner for mapping protein and
> +translated DNA query sequences against a protein reference database (BLASTP
> +and BLASTX alignment mode). The speedup over BLAST is up to 20,000 on short

Please put two spaces between sentences.

> +reads at a typical sensitivity of 90-99% relative to BLAST depending on the
> +data and settings.")
> +(license (license:non-copyleft (string-append 
> "https://github.com/bbuchfink";
> +   "/diamond/blob/v"
> +   version
> +   "/src/COPYING")

(license (license:non-copyleft "file://src/COPYING"
   "See src/COPYING in the distribution."

I wouldn't normally do this, but I went ahead and tested it with these
changes and here's what it comes out to:

--8<---cut here---start->8---
(define-public diamond
  (package
(name "diamond")
(version "0.7.9")
(source (origin
  (method url-fetch)
  (uri (string-append
"

Re: guix edit

2015-06-16 Thread Eric Bavier
On Tue, 16 Jun 2015 22:26:49 +0200
l...@gnu.org (Ludovic Courtès) wrote:

> While looking at another package manager for ideas to steal, I found
> this one to be a good candidate:
> 
>   guix edit gcc-4.8
> 
> will open $EDITOR (aka. “emacsclient”) on the definition of that
> package.  This is pretty handy for developers (even when otherwise
> using Geiser, I think.)

I like it.  I was looking for this command just the other day.

> For “regular users,” it’s less useful because most of the time it will
> open an immutable file.  However, I envision a --clone option that
> would create a file with a module declaration and a template like:
> 
>   (define my-gcc
> (package (inherit gcc)
>   ;; Complete here...
>   )
> 
> (This part is left as an exercise to the reader.)

;)

For immediate use, would we expect the user to save the file to a
directory in $GUIX_PACKAGE_PATH?  Perhaps we could initially open the
file in ~/.config/guix somewhere.

Somewhat related, I'm wondering if others might think it useful for the
recutils output from 'guix package --search' and 'guix package --show'
to print the full name of the file the package is in?

`~Eric