Re: wrap-program

2014-09-27 Thread Ludovic Courtès
Federico Beffa  skribis:

> 1. GSettings schemas: More than schemas compilation, the problem is that
> the schemas are by default expected to be in $datadir/glib-2.0/schemas
> (with $datadir usually being /usr/share).  In spite of this, other
> directories can be specified with the help of the environment variable
> $XDG_DATA_DIRS.  Since at glib-2.0 compiled time we can't know the path
> of future application installations, we may want to define

Right, that’s one of the reasons why the ‘glib’ package defines it as
its search path (see glib.scm.)

> 2. gtk-3.0 modules: gtk+ looks for modules (like libcanberra.so) in
> locations specified by
>
>a. $GTK_PATH,
>
>b. $libdir/gtk-3.0/modules, with $libdir being the one specified at
>gtk+-3.0 ./configure time OR $GTK_EXE_PREFIX/lib.
>
> Option a. is inconvenient because that variable is used by both,
> gtk+-2.0 and gtk+-3.0, easily leading applications compiled with one
> version to find incompatible libraries.
>
> Option b. is more attractive.  Again, at compile time we do not know the
> location of future modules installations: Take emacs: it looks in the
> gtk+-3.0 directory $libdir/gtk-3.0/modules.  However, it is looking for
> a module installed by libcanberra which is not even an input to the
> emacs package.  For this reason we should probably define
>
> GTK_EXE_PREFIX="$HOME/.guix-profile"

That would be easy and could be defined in /etc/profile on the
standalone system.

However that would force users to install GTK+ in their profile so that
the modules it comes with are found, right?  This would be inconvenient.

> We may just want to check that: (i) paths defined in environment
> variables are not duplicated by 'wrap-program' definitions (wrap
> launched by wrap) and (ii) if the variable is already defined (for "non
> guix" reasons), we may want to append the existing value.

Yes, this is the preferred solution, I think (and I think it’s this case
it’s OK to have these two variables leak in sub-processes, as discussed
with Mark.)  However, we’d like to factorize the extra phase that does
the wrapping, so we don’t repeat it for each and every program.

> The only problem I see right now is if a program is launched by a user
> which does not have $HOME/.guix-profile (like a service).  In that case
> there could be a default profile.

I think these are mostly GUIs, unlikely to be launched by a service.

> This could also serve the second purpose of providing initial default
> applications (like guix itself!) to all users on "guix on distro"
> systems.

Hmm what do you mean?

Thanks,
Ludo’.



Re: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies

2014-09-27 Thread Ludovic Courtès
Federico Beffa  skribis:

> From 9bea9402675314a9ed5e74bc23919db423795663 Mon Sep 17 00:00:00 2001
> From: Federico Beffa 
> Date: Thu, 25 Sep 2014 17:04:13 +0200
> Subject: [PATCH] maxima: Remove Tcl from 'inputs'.  Add 'post-install' phase
>
> * gnu/packages/maths.scm(maxima): Remove Tcl from 'inputs'.  Add
>   'post-install' phase.

Thanks, applied with minor tweaks to the log (the subject line should be
a high-level description, whereas the body is the actual change log.)

Ludo’.



Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.

2014-09-27 Thread Ludovic Courtès
Manolis Ragkousis  skribis:

> Taken care of the FIXME.

Thanks, I’ve merged it with the other commit on wip-hurd, and rebased it
on top of master.

> Just wanted to add that in base.scm, instead of gnu-gettext we needed
> perl. Probably I changed it by mistake while rebasing some local
> commits.

OK.

> And thread_terminate does exist, that's why it's enough for our needs.

You mean ‘thread_terminate_release’?  The comment in
libpthread-glibc-preparation.patch still reads:

--8<---cut here---start->8---
We are using a version of GNU Mach that lacks 'thread_terminate_release'
(not introduced yet).  The 'thread_terminate' RPC call will be enough for
our needs.
See .
--8<---cut here---end--->8---

Ludo’.



[PATCH] New ruby package

2014-09-27 Thread Pjotr Prins
Working Ruby package. Next step is to get gems working locally.
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
new file mode 100644
index 000..a13606c
--- /dev/null
+++ b/gnu/packages/ruby.scm
@@ -0,0 +1,99 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Pjotr Prins 
+;;; Copyright © 2014 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 (gnu packages ruby)
+  #:use-module ((guix licenses)
+#:select (rl))
+  #:use-module (gnu packages)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages openssl)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages gdbm)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix utils)
+  #:use-module (guix build-system gnu)
+;;;  #:use-module (guix build-system trivial))
+)
+
+(define-public ruby
+  (package
+(name "ruby")
+(version "2.1.3")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "http://cache.ruby-lang.org/pub/ruby/2.1/";
+  "ruby-" version ".tar.gz"))
+  ;;; (patch-flags '("p76"))
+  (sha256
+   (base32
+"00bz6jcbxgnllplk4b9lnyc3w8yd3pz5rn11rmca1s8cn6vvw608"
+(build-system gnu-build-system)
+(arguments
+ `(#:test-target "test"
+   #:parallel-tests? #f
+   #:phases
+(alist-cons-after
+ ;;; minor patch https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45225/diff/
+ 'unpack 'patch-readline  
+ (lambda _
+   (substitute* '( 
+   "ext/readline/readline.c"
+)
+ (("Function ") "rl_hook_func_t ")))
+(alist-cons-before
+ 'configure 'replace-bin-sh
+ (lambda _
+   (substitute* '(
+  "Makefile.in"
+  "ext/pty/pty.c"
+  "io.c"
+  "lib/mkmf.rb"
+  "process.c"
+  "test/rubygems/test_gem_ext_configure_builder.rb"
+  "test/rdoc/test_rdoc_parser.rb"
+  "test/ruby/test_rubyoptions.rb"
+  "test/ruby/test_process.rb"
+  "test/ruby/test_system.rb"
+  "tool/rbinstall.rb"
+  ;;; "tool/config.guess"
+)
+ (("/bin/sh") (which "sh"
+  %standard-phases
+
+(inputs
+ `(("readline" ,readline)
+   ("autoconf" ,autoconf)
+   ("openssl" ,openssl)
+   ("libffi" ,libffi)
+   ("gdbm" ,gdbm)
+   ("zlib" ,zlib)
+   ))
+
+(synopsis "Ruby")
+(home-page "https://www.ruby-lang.org/en/";)
+(synopsis
+ "Ruby programming language")
+(description
+ "Ruby description")
+(license rl)))
+
diff --git a/guix/licenses.scm b/guix/licenses.scm
index 23e4458..d9b71d7 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -255,6 +255,11 @@ which may be a file:// URI pointing the package's tree."
"http://directory.fsf.org/wiki/License:QPLv1.0";
"http://www.gnu.org/licenses/license-list.html#QPL";))
 
+(define rl
+  (license "Ruby License"
+   "http://directory.fsf.org/wiki/License:Ruby";
+   "https://www.ruby-lang.org/en/about/license.txt";))
+
 (define vim
   (license "Vim"
"http://directory.fsf.org/wiki/License:Vim7.2";


Re: [PATCH] New ruby package

2014-09-27 Thread Pjotr Prins
Ok, hopefully this is the right patch after rebase and format-patch.

>From d0d9843f80aca29e51f82c2da894369f892c9e3c Mon Sep 17 00:00:00 2001
From: Pjotr Prins 
Date: Sat, 27 Sep 2014 14:56:44 +0200
Subject: [PATCH] packages: Add Ruby

* gnu/packages/ruby.scm (Ruby): Added Ruby package
* guix/licenses.scm: Added Ruby license information
---
 gnu/packages/ruby.scm |   99 +
 guix/licenses.scm |5 +++
 2 files changed, 104 insertions(+)
 create mode 100644 gnu/packages/ruby.scm

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
new file mode 100644
index 000..a13606c
--- /dev/null
+++ b/gnu/packages/ruby.scm
@@ -0,0 +1,99 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Pjotr Prins 
+;;; Copyright © 2014 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 (gnu packages ruby)
+  #:use-module ((guix licenses)
+#:select (rl))
+  #:use-module (gnu packages)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages openssl)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages gdbm)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix utils)
+  #:use-module (guix build-system gnu)
+;;;  #:use-module (guix build-system trivial))
+)
+
+(define-public ruby
+  (package
+(name "ruby")
+(version "2.1.3")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "http://cache.ruby-lang.org/pub/ruby/2.1/";
+  "ruby-" version ".tar.gz"))
+  ;;; (patch-flags '("p76"))
+  (sha256
+   (base32
+"00bz6jcbxgnllplk4b9lnyc3w8yd3pz5rn11rmca1s8cn6vvw608"
+(build-system gnu-build-system)
+(arguments
+ `(#:test-target "test"
+   #:parallel-tests? #f
+   #:phases
+(alist-cons-after
+ ;;; minor patch https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45225/diff/
+ 'unpack 'patch-readline  
+ (lambda _
+   (substitute* '( 
+   "ext/readline/readline.c"
+)
+ (("Function ") "rl_hook_func_t ")))
+(alist-cons-before
+ 'configure 'replace-bin-sh
+ (lambda _
+   (substitute* '(
+  "Makefile.in"
+  "ext/pty/pty.c"
+  "io.c"
+  "lib/mkmf.rb"
+  "process.c"
+  "test/rubygems/test_gem_ext_configure_builder.rb"
+  "test/rdoc/test_rdoc_parser.rb"
+  "test/ruby/test_rubyoptions.rb"
+  "test/ruby/test_process.rb"
+  "test/ruby/test_system.rb"
+  "tool/rbinstall.rb"
+  ;;; "tool/config.guess"
+)
+ (("/bin/sh") (which "sh"
+  %standard-phases
+
+(inputs
+ `(("readline" ,readline)
+   ("autoconf" ,autoconf)
+   ("openssl" ,openssl)
+   ("libffi" ,libffi)
+   ("gdbm" ,gdbm)
+   ("zlib" ,zlib)
+   ))
+
+(synopsis "Ruby")
+(home-page "https://www.ruby-lang.org/en/";)
+(synopsis
+ "Ruby programming language")
+(description
+ "Ruby description")
+(license rl)))
+
diff --git a/guix/licenses.scm b/guix/licenses.scm
index 23e4458..d9b71d7 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -255,6 +255,11 @@ which may be a file:// URI pointing the package's tree."
"http://directory.fsf.org/wiki/License:QPLv1.0";
"http://www.gnu.org/licenses/license-list.html#QPL";))
 
+(define rl
+  (license "Ruby License"
+   "http://directory.fsf.org/wiki/License:Ruby";
+   "https://www.ruby-lang.org/en/about/license.txt";))
+
 (define vim
   (license "Vim"
"http://directory.fsf.org/wiki/License:Vim7.2";
-- 
1.7.10.4



Dates set to Dec 31 1969

2014-09-27 Thread Nate Bargmann
As much as I'd like to be six years old again in some aspects, I'm
curious why most of the dates under /gnu/store and under ~/.guix-profile
are set to Dec 31 1969?  Yes, I know that this is just before the
beginning of the Unix epoch, which must figure into the equation in some
way.

If this is in the FM, I apologize for the noise as I haven't completed
the manual yet.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Dates set to Dec 31 1969

2014-09-27 Thread David Thompson
Nate Bargmann  writes:

> As much as I'd like to be six years old again in some aspects, I'm
> curious why most of the dates under /gnu/store and under ~/.guix-profile
> are set to Dec 31 1969?  Yes, I know that this is just before the
> beginning of the Unix epoch, which must figure into the equation in some
> way.
>
> If this is in the FM, I apologize for the noise as I haven't completed
> the manual yet.
>

This is by design in order to have more deterministic builds.  If two
files have the same contents but have different timestamps, then they
will have different hashes.

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate



Re: [PATCH] New ruby package

2014-09-27 Thread David Thompson
Pjotr Prins  writes:

> Ok, hopefully this is the right patch after rebase and format-patch.
>

I can confirm that the package builds and runs. :)

> From d0d9843f80aca29e51f82c2da894369f892c9e3c Mon Sep 17 00:00:00 2001
> From: Pjotr Prins 
> Date: Sat, 27 Sep 2014 14:56:44 +0200
> Subject: [PATCH] packages: Add Ruby

Change to "gnu: Add Ruby."

>
> * gnu/packages/ruby.scm (Ruby): Added Ruby package
> * guix/licenses.scm: Added Ruby license information
> ---
>  gnu/packages/ruby.scm |   99 
> +
>  guix/licenses.scm |5 +++
>  2 files changed, 104 insertions(+)
>  create mode 100644 gnu/packages/ruby.scm
>
> diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
> new file mode 100644
> index 000..a13606c
> --- /dev/null
> +++ b/gnu/packages/ruby.scm
> @@ -0,0 +1,99 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2014 Pjotr Prins 
> +;;; Copyright © 2014 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 (gnu packages ruby)
> +  #:use-module ((guix licenses)
> +#:select (rl))
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages compression)
> +  #:use-module (gnu packages readline)
> +  #:use-module (gnu packages openssl)
> +  #:use-module (gnu packages autotools)
> +  #:use-module (gnu packages libffi)
> +  #:use-module (gnu packages gdbm)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix utils)
> +  #:use-module (guix build-system gnu)
> +;;;  #:use-module (guix build-system trivial))

Remove commented code.

> +)
> +
> +(define-public ruby
> +  (package
> +(name "ruby")
> +(version "2.1.3")
> +(source
> + (origin
> +  (method url-fetch)
> +  (uri (string-append "http://cache.ruby-lang.org/pub/ruby/2.1/";
> +  "ruby-" version ".tar.gz"))
> +  ;;; (patch-flags '("p76"))

Remove commented code.

> +  (sha256
> +   (base32
> +"00bz6jcbxgnllplk4b9lnyc3w8yd3pz5rn11rmca1s8cn6vvw608"
> +(build-system gnu-build-system)
> +(arguments
> + `(#:test-target "test"
> +   #:parallel-tests? #f
> +   #:phases
> +(alist-cons-after
> + ;;; minor patch
> https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45225/diff/

Nitpick: 2 semicolons, not 3.

> + 'unpack 'patch-readline  
> + (lambda _
> +   (substitute* '( 
> +   "ext/readline/readline.c"
> +)

Don't put parens on new lines.

  '("ext/readline/readline.c")

> + (("Function ") "rl_hook_func_t ")))
> +(alist-cons-before
> + 'configure 'replace-bin-sh
> + (lambda _
> +   (substitute* '(
> +  "Makefile.in"
> +  "ext/pty/pty.c"
> +  "io.c"
> +  "lib/mkmf.rb"
> +  "process.c"
> +  "test/rubygems/test_gem_ext_configure_builder.rb"
> +  "test/rdoc/test_rdoc_parser.rb"
> +  "test/ruby/test_rubyoptions.rb"
> +  "test/ruby/test_process.rb"
> +  "test/ruby/test_system.rb"
> +  "tool/rbinstall.rb"
> +  ;;; "tool/config.guess"
> +)

Same as above, and remove commented code.

> + (("/bin/sh") (which "sh"
> +  %standard-phases
> +
> +(inputs
> + `(("readline" ,readline)
> +   ("autoconf" ,autoconf)
> +   ("openssl" ,openssl)
> +   ("libffi" ,libffi)
> +   ("gdbm" ,gdbm)
> +   ("zlib" ,zlib)
> +   ))

The parens are lonely. :(
Move them to the previous line.

> +
> +(synopsis "Ruby")

Duplicated synopsis field.  Surprised this isn't a syntax error.

> +(home-page "https://www.ruby-lang.org/en/";)

Remove the 'en/' part.

> +(synopsis
> + "Ruby programming language")
> +(description
> + "Ruby description")

Expand the description.

> +(license rl)))
> +
> diff --git a/guix/licenses.scm b/guix/licenses.scm
> index 23e4458..d9b71d7 100644
> --- a/guix/licenses.scm
> +++ b/guix/licenses.

Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.

2014-09-27 Thread Manolis Ragkousis
>> And thread_terminate does exist, that's why it's enough for our needs.
>
> You mean ‘thread_terminate_release’?

Okay, let me explain it a bit better

Here is the part we are interested in
"libpthread/sysdeps/mach/pt-thread-terminate.c"

  /* Terminate and release all that's left.  */
  err = __thread_terminate_release (kernel_thread, mach_task_self (),
kernel_thread, reply_port,
stackaddr, stacksize);

  /* The kernel does not support it yet.  Leak but at least terminate
 correctly.  */
  err = __thread_terminate (kernel_thread);

The comment  "The kernel does not support it yet." is misleading.
It wants to say that __thread_terminate_release is not yet supported
so __thread_terminate can be used instead, to at least terminate it
correctly, even though we will have leaks.

That's why Samuel told me here
http://lists.gnu.org/archive/html/bug-hurd/2014-05/msg00127.html

>  Manolis Ragkousis, le Thu 15 May 2014 21:08:41 +, a écrit :
>  > So I commented the part that calls this function out and glibc gets
>  > built succefully with libpthread.
>  > >  err = __thread_terminate_release (kernel_thread, mach_task_self (),
>
>  That should be fine, yes, IIRC I left a thread_terminate call just
>  below, which should work enough for your needs.

Manolis



Re: Dates set to Dec 31 1969

2014-09-27 Thread Nate Bargmann
* On 2014 27 Sep 08:32 -0500, David Thompson wrote:
> 
> This is by design in order to have more deterministic builds.  If two
> files have the same contents but have different timestamps, then they
> will have different hashes.

Thanks, David.

That helps me understand the system a bit better.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Dates set to Dec 31 1969

2014-09-27 Thread Ludovic Courtès
Nate Bargmann  skribis:

> As much as I'd like to be six years old again in some aspects, I'm
> curious why most of the dates under /gnu/store and under ~/.guix-profile
> are set to Dec 31 1969?

It should be noted that it’s actually Jan. 1st 1970 UTC.  :-)

Ludo’.



Re: wrap-program

2014-09-27 Thread Federico Beffa
l...@gnu.org (Ludovic Courtès) writes:

> Federico Beffa  skribis:
>
>> 1. GSettings schemas: More than schemas compilation, the problem is that
>> the schemas are by default expected to be in $datadir/glib-2.0/schemas
>> (with $datadir usually being /usr/share).  In spite of this, other
>> directories can be specified with the help of the environment variable
>> $XDG_DATA_DIRS.  Since at glib-2.0 compiled time we can't know the path
>> of future application installations, we may want to define
>
> Right, that’s one of the reasons why the ‘glib’ package defines it as
> its search path (see glib.scm.)
>

I'm not sure I understand. Take emacs: the package does not have glib as
an input. However, it does have gtk+, which defines schemas in its own
tree ".../gtk+-3.10.1/share/glib-2.0/schemas" (and gtk+ is not an input
to glib). Therefore, having $XDG_DATA_DIRS in the glib package does not
help emacs. The emacs packge needs its own $XDG_DATA_DIRS pointing to
the gtk+ schemas.

>>
>> GTK_EXE_PREFIX="$HOME/.guix-profile"
>
> That would be easy and could be defined in /etc/profile on the
> standalone system.
>
> However that would force users to install GTK+ in their profile so that
> the modules it comes with are found, right?  This would be inconvenient.
>

Yes, so we should probably define $GTK_EXE_PREFIX in the emacs package
with the full path (/gnu/store/...) and not $HOME/ And given that
the gtk+ module is provided by libcanberra, the latter should be an
input to emacs as well.

> Yes, this is the preferred solution, I think (and I think it’s this case
> it’s OK to have these two variables leak in sub-processes, as discussed
> with Mark.)  However, we’d like to factorize the extra phase that does
> the wrapping, so we don’t repeat it for each and every program.
>

Since I'm new to glib schemas and gtk modules, I'm trying to
understand the correct broadest approach before doing anything.

> I think these are mostly GUIs, unlikely to be launched by a service.
>

I was thinking about windows managers and desktops. Not sure they really
need this.

>> This could also serve the second purpose of providing initial default
>> applications (like guix itself!) to all users on "guix on distro"
>> systems.
>
> Hmm what do you mean?
>

I was thinking about a convenient mechanism for providing packages
visible to all users of a system.

Regards,
Fede



Deduplication performance

2014-09-27 Thread Ludovic Courtès
Hello Guix of the hackathon!  :-)

Every time core packages like libc or Bash are changed, we end up
rebuilding (or re-downloading) the world, and storing multiple copies of
mostly-identical packages.  The daemon implements a simple deduplication
strategy, where identical files found in the store are hard-linked
together (via the /gnu/store/.links directory), so as to achieve
single-instance storage.

I’ve upgraded my system to current master (with the Bash fix), and I
still have a bunch of old profile generations, so I wanted to see how
efficient deduplication is.  Some characteristics of my system:

--8<---cut here---start->8---
$ ls -ld /gnu/store/*-bash-4.3 /gnu/store/*-bash-4.3.25 | wc -l
9
$ ls -ld /gnu/store/*-glibc-2.{20,19} | wc -l
4
$ guix package -I | wc -l
178
$ guix package --list-generations | grep ^Gen | wc -l
31
--8<---cut here---end--->8---

The attached script has allowed me to see how much deduplication is
taking place in my store.

The first question is: how much disk space is actually saved by
deduplication?

--8<---cut here---start->8---
scheme@(guile-user)> (saved-space (links))
$43 = 15128046966
scheme@(guile-user)> (/ $43 GiB 1.)
$44 = 14.089091649278998
--8<---cut here---end--->8---

That’s 14 GiB saved by deduplication (!).

We can plot the cumulative distribution function (CDF) of the number of
hard links or each deduplicated file:


It’s a bit hard to read, but we see that most than half of the files
under /gnu/store/.links have 1 or 2 hard links, and 80% have 4 hard
links or more.

The CDF of the size of deduplicated files is like this:


Half of the deduplicated files are 4 KiB or less, and 90% of the
deduplicated files are between 0 and 64 KiB.

The code for that is attached below; it uses Andy’s cool Guile-Charting.

Happy hacking!

Ludo’.

(use-modules (charting)
 ((guix store) #:select (%store-prefix))
 (ice-9 ftw)
 (ice-9 match)
 (srfi srfi-1)
 (srfi srfi-9))

(define-record-type 
  (deduplicated-file name size links)
  deduplicated-file?
  (namededuplicated-file-name)
  (sizededuplicated-file-size)
  (links   deduplicated-file-link-count))

(define %links-directory
  (string-append (%store-prefix) "/.links"))

(define (links)
  "Return a list of ."
  (file-system-fold (const #t)
(lambda (file stat result)  ;leaf
  (cons (deduplicated-file file
   (stat:size stat)
   (stat:nlink stat))
result))
(lambda (directory stat result) ;down
  result)
(lambda (directory stat result) ;up
  result)
(const #f)  ;skip
(lambda (file stat errno result)
  (error "i/o error" file errno))
'()
%links-directory
lstat))

(define KiB (expt 2 10))
(define MiB (* KiB KiB))
(define GiB (* KiB MiB))

(define (saved-space files)
  "Return the total amount of saved space given FILES, a list of
."
  (fold (lambda (df result)
  (match df
(($  name size links)
 (+ result (* size (- links 1))
0
files))

(define (cumulative-distribution files property)
  "Return a list of (VALUE . COUNT) pairs representing the number of FILES
whose PROPERTY is VALUE or less."
  (define (filestring (log2 (inexact->exact tick
(number->string (inexact->exact tick)))

  (define (adjust-items total)
(lambda (x)
  (match x
;; XXX: Filter out the two cases that would give us a numerical
;; overflow.
((0 . _) #f)
((1 . _) #f)
((value . count)
 (and (or (not max-x) (< value max-x))
  (cons value (* 100. (/ count total

  (match distribution
(((_ . total) . rest)
 (let ((percent (filter-map (adjust-items total) distribution)))
   (make-scatter-plot #:title (string-append "cumulative distribution by "
 subtitle)
  #:data `((,group-name ,@percent))
  #:x-axis-label x-axis-label
  #:y-axis-label "%"
  #:tick-label-formatter format-log2-tick
  #:log-x-base 2
  #:min-x 1
  #:max-y 101
  #:write-to-png output)



signature.asc
Description: PGP signature


Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.

2014-09-27 Thread Manolis Ragkousis
I am working on the cross-base patch so we can merge it with wip-hurd as
well, but some problems need to be discussed.

First, in glibc/hurd headers we need to redeclare #:configure-flags with
less flags.
We shouldn't but because we use the same configure flags as in glibc and
glibc/hurd, we get an error at (string-append "--localedir=" (assoc-ref
%outputs "locales") "/share/locale") when it tries to find the locales
output.
>In unknown file:
>   ?: 0 [string-append "--localedir=" #f "/share/locale"]

I attached the log.

Second, in glibc/hurd headers again, because we Don't use the same phases
as in glibc and glibc/hurd, and as a result we don't have the pre-configure
phase of glibc,  /bin/pwd is not substituted with pwd and we get a "no such
file" error.

>checking for i686-pc-gnu-readelf... i686-pc-gnu-readelf
>../glibc-hurd-2.18/configure: line 3312: /bin/pwd: No such file or
directory
>../glibc-hurd-2.18/configure: line 3312: /bin/pwd: No such file or
directory
>configure: error: you must configure in a separate build directory
>phase `configure' failed after 1 seconds

In order to solve this I just need to add a pre-configure phase with just
(lambda _
(substitute* "configure"
(("/bin/pwd") "pwd")))

attached log.

Third, in glibc/hurd the permissions in chmod "bits/pthreadtypes.h" should
be 666 not 555.

With this changes glibc/hurd can be built using the i686-pc-gnu cross
toolchain.

I attached the patch and I made sure that there will be no regressions with
the cross-base patch.

I wrote a simple commit message because it needs to be merged with the
current glibc/hurd patch in wip-hurd.

Thank you,
Manolis


7rc2bifwca5rn62irz5q9hhhjwi30z-glibc-hurd-headers-cross-i686-pc-gnu-2.18.drv.bz2
Description: BZip2 compressed data


k5ghfib3n6campjhi3y3ji634qv960-glibc-hurd-headers-cross-i686-pc-gnu-2.18.drv.bz2
Description: BZip2 compressed data
From 88f065c3818e2e6665ae490557415594528f2d6a Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Sat, 27 Sep 2014 20:07:19 +0300
Subject: [PATCH] gnu: base: Edits on glibc-hurd and glibc-hurd-headers.

* gnu/packages/base.scm (glibc/hurd): Fix file permissions in bits/pthreadtypes.h
			(glibc/hurd-headers): Add configure flags
	: Add preconfigure phase
---
 gnu/packages/base.scm | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 2acb51b..53858d4 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -561,7 +561,7 @@ with the Linux kernel.")
  (assoc-ref %build-inputs "patch/libpthread-patch"))
 
 ;; Make the file writable.
-(chmod "bits/pthreadtypes.h" #o555)
+(chmod "bits/pthreadtypes.h" #o666)
 (copy-recursively "libpthread/sysdeps/generic/bits" "bits"))
   ,phases))
 
@@ -571,6 +571,11 @@ with the Linux kernel.")
 (outputs '("out"))
 (arguments
  (substitute-keyword-arguments (package-arguments glibc/hurd)
+   ;; We just pass the flags really needed to build the headers.
+   ((#:configure-flags _)
+`(list "--enable-add-ons"
+   "--host=i686-pc-gnu"
+   "--enable-obsolete-rpc"))
((#:phases _)
 '(alist-replace
   'install
@@ -586,7 +591,16 @@ with the Linux kernel.")
  (string-append out "/include/gnu/stubs.h"))
 
   ;; Nothing to build.
-  (alist-delete 'build %standard-phases)))
+  (alist-delete 
+   'build 
+
+   ;; We need this to use `pwd', not `/bin/pwd'.
+   (alist-cons-before
+'configure 'pre-configure
+(lambda _
+  (substitute* "configure"
+(("/bin/pwd") "pwd")))
+%standard-phases
 
 (define-public tzdata
   (package
-- 
2.1.1



Re: Dates set to Dec 31 1969

2014-09-27 Thread Nate Bargmann
* On 2014 27 Sep 09:35 -0500, Ludovic Courtès wrote:
> It should be noted that it’s actually Jan. 1st 1970 UTC.  :-)

D'oh!  Indeed.  As I am six hours behind (America/Chicago) the system
rightly interprets the beginning of the epoch UTC as the prior day
here.  All these years and that never dawned on me.

One is never around this stuff so much that there isn't something new to
be learned.  :-)

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Dates set to Dec 31 1969

2014-09-27 Thread Ludovic Courtès
Nate Bargmann  skribis:

> * On 2014 27 Sep 09:35 -0500, Ludovic Courtès wrote:
>> It should be noted that it’s actually Jan. 1st 1970 UTC.  :-)
>
> D'oh!  Indeed.  As I am six hours behind (America/Chicago) the system
> rightly interprets the beginning of the epoch UTC as the prior day
> here.  All these years and that never dawned on me.

Look, people in the Americas had computers in Dec. 1969 while the rest
of the world had to wait until Jan. 1st, 1970!  :-)

Ludo’.c



Use --build instead of --host in hurd-headers

2014-09-27 Thread Manolis Ragkousis
In order to make my cross-base i686-pc-gnu toolchain patch much
simpler, I changed the --host=i686-pc-gnu flag with
--build=i686-pc-gnu in hurd-headers.

The problem is that if we keep --host, we have the same problems we
had with hurd-minimal. But because it's only the headers, --build flag
will do just great.
The hurd-headers package will not break so it's safe to push.

Manolis
From a372021506d766da420957293d52d241d53e7c6c Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Sat, 27 Sep 2014 22:43:21 +0300
Subject: [PATCH] Use --build instead of --host

* gnu/packages/hurd.scm (hurd-headers): Replace the use of --host with --build.
---
 gnu/packages/hurd.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 346a37b..842e5b3 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -119,7 +119,7 @@ communication.")
 
#:configure-flags '(;; Pretend we're on GNU/Hurd; 'configure' wants
;; that.
-   "--host=i686-pc-gnu"
+   "--build=i686-pc-gnu"
 
;; Reduce set of dependencies.
"--without-parted")
-- 
2.1.1



[PATCH] import: Add PyPI importer.

2014-09-27 Thread David Thompson
Happy first day of the Guix hackathon, everyone!

I spent my day working on generalizing the 'guix import' UI to allow for
using a PyPI importer in addition to the pre-existing Nix importer.
It's now at the point where I stop coding and open it up for review. :)

>From b3ec259fd097034631cf311040af7aa12f7c5ebc Mon Sep 17 00:00:00 2001
From: David Thompson 
Date: Sat, 27 Sep 2014 10:16:23 -0400
Subject: [PATCH] import: Add PyPI importer.

* guix/snix.scm: Delete.
* guix/import/snix.scm: New file.
* guix/scripts/import/nix.scm: New file.
* guix/import/pypi.scm: New file.
* guix/scripts/import/pypi.scm: New file.
* Makefile.am (MODULES): Add new files and remove 'guix/snix.scm'.
* guix/scripts/import.scm (%default-options, %options): Delete.
  (importers): New variable.
  (show-help): List importers.
  (guix-import): Factor out Nix-specific logic.  Delegate to correct importer
  based upon first argument.
---
 Makefile.am  |   5 +-
 guix/import/pypi.scm | 210 +++
 guix/import/snix.scm | 474 +++
 guix/scripts/import.scm  |  69 +++
 guix/scripts/import/nix.scm  |  87 
 guix/scripts/import/pypi.scm |  80 
 guix/snix.scm| 474 ---
 7 files changed, 879 insertions(+), 520 deletions(-)
 create mode 100644 guix/import/pypi.scm
 create mode 100644 guix/import/snix.scm
 create mode 100644 guix/scripts/import/nix.scm
 create mode 100644 guix/scripts/import/pypi.scm
 delete mode 100644 guix/snix.scm

diff --git a/Makefile.am b/Makefile.am
index 1f2c4db..c5af9c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,7 +73,8 @@ MODULES =	\
   guix/build/syscalls.scm			\
   guix/build/emacs-utils.scm			\
   guix/packages.scm\
-  guix/snix.scm	\
+  guix/import/snix.scm\
+  guix/import/pypi.scm\
   guix/scripts/download.scm			\
   guix/scripts/build.scm			\
   guix/scripts/archive.scm			\
@@ -87,6 +88,8 @@ MODULES =	\
   guix/scripts/refresh.scm			\
   guix/scripts/system.scm			\
   guix/scripts/lint.scm\
+  guix/scripts/import/nix.scm			\
+  guix/scripts/import/pypi.scm			\
   guix.scm	\
   $(GNU_SYSTEM_MODULES)
 
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
new file mode 100644
index 000..8d0172d
--- /dev/null
+++ b/guix/import/pypi.scm
@@ -0,0 +1,210 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 David Thompson 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (guix import pypi)
+  #:use-module (ice-9 binary-ports)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 pretty-print)
+  #:use-module (ice-9 regex)
+  #:use-module (srfi srfi-1)
+  #:use-module (rnrs bytevectors)
+  #:use-module (json)
+  #:use-module (web uri)
+  #:use-module (guix utils)
+  #:use-module (guix base32)
+  #:use-module (guix hash)
+  #:use-module (guix packages)
+  #:use-module (guix licenses)
+  #:use-module (guix build-system python)
+  #:use-module ((guix build download) #:prefix build:)
+  #:use-module (gnu packages python)
+  #:export (pypi->guix-package))
+
+(define (hash-table->alist table)
+  "Return an alist represenation of TABLE."
+  (map (match-lambda
+((key . (lst ...))
+ (cons key
+   (map (lambda (x)
+  (if (hash-table? x)
+  (hash-table->alist x)
+  x))
+lst)))
+((key . (? hash-table? table))
+ (cons key (hash-table->alist table)))
+(pair pair))
+   (hash-map->list cons table)))
+
+(define (flatten lst)
+  "Return a list that recursively concatenates all sub-lists of LIST."
+  (fold-right
+   (match-lambda*
+(((sub-list ...) memo)
+ (append (flatten sub-list) memo))
+((elem memo)
+ (cons elem memo)))
+   '() lst))
+
+(define (join lst delimiter)
+  "Return a list that contains the elements of LST, each separated by
+DELIMETER."
+  (match lst
+(() '())
+((elem)
+ (list elem))
+((elem . rest)
+ (cons* elem delimiter (join rest delimiter)
+
+(define (assoc-ref* alist key . rest)
+  "Return the value for KEY from ALIST.  For each additional key specified,
+recursively apply the procedure to the sub-list."
+  (if (null? rest)
+  (assoc-ref alist key)
+

Re: [PATCH] import: Add PyPI importer.

2014-09-27 Thread David Thompson
I should mention that the PyPI import requires the guile-json library.
How should this be handled in our build scripts? 

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate



Re: [PATCH] import: Add PyPI importer.

2014-09-27 Thread Ludovic Courtès
David Thompson  skribis:

> I should mention that the PyPI import requires the guile-json library.
> How should this be handled in our build scripts? 

I think it’s fine to install it whether or not guile-json is available.
Now, when there are tests ;-), there’ll have to be an Automake
conditional to decide whether or not to run those tests that require
guile-json.

Ludo’.



Re: [PATCH] import: Add PyPI importer.

2014-09-27 Thread Ludovic Courtès
David Thompson  skribis:

> I spent my day working on generalizing the 'guix import' UI to allow for
> using a PyPI importer in addition to the pre-existing Nix importer.
> It's now at the point where I stop coding and open it up for review. :)

Heheh, cool! :-)

Overall looks good to me.  Some comments below:

> From b3ec259fd097034631cf311040af7aa12f7c5ebc Mon Sep 17 00:00:00 2001
> From: David Thompson 
> Date: Sat, 27 Sep 2014 10:16:23 -0400
> Subject: [PATCH] import: Add PyPI importer.
>
> * guix/snix.scm: Delete.
> * guix/import/snix.scm: New file.
> * guix/scripts/import/nix.scm: New file.

This is good.

> * guix/import/pypi.scm: New file.
> * guix/scripts/import/pypi.scm: New file.

Nice too.  I wonder if there may be shared options between all the
importers (like an option for import & live build.)

That can still be addressed by exporting an option list from (guix
scripts import), like (guix scripts build) does, I think.

> * Makefile.am (MODULES): Add new files and remove 'guix/snix.scm'.
> * guix/scripts/import.scm (%default-options, %options): Delete.
>   (importers): New variable.
>   (show-help): List importers.
>   (guix-import): Factor out Nix-specific logic.  Delegate to correct importer
>   based upon first argument.

Make sure to adjust tests/snix.scm.

Also, it’d be cool to have tests for (guix import pypi), at least for
the part that is concerned with parsing JSON and producing a package
object.

> +(define tarball-url->string-append
> +  (let ((tar.gz-regex (make-regexp "\\.tar\\.gz$"))
> +(tarball-regex (make-regexp ".*-(.*)\\.tar\\.gz")))
> +(lambda (url name version)
> +  "Return a `string-append' s-expression used for building a generic form
> +of URL for the package NAME where VERSION is replaced by a `version'
> +variable."

This is similar to what snix has, and i think it should be shared (see
below.)

> +(define (make-pypi-sexp name version source-url home-page synopsis
> +description license)
> +  "Return the `package' s-expression for a python package with the given 
> NAME,

Namely, what do you think of having importers return directly a
‘package’ object?  Then there could be a shared ‘package->sexp’
procedure, that would to the fancy ‘string-append’ thing like above.

And, eventually, we can add an option to do live builds of the generated
package objects.

That can also be done in the next iteration, though.

> +(define (factorize-uri uri version)
> +  "Factorize URI, a package tarball URI as a string, such that any 
> occurrences
> +of the string VERSION is replaced by the symbol 'version."

This one from snix is redundant with ‘tarball-url->string-append’ (and
maybe less sophisticated?).

Thanks!

Ludo’.



[PATCH 5/5] guix lint: make sure synopses do not start with the package name.

2014-09-27 Thread Cyril Roelandt
* guix/scripts/lint.scm (check-start-with-package-name): New method.
* tests/lint.scm: Test it.
---
 guix/scripts/lint.scm |  9 +
 tests/lint.scm| 10 ++
 2 files changed, 19 insertions(+)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index ee00e5c..8f49afc 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -167,12 +167,21 @@ Run a set of checkers on the specified package; if none 
is specified, run the ch
"synopsis should start with an upper-case letter"
'synopsis)))
 
+  (define (check-start-with-package-name synopsis)
+   (let ((idx (string-contains-ci synopsis (package-name package
+ (when (and idx
+(= idx 0))
+   (emit-warning package
+ "synopsis should not start with the package name")
+ 'synopsis)))
+
  (let ((synopsis (package-synopsis package)))
(if (string? synopsis)
(begin
 (check-synopsis-start-upper-case synopsis)
 (check-final-period synopsis)
 (check-start-article synopsis)
+(check-start-with-package-name synopsis)
 (check-synopsis-length synopsis)
 
 (define (check-patches package)
diff --git a/tests/lint.scm b/tests/lint.scm
index c439faa..62a9df9 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -124,6 +124,16 @@
   (check-synopsis-style pkg
 "synopsis should be less than 80 characters long")))
 
+(test-assert "synopsis: start with package name"
+  (->bool
+   (string-contains (call-with-warnings
+  (lambda ()
+(let ((pkg (dummy-package "x"
+ (name "foo")
+ (synopsis "foo, a nice package"
+  (check-synopsis-style pkg
+"synopsis should not start with the package name")))
+
 (test-assert "inputs: pkg-config is probably a native input"
   (->bool
(string-contains
-- 
1.8.4.rc3




[PATCH 3/5] guix lint: check whether descriptions and synopses start with an upper-case letter.

2014-09-27 Thread Cyril Roelandt
* guix/scripts/lint.scm (check-description-style, 
check-synopsis-start-upper-case): New methods
* tests/lint.scm: Test them.
---
 guix/scripts/lint.scm | 26 ++
 tests/lint.scm| 18 ++
 2 files changed, 44 insertions(+)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 12391ef..5f9b6e4 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -29,6 +29,7 @@
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-37)
   #:export (guix-lint
+check-description-style
 check-inputs-should-be-native
 check-patches
 check-synopsis-style))
@@ -110,6 +111,19 @@ Run a set of checkers on the specified package; if none is 
specified, run the ch
 %checkers)
   (exit 0))
 
+(define (start-with-upper-case s)
+  (char-set-contains? char-set:upper-case (string-ref s 0)))
+
+(define (check-description-style package)
+  ;; Emit a warning if stylistic issues are found in the description of 
PACKAGE.
+ (let ((description (package-description package)))
+   (when (and (string? description)
+  (not (string-null? description))
+  (not (start-with-upper-case description)))
+ (emit-warning package
+   "description should start with an upper-case letter"
+   'description
+
 (define (check-inputs-should-be-native package)
   ;; Emit a warning if some inputs of PACKAGE are likely to belong to its
   ;; native inputs.
@@ -146,9 +160,17 @@ Run a set of checkers on the specified package; if none is 
specified, run the ch
  "synopsis should be less than 80 characters long"
  'synopsis)))
 
+  (define (check-synopsis-start-upper-case synopsis)
+   (when (and (not (string-null? synopsis))
+  (not (start-with-upper-case synopsis)))
+ (emit-warning package
+   "synopsis should start with an upper-case letter"
+   'synopsis)))
+
  (let ((synopsis (package-synopsis package)))
(if (string? synopsis)
(begin
+(check-synopsis-start-upper-case synopsis)
 (check-final-period synopsis)
 (check-start-article synopsis)
 (check-synopsis-length synopsis)
@@ -172,6 +194,10 @@ Run a set of checkers on the specified package; if none is 
specified, run the ch
 (define %checkers
   (list
(lint-checker
+ (name"description")
+ (description "Validate package descriptions")
+ (check   check-description-style))
+   (lint-checker
  (name"inputs-should-be-native")
  (description "Identify inputs that should be native inputs")
  (check   check-inputs-should-be-native))
diff --git a/tests/lint.scm b/tests/lint.scm
index e082908..ceb7abe 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -44,6 +44,24 @@
   (thunk))
 (get-output-string port)))
 
+(test-assert "description: does not start with an upper-case letter"
+  (->bool
+   (string-contains (call-with-warnings
+  (lambda ()
+(let ((pkg (dummy-package "x"
+ (description "bad description."
+  (check-description-style pkg
+"description should start with an upper-case letter")))
+
+(test-assert "synopsis: does not start with an upper-case letter"
+  (->bool
+   (string-contains (call-with-warnings
+  (lambda ()
+(let ((pkg (dummy-package "x"
+ (synopsis "bad synopsis."
+  (check-synopsis-style pkg
+"synopsis should start with an upper-case letter")))
+
 (test-assert "synopsis: ends with a period"
   (->bool
(string-contains (call-with-warnings
-- 
1.8.4.rc3




[PATCH 0/5] Add, fix and improve checkers in guix lint.

2014-09-27 Thread Cyril Roelandt
The following five patches improve the "guix lint" command, according to
suggestions from Alex Kost and Ludovic Courtès.


Cyril Roelandt (5):
  guix lint: make sure check-patches retrieves patch names.
  guix lint: Make sure synopses are not too long.
  guix lint: check whether descriptions and synopses start with an
upper-case letter.
  guix lint: Make sure a synopsis cannot start with a lower-case
article.
  guix lint: make sure synopses do not start with the package name.

 guix/scripts/lint.scm | 49 ++---
 tests/lint.scm| 55 +++
 2 files changed, 101 insertions(+), 3 deletions(-)

-- 
1.8.4.rc3




[PATCH 2/5] guix lint: Make sure synopses are not too long.

2014-09-27 Thread Cyril Roelandt
* guix/scripts/lint.scm (check-synopsis-length): New procedure.
* tests/lint.scm: test it.
---
 guix/scripts/lint.scm | 9 -
 tests/lint.scm| 9 +
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 0fbec1b..12391ef 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -140,11 +140,18 @@ Run a set of checkers on the specified package; if none 
is specified, run the ch
  "no article allowed at the beginning of the synopsis"
  'synopsis)))
 
+  (define (check-synopsis-length synopsis)
+   (if (>= (string-length synopsis) 80)
+   (emit-warning package
+ "synopsis should be less than 80 characters long"
+ 'synopsis)))
+
  (let ((synopsis (package-synopsis package)))
(if (string? synopsis)
(begin
 (check-final-period synopsis)
-(check-start-article synopsis)
+(check-start-article synopsis)
+(check-synopsis-length synopsis)
 
 (define (check-patches package)
   ;; Emit a warning if the patches requires by PACKAGE are badly named.
diff --git a/tests/lint.scm b/tests/lint.scm
index 56558c9..e082908 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -79,6 +79,15 @@
 (check-synopsis-style pkg
 "no article allowed at the beginning of the synopsis")))
 
+(test-assert "synopsis: too long"
+  (->bool
+   (string-contains (call-with-warnings
+  (lambda ()
+(let ((pkg (dummy-package "x"
+ (synopsis (make-string 80 #\x)
+  (check-synopsis-style pkg
+"synopsis should be less than 80 characters long")))
+
 (test-assert "inputs: pkg-config is probably a native input"
   (->bool
(string-contains
-- 
1.8.4.rc3




[PATCH 4/5] guix lint: Make sure a synopsis cannot start with a lower-case article.

2014-09-27 Thread Cyril Roelandt
* guix/scripts/lint.scm (check-start-article): use "string-ci=?" instead of 
"string=?".
* tests/lint.scm: Add corresponding tests.
---
 guix/scripts/lint.scm |  4 ++--
 tests/lint.scm| 18 ++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 5f9b6e4..ee00e5c 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -148,8 +148,8 @@ Run a set of checkers on the specified package; if none is 
specified, run the ch
   'synopsis)))
 
   (define (check-start-article synopsis)
-   (if (or (string=? (string-take synopsis 2) "A ")
-   (string=? (string-take synopsis 3) "An "))
+   (if (or (string-ci=? (string-take synopsis 2) "A ")
+   (string-ci=? (string-take synopsis 3) "An "))
(emit-warning package
  "no article allowed at the beginning of the synopsis"
  'synopsis)))
diff --git a/tests/lint.scm b/tests/lint.scm
index ceb7abe..c439faa 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -97,6 +97,24 @@
 (check-synopsis-style pkg
 "no article allowed at the beginning of the synopsis")))
 
+(test-assert "synopsis: starts with 'a'"
+  (->bool
+   (string-contains (call-with-warnings
+  (lambda ()
+(let ((pkg (dummy-package "x"
+ (synopsis "a bad synopsis"
+(check-synopsis-style pkg
+"no article allowed at the beginning of the synopsis")))
+
+(test-assert "synopsis: starts with 'an'"
+  (->bool
+   (string-contains (call-with-warnings
+  (lambda ()
+(let ((pkg (dummy-package "x"
+ (synopsis "an awful synopsis"
+(check-synopsis-style pkg
+"no article allowed at the beginning of the synopsis")))
+
 (test-assert "synopsis: too long"
   (->bool
(string-contains (call-with-warnings
-- 
1.8.4.rc3




[PATCH 1/5] guix lint: make sure check-patches retrieves patch names.

2014-09-27 Thread Cyril Roelandt
* guix/lint (check-patches): Test the output of origin-patches.
---
 guix/scripts/lint.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 83dde9a..0fbec1b 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -152,6 +152,7 @@ Run a set of checkers on the specified package; if none is 
specified, run the ch
 (name  (package-name package))
 (full-name (package-full-name package)))
 (if (and patches
+ (every string? patches)
  (any (lambda (patch)
 (let ((filename (basename patch)))
   (not (or (eq? (string-contains filename name) 0)
-- 
1.8.4.rc3




Re: [PATCH] New ruby package

2014-09-27 Thread David Thompson
Pjotr Prins  writes:

> Working Ruby package. Next step is to get gems working locally.

I don't have the patches quite ready yet, but I wrote a working Ruby
build system for building gems locally.  I'll share the patches when I
wake up.

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate



[PATCH 1/1] Fix incorrect example package recipe in docs.

2014-09-27 Thread Ian Denhardt
In the section of the manual that first explains how to write a package
recipe, the example didn't work. The fix is trivial, just use
define-public instead of define.
---
 doc/guix.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index f73ce52..813c133 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1371,7 +1371,7 @@ package looks like this:
   #:use-module (guix build-system gnu)
   #:use-module (guix licenses))
 
-(define hello
+(define-public hello
   (package
 (name "hello")
 (version "2.8")
-- 
2.1.1




[PATCH 0/1] Fix incorrect example package recipe in docs.

2014-09-27 Thread Ian Denhardt
I was working off of this example from the manual when trying to
package feh this afternoon, but the example had a mistake. Thanks to
the folks on irc who helped me work this out (and a number of other
issues I was having).

Ian Denhardt (1):
  Fix incorrect example package recipe in docs.

 doc/guix.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.1.1