Re: Packaging Coq

2014-12-04 Thread Nikita Karetnikov
I haven’t done the obvious thing…  The package in Nixpkgs does more
things, so I’ll try to change my recipe accordingly.


pgp4000r6YKBh.pgp
Description: PGP signature


Re: Packaging Coq

2014-12-04 Thread Nikita Karetnikov
Since people are commenting only on the recipe, I guess I need to
clarify that I’d like to know why it fails to build.


pgpVm4hxBpXvG.pgp
Description: PGP signature


Re: Packaging Coq

2014-12-04 Thread Nikita Karetnikov
> Should these arguments not be a double -- ??

No.


pgpIWWS3Y1b3c.pgp
Description: PGP signature


Packaging Coq

2014-12-03 Thread Nikita Karetnikov
Does anyone know how to proceed?

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Nikita Karetnikov 
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (gnu packages coq)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages ocaml))

(define-public coq
  (package
(name "coq")
(version "8.4pl5")
(source
 (origin
  (method url-fetch)
  (uri (string-append "https://"; name ".inria.fr/distrib/V" version
  "/files/" name "-" version ".tar.gz"))
  (sha256
   (base32
"0iajsabyrgypk1ncm0kqcxqv02k24xa1bayaxacjgmsqiavmm09m"
(build-system gnu-build-system)
(arguments
 '(#:phases
(alist-replace 'configure
  (lambda* (#:key outputs #:allow-other-keys)
;; This 'configure' script doesn't support
;; variables passed as arguments.
(let ((out (assoc-ref outputs "out")))
  (setenv "CONFIG_SHELL" (which "bash"))
  (zero?
   ;; 'configure' does not recognize the flags if you
   ;; use 'system*'.
   (system (string-append "./configure"
  " -prefix " out
  " -camldir "
  (dirname (which "ocaml")))
  (alist-replace 'build
 (lambda _
   (system* "make" "world"))
 (alist-replace 'check
(lambda _
  (chdir "test-suite")
  (system* "make" "check")
  (chdir ".."))
%standard-phases)
(native-inputs
 `(("ocaml" ,ocaml)
   ("bzip2" ,bzip2)))
(home-page "https://coq.inria.fr";)
(synopsis "Formal proof management system")
(description
 "Coq is a formal proof management system.  It provides a formal language
to write mathematical definitions, executable algorithms and theorems together
with an environment for semi-interactive development of machine-checked
proofs.  Typical applications include the certification of properties of
programming languages, the formalization of mathematics (e.g., the full
formalization of the Feit-Thompson theorem or homotopy type theory) and
teaching.")
(license lgpl2.1)))


pgpp5l7n4cgnM.pgp
Description: PGP signature


Re: On-line hackathon on Sep. 27-28?

2014-09-11 Thread Nikita Karetnikov
> How could a non programmer help?

How would you like to help?  For instance, would you like to learn how
to program?

In any case, the good first step is to install Guix and play around.
Look at the command line tools, read the documentation.  Have a problem?
Ask on the #guix channel on Freenode, document the solution, and send a
patch.  Read on the ‘diff’, ‘patch’, and ‘git format-patch’ commands if
necessary.

Learn how to write package recipes.  There is a good (though a bit
outdated) intro [1].  What programs do you use daily?  Are they
available in the distribution?  Start with something simple, or look for
outdated versions and submit updates.

Are you familiar with graphics editors?  Contribute artwork.

[1] https://gnu.org/software/guix/guix-ghm-andreas-20130823.pdf


pgp6hTBqxq1pI.pgp
Description: PGP signature


Re: pypi->guix script

2014-09-06 Thread Nikita Karetnikov
> For more details and source code, check out the git repository:
> https://gitorious.org/davexunit/pypi2guix

Why not add it to Guix?


pgp5DxVq5VsRV.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-09-02 Thread Nikita Karetnikov
> BTW, I’ve been traveling lately, and I’ve really missed ‘guix
> prefetch’.

Heh, that was the motivation.

> So if you have spare time to pour into it, or if someone else wants to
> take it over, that’d be nice!

I doubt so, unfortunately.  So please do take it over if you can.


pgpMOhIZmPKkm.pgp
Description: PGP signature


Re: [PATCH] gnu: hurd: Add Hurd Minimal.

2014-05-24 Thread Nikita Karetnikov
> ++if test "x$cross_compiling" = "xyes"; then
> ++   # It may be that we don't have a working libc yet, for instance
> ++   # because we're bootstrapping the cross-compilation tool chain.
> ++   # Thus, use this undocumented Autoconf macro designed for this.
> ++   AC_NO_EXECUTABLES
> ++   echo done
> ++fi

Would you like to report it to the Autoconf team?


pgpguTxsgs9bI.pgp
Description: PGP signature


Re: [PATCH] Add mcrypt

2014-05-24 Thread Nikita Karetnikov
> This patch adds Mcrypt, and two library dependencies.  Comments
> welcome.

I believe the libraries should be listed in the commit message as new
variables.  Ludo, WDYT?

> +  (method url-fetch)
> +
> +  (uri (string-append "mirror://sourceforge/mcrypt/mcrypt-"

Extraneous newline.

> +(synopsis "")

Empty synopsis.

> +   ("perl" ,perl))) ;for tests

Usually, one puts a space after ‘;’.


pgpuWGn3NA2pY.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-05-11 Thread Nikita Karetnikov
>>> Does the installation seem sane, basically?  Do ‘guix build’, ‘guix
>>> package’ etc. work somehow, or not even?

>> Turns out I can’t even build ‘hello’

> Please say exactly why you “can’t”.

Currently, it fails due to the “bad file descriptor” error.

> Why the hell do you keep deleting the store?  :-)

I want to make sure that ‘prefetch’ downloads all the needed tarballs.
Since I don’t use Guix on that machine, I delete the store each time
instead of using a different prefix.

>> SQLite header and source version mismatch
>> 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
>> 2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef

>> This was discussed before and should be fixed by upgrading SQLite.

> OK.  Can you report how things go one that is fixed?

> 1. Run ‘git show c0412fedf | patch -p1 -R’, and then confirm that the
>problem disappears.

> 2. Run ‘git reset --hard’, edit config.h, and comment out the HAVE_
>macros corresponding to the functions listed in c0412fedf, one at a
>time.

What would be a reliable way to run the testsuite after each of the
above steps?  Would ‘make clean && autoreconf -vfi && make && make
check’ be sufficient?


pgpHLVt8oKaHS.pgp
Description: PGP signature


Re: URL wrong for nix upstream

2014-05-08 Thread Nikita Karetnikov
> Funny, I've never had this issue.

I’ve had, but couldn’t reproduce it reliably.


pgpH7nnvD3SYj.pgp
Description: PGP signature


Re: torify w3m: ERROR: ld.so: object ‘libtorsocks.so’ cannot be preloaded

2014-05-07 Thread Nikita Karetnikov
> I'm reasonably sure it means that w3m is not getting torified at all.

What about the TorCheck response: “Congratulations. This browser is
configured to use Tor.”?


pgpNp0hGnblkf.pgp
Description: PGP signature


torify w3m: ERROR: ld.so: object ‘libtorsocks.so’ cannot be preloaded

2014-05-06 Thread Nikita Karetnikov
‘torify w3m https://check.torproject.org’ returns the following error
message before showing “Congratulations. This browser is configured to
use Tor.”  Is it harmless?

ERROR: ld.so: object 
'/gnu/store/2g7lx2qz06vlb241gfr6bpyp6mc5a24z-torsocks-1.2/lib/torsocks/libtorsocks.so'
 from LD_PRELOAD cannot be preloaded: ignored.


pgpxdE5a2nJEo.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-05-06 Thread Nikita Karetnikov
I’m attaching the version incorporating your suggestions, which was
tested with the empty store.  There are a bunch of problems:

1. It doesn’t seem to prefetch all the needed dependencies.  ‘guix build
   hello’ (without network access) fails after prefetching the said
   package.

2. The substituter fails from time to time.  Note that eight tests fail
   on the machine I used: ‘builders.scm’, ‘utils.scm’, ‘packages.scm’,
   ‘store.scm’, ‘monads.scm’, ‘gexp.scm’, ‘guix-package.sh’,
   ‘guix-register.sh’.  Perhaps we ought to fix the mentioned failures
   first.  Which log files would you like to see?

   $ ./pre-inst-env guix prefetch -n icecat
   substitute-binary: guile: hashtab.c:137: vacuum_weak_hash_table: Assertion 
`removed <= len' failed.
   Backtrace:
   In ice-9/boot-9.scm:
157: 15 [catch #t # ...]
   In unknown file:
  ?: 14 [apply-smob/1 #]
   In ice-9/boot-9.scm:
 63: 13 [call-with-prompt prompt0 ...]
   In ice-9/eval.scm:
432: 12 [eval # #]
   In ice-9/boot-9.scm:
   2320: 11 [save-module-excursion #]
   3966: 10 [#]
   1645: 9 [%start-stack load-stack ...]
   1650: 8 [#]
   In unknown file:
  ?: 7 [primitive-load "/home/nikita/guix/guix-savannah/scripts/guix"]
   In guix/ui.scm:
630: 6 [run-guix-command prefetch "-n" "icecat"]
   In ice-9/eval.scm:
432: 5 [eval # #]
   In guix/ui.scm:
265: 4 [show-what-to-build # (# # # ...) ...]
   In guix/utils.scm:
667: 3 [loop (# # # # ...) () (# # # # ...)]
   In guix/ui.scm:
267: 2 [# # # 
()]
   In guix/derivations.scm:
175: 1 [derivation-prerequisites-to-build # # # ...]
   In guix/store.scm:
695: 0 [substitutable-paths # #]

   guix/store.scm:695:2: In procedure substitutable-paths:
   guix/store.scm:695:2: Throw to key `srfi-34' with args `(#)'.

   I’ve also seen this one.  In case it matters, that was before running
   ‘chgrp 1001 /gnu/store; chmod 1775 /gnu/store’.

   $ ./pre-inst-env guix prefetch -n gnunet
   Backtrace:
   In ice-9/boot-9.scm:
157: 17 [catch #t # ...]
   In unknown file:
  ?: 16 [apply-smob/1 #]
   In ice-9/boot-9.scm:
 63: 15 [call-with-prompt prompt0 ...]
   In ice-9/eval.scm:
432: 14 [eval # #]
   In ice-9/boot-9.scm:
   2320: 13 [save-module-excursion #]
   3966: 12 [#]
   1645: 11 [%start-stack load-stack ...]
   1650: 10 [#]
   In unknown file:
  ?: 9 [primitive-load "/home/nikita/guix/guix-savannah/scripts/guix"]
   In guix/ui.scm:
630: 8 [run-guix-command prefetch "-n" "gnunet"]
   In ice-9/eval.scm:
432: 7 [eval # #]
   In guix/ui.scm:
265: 6 [show-what-to-build # (# # # ...) ...]
   In guix/utils.scm:
667: 5 [loop () () ...]
   In guix/ui.scm:
267: 4 [# # 
() ()]
   In guix/derivations.scm:
175: 3 [derivation-prerequisites-to-build # # # ...]
   In guix/store.scm:
695: 2 [substitutable-paths # #]
392: 1 [process-stderr # #f]
   In guix/serialization.scm:
 51: 0 [read-int #]

   guix/serialization.scm:51:4: In procedure read-int:
   guix/serialization.scm:51:4: In procedure bv-u32-ref: Wrong type argument in 
position 1 (expecting bytevector): #

3. When using the substituter, the command takes much more time.  Do
   we even need it in this case?  I seem to recall that the GNUnet
   tarball was served by Hydra, but I forgot the details.

   $ time ./pre-inst-env guix prefetch -n icecat
   The following derivations would be built:
  […]
   101987 operations

   real 4m7.477s
   user 0m19.249s
   sys  0m4.848s

   $ time ./pre-inst-env guix prefetch -n --no-substitutes icecat
   The following derivations would be built:
  […]
   101675 operations

   real 0m22.933s
   user 0m14.745s
   sys  0m3.168s

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 35b10a0..8937d76 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -37,6 +37,7 @@
   #:export (%standard-build-options
 set-build-options-from-command-line
 show-build-options-help
+specification->package
 
 guix-build))
 
diff --git a/guix/scripts/prefetch.scm b/guix/scripts/prefetch.scm
new file mode 100644
index 000..dbcef0f
--- /dev/null
+++ b/guix/scripts/prefetch.scm
@@ -0,0 +1,141 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Nikita Karetnikov 
+;;; 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 hav

Re: ‘package-derivation’ fails with “No such file or directory”

2014-04-30 Thread Nikita Karetnikov
> Yes, probably /var/guix/db/db.sqlite (or similar) was left behind,
> leading to an inconsistency (this database contains info about what’s in
> the store.)

Indeed, thanks.


pgpbFMwu3FcZ1.pgp
Description: PGP signature


‘package-derivation’ fails with “No such file or directory”

2014-04-29 Thread Nikita Karetnikov
I’d like to test a patch with the empty store.  I deleted ‘/gnu’ and
reinstalled Guix.  But whenever I call (package-derivation store hello),
I run into “ERROR: In procedure open-file: No such file or directory:
"/gnu/store/…-guile-bootstrap-2.0.drv".”  Did I forget to delete any
cached files?


pgp6QXTg9ZWZI.pgp
Description: PGP signature


Re: GnuTLS: Upgrade to 3.3.1 (fails)

2014-04-29 Thread Nikita Karetnikov
>> make[4]: Entering directory 
>> '/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
>> PASS: pathlen
>> PASS: aki
>> FAIL: pem-decoding
>> SKIP: template-test
>> make[5]: Entering directory 
>> '/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'

> Does test-suite.log provide any useful hints?

Both issues should be fixed in the development version.  Would you like
to see it packaged or wait for the new release?


pgpGET3PiWWmF.pgp
Description: PGP signature


Re: GnuTLS: Upgrade to 3.3.1 (fails)

2014-04-24 Thread Nikita Karetnikov
>> make[4]: Entering directory 
>> '/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
>> PASS: pathlen
>> PASS: aki
>> FAIL: pem-decoding
>> SKIP: template-test
>> make[5]: Entering directory 
>> '/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'

> Does test-suite.log provide any useful hints?

I’ll report to .

FAIL: pem-decoding
==

68a69
> warning: altname contains an embedded NUL, replacing with '!'
74a76
> warning: altname contains an embedded NUL, replacing with '!'
76a79
> warning: altname contains an embedded NUL, replacing with '!'
80a84
> warning: altname contains an embedded NUL, replacing with '!'
82a87
> warning: altname contains an embedded NUL, replacing with '!'
68a69
> warning: altname contains an embedded NUL, replacing with '!'
74a76
> warning: altname contains an embedded NUL, replacing with '!'
76a79
> warning: altname contains an embedded NUL, replacing with '!'
80a84
> warning: altname contains an embedded NUL, replacing with '!'
82a87
> warning: altname contains an embedded NUL, replacing with '!'
XMPP cert decoding failed 2


pgpFqvLNirapT.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-04-24 Thread Nikita Karetnikov
I’m attaching the patch.  Several issues must be addressed before it can
be pushed:

1. ‘guix prefetch’ tries to configure and build some packages instead of
   just downloading them.  I tried the following on a machine with the
   empty store:

   a. Ran ‘guix prefetch hello’.  Some packages were downloaded and
  built (I gathered those are needed to download the other packages,
  so I didn’t write down the names.  If I recall correctly, Guile
  was in that list.)

   b. Invoked ‘guix build hello’ without network access.  The command
  succeeded.  No questions here.

   c. Called ‘guix prefetch emacs’.  These packages were configured and
  built: pkg-config, libunistring, ncurses, libatomic_ops, patch,
  tar, xz, gzip, zlib, which, gc, perl, m4, readline, libffi,
  texinfo, libtool, gmp, libtasn1, nettle, guile, gnutls.

  Are these essential, or is there an error in ‘guix prefetch’?
  According to the build logs, the install prefix of gmp is
  ‘/gnu/store/hpaz49xz76p4qmpjc9r33hni1w781y66-gmp-5.1.3’, which
  doesn’t appear in the lists provided by ‘guix prefetch hello’ and
  ‘guix prefetch emacs’.  I’m not sure why it’s the case.

2. I think it would be nice to output the location of a tarball after
   running ‘guix prefetch’, but I’m not sure how to get the relevant
   derivation.  For ‘hello’, it’s neither

 (package-source-derivation store (package-source hello))

   nor

 (package-derivation store hello)

   because the derivation listed in the initial output of ‘guix prefetch
   hello’ differs.  Of course, it’s possible to filter the list
   produced by

 (build-derivations
  store
  (map (lambda (drv)
 ;; (format #t "   ~a~%" (derivation-file-name drv))
 (format #t "   ~a~%" drv)
 drv)
   (derivations-to-prefetch
store
(package-derivation store package)

   But it’s error-prone, so I’d rather avoid that.

3. I’m planning to add ‘--dry-run’, which will simply print the list of
   needed derivations.  What options would you like to see implemented?

diff --git a/guix/scripts/prefetch.scm b/guix/scripts/prefetch.scm
new file mode 100644
index 000..16346bb
--- /dev/null
+++ b/guix/scripts/prefetch.scm
@@ -0,0 +1,149 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Nikita Karetnikov 
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts prefetch)
+  #:use-module (guix derivations)
+  #:use-module (guix packages)
+  #:use-module (guix store)
+  #:use-module (guix ui)
+  #:use-module (guix utils)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-11)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:use-module (ice-9 match)
+  #:export (guix-prefetch))
+
+;;; Commentary:
+;;;
+;;; This program is used to download and add to the store all inputs that are
+;;; needed to build the specified packages.
+;;;
+;;; Code:
+
+(define (fold-values f acc seen lst)
+  (if (null-list? lst)
+  (values acc seen)
+  (let-values (((acc* seen*)
+(f acc seen (first lst
+(fold-values f
+ acc*
+ seen*
+ (cdr lst)
+
+(define (derivations-to-prefetch store drv)
+  "Return the list of fixed-output derivations that DRV depends on, directly
+or indirectly."
+  (define (unique-derivations acc seen lst)
+;; Return two values: the list of unique fixed-output derivations and the
+;; list of seen derivations.
+(fold-values (lambda (acc seen drv-input)
+   (let ((drv* (call-with-input-file (derivation-input-path 
drv-input)
+ read-derivation)))
+ (cond ((fixed-output-derivation? drv*)
+(values (lset-adjoin equal? acc drv*)
+seen))
+   ((member drv* seen)
+(values acc seen))
+   (else
+(unique-derivations acc
+(cons drv* seen)
+(derivation-inputs drv*))
+ acc
+   

Re: GSoC status

2014-04-23 Thread Nikita Karetnikov
> FWIW, I received that message (dated Wed, 09 Apr 2014 21:28:54 +0200),
> as I was on the CC list.  In fact, I received two copies of it.

> I see that it was also sent to Thomas Schwinge, Samuel Thibault, Richard
> Braun, Andreas Enge, and Nikita Karetnikov.  It would be interesting to
> know which of the recipients saw the message, and how it got lost.

I received the message.


pgpvyE3dJGaCE.pgp
Description: PGP signature


GnuTLS: Upgrade to 3.3.1 (fails)

2014-04-22 Thread Nikita Karetnikov
‘gnutls-remove-gnutls_secure_malloc.patch’ fixes the following issue:

make[4]: Entering directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/guile/src'
  CC   guile_gnutls_v_2_la-core.lo
core.c: In function 'scm_init_gnutls':
core.c:3369:3: error: 'gnutls_secure_malloc' undeclared (first use in this 
function)
   gnutls_secure_malloc = scm_malloc;
   ^
core.c:3369:3: note: each undeclared identifier is reported only once for each 
function it appears in
Makefile:1448: recipe for target 'guile_gnutls_v_2_la-core.lo' failed
make[4]: *** [guile_gnutls_v_2_la-core.lo] Error 1
make[4]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/guile/src'
Makefile:1340: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/guile/src'
Makefile:1301: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/guile'
Makefile:1373: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1'
Makefile:1300: recipe for target 'all' failed
make: *** [all] Error 2
phase `build' failed after 1003 seconds
builder for `/gnu/store/5v3nssmzk94bbibmrymphssvssfgq4ir-gnutls-3.3.1.drv' 
failed with exit code 1
@ build-failed /gnu/store/5v3nssmzk94bbibmrymphssvssfgq4ir-gnutls-3.3.1.drv - 1 
builder for `/gnu/store/5v3nssmzk94bbibmrymphssvssfgq4ir-gnutls-3.3.1.drv' 
failed with exit code 1
cannot build derivation 
`/gnu/store/cm8r2pssz9djvnhnj01cn4d9jpkflm4y-profile.drv': 1 dependencies 
couldn't be built
guix package: error: build failed: build of 
`/gnu/store/cm8r2pssz9djvnhnj01cn4d9jpkflm4y-profile.drv' failed

But the program still fails to build:

make[4]: Entering directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
PASS: pathlen
PASS: aki
FAIL: pem-decoding
SKIP: template-test
make[5]: Entering directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'

Testsuite summary for GnuTLS 3.3.1

# TOTAL: 4
# PASS:  2
# SKIP:  1
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

See tests/cert-tests/test-suite.log
Please report to b...@gnutls.org

Makefile:1478: recipe for target 'test-suite.log' failed
make[4]: *** [test-suite.log] Error 1
make[4]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
Makefile:1584: recipe for target 'check-TESTS' failed
make[3]: *** [check-TESTS] Error 2
make[3]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
Makefile:1685: recipe for target 'check-am' failed
make[2]: *** [check-am] Error 2
make[2]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests/cert-tests'
Makefile:2657: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory 
'/tmp/nix-build-gnutls-3.3.1.drv-0/gnutls-3.3.1/tests'
Makefile:1373: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
phase `check' failed after 902 seconds
builder for `/gnu/store/4wsibp5apk03zp91nih72n6njg3445xd-gnutls-3.3.1.drv' 
failed with exit code 1
@ build-failed /gnu/store/4wsibp5apk03zp91nih72n6njg3445xd-gnutls-3.3.1.drv - 1 
builder for `/gnu/store/4wsibp5apk03zp91nih72n6njg3445xd-gnutls-3.3.1.drv' 
failed with exit code 1
cannot build derivation 
`/gnu/store/x5jfbi9nwzan0h7pc0i6i933fsizmwaq-profile.drv': 1 dependencies 
couldn't be built
guix package: error: build failed: build of 
`/gnu/store/x5jfbi9nwzan0h7pc0i6i933fsizmwaq-profile.drv' failed

diff --git a/gnu/packages/gnutls.scm b/gnu/packages/gnutls.scm
index 0391f54..0b0df81 100644
--- a/gnu/packages/gnutls.scm
+++ b/gnu/packages/gnutls.scm
@@ -63,7 +63,7 @@ specifications.")
 (define-public gnutls
   (package
 (name "gnutls")
-(version "3.2.12")
+(version "3.3.1")
 (source (origin
  (method url-fetch)
  (uri
@@ -75,12 +75,10 @@ specifications.")
  "/gnutls-" version ".tar.xz"))
  (sha256
   (base32
-   "0195nliarszq5mginli6d2f5z7ljnd7mwa46iy9z8pkcgy56khbl"
+   "1fyg0bwfc003795hl5vs35m3rg2yqj9m5z76rlhfs0g5xaxrwjwq"))
+ (patches (list (search-patch
+ "gnutls-remove-gnutls_secure_malloc.patch")
 (build-system gnu-build-system)
-(arguments
- ;; Work around build issue reported at
- ;; 

Re: Proposal: prefetch tarballs in a batch

2014-04-12 Thread Nikita Karetnikov
>> 1. Should the recursion stop when ‘fixed-output-derivation?’ returns #t?

> I think so.  In general fixed-output derivations are the things you
> would like to pre-fetch; so you would typically call ‘build-derivations’
> on these to do the actual pre-fetching.

Could you show a package with a fixed-output derivation?  My current
implementation calls itself indefinitely because the base case is never
satisfied.


pgpO0m3D0RKfa.pgp
Description: PGP signature


[PATCH] openssh: Add another mirror.

2014-04-12 Thread Nikita Karetnikov
The original mirror doesn’t respond.  Please verify and push.

From cbac7ff6ef8f7c02d01331b77511ba8c9dadc45d Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Sat, 12 Apr 2014 16:18:45 +0400
Subject: [PATCH] openssh: Add another mirror.

* gnu/packages/ssh.scm (openssh): Add the mirror.
---
 gnu/packages/ssh.scm |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index a952890..08677e8 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -141,9 +141,11 @@ a server that supports the SSH-2 protocol.")
(version "6.6p1")
(source (origin
 (method url-fetch)
-(uri (string-append
-   "ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-";
-   version ".tar.gz"))
+(uri (let ((tail (string-append name "-" version ".tar.gz")))
+   (list (string-append "ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/";
+tail)
+ (string-append "ftp://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/";
+tail
 (sha256 (base32
  "1fq3w86q05y5nn6z878wm312k0svaprw8k007188fd259dkg1ha8"
(build-system gnu-build-system)
-- 
1.7.2.5



pgp8cOMv4EkWc.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-04-09 Thread Nikita Karetnikov
So, in order to add a tarball to the store, one can write:

$ ./pre-inst-env guile
scheme@(guile-user)> ,use (guix store) (guix packages) (guix derivations) (gnu 
packages wget)
scheme@(guile-user)> (define s (open-connection))
scheme@(guile-user)> (package-source-derivation s (package-source wget))
$1 = # 
/gnu/store/qz9vm8802v6pi69ci2kgnvfivrkr085r-wget-1.15.tar.xz 1922cd0>
scheme@(guile-user)> (build-derivations s (list $1))
$2 = #t
scheme@(guile-user)> (file-exists? (derivation->output-path $1))
$3 = #t

And to get a list of inputs (including the implicit ones):

scheme@(guile-user)> ,use (srfi srfi-26)
scheme@(guile-user)> (for-each (cut format #t "~a~%" <>) (derivation-inputs 
(package-derivation s wget)))
#< path: 
"/gnu/store/divcaakxh5zhgpkih3paxb6znmnpbzhw-guile-2.0.11.drv" sub-derivations: 
("out")>
#< path: 
"/gnu/store/jf4hzf16akk7bjidpr6im3wamfnr5rpv-wget-1.15.tar.xz.drv" 
sub-derivations: ("out")>
#< path: 
"/gnu/store/rx5kn39gcc0vm4hwr81kcwpxgybx2yay-perl-5.16.1.drv" sub-derivations: 
("out")>
[…]

Then ‘read-derivation’ can be used to “turn” a  type into 
:

scheme@(guile-user)> ,use (srfi srfi-1)
scheme@(guile-user)> (call-with-input-file (derivation-input-path (first 
(derivation-inputs (package-derivation s wget read-derivation)
$4 = # /gnu/store/6mfc9dhala2mnkmc8xjyjzc04mxwym26-guile-2.0.11-debug 
/gnu/store/1r1097pd7842mf3fpyhfn86wdrilx73q-guile-2.0.11 1922fa0>

I’m planning to do the same for every input.  But a couple of things are
not clear:

1. Should the recursion stop when ‘fixed-output-derivation?’ returns #t?
   Or should I use a different function for the base case?

2. I’d like to use ‘package-source-derivation’ (see above) in order to
   get a tarball.  Is it possible to get a  type from
   ?  If not, what are my options?


pgpjURE17LRzw.pgp
Description: PGP signature


Re: [PATCH] gnu: Python: disable failing tests on MIPS64.

2014-04-09 Thread Nikita Karetnikov
> What does 'python -c "import platform; print(platform.machine())"'
> return on your machine ? 

‘mips64’.

> The tests that fail are now disabled on mips64.

I ran ‘make clean’ & co., rebuilt Python; and the tests succeeded.




pgpZyyuH117PD.pgp
Description: PGP signature


Re: [PATCH] gnu: Python: disable failing tests on MIPS64.

2014-04-08 Thread Nikita Karetnikov
> I've tested this on the Loongson 3A machine, and it works as expected.

Python fails for me on Lemote YeeLoong.

$ git rev-parse HEAD
32d5c729522d02fe973cb245fe26262f040e0c13

==
FAIL: test_issue_8959_a (ctypes.test.test_callbacks.SampleCallbacksTestCase)
--
Traceback (most recent call last):
  File 
"/tmp/nix-build-python-3.3.5.drv-0/Python-3.3.5/Lib/ctypes/test/test_callbacks.py",
 line 191, in test_issue_8959_a
self.assertEqual(array[:], [1, 5, 7, 33, 99])
AssertionError: Lists differ: [33, 7, 99, 1, 5] != [1, 5, 7, 33, 99]

First differing element 0:
33
1

- [33, 7, 99, 1, 5]
+ [1, 5, 7, 33, 99]

==
FAIL: test_qsort (ctypes.test.test_libc.LibTest)
--
Traceback (most recent call last):
  File 
"/tmp/nix-build-python-3.3.5.drv-0/Python-3.3.5/Lib/ctypes/test/test_libc.py", 
line 30, in test_qsort
self.assertEqual(chars.raw, b"   ,,dmmmnpppsss\x00")
AssertionError: b'mmaappss  dna ,,maps\x00' != b'   ,,dmmmnpppsss\x00'

--
Ran 346 tests in 6.696s

FAILED (failures=2, skipped=1)
Makefile:882: recipe for target 'test' failed
make: *** [test] Error 1
phase `check' failed after 3765 seconds
builder for `/gnu/store/1sryxkz1hbvvw38c86miw14xydbjzv0i-python-3.3.5.drv' 
failed with exit code 1
@ build-failed /gnu/store/1sryxkz1hbvvw38c86miw14xydbjzv0i-python-3.3.5.drv - 1 
builder for `/gnu/store/1sryxkz1hbvvw38c86miw14xydbjzv0i-python-3.3.5.drv' 
failed with exit code 1
cannot build derivation 
`/gnu/store/h05a7j9f7p21m1jkkyy48vg3zn5wikb7-python-wrapper-3.3.5.drv': 1 
dependencies couldn't be built


pgpMX7Bjjq9Sq.pgp
Description: PGP signature


Re: [PATCH 2/3] gnu: Add man-db

2014-04-08 Thread Nikita Karetnikov
> For some reason I'm having trouble pushing to the git repo.

What kind of trouble?


pgpH8KflVVdZ4.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-04-02 Thread Nikita Karetnikov
>> Is there a function that accepts a package name and returns a list of
>> implicit inputs?

> No, because by definition, those “implicit inputs” are not listed in the
> package object.  Instead, they are added by the build system (see
> build-system/gnu.scm.)

> That’s why I suggested using derivations instead: take the output of
> (package-derivation x y), and traverse it in search of fixed-output
> derivations.

What’s a fixed-ouput derivation?


pgpOymZkURk3a.pgp
Description: PGP signature


Re: Proposal: prefetch tarballs in a batch

2014-04-01 Thread Nikita Karetnikov
> The simplest way to do it would be by walking the package DAG: start
> from ‘foo’, accumulate its ‘package-source’, then traverse its inputs,
> etc.  Recursion would stop at the implicit inputs (GCC, glibc,
> Coreutils, etc.), though.

> If you’d like implicit inputs to be taken into account, then you’d have
> to traverse derivations.  It’s less convenient because it’s lower-level.

Is there a function that accepts a package name and returns a list of
implicit inputs?


pgpgAX4DF_2Xb.pgp
Description: PGP signature


Proposal: prefetch tarballs in a batch

2014-03-27 Thread Nikita Karetnikov
By default, Guix fetches source tarballs on demand.  You download a
tarball, configure and install, move to the next one, and so on.  But it
may be useful to fetch all the prerequisites before building.

For instance, you travel frequently and don’t usually have Internet
access.  So it’d be nice to do something like ‘guix package
–install={foo,bar,baz}’ at home, run ‘pm-hibernate’ at some point, hop
on a train, and continue building if the sources got downloaded.

Actaully, the last part made me realize that it may be better to have a
separate script for downloading.  After all, we’d like to ensure that
the tarballs were fetched, or the train ride would be boring.  On IRC,
Ludo suggested to add a new option to ‘guix build’, how hard would it
be?


pgpNnsLnq3Z8m.pgp
Description: PGP signature


Re: wip-signed-archives progress report

2014-03-27 Thread Nikita Karetnikov
> Nikita: comments welcome on the two commits I just pushed in
> wip-signed-archives.

Thanks for working on it.  One question: in the past, you told me to
avoid ‘false-if-exception’.  If it’s an issue here, can we replace it
with something else?


pgpNylqhDAzdE.pgp
Description: PGP signature


Re: master: FAIL: tests/store.scm

2014-03-17 Thread Nikita Karetnikov
>> FAIL: tests/store.scm
>> FAIL: tests/guix-build.sh
>> FAIL: tests/guix-register.sh

> These two failures are because the ‘test-tmp’ directory predates the
> nix → guix change in commit f5768afa333bbc8167ef2e33db44c9bb64bef0be.

> An annoyance, but that should be fixed by either “rm -rf test-tmp &&
> make check”, or “cd test-tmp/var/log && mv nix guix”.

> Can you confirm?

I ran both commands, which fixed ‘tests/guix-build.sh’ but not
‘tests/store.scm’.

>> + type -P sqlite3
>> /nix/var/nix/profiles/default/guix-profile/bin/sqlite3
>> + echo 'select * from ValidPaths where 
>> path="/gnu/store/r5a3g247wzcvyap67jhk2f1hbhsqajw0-guile-bootstrap-2.0";'
>> + sqlite3 /home/tester/guix-MASTER/t-register-24008/nix/var/nix/db/db.sqlite
>> Error: near line 1: database is locked
>> + chmod -R +w t-register-24008
>> + rm -rf t-register-24008 t-register-closure-24008
>> + kill 24053

> I don’t know what this means.

> Could this be a version mismatch between the ‘sqlite3’ command above and
> libsqlite guix-register is linked against?

Maybe.  How can I check?


pgpa7KTqH5aq1.pgp
Description: PGP signature


Re: master: FAIL: tests/store.scm

2014-03-16 Thread Nikita Karetnikov
>> Which log files would you like to see?

> The SRFI-64 $top_builddir/*.log files, and $top_builddir/test-suite.log.

$ git rev-parse HEAD
6f58d582432fe46c163f61ddf8f653584f4f7be8

FAIL: tests/store.scm
FAIL: tests/guix-build.sh
FAIL: tests/guix-register.sh

 Starting test store
Group begin: store
Test begin:
  test-name: "store-path-hash-part"
  source-file: "tests/store.scm"
  source-line: 58
  source-form: (test-equal "store-path-hash-part" 
"283gqy39v3g9dxjy26rynl0zls82fmcg" (store-path-hash-part (string-append 
(%store-prefix) "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
Test end:
  result-kind: pass
  actual-value: "283gqy39v3g9dxjy26rynl0zls82fmcg"
  expected-value: "283gqy39v3g9dxjy26rynl0zls82fmcg"
Test begin:
  test-name: "store-path-hash-part #f"
  source-file: "tests/store.scm"
  source-line: 64
  source-form: (test-equal "store-path-hash-part #f" #f (store-path-hash-part 
(string-append (%store-prefix) 
"/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
Test end:
  result-kind: pass
  actual-value: #f
  expected-value: #f
Test begin:
  test-name: "store-path-package-name"
  source-file: "tests/store.scm"
  source-line: 70
  source-form: (test-equal "store-path-package-name" "guile-2.0.7" 
(store-path-package-name (string-append (%store-prefix) 
"/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
Test end:
  result-kind: pass
  actual-value: "guile-2.0.7"
  expected-value: "guile-2.0.7"
Test begin:
  test-name: "store-path-package-name #f"
  source-file: "tests/store.scm"
  source-line: 76
  source-form: (test-equal "store-path-package-name #f" #f 
(store-path-package-name 
"/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
Test end:
  result-kind: pass
  actual-value: #f
  expected-value: #f
Test begin:
  test-name: "direct-store-path?"
  source-file: "tests/store.scm"
  source-line: 81
  source-form: (test-assert "direct-store-path?" (and (direct-store-path? 
(string-append (%store-prefix) 
"/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")) (not (direct-store-path? 
(string-append (%store-prefix) 
"/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile")
Test end:
  result-kind: pass
  actual-value: #t
Test begin:
  test-name: "dead-paths"
  source-file: "tests/store.scm"
  source-line: 92
  source-form: (test-assert "dead-paths" (let ((p (add-text-to-store %store 
"random-text" (random-text (member p (dead-paths %store
Test end:
  result-kind: pass
  actual-value: 
("/home/tester/guix-MASTER/test-tmp/store/w3lm187yqxlsjimi64f34bb4lnv0vp2v-random-text"
 
"/home/tester/guix-MASTER/test-tmp/store/w3sfzi4jvfq2lyfvprda6m54cpd3qqiq-glib-2.39.1.tar.xz-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/w4q41l59sinsm7hp5jb7w0sdz4djnidh-lcms2-2.4.tar.gz.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/w6l6kp8lpyz7s1a1ca77avhv6za4jvn2-the-thing"
 
"/home/tester/guix-MASTER/test-tmp/store/w7af7wy7r70f62jlk4ljig1k83rd65y3-the-thing"
 
"/home/tester/guix-MASTER/test-tmp/store/w82zswk2gvp62lp1n82x6yq38fmrllqa-inputproto-2.2.tar.bz2.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/w93x6517qz0qg62wynqchcs0m2kayfmc-gperf-3.0.4-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/w981gb7gl68ggzsg1ak7siagka59jbha-libgc-7.2d-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/w9zpdm5w451bq1lma2ljr1blbp4cgbq1-hello-2.8.tar.gz-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wan1rdhflnm91mh9l75yp82k1nx743np-flex-2.5.37-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wapz07y3wwrsnp4qgviy0zzqr282zqfj-guile-2.0.9-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wb8c5l4pymkqa46zckwx135y11h9hqyg-bison-3.0.2-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wd224g01b90isrzksrlahy75b57xn4wy-dbus-1.6.4-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wf2zag5z0ghqa93ah52zikmnvyq9d9az-openssl-1.0.1f.tar.gz.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wg5l6igq2ww5g28pascbqx9afky7wc7d-Python-3.3.3.tar.xz-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wgv3cnplzhy4fbi30gmmwz6ibkj402m5-tzdata2013d.tar.gz.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/whck7fbhihcmcm3gz3k01i5n9mmjg3n9-patchelf-0.6.tar.xz-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/why15737ri2w4klg52wp904c8mvsw136-libxt-1.1.3.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wiiwscvwscm7bqvf46r6cjzckmniy3fl-ld-wrapper-0.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wizjkr6qhz0d0z0d0ix4rkpzpbi7jv61-gperf-3.0.4.tar.gz.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wjihrhav5yjm6gjdx9z9nycy5l1x61sn-acl-2.2.51-guile-builder"
 
"/home/tester/guix-MASTER/test-tmp/store/wk5qy48xrnhpnkafv4n34d9vlq0hvmsx-gc-7.2d.tar.gz.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wlc6qa7s72lzgrjjdw392a7n18s2ds6d-gcc-cross-boot0-wrapped-4.8.2.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wlx9ni74h2x6s1jlly4bql53xp8aiicr-xz-5.0.4.drv"
 
"/home/tester/guix-MASTER/test-tmp/store/wmp6cx95l11bzph2f77pha9byv2plwza-gzip-1.6.tar.gz.drv"
 
"/home/tester/guix-MASTER/test-

Re: [PATCH 2/2] guix substitute-binary: Support the Signature field of a narinfo file.

2014-03-15 Thread Nikita Karetnikov
>>> I was about to say you could push to master, but since the new
>>> substitute-binary will refuse any unsigned archives[*], it may be wiser
>>> to push to a special branch so we can test it in real life before
>>> merging into master.

>> Should the special branch be based on ‘master’ or ‘core-updates’?

> On ‘master’.

Done.  Since some tests on ‘master’ fail for me, could you run ‘make
check’ to make sure that it doesn’t break anything?


pgp4farRFby2k.pgp
Description: PGP signature


Re: [PATCH 2/2] guix substitute-binary: Support the Signature field of a narinfo file.

2014-03-13 Thread Nikita Karetnikov
> I was about to say you could push to master, but since the new
> substitute-binary will refuse any unsigned archives[*], it may be wiser
> to push to a special branch so we can test it in real life before
> merging into master.

Should the special branch be based on ‘master’ or ‘core-updates’?


pgp8_r69ZJSvW.pgp
Description: PGP signature


[PATCH 2/2] guix substitute-binary: Support the Signature field of a narinfo file. (was: Signed archives (preliminary patch))

2014-03-12 Thread Nikita Karetnikov
> Here’s a proposal: just copy/paste ‘assert-valid-signature’, adjust it
> to your needs, and I’ll see how we can factorize that later.

> Works for you?

The perfect is the enemy of the good.  So, may I push both patches to
‘core-updates’?

From 26e98465deac592cbcdb9891f091d997e00eda9d Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Wed, 12 Mar 2014 21:21:39 +
Subject: [PATCH 1/2] nar: Clarify that 'assert-valid-signature' accepts a
 string.

* guix/nar.scm (assert-valid-signature): Turn a comment into a
  docstring and improve the wording.
---
 guix/nar.scm |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/nar.scm b/guix/nar.scm
index 5bf1745..63b10dc 100644
--- a/guix/nar.scm
+++ b/guix/nar.scm
@@ -369,8 +369,8 @@ while the locks are held."
 port)
 
   (define (assert-valid-signature signature hash file)
-;; Bail out if SIGNATURE, an sexp, doesn't match HASH, a bytevector
-;; containing the expected hash for FILE.
+"Bail out if SIGNATURE, a string (as produced by 'canonical-sexp->string'),
+doesn't match HASH, a bytevector containing the expected hash for FILE."
 (let* ((signature (catch 'gcry-error
 (lambda ()
   (string->canonical-sexp signature))
-- 
1.7.9.5

From e1a00a6d691ad9d73fb5162cd3e9bdf8863d152f Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Wed, 12 Mar 2014 23:04:04 +
Subject: [PATCH 2/2] guix substitute-binary: Support the Signature field of a
 narinfo file.

* guix/scripts/substitute-binary.scm (): Add the 'signature'
  and 'contents' fields.
  (narinfo-signature->canonical-sexp): New function.
  (narinfo-maker): Add the 'signature' argument and use it.
  (assert-valid-signature): New function.
  (read-narinfo): Support the Signature field.
  (write-narinfo): Use 'narinfo-contents'.
* guix/base64.scm, tests/base64.scm, tests/substitute-binary.scm: New files.
* Makefile.am (SCM_TESTS): Add the test files.
---
 Makefile.am|2 +
 guix/base64.scm|  212 
 guix/scripts/substitute-binary.scm |  157 ++
 tests/base64.scm   |   59 ++
 tests/substitute-binary.scm|  193 
 5 files changed, 579 insertions(+), 44 deletions(-)
 create mode 100644 guix/base64.scm
 create mode 100644 tests/base64.scm
 create mode 100644 tests/substitute-binary.scm

diff --git a/Makefile.am b/Makefile.am
index 764332a..111f1c5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -120,9 +120,11 @@ clean-go:
 
 SCM_TESTS =	\
   tests/base32.scm\
+  tests/base64.scm\
   tests/hash.scm\
   tests/pk-crypto.scm\
   tests/pki.scm	\
+  tests/substitute-binary.scm			\
   tests/builders.scm\
   tests/derivations.scm\
   tests/ui.scm	\
diff --git a/guix/base64.scm b/guix/base64.scm
new file mode 100644
index 000..f7f7f5f
--- /dev/null
+++ b/guix/base64.scm
@@ -0,0 +1,212 @@
+;; -*- mode: scheme; coding: utf-8 -*-
+;;
+;; This module was renamed from (weinholt text base64 (1 0 20100612)) to
+;; (guix base64) by Nikita Karetnikov  on
+;; February 12, 2014.
+;;
+;; Copyright © 2009, 2010 Göran Weinholt 
+;;
+;; This program 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.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#!r6rs
+
+;; RFC 4648 Base-N Encodings
+
+(library (guix base64)
+  (export base64-encode
+  base64-decode
+  base64-alphabet
+  base64url-alphabet
+  get-delimited-base64
+  put-delimited-base64)
+  (import (rnrs)
+  (only (srfi :13 strings)
+string-index
+string-prefix? string-suffix?
+string-concatenate string-trim-both))
+
+  (define base64-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+
+  (define base64url-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")
+
+  (define base64-encode
+(case-lambda
+  ;; Simple interface. Returns a string containing the canonical
+  ;; base64 representation of the given bytevector.
+  ((bv)
+   (base64-encode bv 0 (bytevector-length bv) #f #f base64-alphabet #f))
+  ((bv start)
+   (base64-encode bv start

Re: Signed archives (preliminary patch)

2014-03-12 Thread Nikita Karetnikov
>> Actually, the problem with making ‘assert-valid-signature’ public is
>> that it raises &nar error conditions.

I’ve looked through the code; now I need even more information.  Please
elaborate.

>> It could be changed to raise a more generic &signature-error, but then
>> ‘restore-file-set’ would have to guard against it to re-throw it along
>> with a &nar-error (making a compound condition.)  And then ui.scm would
>> figure it out.  Blech.

Why would it need a more generic error?  Why would ‘restore-file-set’
have to rethrow it along with an &nar-error?  How’s ‘ui.scm’ relevant?
It’d be great if you could paste the code you were talking about.


pgppQQztrhM9u.pgp
Description: PGP signature


Re: Signed archives (preliminary patch)

2014-03-11 Thread Nikita Karetnikov
>> I think the current docstring of ‘assert-valid-signature’ is not correct
>> since ‘signature’ must be a string (as produced by
>> ‘canonical-sexp->string’), not an sexp.

> In guix/nar.scm, the comment is:

>   (define (assert-valid-signature signature hash file)
> ;; Bail out if SIGNATURE, an sexp, doesn't match HASH, a bytevector
> ;; containing the expected hash for FILE.

> and indeed, SIGNATURE must be a string here.

>> Similarly, the “signature is not a valid s-expression” and “corrupt
>> signature data” messages are a bit confusing due to the way
>> ‘string->canonical-sexp’ works (try ‘string->canonical-sexp "foo"’).
>> But I may be wrong about the latter.

> Ah right, you could get “corrupt signature data” when
> (string->canonical-sexp signature) returns the null canonical sexp,
> whereas you’d want “not a valid s-expression”.

> Well, we can fix that in a separate patch if you want.

Do you have time for this?  I think it would be much easier for you than
for me because you wrote the bindings.

>> +(define* (assert-valid-signature signature hash port
>> + #:optional (acl (current-acl)))
>> +  ;; Bail out if SIGNATURE, a string, doesn't match HASH, a bytevector
>> +  ;; containing the expected hash for PORT.

> Make it a docstring.

> Also, please make this change a separate patch.

OK.

>> +  (let* ((file  (port-filename port))

> I don’t think this will work, because most of the time PORT is a pipe
> (an input port), whereas FILE is supposed to be the name of the file
> being restored.

What can we do about it?  Should the function accept ‘file’ and ‘port’?

> > +(raise (condition (&message (message "invalid hash"))
>> +  (&nar-invalid-hash-error
>> +   (port port) (file file)
>> +   (signature signature)
>> +   (expected (hash-data->bytevector data))
>> +   (actual hash)
>> +(raise (condition (&message (message "unauthorized public key"))
>> +  (&nar-signature-error
>> +   (signature signature) (file file) (port 
>> port)
>> +(raise (condition
>> +(&message (message "corrupt signature data"))
>> +(&nar-signature-error
>> + (signature signature) (file file) (port port)))

> Actually, the problem with making ‘assert-valid-signature’ public is
> that it raises &nar error conditions.

> It could be changed to raise a more generic &signature-error, but then
> ‘restore-file-set’ would have to guard against it to re-throw it along
> with a &nar-error (making a compound condition.)  And then ui.scm would
> figure it out.  Blech.

> It’s worth factorizing, but I don’t see how to do it nicely.  Thoughts?

Haven’t thought of it yet.  But I’ll try to take care of this one.


pgp40XlIJShHd.pgp
Description: PGP signature


Re: master: FAIL: tests/store.scm

2014-03-11 Thread Nikita Karetnikov
Apologies for the sloppy reporting.  Let me explain why it’s the case.

I ran ‘make check’ multiple times.  These tests failed when I cloned the
repo and ran ‘make check’ for the first time: tests/derivations.scm,
tests/store.scm, tests/guix-build.sh, tests/guix-register.sh.  These
ones failed when I reran ‘make check’: tests/store.scm,
tests/guix-build.sh, tests/guix-register.sh.

Then I deleted the tree and cloned again.  tests/builders.scm,
tests/store.scm, tests/guix-build.sh, tests/guix-register.sh failed.
When I ran ‘make check’ once again, the following tests failed:
tests/store.scm, tests/guix-build.sh, tests/guix-register.sh.

Which log files would you like to see?


pgpmWJBCcyXtw.pgp
Description: PGP signature


Re: Signed archives (preliminary patch)

2014-03-08 Thread Nikita Karetnikov
> +  ((nar-invalid-hash-error? condition))

Should be ((nar-invalid-hash-error? condition) #t), I guess.  Otherwise,
the procedure returns ‘undefined’.


pgpgUXbCKRGuS.pgp
Description: PGP signature


Re: Signed archives (preliminary patch)

2014-03-08 Thread Nikita Karetnikov
Still WIP, sorry.   Please take a look anyway.

I think the current docstring of ‘assert-valid-signature’ is not correct
since ‘signature’ must be a string (as produced by
‘canonical-sexp->string’), not an sexp.

Similarly, the “signature is not a valid s-expression” and “corrupt
signature data” messages are a bit confusing due to the way
‘string->canonical-sexp’ works (try ‘string->canonical-sexp "foo"’).
But I may be wrong about the latter.

diff --git a/guix/base64.scm b/guix/base64.scm
new file mode 100644
index 000..f7f7f5f
--- /dev/null
+++ b/guix/base64.scm
@@ -0,0 +1,212 @@
+;; -*- mode: scheme; coding: utf-8 -*-
+;;
+;; This module was renamed from (weinholt text base64 (1 0 20100612)) to
+;; (guix base64) by Nikita Karetnikov  on
+;; February 12, 2014.
+;;
+;; Copyright © 2009, 2010 Göran Weinholt 
+;;
+;; This program 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.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#!r6rs
+
+;; RFC 4648 Base-N Encodings
+
+(library (guix base64)
+  (export base64-encode
+  base64-decode
+  base64-alphabet
+  base64url-alphabet
+  get-delimited-base64
+  put-delimited-base64)
+  (import (rnrs)
+  (only (srfi :13 strings)
+string-index
+string-prefix? string-suffix?
+string-concatenate string-trim-both))
+
+  (define base64-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+
+  (define base64url-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")
+
+  (define base64-encode
+(case-lambda
+  ;; Simple interface. Returns a string containing the canonical
+  ;; base64 representation of the given bytevector.
+  ((bv)
+   (base64-encode bv 0 (bytevector-length bv) #f #f base64-alphabet #f))
+  ((bv start)
+   (base64-encode bv start (bytevector-length bv) #f #f base64-alphabet 
#f))
+  ((bv start end)
+   (base64-encode bv start end #f #f base64-alphabet #f))
+  ((bv start end line-length)
+   (base64-encode bv start end line-length #f base64-alphabet #f))
+  ((bv start end line-length no-padding)
+   (base64-encode bv start end line-length no-padding base64-alphabet #f))
+  ((bv start end line-length no-padding alphabet)
+   (base64-encode bv start end line-length no-padding alphabet #f))
+  ;; Base64 encodes the bytes [start,end[ in the given bytevector.
+  ;; Lines are limited to line-length characters (unless #f),
+  ;; which must be a multiple of four. To omit the padding
+  ;; characters (#\=) set no-padding to a true value. If port is
+  ;; #f, returns a string.
+  ((bv start end line-length no-padding alphabet port)
+   (assert (or (not line-length) (zero? (mod line-length 4
+   (let-values (((p extract) (if port
+ (values port (lambda () (values)))
+ (open-string-output-port
+ (letrec ((put (if line-length
+   (let ((chars 0))
+ (lambda (p c)
+   (when (fx=? chars line-length)
+ (set! chars 0)
+ (put-char p #\linefeed))
+   (set! chars (fx+ chars 1))
+   (put-char p c)))
+   put-char)))
+   (let lp ((i start))
+ (cond ((= i end))
+   ((<= (+ i 3) end)
+(let ((x (bytevector-uint-ref bv i (endianness big) 3)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (put p (string-ref alphabet (fxbit-field x 6 12)))
+  (put p (string-ref alphabet (fxbit-field x 0 6)))
+  (lp (+ i 3
+   ((<= (+ i 2) end)
+(let ((x (fxarithmetic-shift-left (bytevector-u16-ref bv i 
(endianness big)) 8)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (put p (string-ref alphabet (fxbit-field x 6 12)))
+  (unless no-padding
+ 

Re: Want help with writing package recipe

2014-03-07 Thread Nikita Karetnikov
> I used guix hash -f base32 to export the base32 hash, which is:
> i5q225g6twsg5egicgpt6ub7hn4m7pdzg56hwxx57jm4o4ns5fgq

You need ‘nix-base32’, which is the default format, so use ‘guix hash’.

> I've written a recipe for gtypist located here:
> http://pastebin.com/ysLHJUWg

Please include everything in the message body.  Otherwise, some
information may get lost in the future.

> (use-modules (guix packages)
>  (guix download)
>  (guix build-system gnu)
>  (guix licenses))

You must use ‘define-module’ instead.  See the recipes under
‘gnu/packages’ in the source tree, e.g., ‘wget.scm’.

> (define gtypist

Guix can’t access the definition if it’s not public, so substitute the
above with ‘define-public’.

>   (package
> (name "gtypist")
> (version "2.9.4")
> (source (origin
>  (method url-fetch)
>  (uri (string-append "mirror://gnu/gtypist-" version
>  ".tar.gz"))
>  (sha256
>   (base32 
> "i5q225g6twsg5egicgpt6ub7hn4m7pdzg56hwxx57jm4o4ns5fgq"

Don’t forget to recompute the hash.

> (build-system gnu-build-system)
> (inputs `(("perl" ,perl)))
> (inputs `(("ncurses" ,ncurses)))

No need for two ‘input’ fields here.  See the definition of ‘coreutils’
in ‘gnu/packages/base.scm’ for an example.

> (synopsis "GNU Typist")
> (description "The official GNU software to help improve your typing.")
> (home-page "http://www.gnu.org/software/gtypist/";)

Make sure to run ‘make sync-descriptions’ to check the above.  Use the
proposed synopsis and description.

> (license gpl3+)))

> But now, I'm stuck. I'm not sure how to tell guix to run the
> recipe. Guix's documentation says that the command "guix build options
> package-or-derivation"
> will build the package into a binary that I can run on my
> machine. I can't say "guix build gtypist", because guix does not
> currently have a recipe to build gtypist, and I can't say "guix
> build options /path/to/gtypist.dri", because there is not a derivation
> file on my machine for gtypist.

Put the code in a file, say, ‘gnu/packages/gtypist.scm’.  Then, run
‘guix build -K gtypist’ in order to build it.  If any errors occur, try
to get some hints by running (from the root of your guix directory)

$ ./pre-inst-env guile
scheme@(guile-user)> ,use (gnu packages gtypist)

> How do I submit a patch when I get it working?

See the “Submitting Patches” section in ‘HACKING’.  Basically, you add
the needed files with ‘git add’, commit them with ‘git commit’, and
produce the patch with ‘git format-patch’.  After that you send the
patch to the list.  Your patch should look similar to this one [1].

Also, there is a packaging tutorial [2].

[1] 
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=ece262461625e80957d904f39a6818286099d367
[2] https://gnu.org/software/guix/guix-ghm-andreas-20130823.pdf


pgpoBmQb7p4UJ.pgp
Description: PGP signature


Re: core-updates: FAIL: tests/builders.scm; tests/packages.scm; tests/store.scm

2014-03-05 Thread Nikita Karetnikov
> Could you send test-suite.log and tests/{builders,packages,store}.log?
> (Note: tests/foo.log is different from foo.log!)

I can reproduce only the ‘tests/store’ failure on
1faca892a35941b6eed2d6c04478f9f77ab81e15.

accepted connection from pid 1942, uid 1000
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;   or pass the --no-auto-compile argument to disable.
;;; compiling /home/tester/guix-test3/nix/scripts/list-runtime-roots
;;; compiled 
/home/tester/guix-test3/test-tmp/var/1937/cache-1937/guile/ccache/2.0-LE-4-2.0/home/tester/guix-test3/nix/scripts/list-runtime-roots.go
accepted connection from pid 1942, uid 1000
accepted connection from pid 1942, uid 1000
4 operations
27 operations
accepted connection from pid 1942, uid 1000
accepted connection from pid 1942, uid 1000
finding garbage collector roots...
removing stale temporary roots file 
`/home/tester/guix-test3/test-tmp/var/1937/temproots/1947'
determining live/dead paths...
finding garbage collector roots...
deleting unused links...
@ build-started 
/home/tester/guix-test3/test-tmp/store/bsmqh4ci0i71w2wdpvflyl398rhis28r-the-thing.drv
 - i686-linux 
/home/tester/guix-test3/test-tmp/var/log/nix/drvs/bs//mqh4ci0i71w2wdpvflyl398rhis28r-the-thing.drv.bz2
@ build-succeeded 
/home/tester/guix-test3/test-tmp/store/bsmqh4ci0i71w2wdpvflyl398rhis28r-the-thing.drv
 -
killing process 1974
@ build-started 
/home/tester/guix-test3/test-tmp/store/vv356jq54l0h75lw0k8gz9m229av85gd-the-thing.drv
 - i686-linux 
/home/tester/guix-test3/test-tmp/var/log/nix/drvs/vv//356jq54l0h75lw0k8gz9m229av85gd-the-thing.drv.bz2
@ build-succeeded 
/home/tester/guix-test3/test-tmp/store/vv356jq54l0h75lw0k8gz9m229av85gd-the-thing.drv
 -
killing process 1997
@ build-started 
/home/tester/guix-test3/test-tmp/store/67rrfrilz68kk4ai3anx47a3lnkmhjia-the-thing.drv
 - i686-linux 
/home/tester/guix-test3/test-tmp/var/log/nix/drvs/67//rrfrilz68kk4ai3anx47a3lnkmhjia-the-thing.drv.bz2
@ build-succeeded 
/home/tester/guix-test3/test-tmp/store/67rrfrilz68kk4ai3anx47a3lnkmhjia-the-thing.drv
 -
killing process 2020
@ substituter-started 
/home/tester/guix-test3/test-tmp/store/rq216m3qbzs9a3zccqrq8i5xyy5m205i-substitute-me
 /home/tester/guix-test3/nix/scripts/substitute-binary
downloading 
`/home/tester/guix-test3/test-tmp/store/rq216m3qbzs9a3zccqrq8i5xyy5m205i-substitute-me'
 from 
`file:/home/tester/guix-test3/test-tmp/var/1937/substituter-data/example.nar' 
(0.0 MiB installed)...

file:///.../example.nar 100.0% of 0.2 KiB@ substituter-succeeded 
/home/tester/guix-test3/test-tmp/store/rq216m3qbzs9a3zccqrq8i5xyy5m205i-substitute-me
@ substituter-started 
/home/tester/guix-test3/test-tmp/store/vd71lgzjf0x2z1nm3hj443mvbqd5ash4-substitute-me-not
 /home/tester/guix-test3/nix/scripts/substitute-binary
downloading 
`/home/tester/guix-test3/test-tmp/store/vd71lgzjf0x2z1nm3hj443mvbqd5ash4-substitute-me-not'
 from 
`file:/home/tester/guix-test3/test-tmp/var/1937/substituter-data/does-not-exist.nar'
 (0.0 MiB installed)...
Backtrace:
In ice-9/boot-9.scm:
 157: 13 [catch #t # ...]
In unknown file:
   ?: 12 [apply-smob/1 #]
In ice-9/boot-9.scm:
  63: 11 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 10 [eval # #]
In ice-9/boot-9.scm:
2320: 9 [save-module-excursion #]
3966: 8 [#]
1645: 7 [%start-stack load-stack ...]
1650: 6 [#]
In unknown file:
   ?: 5 [primitive-load "/home/tester/guix-test3/scripts/guix"]
In guix/ui.scm:
 597: 4 [run-guix-command substitute-binary "--substitute" ...]
In ice-9/boot-9.scm:
 157: 3 [catch getaddrinfo-error ...]
In guix/scripts/substitute-binary.scm:
 580: 2 [#]
 132: 1 [fetch # # #f ...]
In unknown file:
   ?: 0 [open-file 
"/home/tester/guix-test3/test-tmp/var/1937/substituter-data/does-not-exist.nar" 
...]

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: 
"/home/tester/guix-test3/test-tmp/var/1937/substituter-data/does-not-exist.nar"
@ substituter-failed 
/home/tester/guix-test3/test-tmp/store/vd71lgzjf0x2z1nm3hj443mvbqd5ash4-substitute-me-not
 256 fetching path 
`/home/tester/guix-test3/test-tmp/store/vd71lgzjf0x2z1nm3hj443mvbqd5ash4-substitute-me-not'
 failed with exit code 1
@ substituter-started 
/home/tester/guix-test3/test-tmp/store/vd71lgzjf0x2z1nm3hj443mvbqd5ash4-substitute-me-not
 /home/tester/guix-test3/nix/scripts/substitute-binary
downloading 
`/home/tester/guix-test3/test-tmp/store/vd71lgzjf0x2z1nm3hj443mvbqd5ash4-substitute-me-not'
 from 
`file:/home/tester/guix-test3/test-tmp/var/1937/substituter-data/does-not-exist.nar'
 (0.0 MiB installed)...
Backtrace:
In ice-9/boot-9.scm:
 157: 13 [catch #t # ...]
In unknown file:
   ?: 12 [apply-smob/1 #]
In ice-9/boot-9.scm:
  7 operations
5 operations
 Starting test store  (Writing full log to "store.log")
tests/store.scm:182: FAIL topologically-sorted, more difficult

;;; 
("/home/tester/guix-test3/test-tmp/var/log/nix/drvs/vv/356jq54l0h75lw0k8gz9m229av85gd-the-thing.drv.bz2")

;;; 
("/home/tester/guix-test3/test-tmp/var/log/nix/drvs/67/rrfrilz6

master: FAIL: tests/store.scm (was: master: the tests take ages)

2014-03-05 Thread Nikita Karetnikov
> Yes, some of the tests involve downloading a couple of packages, and
> building them.  This takes a while the first time you run ‘make check’,
> but is fast in subsequent runs (unless you removed ‘test-tmp’.)

Now ‘tests/store’ fails on ece262461625e80957d904f39a6818286099d367.


   GNU Guix 0.6: ./test-suite.log


# TOTAL: 26
# PASS:  25
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/store
=

accepted connection from pid 25080, uid 1000
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;   or pass the --no-auto-compile argument to disable.
;;; compiling /home/tester/guix-test3/nix/scripts/list-runtime-roots
;;; compiled 
/home/tester/guix-test3/test-tmp/var/25075/cache-25075/guile/ccache/2.0-LE-4-2.0/home/tester/guix-test3/nix/scripts/list-runtime-roots.go
accepted connection from pid 25080, uid 1000
accepted connection from pid 25080, uid 1000
accepted connection from pid 25080, uid 1000
accepted connection from pid 25080, uid 1000
finding garbage collector roots...
removing stale temporary roots file 
`/home/tester/guix-test3/test-tmp/var/25075/temproots/25085'
determining live/dead paths...
finding garbage collector roots...
deleting unused links...
@ build-started 
/home/tester/guix-test3/test-tmp/store/pfh1j0k1irzmw8z6ab77c8nknybjcrfl-the-thing.drv
 - i686-linux 
/home/tester/guix-test3/test-tmp/var/log/nix/drvs/pf//h1j0k1irzmw8z6ab77c8nknybjcrfl-the-thing.drv.bz2
@ build-succeeded 
/home/tester/guix-test3/test-tmp/store/pfh1j0k1irzmw8z6ab77c8nknybjcrfl-the-thing.drv
 -
killing process 25112
@ build-started 
/home/tester/guix-test3/test-tmp/store/sdlzbjmsxdh9wpvs9h64lx32gqkpjdia-the-thing.drv
 - i686-linux 
/home/tester/guix-test3/test-tmp/var/log/nix/drvs/sd//lzbjmsxdh9wpvs9h64lx32gqkpjdia-the-thing.drv.bz2
@ build-succeeded 
/home/tester/guix-test3/test-tmp/store/sdlzbjmsxdh9wpvs9h64lx32gqkpjdia-the-thing.drv
 -
killing process 25135
@ build-started 
/home/tester/guix-test3/test-tmp/store/h2ndpc8i99kl541jzlf40hqmafrmb5i0-the-thing.drv
 - i686-linux 
/home/tester/guix-test3/test-tmp/var/log/nix/drvs/h2//ndpc8i99kl541jzlf40hqmafrmb5i0-the-thing.drv.bz2
@ build-succeeded 
/home/tester/guix-test3/test-tmp/store/h2ndpc8i99kl541jzlf40hqmafrmb5i0-the-thing.drv
 -
killing process 25158
@ substituter-started 
/home/tester/guix-test3/test-tmp/store/13nl05wa3pzshk1729scma5ddlmvjm30-substitute-me
 /home/tester/guix-test3/nix/scripts/substitute-binary
downloading 
`/home/tester/guix-test3/test-tmp/store/13nl05wa3pzshk1729scma5ddlmvjm30-substitute-me'
 from 
`file:/home/tester/guix-test3/test-tmp/var/25075/substituter-data/example.nar' 
(0.0 MiB installed)...

file:///.../example.nar 100.0% of 0.2 KiB@ substituter-succeeded 
/home/tester/guix-test3/test-tmp/store/13nl05wa3pzshk1729scma5ddlmvjm30-substitute-me
@ substituter-started 
/home/tester/guix-test3/test-tmp/store/6q3634xm7xnfzixy431x4r7g18q7p6va-substitute-me-not
 /home/tester/guix-test3/nix/scripts/substitute-binary
downloading 
`/home/tester/guix-test3/test-tmp/store/6q3634xm7xnfzixy431x4r7g18q7p6va-substitute-me-not'
 from 
`file:/home/tester/guix-test3/test-tmp/var/25075/substituter-data/does-not-exist.nar'
 (0.0 MiB installed)...
Backtrace:
In ice-9/boot-9.scm:
 157: 13 [catch #t # ...]
In unknown file:
   ?: 12 [apply-smob/1 #]
In ice-9/boot-9.scm:
  63: 11 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 10 [eval # #]
In ice-9/boot-9.scm:
2320: 9 [save-module-excursion #]
3966: 8 [#]
1645: 7 [%start-stack load-stack ...]
1650: 6 [#]
In unknown file:
   ?: 5 [primitive-load "/home/tester/guix-test3/scripts/guix"]
In guix/ui.scm:
 597: 4 [run-guix-command substitute-binary "--substitute" ...]
In ice-9/boot-9.scm:
 157: 3 [catch getaddrinfo-error ...]
In guix/scripts/substitute-binary.scm:
 586: 2 [#]
 133: 1 [fetch # # #f ...]
In unknown file:
   ?: 0 [open-file 
"/home/tester/guix-test3/test-tmp/var/25075/substituter-data/does-not-exist.nar"
 ...]

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: 
"/home/tester/guix-test3/test-tmp/var/25075/substituter-data/does-not-exist.nar"
@ substituter-failed 
/home/tester/guix-test3/test-tmp/store/6q3634xm7xnfzixy431x4r7g18q7p6va-substitute-me-not
 256 fetching path 
`/home/tester/guix-test3/test-tmp/store/6q3634xm7xnfzixy431x4r7g18q7p6va-substitute-me-not'
 failed with exit code 1
@ substituter-started 
/home/tester/guix-test3/test-tmp/store/6q3634xm7xnfzixy431x4r7g18q7p6va-substitute-me-not
 /home/tester/guix-test3/nix/scripts/substitute-binary
downloading 
`/home/tester/guix-test3/test-tmp/store/6q3634xm7xnfzixy431x4r7g18q7p6va-substitute-me-not'
 from 
`file:/home/tester/guix-test3/test-tmp/var/25075/substituter-data/does-not-exist.nar'
 (0.0 MiB installed)...
Backtrace:
In ice-9/boot-9.scm:
 157: 13 [catch #t # ...]
In unknown file:
   ?: 12 [apply-smob/1 #]
In ice-9/boot7 operations
27 operations
5 operat

master: the tests take ages

2014-03-04 Thread Nikita Karetnikov
On master, ‘make check’ hangs after

PASS: tests/base32.scm
PASS: tests/hash.scm
PASS: tests/pk-crypto.scm
PASS: tests/pki.scm

Any clues?


pgpIlOqNfFHML.pgp
Description: PGP signature


core-updates: coreutils: FAIL: tests/misc/nohup

2014-03-04 Thread Nikita Karetnikov
Cyril reported this on IRC.  Indeed, one of the tests fails (I tested on
i686).  Is there a need to report upstream?


   GNU coreutils 8.22: ./tests/test-suite.log


# TOTAL: 551
# PASS:  412
# SKIP:  138
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

++ initial_cwd_=/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22 gt-nohup.sh.
+++ case $# in
+++ destdir_=/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22
+++ template_=gt-nohup.sh.
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
 unset TMPDIR
+++ d=/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
+++ case $d in
+++ test -d /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
 ls -dgo /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
 tr S -
+++ perms='drwx-- 2 4096 Mar  4 09:21 
/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tn-Y'
+++ case $perms in
+++ test 0 = 0
+++ echo /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
+++ return
++ test_dir_=/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
++ cd /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
++ gl_init_sh_nl_='
'
++ IFS='
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/./src
+ case $abs_path_dir_ in
+ 
PATH=/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/./src:/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/src:/nix/store/fzs99arrgyc87spxp64jkhl7g44d4c2x-perl-5.16.1/bin:/nix/store/nbqm528nqlpsr0m8lbfslna6amkfxwq8-bash-4.3/bin:/nix/store/ckpkg84qq02xkc0adp1xjpzipx70ag0g-gcc-4.8.2/bin:/nix/store/zx7qgk5fz7z2lyr3q8hwrngrm7amsvws-ld-wrapper-boot3-0/bin:/nix/store/h2a8jr9swsi40n5dz059silcgwyc0n6n-glibc-2.19/bin:/nix/store/h2a8jr9swsi40n5dz059silcgwyc0n6n-glibc-2.19/sbin:/nix/store/x6f1wq0zmzka7rsryg1cpldi1h6k234v-binutils-cross-boot0-2.24/bin:/nix/store/alwd5d5h7zn1fcs0g4slfrqnp3ra2bzq-make-boot0-4.0/bin:/nix/store/6pn78dk4fzi7qlyy4n0r5znyyhbib8m5-diffutils-3.3/bin:/nix/store/qfb2r36i5514qnnhhf1wqsp7lfsqw4na-findutils-4.4.2/bin:/nix/store/3796gfkqgq82jcmg6ksf5awbn4qrknwr-binutils-bootstrap-0/bin:/nix/store/c1nlcrvh3pwzak3xs8kyga42pflk4gms-bootstrap-binaries-0/bin:/nix/store/93x14705j28fpy9dbkbl452fiadkshfz-acl-2.2.51/bin:/sbin:/usr/sbin
+ create_exe_shims_ /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ nohup
+ test yes = yes
+ local i
+ for i in '$*'
+ env nohup --version
nohup (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jim Meyering.
+ nohup sh -c 'echo stdout; echo stderr 1>&2'
stdout
+ test -t 1
+ test -f nohup.out
+ test -t 0
+ rm -f exp
+ echo stderr
+ compare exp err
+ compare_dev_null_ exp err
+ test 2 = 2
+ test xexp = x/dev/null
+ test xerr = x/dev/null
+ return 2
+ case $? in
+ compare_ exp err
+ diff -u exp err
+ rm -f nohup.out err exp
+ nohup sh -c 'echo stdout; echo stderr 1>&2'
stderr
+ test -t 2
++ tr '\n' -
++ cat out
+ test stdout- = stdout-
+ test -f nohup.out
+ rm -f nohup.out err
+ test -w /dev/full
+ test -c /dev/full
+ exec
./tests/misc/nohup.sh: line 66: /dev/tty: No such device or address
+ fail=1
+ nohup no-such-command
+ errno=127
+ test -t 1
+ cat
+ rm -f nohup.out err exp
+ touch k
+ chmod 0 k
+ nohup ./k
+ errno=126
+ test 126 = 126
+ test -t 1
+ cat
+ nohup
+ test 125 = 125
+ POSIXLY_CORRECT=1
+ nohup
+ test 127 = 127
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ cd /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22
+ chmod -R u+rwx 
/tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
+ rm -rf /tmp/nix-build-coreutils-8.22.drv-0/coreutils-8.22/gt-nohup.sh.tnSY
+ exit 1


pgpolqAapJ35S.pgp
Description: PGP signature


Re: Signed archives (preliminary patch)

2014-03-03 Thread Nikita Karetnikov
> For simplicity, change this pattern to ("1" id body).  That will allow
> the inner ‘cond’ to be simplified.

I like informative error messages, may I keep it please?  The attached
diff should address all the things you mentioned except this one.
Please review.

I’m planning to send a proper patch as soon as I test (guix base64) and
change a couple of things in (test-substitute-binary).

diff --git a/guix/base64.scm b/guix/base64.scm
new file mode 100644
index 000..f7f7f5f
--- /dev/null
+++ b/guix/base64.scm
@@ -0,0 +1,212 @@
+;; -*- mode: scheme; coding: utf-8 -*-
+;;
+;; This module was renamed from (weinholt text base64 (1 0 20100612)) to
+;; (guix base64) by Nikita Karetnikov  on
+;; February 12, 2014.
+;;
+;; Copyright © 2009, 2010 Göran Weinholt 
+;;
+;; This program 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.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#!r6rs
+
+;; RFC 4648 Base-N Encodings
+
+(library (guix base64)
+  (export base64-encode
+  base64-decode
+  base64-alphabet
+  base64url-alphabet
+  get-delimited-base64
+  put-delimited-base64)
+  (import (rnrs)
+  (only (srfi :13 strings)
+string-index
+string-prefix? string-suffix?
+string-concatenate string-trim-both))
+
+  (define base64-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+
+  (define base64url-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")
+
+  (define base64-encode
+(case-lambda
+  ;; Simple interface. Returns a string containing the canonical
+  ;; base64 representation of the given bytevector.
+  ((bv)
+   (base64-encode bv 0 (bytevector-length bv) #f #f base64-alphabet #f))
+  ((bv start)
+   (base64-encode bv start (bytevector-length bv) #f #f base64-alphabet #f))
+  ((bv start end)
+   (base64-encode bv start end #f #f base64-alphabet #f))
+  ((bv start end line-length)
+   (base64-encode bv start end line-length #f base64-alphabet #f))
+  ((bv start end line-length no-padding)
+   (base64-encode bv start end line-length no-padding base64-alphabet #f))
+  ((bv start end line-length no-padding alphabet)
+   (base64-encode bv start end line-length no-padding alphabet #f))
+  ;; Base64 encodes the bytes [start,end[ in the given bytevector.
+  ;; Lines are limited to line-length characters (unless #f),
+  ;; which must be a multiple of four. To omit the padding
+  ;; characters (#\=) set no-padding to a true value. If port is
+  ;; #f, returns a string.
+  ((bv start end line-length no-padding alphabet port)
+   (assert (or (not line-length) (zero? (mod line-length 4
+   (let-values (((p extract) (if port
+ (values port (lambda () (values)))
+ (open-string-output-port
+ (letrec ((put (if line-length
+   (let ((chars 0))
+ (lambda (p c)
+   (when (fx=? chars line-length)
+ (set! chars 0)
+ (put-char p #\linefeed))
+   (set! chars (fx+ chars 1))
+   (put-char p c)))
+   put-char)))
+   (let lp ((i start))
+ (cond ((= i end))
+   ((<= (+ i 3) end)
+(let ((x (bytevector-uint-ref bv i (endianness big) 3)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (put p (string-ref alphabet (fxbit-field x 6 12)))
+  (put p (string-ref alphabet (fxbit-field x 0 6)))
+  (lp (+ i 3
+   ((<= (+ i 2) end)
+(let ((x (fxarithmetic-shift-left (bytevector-u16-ref bv i (endianness big)) 8)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (put p (string-ref alphabet (fxbit-field x 6 12)))
+  (unless no-padding
+(put p #\=
+   (else
+(let

Re: Signed archives (preliminary patch)

2014-02-28 Thread Nikita Karetnikov
> There’s an important check missing here: the code verifies that BODY* is
> a valid signature, but it doesn’t check whether what it signs
> corresponds to this narinfo up to but excluding the ‘Signature’ field.

Oh, indeed.

>   5. pass the hash to the signature verification procedure.

Then, it should extract the other hash from the Signature line, compare
the hashes, and run the rest of the checks, right?

>> +("Signature" . ,(lambda (narinfo)
>> +  (let ((sig (narinfo-signature 
>> narinfo)))
>> +(string-append
>> + (number->string (signature-version 
>> sig))
>> + ";"
>> + (signature-key-id sig)
>> + ";"
>> + (base64-encode
>> +  ;; XXX: Can we assume UTF-8 here?
>> +  (string->utf8
>> +   (canonical-sexp->string
>> +(signature-body sig)

> It’s important to keep the original signatures intact.

Not sure I follow.  Can I simply use ("Signature" . ,narinfo-signature)?

> To fix this, the  record must include an additional field to
> contain the original narinfo string.

Please elaborate.  Which string are you talking about?


pgpADRO9kzyfQ.pgp
Description: PGP signature


Re: Signed archives (preliminary patch)

2014-02-28 Thread Nikita Karetnikov
> How do you envision the transition from this single-signature
> architecture to one where other users and/or independent build farms
> can add their signatures to hydra?  Will those signatures be treated
> differently than the signatures created by hydra.gnu.org?  Will they
> be stored and sent to users using a different mechanism?

Let’s not get ahead of ourselves.  The “single signature” solution is
far from being perfect, but it’s way better than nothing.  I suspect
that the “web of trust” thing would require a lot of effort.  So I
propose to postpone that until we implement the former since a bird in
the hand is worth two in the bush.  Even though that bird would be an
obvious target for an attacker.
c


pgpE5bUEmHESc.pgp
Description: PGP signature


Re: Signed archives (preliminary patch)

2014-02-27 Thread Nikita Karetnikov
Too lazy to write a proper commit message, so here’s the diff.  Please
take a look and comment on the XXX stuff.

diff --git a/guix/base64.scm b/guix/base64.scm
new file mode 100644
index 000..f7f7f5f
--- /dev/null
+++ b/guix/base64.scm
@@ -0,0 +1,212 @@
+;; -*- mode: scheme; coding: utf-8 -*-
+;;
+;; This module was renamed from (weinholt text base64 (1 0 20100612)) to
+;; (guix base64) by Nikita Karetnikov  on
+;; February 12, 2014.
+;;
+;; Copyright © 2009, 2010 Göran Weinholt 
+;;
+;; This program 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.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#!r6rs
+
+;; RFC 4648 Base-N Encodings
+
+(library (guix base64)
+  (export base64-encode
+  base64-decode
+  base64-alphabet
+  base64url-alphabet
+  get-delimited-base64
+  put-delimited-base64)
+  (import (rnrs)
+  (only (srfi :13 strings)
+string-index
+string-prefix? string-suffix?
+string-concatenate string-trim-both))
+
+  (define base64-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
+
+  (define base64url-alphabet
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")
+
+  (define base64-encode
+(case-lambda
+  ;; Simple interface. Returns a string containing the canonical
+  ;; base64 representation of the given bytevector.
+  ((bv)
+   (base64-encode bv 0 (bytevector-length bv) #f #f base64-alphabet #f))
+  ((bv start)
+   (base64-encode bv start (bytevector-length bv) #f #f base64-alphabet #f))
+  ((bv start end)
+   (base64-encode bv start end #f #f base64-alphabet #f))
+  ((bv start end line-length)
+   (base64-encode bv start end line-length #f base64-alphabet #f))
+  ((bv start end line-length no-padding)
+   (base64-encode bv start end line-length no-padding base64-alphabet #f))
+  ((bv start end line-length no-padding alphabet)
+   (base64-encode bv start end line-length no-padding alphabet #f))
+  ;; Base64 encodes the bytes [start,end[ in the given bytevector.
+  ;; Lines are limited to line-length characters (unless #f),
+  ;; which must be a multiple of four. To omit the padding
+  ;; characters (#\=) set no-padding to a true value. If port is
+  ;; #f, returns a string.
+  ((bv start end line-length no-padding alphabet port)
+   (assert (or (not line-length) (zero? (mod line-length 4
+   (let-values (((p extract) (if port
+ (values port (lambda () (values)))
+ (open-string-output-port
+ (letrec ((put (if line-length
+   (let ((chars 0))
+ (lambda (p c)
+   (when (fx=? chars line-length)
+ (set! chars 0)
+ (put-char p #\linefeed))
+   (set! chars (fx+ chars 1))
+   (put-char p c)))
+   put-char)))
+   (let lp ((i start))
+ (cond ((= i end))
+   ((<= (+ i 3) end)
+(let ((x (bytevector-uint-ref bv i (endianness big) 3)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (put p (string-ref alphabet (fxbit-field x 6 12)))
+  (put p (string-ref alphabet (fxbit-field x 0 6)))
+  (lp (+ i 3
+   ((<= (+ i 2) end)
+(let ((x (fxarithmetic-shift-left (bytevector-u16-ref bv i (endianness big)) 8)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (put p (string-ref alphabet (fxbit-field x 6 12)))
+  (unless no-padding
+(put p #\=
+   (else
+(let ((x (fxarithmetic-shift-left (bytevector-u8-ref bv i) 16)))
+  (put p (string-ref alphabet (fxbit-field x 18 24)))
+  (put p (string-ref alphabet (fxbit-field x 12 18)))
+  (unless no-padding
+(put p #\=)

Re: Signed archives

2014-02-20 Thread Nikita Karetnikov
More questions:

1. Will hydra.gnu.org serve only signed .narinfo files?

2. If not, how can one opt out of verifying while using ‘guix
   substitute-binary’?  Should we add an option to ‘guix package’ and
   ‘guix build’?

3. How does a user get Hydra’s public key?

4. Will the entire cache be signed with a single key?  (Mark, would you
   like to add something?)

5. When do we want to verify the .narinfo file?  Can it be done in
   ‘read-narinfo’?  Similarly, should we sign and base64-encode in
   ‘write-narinfo’?

6. Where should ‘guix substitute-binary’ look for a keypair?

7. How do we determine that a file is signed with a trusted key?  What
   if we don’t have the needed public key?  Does it mean we miss the
   right one, or is it a MITM attack?


pgpYEYtjekiUl.pgp
Description: PGP signature


Re: Guix tutorial

2014-02-16 Thread Nikita Karetnikov
> I wrote a basic guide[1] for contributors. It covers instalation and usage
> of guix, and also writing simple recipes and contributing to the project.

Thanks for spreading the word!

> If you find unpolished corners, please, comment , and I'll update the
> post.

Here goes…

> - Install guix . Download the git version from git clone 
> git://git.savannah.gnu.org/guix.git

‘git clone’ is not enough to install Guix, you also have to run
‘./configure && make && make check && make install’.

Also, there is an extraneous space before the dot.

> - Run server.  ./pre-inst-env guix-daemon --build-users-group=guix-builder

I’d add a note saying that ‘./pre-inst-env’ is only needed when Guix
isn’t installed system-wide.

> Search package.  ./pre-inst-env scripts/guix package -s hello

No need for ‘scripts/’.

> The file is in gnu/packages/base.scm

There’s an extraneous newline after this sentence.

> here we added PREFIX variable in make phase, and we removed configure phase 
> and test.

s/here/Here/.

> The community is also important in opensource projects.

“While free software by any other name would give you the same freedom,
it makes a big difference which name we use: different words convey
different ideas. […] So please mention the Free Software movement when
you talk about the work we have done, and the software we have
developed—such as the GNU/Linux operating system. […] Sooner or later
these users will be invited to switch back to proprietary software for
some practical advantage. Countless companies seek to offer such
temptation, and why would users decline? Only if they have learned to
value the freedom free software gives them, for its own sake. It is up
to us to spread this idea—and in order to do that, we have to talk about
freedom.” [1]

[1] https://www.gnu.org/philosophy/free-software-for-freedom.html


pgptmuHdUCGn4.pgp
Description: PGP signature


‘guix authenticate’: Throw to key `gcry-error' with args `(536871113)'.

2014-02-11 Thread Nikita Karetnikov
The keypair was created this way:

$ openssl genrsa -out ./cache-key.sec 2048
$ openssl rsa -in ./cache-key.sec -pubout > ./cache-key.pub

All the tests pass.  What’s wrong?

$ guix authenticate rsautl -sign -inkey cache-key.sec -in 
3r2n9zm3kxb28klpzgarjxj8x3y3y6wf.narinfo.hash
Backtrace:
In ice-9/boot-9.scm:
 157: 11 [catch #t # ...]
In unknown file:
   ?: 10 [apply-smob/1 #]
In ice-9/boot-9.scm:
  63: 9 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 8 [eval # #]
In ice-9/boot-9.scm:
2320: 7 [save-module-excursion #]
3966: 6 [#]
1645: 5 [%start-stack load-stack ...]
1650: 4 [#]
In unknown file:
   ?: 3 [primitive-load "/usr/local/bin/guix"]
In guix/ui.scm:
 593: 2 [run-guix-command authenticate "rsautl" ...]
In guix/scripts/authenticate.scm:
  60: 1 [guix-authenticate "rsautl" "-sign" ...]
In ice-9/boot-9.scm:
 793: 0 [call-with-input-file "cache-key.sec" ...]

ice-9/boot-9.scm:793:17: In procedure call-with-input-file:
ice-9/boot-9.scm:793:17: Throw to key `gcry-error' with args `(536871113)'.


pgptSumpMZFl2.pgp
Description: PGP signature


Re: i686: recipe for target 'cc1plus' failed

2014-02-08 Thread Nikita Karetnikov
> This is ‘master’?

Yes.

> Could it be an ENOMEM showing up above in the log?

ranlib: libbackend.a: No space left on device

It seems I should clean up my disk.  How much space does IceCat need?


pgpuOKvgFjP1m.pgp
Description: PGP signature


i686: recipe for target 'cc1plus' failed

2014-02-08 Thread Nikita Karetnikov
Can anyone reproduce this?

g++   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti 
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings 
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long 
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H 
-static-libstdc++ -static-libgcc 
-Wl,-rpath=/nix/store/srnpqj0vh0hwnkf38fyrvf395y188smw-glibc-bootstrap-0/lib 
-Wl,-dynamic-linker 
-Wl,/nix/store/srnpqj0vh0hwnkf38fyrvf395y188smw-glibc-bootstrap-0/lib/ld-linux.so.2
 -o cc1plus \
  cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/decl.o cp/expr.o cp/pt.o 
cp/typeck2.o cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o 
cp/rtti.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o 
cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o 
cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o 
cp/cp-gimplify.o attribs.o incpath.o c-family/c-common.o 
c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o 
c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o 
c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o 
c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o 
tree-mudflap.o i386-c.o glibc-c.o cc1plus-checksum.o libbackend.a main.o  
libcommon-target.a libcommon.a ../libcpp/libcpp.a 
../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a 
../libdecnumber/libdecnumber.a   
-L/tmp/nix-build-gcc-cross-boot0-4.8.2.drv-0/build/./gmp/.libs 
-L/tmp/nix-build-gcc-cross-boot0-4.8.2.drv-0/build/./mpfr/src/.libs 
-L/tmp/nix-build-gcc-cross-boot0-4.8.2.drv-0/build/./mpc/src/.libs -lmpc -lmpfr 
-lgmp -rdynamic -ldl  -L../zlib -lz
collect2: error: ld returned 1 exit status
../../gcc-4.8.2/gcc/cp/Make-lang.in:103: recipe for target 'cc1plus' failed
make[2]: *** [cc1plus] Error 1
make[2]: Leaving directory 
'/tmp/nix-build-gcc-cross-boot0-4.8.2.drv-0/build/gcc'
Makefile:3897: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory '/tmp/nix-build-gcc-cross-boot0-4.8.2.drv-0/build'
Makefile:843: recipe for target 'all' failed
make: *** [all] Error 2
phase `build' failed after 683 seconds
builder for 
`/nix/store/w9kp65kmz1gjmhj1vb8zd2apd5pyhmc1-gcc-cross-boot0-4.8.2.drv' failed 
with exit code 1
cannot build derivation 
`/nix/store/llwwby9glmab442dib1v6pmilpsx8afg-glibc-2.18.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/nix/store/w5y65km8rzbaymnz3s44gniv6vnlhivg-python2-pysqlite-2.6.3a.drv': 1 
dependencies couldn't be built
cannot build derivation 
`/nix/store/3nl916s841ray8vnrh7bqld2baac8ii4-profile.drv': 1 dependencies 
couldn't be built


pgp7cXZs9xIB9.pgp
Description: PGP signature


Re: Signed archives

2014-02-03 Thread Nikita Karetnikov
I’d like to see a signature in the wild.  Are there any signed .narinfo
files on hydra.nixos.org?  I’ve checked GNU Hello [1]; it’s not signed.

[1] http://hydra.nixos.org/6iqpvq3k2nlmfn3l59rsf3c57ji7jiyb.narinfo


pgpTuQkQKLw91.pgp
Description: PGP signature


Re: Symlinks to generic names

2014-02-01 Thread Nikita Karetnikov
> Some software (rightly or wrongly) tries to build with "lex" and "yacc" .  
> Guix does not provide these.
> Instead we have "flex" and "bison".  Most operating systems have symbolic 
> links lex -> flex and yacc -> bison.
> Shouldn't we provide these too?

I guess this should solve the problem (untested):

(inputs
  `(("lex" ,flex)
("yacc" ,bison)
...))



pgp48OAK0rB3q.pgp
Description: PGP signature


Re: Signed archives

2014-01-27 Thread Nikita Karetnikov
Sorry, I’m failing to understand how the protocol works.  Is the spec
available somewhere?

Could you describe the entire process in a step-by-step way?  What does
happen when the client requests a substitute?  You mentioned that the
client attempts to fetch the corresponding .narinfo file.  What does
happen after that?

Why does the client need to cache the answer?  Does it check the cache
first?

‘guix authenticate’ accepts a ‘hash-file’ argument.  Does it come from
the .narinfo file?  If so, should ‘substitute-binary.scm’ check the
signature against the NarHash field?


pgplIZN8bmQMu.pgp
Description: PGP signature


Signed archives (was: ‘guix archive’ doesn’t work over ‘./pre-inst-env’)

2014-01-26 Thread Nikita Karetnikov
> Indeed.  I just fixed that.

Thanks!

>> Also, where can I find the corresponding NAR info file?  According to
>> this commit [1], the signature should be there.

> The .narinfo files are created on the fly.  When looking for a binary
> for /nix/store/x4mnd9747fgwacjrvl1rynh59qlgz8gh-coreutils-8.21, the
> substituter attempts to fetch:

>   http://hydra.gnu.org/x4mnd9747fgwacjrvl1rynh59qlgz8gh.narinfo

> It caches the answer (positive or negative) under
> /nix/var/nix/substitute-binary/cache/x4mnd9747fgwacjrvl1rynh59qlgz8gh
> (or similar.)

Does Hydra create the .narinfo files?  How can I create a signed
.narinfo file locally (for testing purposes)?


pgp8LB5DRL12v.pgp
Description: PGP signature


‘guix archive’ doesn’t work over ‘./pre-inst-env’

2014-01-26 Thread Nikita Karetnikov
$ sudo ./pre-inst-env guix archive --generate-key
$ ./pre-inst-env guix archive --export hello > hello.nar
error: executing `guix-authenticate': No such file or directory
guix archive: error: build failed: program `guix-authenticate' failed with exit 
code 1

The command succeeded when I installed Guix and re-ran it without
‘./pre-inst-env’.

Slightly off-topic: is Hydra supposed to do the same when someone
requests a substitute?

Also, where can I find the corresponding NAR info file?  According to
this commit [1], the signature should be there.

[1] https://github.com/NixOS/nix/commit/0fdf4da0e979f992db75cc17376e455ddc5a96d8


pgpE9DbF58YUg.pgp
Description: PGP signature


Re: Guix initd script

2014-01-15 Thread Nikita Karetnikov
> I wrote an initd script for starting guix-daemon and would like to
> share it.  It is available here:
> https://gnunet.org/content/gnu-guix-initd-script

Could you add a license header?


pgpz2N9UVYWxf.pgp
Description: PGP signature


Re: Package Definition Place

2014-01-03 Thread Nikita Karetnikov
> Thanks, here are the results:
>
>   gnu/packages/zsh.scm:12:2: warning: possibly unbound variable `mit'
>
> The license is like MIT.
>
>   guix build: error: zsh: unknown package

I guess it would be easier to help if you provide the code.


pgpy4oI5TndsZ.pgp
Description: PGP signature


Re: Package Definition Place

2014-01-02 Thread Nikita Karetnikov
> Yes, I don't know where 'gnu/packages' is except for savannah.

Hm, I’m a bit puzzled.  How did you change ‘gnu-system.am’, then?
‘gnu/packages’ should be in the same directory (on your machine) as
‘gnu-system.am’.

Did you clone the repository or download the tarball?  If not, could you
please follow the instructions in my previous email?

Are you familiar with Git?  Do you know Scheme?  Have you contributed to
free software projects?


pgp9uK1NaTBZQ.pgp
Description: PGP signature


Re: Package Definition Place

2014-01-01 Thread Nikita Karetnikov
> make[2]: *** No rule to make target `gnu/packages/zsh.scm', needed by `all-
> am'.  Stop.

Sorry, I totally misunderstood the context.  Are you trying to add Zsh?

It seems you added a line to ‘gnu-system.am’ but forgot to add a file to
‘gnu/packages’.  Could you confirm?


pgphZ6mz0EGJx.pgp
Description: PGP signature


Re: Package Definition Place

2014-01-01 Thread Nikita Karetnikov
> Am I supposed to add a module to gnu-system.am?

Yes, here’s an example [1].

> make[2]: *** No rule to make target `gnu/packages/zsh.scm', needed by `all-
> am'.  Stop.

I’ve just tried the following.  Could you do the same and report any
issues?

$ git clone git://git.sv.gnu.org/guix.git
$ cd guix
$ ./bootstrap && ./configure --localstatedir=/nix/var && make && make check

(See ‘HACKING’ for more information.)

Then you could add a recipe (i.e., the definition of a package) to
‘guix/gnu/packages’.  For instance, this commit [1] adds the elfutils
recipe to ‘gnu/packages/elf.scm’.

Did I forget to address anything?

[1] 
http://git.savannah.gnu.org/cgit/guix.git/commit/?id=2ed5b0f42c40b5eb8df462b3cff3399123423182


pgp5nRtwr8tIr.pgp
Description: PGP signature


Re: FAIL: tests/guix-build.sh

2013-11-27 Thread Nikita Karetnikov
> Eric reported a similar failure on IRC, with Guile 2.0.5, which I
> believe is solved by de67926.  Can you confirm?

I couldn’t reproduce it earlier, so I can’t confirm.  However, ‘make
check TESTS=tests/guix-build.sh’ passes in HEAD.


pgpBshU1nT3vk.pgp
Description: PGP signature


GNU Aris doesn’t work properly

2013-11-20 Thread Nikita Karetnikov
The attached recipe successfully builds, but the ‘test’ program
segfaults, and the ‘aris’ program becomes unusable when you try to
create a new file.

I don’t have time to look through the build directory nor to build it
outside of Guix right now, but I’ll do it later.

As always, any help is appreciated.

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 9b2b052..226db7c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -29,6 +29,7 @@
   #:use-module ((gnu packages gettext)
 #:renamer (symbol-prefix-proc 'gnu:))
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -200,3 +201,30 @@ text, Postscript, PDF or HTML.")
 problems in numerical linear algebra.")
 (license (license:bsd-style "file://LICENSE"
 "See LICENSE in the distribution."
+
+(define-public aris
+  (package
+(name "aris")
+(version "2.1.1")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/aris/aris-"
+  version ".tar.bz2"))
+  (sha256
+   (base32
+"08vw43qkmnsd2xjfwfkvp6njar8cdns0hbzav6sxgvbr08778cgp"
+(build-system gnu-build-system)
+(inputs `(("pkg-config" ,pkg-config)
+  ("gtk+" ,gtk+-2)
+  ("libxml2", libxml2)))
+(home-page "https://gnu.org/software/aris";)
+(synopsis "Natural deduction first-order logic interface")
+(description
+ "Aris is a program for performing logical proofs.  It supports
+propositional and predicate logic, as well as Boolean algebra and
+arithmetical logic.  In addition to its predefined inference and equivalence
+rules, Aris also supports references to older proofs. Its use of standard
+logical symbols and its natural deduction interface make it easy to use for
+beginners.")
+(license license:gpl3+)))


pgpnT5AwJjlgL.pgp
Description: PGP signature


FAIL: tests/guix-build.sh

2013-11-11 Thread Nikita Karetnikov
I got the following error, which I couldn’t reproduce
(bf4211523baf8ab1c853aac48ef0324f8f704510).  Is there a need to worry?

+ guix build hello -d
+ grep -e '-hello-[0-9\.]\+\.drv$'
accepted connection from pid 15177, uid 1000
guix build: error: build failed: substituter `substitute-binary' died 
unexpectedly
238 operations


pgpILnuyPM1mf.pgp
Description: PGP signature


Re: [PATCH] gnu: Add GNU APL.

2013-11-10 Thread Nikita Karetnikov
> Do Readline and LAPACK show up in ‘guix gc --references $(guix build
> apl)’?  If they don’t, you can remove them.

LAPACK doesn’t show up, but this line appears in the logs when it’s
omitted:

LApack.cc:410:2: warning: #warning liblapack not found or not installed. ⌹ 
will not work. [-Wcpp]

> As for gettext, please check in the log whether some of its commands are
> actually run.

I know nearly nothing about Gettext.  The only bits that seem relevant:

checking for msgfmt... 
/nix/store/1v42xk9j5hzbgxbh21pdp97ccd244hvl-gettext-0.18.3/bin/msgfmt
checking for gmsgfmt... 
/nix/store/1v42xk9j5hzbgxbh21pdp97ccd244hvl-gettext-0.18.3/bin/msgfmt
checking for xgettext... 
/nix/store/1v42xk9j5hzbgxbh21pdp97ccd244hvl-gettext-0.18.3/bin/xgettext
checking for msgmerge... 
/nix/store/1v42xk9j5hzbgxbh21pdp97ccd244hvl-gettext-0.18.3/bin/msgmerge


pgpoCc2YFfgxn.pgp
Description: PGP signature


[PATCH] gnu: Add GNU APL.

2013-11-07 Thread Nikita Karetnikov
Even though ‘README-1-prerequisites’ states that LAPACK, Gettext, and
Readline are needed, GNU APL successfully builds without them.  Would
you like to keep these inputs anyway?

From b0f941b6c2ffd703d9a822c580356df4b6423c62 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Thu, 7 Nov 2013 10:23:22 +
Subject: [PATCH] gnu: Add GNU APL.

* gnu/packages/apl.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
 gnu-system.am|1 +
 gnu/packages/apl.scm |   50 ++
 2 files changed, 51 insertions(+)
 create mode 100644 gnu/packages/apl.scm

diff --git a/gnu-system.am b/gnu-system.am
index 3b0c2b8..487788f 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -25,6 +25,7 @@ GNU_SYSTEM_MODULES =\
   gnu/packages/acct.scm\
   gnu/packages/acl.scm\
   gnu/packages/algebra.scm			\
+  gnu/packages/apl.scm\
   gnu/packages/apr.scm\
   gnu/packages/aspell.scm			\
   gnu/packages/attr.scm\
diff --git a/gnu/packages/apl.scm b/gnu/packages/apl.scm
new file mode 100644
index 000..5750abb
--- /dev/null
+++ b/gnu/packages/apl.scm
@@ -0,0 +1,50 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013 Nikita Karetnikov 
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages apl)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module ((gnu packages gettext)
+#:renamer (symbol-prefix-proc 'guix:))
+  #:use-module (gnu packages maths)
+  #:use-module (gnu packages readline))
+
+(define-public apl
+  (package
+(name "apl")
+(version "1.1")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/apl/apl-" version ".tar.gz"))
+  (sha256
+   (base32
+"1myinxa0m3y4fanpxflfakfk3m1s8641wdlbwbs0vg5yp10xm0m3"
+(build-system gnu-build-system)
+(home-page "http://www.gnu.org/software/apl/";)
+(inputs
+ `(("gettext" ,guix:gettext)
+   ("lapack" ,lapack)
+   ("readline" ,readline)))
+(synopsis "APL interpreter")
+(description
+ "GNU APL is a free interpreter for the programming language APL.  It is
+an implementation of the ISO standard 13751.")
+(license gpl3+)))
-- 
1.7.9.5



pgpY7IAFgqmX3.pgp
Description: PGP signature


Re: [PATCH] gnu: Add LAPACK.

2013-11-07 Thread Nikita Karetnikov
>> May I push this patch to ‘master’?

> Yep!

Done.

> (though I gather that the next upstream version of LAPACK will be
> fixed, right?).

I think so.

> Two things we could do: (1) add a ‘snippet’ field in ‘origin’, which is
> where the ‘remove-file’ calls would appear, (2) host a freed version
> under alpha.gnu.org/gnu/guix/mirror.

> Hmm I’ll see if (1) can be implemented before 0.5 without triggering a
> full rebuild.

OK, let me know if you need any help.


pgpfvWmHXVdsL.pgp
Description: PGP signature


[PATCH] gnu: Add LAPACK. (was: LAPACK: tests fail; non-free files)

2013-11-04 Thread Nikita Karetnikov
May I push this patch to ‘master’?  Should (format #t "removing '~a'~%"
file) be i18n’d?

From 3e94fe1afc01d08997fd95775aab06c4495ba9d6 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Mon, 4 Nov 2013 18:58:54 +
Subject: [PATCH] gnu: Add LAPACK.

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

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ccbb57b..27d83f0 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge 
+;;; Copyright © 2013 Nikita Karetnikov 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,13 +23,16 @@
 #:renamer (symbol-prefix-proc 'license:))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages compression)
   #:use-module ((gnu packages gettext)
 #:renamer (symbol-prefix-proc 'gnu:))
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages xml))
 
@@ -153,3 +157,48 @@ interoperate with Gnumeric, LibreOffice and OpenOffice.  Data can be imported
 from spreadsheets, text files and database sources and it can be output in
 text, Postscript, PDF or HTML.")
 (license license:gpl3+)))
+
+(define-public lapack
+  (package
+(name "lapack")
+(version "3.4.2")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "http://www.netlib.org/lapack/lapack-";
+  version ".tgz"))
+  (sha256
+   (base32
+"1w7sfm7fi2kyx1fzgbm22193l8c2d53m8q1ibhvfy6m5v9k0"
+(build-system cmake-build-system)
+(home-page "http://www.netlib.org/lapack/";)
+(inputs `(("fortran" ,gfortran-4.8)
+  ("python" ,python-2)))
+(arguments
+ `(#:modules ((guix build cmake-build-system)
+  (guix build utils)
+  (srfi srfi-1))
+   #:phases (alist-cons-before
+ ;; See <http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01383.html>.
+ 'configure 'remove-non-free-files
+ (lambda _
+   (for-each (lambda (file)
+   (begin
+ (format #t "removing '~a'~%" file)
+ (delete-file file)))
+ '("lapacke/example/example_DGESV_rowmajor.c"
+   "lapacke/example/example_ZGESV_rowmajor.c"
+   "DOCS/psfig.tex")))
+ (alist-cons-before
+  'check 'patch-python
+  (lambda* (#:key inputs #:allow-other-keys)
+(let ((python (assoc-ref inputs "python")))
+  (substitute* "lapack_testing.py"
+(("/usr/bin/env python") python
+  %standard-phases
+(synopsis "Library for numerical linear algebra")
+(description
+ "LAPACK is a Fortran 90 library for solving the most commonly occurring
+problems in numerical linear algebra.")
+(license (license:bsd-style "file://LICENSE"
+"See LICENSE in the distribution."
-- 
1.7.9.5



pgpIoBnKM05H4.pgp
Description: PGP signature


Re: [PATCH] gnu: Add GCC front ends for Fortran, Go, Objective C, and Objective C++.

2013-11-01 Thread Nikita Karetnikov
> ‘ld-wrapper’ is a wrapper around the linker that adds a -rpath argument
> for each -l argument (see the top of ld-wrapper.scm), such that all the
> needed libraries are in the resulting binary’s RUNPATH.

Could you show how it helps to avoid the need to set environment
variables?

> Please add a docstring here, and then OK to push.

I’ve just pushed.  Please test.


pgptsjUuQptj6.pgp
Description: PGP signature


[PATCH] gnu: Add GCC front ends for Fortran, Go, Objective C, and Objective C++.

2013-10-31 Thread Nikita Karetnikov
>> If you want to test any of the front-ends, don’t forget to set
>> LIBRARY_PATH and LD_LIBRARY_PATH, like so:
>>
>> $ export 
>> LIBRARY_PATH=/nix/store/wmaxqx3p658v2yqjv00mss2shvn23h7a-glibc-2.18/lib
>> $ export 
>> LD_LIBRARY_PATH=/nix/store/kvhg0fszagsx5y80sq79bkmb7yqvjfmd-gcc-go-4.8.1/lib

> I guess that’s unnecessary when using ‘ld-wrapper’.

I know nothing about it.  Could you elaborate?

I tested each front end using the “hello, world” program.  Is it enough?

It was necessary to set some environment variables.  An example for
Fortran:

LIBRARY_PATH=/nix/var/nix/profiles/default/guix-profile/lib
LD_LIBRARY_PATH=/nix/store/jh5shyx6pg7m0dibdgl202pj7ryp5nvq-gfortran-4.8.2/lib
CPATH=/nix/var/nix/profiles/default/guix-profile/include
PATH=/nix/var/nix/profiles/default/guix-profile/bin:$PATH

May I push this patch to ‘master’?

From be260e7d9d4a7592129c0369eee52b156170d1cf Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Thu, 31 Oct 2013 19:54:36 +
Subject: [PATCH] gnu: Add GCC front ends for Fortran, Go, Objective C, and
 Objective C++.

* gnu/packages/gcc.scm (custom-gcc, gfortran-4.8, gccgo-4.8)
  (gcc-objc-4.8, gcc-objc++-4.8): New variables.
---
 gnu/packages/gcc.scm |   29 +
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index dde0f0d..60bc5bb 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -27,6 +27,7 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
   #:use-module (ice-9 regex))
 
 (define %gcc-infrastructure
@@ -211,6 +212,34 @@ Go.  It also includes standard libraries for these languages.")
   (base32
"1j6dwgby4g3p3lz7zkss32ghr45zpdidrg8xvazvn91lqxv25p09"))
 
+(define (custom-gcc gcc name languages)
+  (package (inherit gcc)
+(name name)
+(arguments
+ (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
+(guix build utils)
+(ice-9 regex)
+(srfi srfi-1)
+(srfi srfi-26))
+   ,@(package-arguments gcc))
+   ((#:configure-flags flags)
+`(cons (string-append "--enable-languages="
+  ,(string-join languages ","))
+   (remove (cut string-match "--enable-languages.*" <>)
+   ,flags)))
+
+(define-public gfortran-4.8
+  (custom-gcc gcc-4.8 "gfortran" '("fortran")))
+
+(define-public gccgo-4.8
+  (custom-gcc gcc-4.8 "gccgo" '("go")))
+
+(define-public gcc-objc-4.8
+  (custom-gcc gcc-4.8 "gcc-objc" '("objc")))
+
+(define-public gcc-objc++-4.8
+  (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")))
+
 (define-public isl
   (package
 (name "isl")
-- 
1.7.9.5



pgp7VJPfHUErO.pgp
Description: PGP signature


Re: GCC front-ends

2013-10-28 Thread Nikita Karetnikov
> Argh, you also need (srfi srfi-26) for ‘cut’, sorry about that.

Hm, I’ve added the module, but I still get the same error.


pgp_x9KZwHIvm.pgp
Description: PGP signature


Re: GCC front-ends

2013-10-28 Thread Nikita Karetnikov
> That’s a bug, which may have been fixed in 4.8.2 no?  I’d rather not
> workaround that if it’s been/being fixed.

No, it has not been fixed.  Well, the previous patch didn’t contain any
workarounds.  However, users would have to pass ‘-g’ each time they
decide to compile anything.  Otherwise, their binaries will not work.
Can we do anything about it?

> GNAT and GCJ are definitely trickier, so I’d suggest to leave them for now.

OK.

> So the mapping has to be done in builder-side code, not in host-side
> code, like ‘gcc-cross-boot0’ does.

> Something like:

>   `(cons "--enable-languages=" ,(string-join languages ",")
>  (remove (cut string-match "--enable-languages.*" <>) ,flags))

(define (custom-gcc gcc name languages)
  (package (inherit gcc)
(name name)
(arguments
 (substitute-keyword-arguments (package-arguments gcc)
   ((#:configure-flags flags)
`(cons "--enable-languages=" ,(string-join languages ",")
   (remove (cut string-match "--enable-languages.*" <>)
   ,flags)))
   ((#:modules _)
'((guix build gnu-build-system)
  (guix build utils)
  (srfi srfi-1)))

(define-public gfortran-4.8
  (custom-gcc gcc-4.8 "gfortran" '("fortran")))

The above code fails.

Backtrace:
In ice-9/boot-9.scm:
 157: 14 [catch #t # ...]
In unknown file:
   ?: 13 [apply-smob/1 #]
In ice-9/boot-9.scm:
  63: 12 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 11 [eval # #]
In ice-9/boot-9.scm:
2320: 10 [save-module-excursion #]
3966: 9 [#]
1645: 8 [%start-stack load-stack ...]
1650: 7 [#]
In unknown file:
   ?: 6 [primitive-load 
"/nix/store/m8axi2v9cbj2s0kfpifxp874sxplwwwg-gfortran-4.8.2-guile-builder"]
In ice-9/eval.scm:
 387: 5 [eval # ()]
 387: 4 [eval # ()]
 387: 3 [eval # ()]
 386: 2 [eval # ()]
 393: 1 [eval # ()]
In unknown file:
   ?: 0 [memoize-variable-access! # #]

ERROR: In procedure memoize-variable-access!:
ERROR: Unbound variable: remove


pgpe4lqlTFSoF.pgp
Description: PGP signature


[PATCH] gnu: gcc-4.8: Upgrade to 4.8.2.

2013-10-28 Thread Nikita Karetnikov
May I push this patch to master?

From 8bceb04eb5a7723eb988a164ee9ca8e7037d551f Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Mon, 28 Oct 2013 16:44:26 +
Subject: [PATCH] gnu: gcc-4.8: Upgrade to 4.8.2.

* gnu/packages/gcc.scm (gcc-4.8): Upgrade to 4.8.2.
---
 gnu/packages/gcc.scm |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index cececca..dde0f0d 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -202,14 +202,14 @@ Go.  It also includes standard libraries for these languages.")
 
 (define-public gcc-4.8
   (package (inherit gcc-4.7)
-(version "4.8.1")
+(version "4.8.2")
 (source (origin
  (method url-fetch)
  (uri (string-append "mirror://gnu/gcc/gcc-"
  version "/gcc-" version ".tar.bz2"))
  (sha256
   (base32
-   "04sqn0ds17ys8l6zn7vyyvjz1a7hsk4zb0381vlw9wnr7az48nsl"))
+   "1j6dwgby4g3p3lz7zkss32ghr45zpdidrg8xvazvn91lqxv25p09"))
 
 (define-public isl
   (package
-- 
1.7.9.5



pgpWWz_IJN7gx.pgp
Description: PGP signature


Re: Important libffi bug fix for MIPS N32

2013-10-27 Thread Nikita Karetnikov
> This line is:

>   ASSERT (st1.st_ctime < st2.st_ctime
>   || (st1.st_ctime == st2.st_ctime
>   && get_stat_ctime_ns (&st1) < get_stat_ctime_ns (&st2)));

> (See 
> .)

> Could it have something to do with nanosecond-resolution timestamp
> support in the kernel that’s running, or in the underlying file system?

Mark suggested to try again.  I retried, and it passed all 295 tests.
Should I test anything else?


pgpbeaT4Oo8TZ.pgp
Description: PGP signature


Re: [PATCH] gnu: cmake: Bump to 2.8.12

2013-10-24 Thread Nikita Karetnikov
> Could you apply this patch and try to build lapack ?

Thanks, it works.

@ build-succeeded /nix/store/wyzcbhijr8ibk2rn3rxiiyq2hbrfrwqr-lapack-3.4.2.drv -
/nix/store/gfzgj7ycqc1j8y094mma77ck4zbzvkf3-lapack-3.4.2


pgpVFYua9rj_k.pgp
Description: PGP signature


Re: LAPACK: tests fail; non-free files

2013-10-24 Thread Nikita Karetnikov
> I would suggest to add lapack only after the fortran compiler is in
> master.

Sure.  But I won’t push the compiler without talking to Ludo.

> You might wish to put the variable into maths.scm.

OK.

> Debian removes them:
>
> http://ftp-master.metadata.debian.org/changelogs/main/l/lapack/unstable_copyright
> So does Fedora:
>
> https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130325/987558.html
> I would suggest to do the same; if you feel reporting it, it would be interes-
> ting to see how upstream reacts.

It was already reported [1].  I’ll remove all non-free files.

[1] http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01383.html


pgpmkgw0sSrg3.pgp
Description: PGP signature


Re: Important libffi bug fix for MIPS N32

2013-10-23 Thread Nikita Karetnikov
(Not sure why my previous messages weren’t signed.)

>> Now, should I test the mentioned fix?

> Yes, please do!

The coreutils package fails to build:

FAIL: test-fchownat (exit: 134)
===

test-chown.h:193: assertion failed

[…]

==
1 of 295 tests failed
(22 tests were not run)
See gnulib-tests/test-suite.log
Please report to bug-coreut...@gnu.org
==
make[6]: *** [test-suite.log] Error 1
make[6]: Leaving directory 
`/tmp/nix-build-coreutils-8.21.drv-0/coreutils-8.21/gnulib-tests'
make[5]: *** [check-TESTS] Error 2
make[5]: Leaving directory 
`/tmp/nix-build-coreutils-8.21.drv-0/coreutils-8.21/gnulib-tests'
make[4]: *** [check-am] Error 2
make[4]: Leaving directory 
`/tmp/nix-build-coreutils-8.21.drv-0/coreutils-8.21/gnulib-tests'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory 
`/tmp/nix-build-coreutils-8.21.drv-0/coreutils-8.21/gnulib-tests'
make[2]: *** [check] Error 2
make[2]: Leaving directory 
`/tmp/nix-build-coreutils-8.21.drv-0/coreutils-8.21/gnulib-tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-coreutils-8.21.drv-0/coreutils-8.21'
make: *** [check] Error 2
phase `check' failed after 1756 seconds
builder for `/nix/store/09i57yii00zj9jgwlakfch928ppdkiq7-coreutils-8.21.drv' 
failed with exit code 1
@ build-failed /nix/store/09i57yii00zj9jgwlakfch928ppdkiq7-coreutils-8.21.drv - 
1 builder for `/nix/store/09i57yii00zj9jgwlakfch928ppdkiq7-coreutils-8.21.drv' 
failed with exit code 1
cannot build derivation 
`/nix/store/a1ilh9ml81j1mm645rsp9ha7aqh3c48a-hello-2.8.drv': 1 dependencies 
couldn't be built
guix package: error: build failed: build of 
`/nix/store/a1ilh9ml81j1mm645rsp9ha7aqh3c48a-hello-2.8.drv' failed

Should I provide more information?


pgpNbbomeku_f.pgp
Description: PGP signature


Re: LAPACK: tests fail; non-free files

2013-10-23 Thread Nikita Karetnikov
> (home-page "http://www.gnu.org/software/lapack/";)

Oops, I’ll fix this.


pgpmG10JlJOS3.pgp
Description: PGP signature


LAPACK: tests fail; non-free files

2013-10-23 Thread Nikita Karetnikov
The attached patch requires this one [1].

1. Could anyone explain why the tests fail?

   100% tests passed, 0 tests failed out of 86

   Total Test time (real) = 169.48 sec
   No such file or directory
   Problem running command: ./lapack_testing.py -s -d TESTING
   Problem executing post-test command(s).
   Errors while running CTest
   make: *** [test] Error 8
   phase `check' failed after 169 seconds

   When I sourced environment-variables and ran ‘lapack_testing.py’, it
   didn’t complain.  So it must be something else.  How can I pass the
   verbose flag to CMake?

2. These files are not free:

   lapacke/example/example_DGESV_rowmajor.c
   lapacke/example/example_ZGESV_rowmajor.c

   Should I report upstream or simply remove them?

[1] https://lists.gnu.org/archive/html/guix-devel/2013-10/txtEV9ZKOlmFQ.txt

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov 
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (gnu packages lapack)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages python))

(define-public lapack
  (package
(name "lapack")
(version "3.4.2")
(source
 (origin
  (method url-fetch)
  (uri (string-append "http://www.netlib.org/lapack/lapack-";
  version ".tgz"))
  (sha256
   (base32
"1w7sfm7fi2kyx1fzgbm22193l8c2d53m8q1ibhvfy6m5v9k0"
(build-system cmake-build-system)
(home-page "http://www.gnu.org/software/lapack/";)
(inputs `(("fortran" ,gcc-fortran-4.8)
  ("python" ,python-2)))
(arguments `(#:modules ((guix build cmake-build-system)
(guix build utils)
(srfi srfi-1))
 #:phases (alist-cons-before
   'check 'patch-python
   (lambda* (#:key inputs #:allow-other-keys)
 (let ((python (assoc-ref inputs "python")))
   (substitute* "lapack_testing.py"
 (("/usr/bin/env python") python
   %standard-phases)))
(synopsis "Library for numerical linear algebra")
(description
 "LAPACK is a Fortran 90 library for solving the most commonly occurring
problems in numerical linear algebra.")
(license (bsd-style "file://LICENSE"
"See LICENSE in the distribution."


pgpY_vo54CXlk.pgp
Description: PGP signature


Re: Important libffi bug fix for MIPS N32

2013-10-22 Thread Nikita Karetnikov
> A failing test in glib alerted me to a bug in libffi on MIPS N32.  I've
> pushed a fix[*] to the 'loongson' branch.  It will require rebuilding
> quite a few packages, so I recommend aborting whatever builds you have
> running, and pulling the latest 'loongson' before continuing.

I successfully built ‘hello’ after switching to ext3.  Now, should I
test the mentioned fix?


pgpDxZOsR6pbF.pgp
Description: PGP signature


Re: Preliminary MIPS N32 port now available

2013-10-19 Thread Nikita Karetnikov
First, I upgraded and tried again, but got the same error.  Then, I
defined SQLITE_DISABLE_DIRSYNC and got this one:

stripping binaries in 
"/nix/store/1n843qz1psmp3bvx6hk1gj3mp1akdama-glibc-intermediate-2.18/sbin" with 
"strip" and flags ("--strip-debug")
debugging output written to 
"/nix/store/zcml8660gkcd84laj3h1yr30vz4dvgxq-glibc-intermediate-2.18-debug" 
using "objcopy"
phase `strip' succeeded after 652 seconds
guix package: error: build failed: cannot close compressed log file (BZip2 
error = -6)

I couldn’t find anything on the web.  Do you have any ideas?  If not,
I’ll switch to ext3.


pgpUWanH5mMql.pgp
Description: PGP signature


GCC front-ends (was: GFortran can’t find system headers)

2013-10-19 Thread Nikita Karetnikov
> I guess this triggers a complete rebuild, right?  (That means it would
> go in ‘core-updates’.)

> Using the ‘substitute-keyword-arguments’ hack as in base.scm would allow
> you to avoid that.

> Also, the ‘origin’ thing should be factorized:

>   (define (gcc-source version)
> (origin ...))

> It’s good that you’re tackling this!  Then we can also build the
> Objective-C front-end, and then start GNUstepping.

What do you think about the attached diff?  Is there a way to avoid
multiple ‘map’s?

What about the names of the packages?  For example, ‘gcc-fortran’ is
usually called ‘gfortran’, ‘gcc-go’ is called ‘gccgo’, etc.  Should we
use these names?  How should we call ‘gcc-objc’, then?

If you want to test any of the front-ends, don’t forget to set
LIBRARY_PATH and LD_LIBRARY_PATH, like so:

$ export LIBRARY_PATH=/nix/store/wmaxqx3p658v2yqjv00mss2shvn23h7a-glibc-2.18/lib
$ export 
LD_LIBRARY_PATH=/nix/store/kvhg0fszagsx5y80sq79bkmb7yqvjfmd-gcc-go-4.8.1/lib

Notes:

1. The Go front-end requires ‘-g’ (see [1]).

2. “GFORTRAN guesses the source code formatting based on the file
   extension. For .f90 files, it will assume it's working with FORTRAN
   90 source code and use free formatting rules. For .f and .for files,
   it will assume the file is F77 source code and use fixed formatting
   rules.” [2]

3. If you want to compile Objective-C or Objective-C++, pass ‘-x ’
   to ‘gcc’.

4. The Ada front-end requires GNAT [3] (see [4]).

5. Not sure why the Java front-end fails:

   libtool: link: ( cd ".libs" && rm -f "libquadmath.la" && ln -s 
"../libquadmath.la" "libquadmath.la" )
   make[3]: Leaving directory 
`/tmp/nix-build-gcc-java-4.8.1.drv-0/build/i686-pc-linux-gnu/libquadmath'
   make[2]: Leaving directory 
`/tmp/nix-build-gcc-java-4.8.1.drv-0/build/i686-pc-linux-gnu/libquadmath'
   make[1]: Leaving directory `/tmp/nix-build-gcc-java-4.8.1.drv-0/build'
   make: *** [all] Error 2
   phase `build' failed after 2229 seconds
   note: keeping build directory `/tmp/nix-build-gcc-java-4.8.1.drv-0'
   builder for `/nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java-4.8.1.drv' 
failed with exit code 1
   @ build-failed 
/nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java-4.8.1.drv - 1 builder for 
`/nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java-4.8.1.drv' failed with 
exit code 1
   guix build: error: build failed: build of 
`/nix/store/wlqwyy9k9mbl3wpy9jq08k91qq23f4kp-gcc-java-4.8.1.drv' failed

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57194
[2] http://ubuntuforums.org/showthread.php?t=853105
[3] https://www.gnu.org/software/gnat/
[4] http://gcc.gnu.org/ml/gcc/2007-11/msg00091.html

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index cececca..c2742fb 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -26,6 +26,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (ice-9 regex))
 
@@ -211,6 +212,41 @@ Go.  It also includes standard libraries for these languages.")
   (base32
"04sqn0ds17ys8l6zn7vyyvjz1a7hsk4zb0381vlw9wnr7az48nsl"))
 
+(define (custom-gcc gcc name languages)
+  (package (inherit gcc)
+(name name)
+(arguments
+ (substitute-keyword-arguments (package-arguments gcc)
+   ((#:configure-flags flags)
+(map (lambda (x)
+   (if (list? x)
+   (map (lambda (y)
+  (if (equal? "--enable-languages=c,c++" y)
+  (string-append "--enable-languages="
+ languages)
+  y))
+x)
+   x))
+ flags))
+
+;; (define-public gcc-ada-4.8
+;;   (custom-gcc gcc-4.8 "gcc-ada" "ada"))
+
+(define-public gcc-fortran-4.8
+  (custom-gcc gcc-4.8 "gcc-fortran" "fortran"))
+
+(define-public gcc-go-4.8
+  (custom-gcc gcc-4.8 "gcc-go" "go"))
+
+;; (define-public gcc-java-4.8
+;;   (custom-gcc gcc-4.8 "gcc-java" "java"))
+
+(define-public gcc-objc-4.8
+  (custom-gcc gcc-4.8 "gcc-objc" "objc"))
+
+(define-public gcc-objc++-4.8
+  (custom-gcc gcc-4.8 "gcc-objc++" "obj-c++"))
+
 (define-public isl
   (package
 (name "isl")


pgpkXvlDm4gbN.pgp
Description: PGP signature


Re: Preliminary MIPS N32 port now available

2013-10-18 Thread Nikita Karetnikov
> I still think it's probably a good idea to switch away from JFS, since
> you're likely to run into other problems like this,

I see this as an opportunity to report problems.

> but if you really
> want to stick with JFS, compiling a newer version of SQLite and then
> reconfiguring and rebuilding Guix might get you past this immediate
> problem.

I think I’ll try the new version of SQLite.  That should be faster.


pgpz5jizma6_T.pgp
Description: PGP signature


Re: Preliminary MIPS N32 port now available

2013-10-18 Thread Nikita Karetnikov
> I think your best option is to switch back to ext3 or ext4.

Thanks, will do.

I was told to switch to JFS to avoid ext-specific issues; I’m laughing
out loud now, haha.


pgpQ6EKF8J1gg.pgp
Description: PGP signature


Re: Preliminary MIPS N32 port now available

2013-10-18 Thread Nikita Karetnikov
I tried to build ‘hello’ twice, and the following error occurred each
time:

stripping binaries in 
"/nix/store/hl8khv4qip9nwbm1qm93irbz9has4wrd-gcc-cross-boot0-4.7.3/bin" with 
"strip" and flags ("--strip-debug")
phase `strip' succeeded after 17 seconds
error (ignored): aborting transaction: cannot rollback - no transaction is 
active
guix package: error: build failed: committing transaction: disk I/O error

I guess something is wrong with my system, what should I check?


pgp3EYnJ2dwVW.pgp
Description: PGP signature


Re: Preliminary MIPS N32 port now available

2013-10-18 Thread Nikita Karetnikov
> If you own a 64-bit MIPS system (including Loongson 2F), are willing to
> build everything on your own machine, and would like to try out the
> preliminary port of Guix to MIPS N32, the "loongson" branch of the Guix
> git repo is ready for your early testing.

> If you run into a 'match-error', try "make clean".  This is needed
> because of recent unrelated changes on the master branch.

> Please let us know how it goes!

Thanks for your work, Mark.  I’ll try and report back.


pgpksVd_kLTf2.pgp
Description: PGP signature


Re: GFortran can’t find system headers

2013-10-17 Thread Nikita Karetnikov
> Instead, what should do is preserve the arguments; the value associated
> with #:configure-flags should be changed to replace any
> --enable-languages=.* flag with yours.  See ‘gcc-boot0’ in base.scm for
> how to do that.

Are you talking about the ‘substitute-keyword-arguments’ part?

> Alternately, you could turn the current ‘gcc-4.8’ definition into a
> ‘make-gcc-4.8’ procedure like this:

>   (define* (make-gcc-4.8 #:key languages)
> (package
>...

>#:configure-flags ... ,(string-join languages ",")

>...))

>   (define gcc-4.8
> (make-gcc-4.8 #:languages '("c" "c++")))

> That would probably be easier to work with.

I don’t like the above version because it doesn’t allow to choose the
version of GCC.  I’ve attached my version, how can I make it look
better?

Also, ‘/nix/store/nxpzxlvg5z5qq10wzxrzk9hjyhxyicxq-gfortran-4.8.1/bin’
contains these programs:

c++ gcc-ranlib i686-pc-linux-gnu-gcc-4.8.1
cpp gcov   i686-pc-linux-gnu-gcc-ar
g++ gfortran   i686-pc-linux-gnu-gcc-nm
gcc i686-pc-linux-gnu-c++  i686-pc-linux-gnu-gcc-ranlib
gcc-ar  i686-pc-linux-gnu-g++  i686-pc-linux-gnu-gfortran
gcc-nm  i686-pc-linux-gnu-gcc

Are C++ and C-related programs supposed to be there?

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index cececca..46c4804 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -47,7 +47,7 @@ where the OS part is overloaded to denote a specific ABI---into GCC
  ;; TODO: Add `armel.*gnueabi', `hf', etc.
  '(
 
-(define-public gcc-4.7
+(define* (inherit-gcc name* version* source* #:key (languages '("c" "c++")))
   (let* ((stripped? #t)   ; TODO: make this a parameter
  (maybe-target-tools
   (lambda ()
@@ -68,13 +68,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC
 ;; contents of (maybe-target-tools).
 (list 'quasiquote
   (append
-   '("--enable-plugin"
- "--enable-languages=c,c++"
+   `("--enable-plugin"
+ ,(string-append "--enable-languages="
+ (string-join languages ","))
  "--disable-multilib"
 
- "--with-local-prefix=/no-gcc-local-prefix"
+ "--with-local-prefix=/no-gcc-local-prefix")
 
- ,(let ((libc (assoc-ref %build-inputs "libc")))
+   '(,(let ((libc (assoc-ref %build-inputs "libc")))
 (if libc
 (string-append "--with-native-system-header-dir=" libc
"/include")
@@ -88,15 +89,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
 
(maybe-target-tools))
 (package
-  (name "gcc")
-  (version "4.7.3")
-  (source (origin
-   (method url-fetch)
-   (uri (string-append "mirror://gnu/gcc/gcc-"
-   version "/gcc-" version ".tar.bz2"))
-   (sha256
-(base32
- "1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g"
+  (name name*)
+  (version version*)
+  (source source*)
   (build-system gnu-build-system)
   (inputs `(("gmp" ,gmp)
 ("mpfr" ,mpfr)
@@ -200,6 +195,17 @@ Go.  It also includes standard libraries for these languages.")
   (license gpl3+)
   (home-page "http://gcc.gnu.org/";
 
+(define-public gcc-4.7
+  (let ((version "4.7.3"))
+(inherit-gcc "gcc" version
+ (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/gcc/gcc-"
+  version "/gcc-" version ".tar.bz2"))
+  (sha256
+   (base32
+"1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g"))
+
 (define-public gcc-4.8
   (package (inherit gcc-4.7)
 (version "4.8.1")
@@ -211,6 +217,18 @@ Go.  It also includes standard libraries for these languages.")
   (base32
"04sqn0ds17ys8l6zn7vyyvjz1a7hsk4zb0381vlw9wnr7az48nsl"))
 
+(define-public gfortran-4.8
+  (let ((version "4.8.1"))
+(inherit-gcc "gfortran" version
+ (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/gcc/gcc-"
+  version "/gcc-" version ".tar.bz2"))
+  (sha256
+   (base32
+"04sqn0ds17ys8l6zn7vyyvjz1a7hsk4zb0381vlw9wnr7az48nsl")))
+ #:languages '("fortran"
+
 (define-public isl
   (package
 (name "isl")


pgpHyNQzdGDGR.pgp
Description: PGP signature


GFortran can’t find system headers

2013-10-14 Thread Nikita Karetnikov
I’m trying to package APL, which requires LAPACK, which requires
Fortran.

Here’s my attempt to add the last one:

(define-public gfortran-4.8
  (package (inherit gcc-4.8)
(name "gfortran")
(arguments `(#:configure-flags '("--enable-languages=fortran")

I get the following error while trying to build it:

The directory that should contain system headers does not exist:
  /usr/include

Note that GFortran inherits GCC 4.8, which has these lines:

  (native-search-paths
   (list (search-path-specification
  (variable "CPATH")
  (directories '("include")))
 (search-path-specification
  (variable "LIBRARY_PATH")
  (directories '("lib" "lib64")

Then why does the error appear?


pgpLro6PUOiZF.pgp
Description: PGP signature


[PATCH] doc: Improve the copyright notice.

2013-10-11 Thread Nikita Karetnikov
Karl, thank you so much.  I hope it’s OK now.

Ludo, what do you think?

From a384d93077e1dab066e0761a056b52fe1ba6dfd6 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Fri, 11 Oct 2013 15:52:27 +
Subject: [PATCH] doc: Improve the copyright notice.

---
 doc/guix.texi |   55 +++
 1 file changed, 15 insertions(+), 40 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ceb8046..a78000f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8,7 +8,19 @@
 @c %**end of header
 
 @include version.texi
-@set YEARS 2012, 2013
+
+@copying
+Copyright @copyright{} 2012, 2013 Ludovic Court@`es@*
+Copyright @copyright{} 2013 Andreas Enge@*
+Copyright @copyright{} 2013 Nikita Karetnikov
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
+copy of the license is included in the section entitled ``GNU Free
+Documentation License''.
+@end copying
 
 @dircategory Package management
 @direntry
@@ -22,7 +34,7 @@
 @titlepage
 @title GNU Guix Reference Manual
 @subtitle Using the GNU Guix Functional Package Manager
-@author Ludovic Courtès
+@author Ludovic Court@`es
 @author Andreas Enge
 @author Nikita Karetnikov
 
@@ -31,34 +43,9 @@
 Edition @value{EDITION} @*
 @value{UPDATED} @*
 
-Copyright @copyright{} @value{YEARS} Ludovic Court@`es, Andreas Enge, Nikita Karetnikov
-
-@ifinfo
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
-copy of the license is included in the section entitled ``GNU Free
-Documentation License''.
-@end quotation
-@end ifinfo
-
+@insertcopying
 @end titlepage
 
-@copying
-This manual documents GNU Guix version @value{VERSION}.
-
-Copyright @copyright{} @value{YEARS} Ludovic Courtès
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
-copy of the license is included in the section entitled ``GNU Free
-Documentation License.''
-@end copying
-
 @contents
 
 @c *
@@ -68,18 +55,6 @@ Documentation License.''
 This document describes GNU Guix version @value{VERSION}, a functional
 package management tool written for the GNU system.
 
-
-@quotation
-Copyright @copyright{} @value{YEARS} Ludovic Courtès, Andreas Enge, Nikita Karetnikov
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
-copy of the license is included in the section entitled ``GNU Free
-Documentation License.''
-@end quotation
-
 @menu
 * Introduction::What is Guix about?
 * Installation::Installing Guix.
-- 
1.7.9.5



pgpiBq87xQouN.pgp
Description: PGP signature


Re: [PATCH] gnu: Add GNU acct.

2013-10-11 Thread Nikita Karetnikov
> Yes, please!

Done.  By the way, thanks for showing the head of the file, it’s really
helpful.

> (Make sure ‘make sync-descriptions’ doesn’t complain.)

There are other packages that complain.  I’m willing to help with this.
Which should be updated in ‘core-updates’?  Will it be enough to run
‘guix build coreutils -n‘ (as suggested here [1]) to check?

[1] https://lists.gnu.org/archive/html/bug-guix/2013-03/msg00041.html


pgpAIHvAdNNNs.pgp
Description: PGP signature


Re: [PATCH] doc: Add 'copyrights' and 'license' macros.

2013-10-10 Thread Nikita Karetnikov
>>> Sorry, I don't understand what problem you're trying to solve.
>>> Why are you separating copyright text and license text?  

I don’t know how to keep the @ifinfo trick (see the attachment) without
separating them.  Maybe the @ifinfo part should be removed.

>>> Can you send me the whole file (beginning of it, anyway)?
>>> The diff is hard to read.

Attached.

>> And yeah, there could be a single macro since the two always go
>> together.

> Why is a macro needed at all?
> (vs. just using text inside @copying).

In the document, nearly the same (more on that later) copyright notice
is repeated three times.  A new contributor would have to adjust each
notice, which is error-prone.

Now, I said “nearly” because the “Copyright” lines are different, but
they should be identical.

\input texinfo
@c -*-texinfo-*-

@c %**start of header
@setfilename guix.info
@documentencoding UTF-8
@settitle GNU Guix Reference Manual
@c %**end of header

@include version.texi
@set YEARS 2012, 2013

@dircategory Package management
@direntry
* guix: (guix).   Guix, the functional package manager.
* guix package: (guix)Invoking guix package
  Managing packages with Guix.
* guix build: (guix)Invoking guix build
  Building packages with Guix.
@end direntry

@titlepage
@title GNU Guix Reference Manual
@subtitle Using the GNU Guix Functional Package Manager
@author Ludovic Courtès
@author Andreas Enge
@author Nikita Karetnikov

@page
@vskip 0pt plus 1filll
Edition @value{EDITION} @*
@value{UPDATED} @*

Copyright @copyright{} @value{YEARS} Ludovic Court@`es, Andreas Enge, Nikita 
Karetnikov

@ifinfo
@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
copy of the license is included in the section entitled ``GNU Free
Documentation License''.
@end quotation
@end ifinfo

@end titlepage

@copying
This manual documents GNU Guix version @value{VERSION}.

Copyright @copyright{} @value{YEARS} Ludovic Courtès

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
copy of the license is included in the section entitled ``GNU Free
Documentation License.''
@end copying

@contents

@c *
@node Top
@top GNU Guix

This document describes GNU Guix version @value{VERSION}, a functional
package management tool written for the GNU system.


@quotation
Copyright @copyright{} @value{YEARS} Ludovic Courtès, Andreas Enge, Nikita 
Karetnikov

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
copy of the license is included in the section entitled ``GNU Free
Documentation License.''
@end quotation


pgpcBeSFTlxGX.pgp
Description: PGP signature


Re: a2ps: manpages fail to build

2013-10-10 Thread Nikita Karetnikov
> It invokes /missing instead of $top_srcdir/build-aux/missing.

>> I added ‘help2man’, but it didn’t help.

> Could you check the configure log for clues?

> Also, can you check the makefiles to see how it’s supposed to build the
> man pages?

It just needed Perl.

>>> Rather use (substitute* (find-files "." ".*") ...) if that works.

> Too much time?  But it succeeds?

Sorry, I was thinking about a different command.  Yours fails with
“string contains #\nul character.”  May I stick to the list of files
instead of using ‘find-files’?

Now, 20 of 25 tests failed.  Tests are written in Ksh, not Bash, so I’ll
try to package it first.


pgpeqdpNkxvF0.pgp
Description: PGP signature


[PATCH] gnu: Add GNU acct.

2013-10-10 Thread Nikita Karetnikov
May I push this patch?

From 20809203713f119ffaa0fb6d372b73cce5d1cf51 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Thu, 10 Oct 2013 10:32:15 +
Subject: [PATCH] gnu: Add GNU acct.

* gnu/packages/acct.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
 gnu-system.am |1 +
 gnu/packages/acct.scm |   44 
 2 files changed, 45 insertions(+)
 create mode 100644 gnu/packages/acct.scm

diff --git a/gnu-system.am b/gnu-system.am
index 37a174c..0132187 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -22,6 +22,7 @@
 
 GNU_SYSTEM_MODULES =\
   gnu/packages.scm\
+  gnu/packages/acct.scm\
   gnu/packages/acl.scm\
   gnu/packages/algebra.scm			\
   gnu/packages/apr.scm\
diff --git a/gnu/packages/acct.scm b/gnu/packages/acct.scm
new file mode 100644
index 000..e892fd8
--- /dev/null
+++ b/gnu/packages/acct.scm
@@ -0,0 +1,44 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013 Nikita Karetnikov 
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages acct)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu))
+
+(define-public acct
+  (package
+(name "acct")
+(version "6.6.1")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/acct/acct-"
+  version ".tar.gz"))
+  (sha256
+   (base32
+"1jzz601cavml7894fjalw661gz28ia35002inw990agr3rhiaiam"
+(build-system gnu-build-system)
+(home-page "https://gnu.org/software/acct/";)
+(synopsis "Standard login and process accounting utilities")
+(description
+ "GNU acct provides a means for system administrators to determine
+system usage patterns.  It provides information on, for example, connections,
+programs executed, and system resources used.")
+(license gpl3+)))
-- 
1.7.9.5



pgpI7o0UdziSA.pgp
Description: PGP signature


Re: a2ps: manpages fail to build

2013-10-09 Thread Nikita Karetnikov
> There’s a bug in its build system, but most likely it wants ‘help2man’
> (as native input.)

Could you expand on the bug part?

I added ‘help2man’, but it didn’t help.

> Rather use (substitute* (find-files "." ".*") ...) if that works.

It takes too much time, or I’m doing something wrong.

> Now description have to be taken from pkgdescr.txt (run ‘make
> sync-descriptions’ to get the right text.)

I should package more, thanks for pointing this out.


pgp90WSx07yaJ.pgp
Description: PGP signature


a2ps: manpages fail to build

2013-10-09 Thread Nikita Karetnikov
I’m getting the following error:

make[2]: Entering directory `/tmp/nix-build-a2ps-4.14.drv-7/a2ps-4.14/man'
Updating man page fixps.1
Updating man page psmandup.1
Updating man page card.1
/nix/store/vw6j6hcbcg2siv93v66d7i3fswyj116k-bash-4.2/bin/bash: line 3: 
/missing: No such file or directory
/nix/store/vw6j6hcbcg2siv93v66d7i3fswyj116k-bash-4.2/bin/bash: line 3: 
/missing: No such file or directory
make[2]: *** [card.1] Error 1
make[2]: *** Waiting for unfinished jobs
make[2]: *** [fixps.1] Error 1
Updating man page psset.1
/nix/store/vw6j6hcbcg2siv93v66d7i3fswyj116k-bash-4.2/bin/bash: line 3: 
/missing: No such file or directory
/nix/store/vw6j6hcbcg2siv93v66d7i3fswyj116k-bash-4.2/bin/bash: line 3: 
/missing: No such file or directory
make[2]: *** [psset.1] Error 1
make[2]: *** [psmandup.1] Error 1
make[2]: Leaving directory `/tmp/nix-build-a2ps-4.14.drv-7/a2ps-4.14/man'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-a2ps-4.14.drv-7/a2ps-4.14'
make: *** [all] Error 2
phase `build' failed after 10 seconds
note: keeping build directory `/tmp/nix-build-a2ps-4.14.drv-7'
builder for `/nix/store/4dfd0qglsh76cbfs2a539j38bndkm5zj-a2ps-4.14.drv' failed 
with exit code 1
@ build-failed /nix/store/4dfd0qglsh76cbfs2a539j38bndkm5zj-a2ps-4.14.drv - 1 
builder for `/nix/store/4dfd0qglsh76cbfs2a539j38bndkm5zj-a2ps-4.14.drv' failed 
with exit code 1
guix build: error: build failed: build of 
`/nix/store/4dfd0qglsh76cbfs2a539j38bndkm5zj-a2ps-4.14.drv' failed

What’s wrong?

Also, I don’t like the synopsis from Womb, so I used my own.  Is it OK?

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov 
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (gnu packages a2ps)
  #:use-module (guix licenses)
  #:use-module (gnu packages gperf)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu))

(define-public a2ps
  (package
(name "a2ps")
(version "4.14")
(source
 (origin
  (method url-fetch)
  (uri (string-append "mirror://gnu/a2ps/a2ps-"
  version ".tar.gz"))
  (sha256
   (base32
"195k78m1h03m961qn7jr120z815iyb93gwi159p1p9348lyqvbpk"
(build-system gnu-build-system)
(inputs
 `(("gperf" ,gperf)))
(arguments
 '(#:phases (alist-cons-before
 'build 'pre-build
 (lambda _
   (substitute* '("contrib/card.in"
  "contrib/fixps.in"
  "contrib/psset.m4"
  "contrib/fixps.m4"
  "contrib/fixbb.m4"
  "contrib/psmandup.in"
  "contrib/psmandup.m4"
  "contrib/card.m4"
  "contrib/psset.in"
  "afm/make_fonts_map.sh"
  "tests/backup.tst"
  "tests/defs.in"
  "tests/tstfiles/psmandup"
  "tests/gps-ref/psmandup.ps"
  "tests/ps-ref/psmandup.ps"
  "tests/view-diff"
  "tests/styles.tst")
 (("/bin/rm") (which "rm"
 %standard-phases)))
(home-page "https://gnu.org/software/a2ps/";)
(synopsis "Convert any file to PostScript")
(description
 "GNU a2ps is a filter which generates PostScript from various formats,
with pretty-printing features, has strong support for many alphabets, and
customizable layout.")
(license gpl3+)))


pgpHF_48PQ7S9.pgp
Description: PGP signature


[PATCH] doc: Add 'copyrights' and 'license' macros.

2013-10-09 Thread Nikita Karetnikov
What do you think about this change?  I used ‘itemize’ to avoid
extraneous blank lines.  The only downside is that the indentation of
the ‘copyrights’ macro slightly differs from the surrounding text.

Karl, do you know a better way?

From b8867a4956af60065200c3b89604108cd7e46e83 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Wed, 9 Oct 2013 10:37:34 +
Subject: [PATCH] doc: Add 'copyrights' and 'license' macros.

* doc/guix.texi (YEARS): Remove it.
  (copyrights, license): Add these macros and use them.
---
 doc/guix.texi |   39 ---
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ceb8046..7408be0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8,7 +8,6 @@
 @c %**end of header
 
 @include version.texi
-@set YEARS 2012, 2013
 
 @dircategory Package management
 @direntry
@@ -31,16 +30,28 @@
 Edition @value{EDITION} @*
 @value{UPDATED} @*
 
-Copyright @copyright{} @value{YEARS} Ludovic Court@`es, Andreas Enge, Nikita Karetnikov
+@macro copyrights
+@itemize @w{}
+@item Copyright @copyright{} 2012, 2013 Ludovic Court@`es
+@item Copyright @copyright{} 2013 Andreas Enge
+@item Copyright @copyright{} 2013 Nikita Karetnikov
+@end itemize
+@end macro
 
-@ifinfo
-@quotation
+@macro license
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
 copy of the license is included in the section entitled ``GNU Free
-Documentation License''.
+Documentation License.''
+@end macro
+
+@copyrights
+
+@ifinfo
+@quotation
+@license
 @end quotation
 @end ifinfo
 
@@ -49,14 +60,9 @@ Documentation License''.
 @copying
 This manual documents GNU Guix version @value{VERSION}.
 
-Copyright @copyright{} @value{YEARS} Ludovic Courtès
+@copyrights
 
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
-copy of the license is included in the section entitled ``GNU Free
-Documentation License.''
+@license
 @end copying
 
 @contents
@@ -70,14 +76,9 @@ package management tool written for the GNU system.
 
 
 @quotation
-Copyright @copyright{} @value{YEARS} Ludovic Courtès, Andreas Enge, Nikita Karetnikov
+@copyrights
 
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
-copy of the license is included in the section entitled ``GNU Free
-Documentation License.''
+@license
 @end quotation
 
 @menu
-- 
1.7.9.5



pgppK6IwKINj6.pgp
Description: PGP signature


  1   2   3   >