HTTP and FTP proxies for guix package / guix-daemon

2015-06-08 Thread 韋嘉誠
When running guix in a VM I usually run into various connectivity
problems. VirtualBox on Windows seems to do some helpful FTP
transparent proxying which breaks everything and in another case I
don't have internet connectivity due to how the VM is set up.

Is there a way to make guix-daemon talk to a proxy when downloading
substitutions and source archives?

I tried starting it with http_proxy set, but I'm not sure it responded
to it (as I'm writing this ISTR having read and tested that an updated
guix does this right).

This is only for http, though. Lots of source archives get fetched
over ftp, is there some way to make it get ftp over a proxy too?



[PATCH] gnu: make-bootstrap: Remove unneeded configure flag from %gcc-static.

2015-06-08 Thread Manolis Ragkousis
With this commit "guix build bootstrap-tarballs --target=i686-pc-gnu" works.
From 53582d2cdaf3fb69500a24afe3ed4f58cfbffcea Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Tue, 9 Jun 2015 01:14:03 +0300
Subject: [PATCH] gnu: make-bootstrap: Remove unneeded configure flag from
 %gcc-static.

With this commit "guix build bootstrap-tarballs --target=i686-pc-gnu" works.

* gnu/packages/make-bootstrap.scm (%gcc-static): Remove unneeded
  --disable-decimal-float.
---
 gnu/packages/make-bootstrap.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 88fad0e..3d43421 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -427,8 +427,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
"--disable-libitm"
"--disable-libgomp"
"--disable-libssp"
-   "--disable-libquadmath"
-   "--disable-decimal-float")
+   "--disable-libquadmath")
   (remove (cut string-match "--(.*plugin|enable-languages)" <>)
   ,flags)))
 ((#:phases phases)
-- 
2.4.2



Re: MIPS bootstrap problem in core-updates

2015-06-08 Thread Mark H Weaver
Mark H Weaver  writes:

> l...@gnu.org (Ludovic Courtès) writes:
>
>> This (lightly tested) patch may work:
>>
>> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
>> index ab16660..6dd4d55 100644
>> --- a/gnu/packages/commencement.scm
>> +++ b/gnu/packages/commencement.scm
>> @@ -139,6 +139,19 @@
>>   (arguments
>>`(#:guile ,%bootstrap-guile
>>  #:implicit-inputs? #f
>> +
>> +#:phases (alist-cons-after
>> +  'install 'add-gas-symlink
>> +  (lambda* (#:key outputs #:allow-other-keys)
>> +;; The cross-gcc invokes 'as', not the cross-'as', so 
>> add
>> +;; an 'as' symlink.
>> +(let ((out (assoc-ref outputs "out")))
>> +  (with-directory-excursion (string-append out "/bin")
>> +(symlink (string-append ,(boot-triplet) "-as")
>> + "as")
>> +#t)))
>> +  %standard-phases)
>> +
>>  ,@(substitute-keyword-arguments (package-arguments binutils)
>>  ((#:configure-flags cf)
>>   `(cons ,(string-append "--target=" (boot-triplet))
>> @@ -274,10 +287,7 @@
>>;; 2nd stage inputs.
>>`(("gcc" ,gcc-boot0)
>>  ("binutils-cross" ,binutils-boot0)
>> -
>> -;; Keep "binutils" here because the cross-gcc invokes `as', not the
>> -;; cross-`as'.
>> -,@%boot0-inputs))
>> +,@(alist-delete "binutils" %boot0-inputs)))
>>  
>>  (define glibc-final-with-bootstrap-bash
>>;; The final libc, "cross-built".  If everything went well, the resulting
>
> Sounds good.
>
>> Could you try it on MIPS, on top of ‘core-updates’?
>
> I tried this and it turned out that 'ld' was also needed.  I added an
> 'ld' symlink and then discovered than 'ar' was needed as well.  I'm now
> trying it with symlinks for _all_ of the programs in binutils' /bin
> directory.

... and that finally fixed it.  Pushed to core-updates in commit
f8badf151b4d2d966a1ebeba0345dfc9e4564d01.

 Thanks,
   Mark



Re: [PATCH 10/10] gnu: base: Added glibc-for-target macro.

2015-06-08 Thread Manolis Ragkousis
Updated patch as well. It's time to push it to wip-hurd.
From 21fe31fb235c322654959c458f73c5f192efee7c Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Tue, 9 Jun 2015 01:08:55 +0300
Subject: [PATCH] gnu: base: Add glibc-for-target macro.

* gnu/packages/base.scm (glibc): Add macro.
---
 gnu/packages/base.scm | 104 --
 1 file changed, 59 insertions(+), 45 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 64eea3a..5b60e2c 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -43,7 +43,9 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system trivial))
+  #:use-module (guix build-system trivial)
+  #:use-module (ice-9 match)
+  #:export (glibc))
 
 ;;; Commentary:
 ;;;
@@ -430,7 +432,7 @@ store.")
 
 (export make-ld-wrapper)
 
-(define-public glibc
+(define-public glibc/linux
   (package
(name "glibc")
(version "2.21")
@@ -598,6 +600,61 @@ with the Linux kernel.")
(license lgpl2.0+)
(home-page "http://www.gnu.org/software/libc/";)))
 
+(define-public glibc/hurd
+  (package (inherit glibc/linux)
+(name "glibc-hurd")
+(version "2.19")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-";
+  version "-hurd+libpthread-20150515" ".tar.gz"))
+  (sha256
+   (base32
+"0fkmn1kfsbhyrkf1wqqvc47dl5bzflnbcggjjfp5s9c489z916zw"))
+  (patches (list (search-patch "glibc-hurd-libs.patch")
+ (search-patch "libpthread-remove-duplicate.patch")
+
+;; Libc provides , which includes a bunch of Hurd and Mach headers,
+;; so both should be propagated.
+(propagated-inputs `(("gnumach-headers" ,gnumach-headers)
+ ("hurd-headers" ,hurd-headers)
+ ("hurd-minimal" ,hurd-minimal)))
+(native-inputs
+ `(,@(package-native-inputs glibc/linux)
+   ("mig" ,mig)
+   ("perl" ,perl)))
+
+(arguments
+ (substitute-keyword-arguments (package-arguments glibc/linux)
+   ((#:configure-flags original-configure-flags)
+`(append (list "--host=i686-pc-gnu"
+
+   ;; nscd fails to build for GNU/Hurd:
+   ;; .
+   ;; Disable it.
+   "--disable-nscd")
+ (filter (lambda (flag)
+   (not (or (string-prefix? "--with-headers=" flag)
+(string-prefix? "--enable-kernel=" flag
+ ;; Evaluate 'original-configure-flags' in a
+ ;; lexical environment that has a dummy
+ ;; "linux-headers" input, to prevent errors.
+ (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
+,@%build-inputs)))
+   ,original-configure-flags
+
+(define* (glibc-for-target #:optional
+   (target (or (%current-target-system)
+   (%current-system
+  "Return the glibc for TARGET, GLIBC/LINUX for a Linux host or
+GLIBC/HURD for a Hurd host"
+  (match target
+("i686-pc-gnu" glibc/hurd)
+(_ glibc/linux)))
+
+(define-syntax glibc
+  (identifier-syntax (glibc-for-target)))
+
 (define-public glibc-locales
   (package
 (inherit glibc)
@@ -694,49 +751,6 @@ variety of options.  It is an alternative to the shell \"type\" built-in
 command.")
 (license gpl3+))) ; some files are under GPLv2+
 
-(define-public glibc/hurd
-  (package (inherit glibc)
-(name "glibc-hurd")
-(version "2.19")
-(source (origin
-  (method url-fetch)
-  (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-";
-  version "-hurd+libpthread-20150515" ".tar.gz"))
-  (sha256
-   (base32
-"0fkmn1kfsbhyrkf1wqqvc47dl5bzflnbcggjjfp5s9c489z916zw"))
-  (patches (list (search-patch "glibc-hurd-libs.patch")
- (search-patch "libpthread-remove-duplicate.patch")
-
-;; Libc provides , which includes a bunch of Hurd and Mach headers,
-;; so both should be propagated.
-(propagated-inputs `(("gnumach-headers" ,gnumach-headers)
- ("hurd-headers" ,hurd-headers)
- ("hurd-minimal" ,hurd-minimal)))
-(native-inputs
- `(,@(package-native-inputs glibc)
-   ("mig" ,mig)
-   ("perl" ,perl)))
-
-(arguments
- (substitute-keyword-arguments (package-arguments glibc)
-   ((#:configure-flags original-configure-flags)
-`(append (list "--host=i686-pc-gnu"
-
-  

Re: Daemon update again

2015-06-08 Thread Andreas Enge
On Sat, Jun 06, 2015 at 07:41:42PM +0200, Ludovic Courtès wrote:
> Could you run “make V=1”?  Normally DEFAULT_CHROOT_DIRS is defined from
> the command line (see ‘libstore_a_CPPFLAGS’.)

There is no trace of it on the command line:

g++ -DHAVE_CONFIG_H -I. -I./nix  -I./nix -I./nix/libutil -I./nix 
-I./nix/libstore -I./nix/libstore -DNIX_STORE_DIR=\"/gnu/store\" 
-DNIX_DATA_DIR=\"/usr/local/guix/share\" 
-DNIX_STATE_DIR=\"/usr/local/guix/var/guix\" 
-DNIX_LOG_DIR=\"/usr/local/guix/var/log/guix\" 
-DNIX_CONF_DIR=\"/usr/local/guix/etc/guix\" 
-DNIX_LIBEXEC_DIR=\"/usr/local/guix/libexec\" 
-DNIX_BIN_DIR=\"/usr/local/guix/bin\" -DOPENSSL_PATH="\"guix-authenticate\""  
-Wall -std=c++0x   -g -O2 -MT nix/libstore/libstore_a-build.o -MD -MP -MF 
nix/libstore/.deps/libstore_a-build.Tpo -c -o nix/libstore/libstore_a-build.o 
`test -f 'nix/libstore/build.cc' || echo './'`nix/libstore/build.cc
nix/libstore/build.cc: In member function ‘void 
nix::DerivationGoal::startBuilder()’:
nix/libstore/build.cc:1808:91: error: ‘DEFAULT_CHROOT_DIRS’ was not declared in 
this scope
 PathSet dirs = 
tokenizeString(settings.get("build-chroot-dirs", 
string(DEFAULT_CHROOT_DIRS)));

Andreas




Re: Guix binary tarball

2015-06-08 Thread Ludovic Courtès
Alex Kost  skribis:

> Ludovic Courtès (2015-06-07 19:14 +0300) wrote:
>
>> Thomas Schwinge  skribis:
>>
>>> I'm not a fan of extracting tarballs inside populated directories; so I'm
>>> in favor on the suggested change to extract inside a temporary directory,
>>> and then move everything in place as a separate step.
>>
>> OK.  I had come to the conclusion that yes, doing it in two steps is
>> reasonable, but it’s the user’s choice, and I wondered whether
>> describing the additional steps in the manual would make things look
>> more complicated than they are.  WDYT?
>
> I agree with Thomas.  I believe it would be better to split this step.
> (OTOH a user who installs Guix should probably know what to do with a
> tarball without additional documentation)

Done in 5dc4296.

>>> It's very common, but I don't think there's a hard requirement for the
>>> root user's home directory to be /root.  Maybe instead of shipping it in
>>> the tarball, the symbolic link should be created by an explicit command?
>>>
>>> $ sudo ln -sf /var/guix/profiles/per-user/root/guix-profile 
>>> ~root/.guix-profile
>>
>> Yes, why not.  What do people think?
>
> I totally agree, I think there is no need to put "/root" into the
> tarball, and to add this step instead.

Done in 7acd343.

Thanks!

Ludo’.



Re: [PATCH 08/10] gnu: base: Updated glibc-hurd to 2.19 and removed patches.

2015-06-08 Thread Manolis Ragkousis
Actually I merged this patch with the one from [PATCH 09/10] gnu: base:
Remove a multiple definition from libpthread with some changes.

This is the updated patch.
From f4867aa5438bd5c51579aa9cc3ac0227d7eaf211 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Thu, 21 May 2015 16:57:23 +0300
Subject: [PATCH] gnu: base: Updated glibc-hurd to 2.19 and removed patches.

* gnu/packages/base.scm (glibc/hurd): Update to 2.19
* gnu/packages/patches/glibc-hurd-extern-inline.patch: Rename to ...
* gnu/packages/patches/glibc-hurd-libs.patch: ... this and removed a patch.
* gnu/packages/patches/libpthread-glibc-preparation.patch: Remove.
* gnu/packages/patches/libpthread-remove-duplicate.patch: Add
* gnu-system.am (dist_patch_DATA): Add, remove and adapt to renamed file.
---
 gnu-system.am  |   4 +-
 gnu/packages/base.scm  |  40 ++
 .../patches/glibc-hurd-extern-inline.patch |  35 -
 gnu/packages/patches/glibc-hurd-libs.patch |  19 +++
 .../patches/libpthread-glibc-preparation.patch | 146 -
 .../patches/libpthread-remove-duplicate.patch  |  17 +++
 6 files changed, 47 insertions(+), 214 deletions(-)
 delete mode 100644 gnu/packages/patches/glibc-hurd-extern-inline.patch
 create mode 100644 gnu/packages/patches/glibc-hurd-libs.patch
 delete mode 100644 gnu/packages/patches/libpthread-glibc-preparation.patch
 create mode 100644 gnu/packages/patches/libpthread-remove-duplicate.patch

diff --git a/gnu-system.am b/gnu-system.am
index 8b4f703..12f35aa 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -436,9 +436,9 @@ dist_patch_DATA =		\
   gnu/packages/patches/glibc-bootstrap-system.patch		\
   gnu/packages/patches/glibc-ldd-x86_64.patch			\
   gnu/packages/patches/glibc-locales.patch			\
+  gnu/packages/patches/glibc-hurd-libs.patch			\
   gnu/packages/patches/gmp-arm-asm-nothumb.patch		\
   gnu/packages/patches/gnutls-fix-duplicate-manpages.patch	\
-  gnu/packages/patches/glibc-hurd-extern-inline.patch		\
   gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \
   gnu/packages/patches/gobject-introspection-cc.patch		\
   gnu/packages/patches/gobject-introspection-girepository.patch	\
@@ -466,6 +466,7 @@ dist_patch_DATA =		\
   gnu/packages/patches/libevent-dns-tests.patch			\
   gnu/packages/patches/liboop-mips64-deplibs-fix.patch		\
   gnu/packages/patches/libmad-mips-newgcc.patch			\
+  gnu/packages/patches/libpthread-remove-duplicate.patch	\
   gnu/packages/patches/libtheora-config-guess.patch		\
   gnu/packages/patches/libtool-skip-tests.patch			\
   gnu/packages/patches/libtool-skip-tests2.patch		\
@@ -475,7 +476,6 @@ dist_patch_DATA =		\
   gnu/packages/patches/libvpx-vp9-out-of-bounds-access.patch	\
   gnu/packages/patches/linux-libre-libreboot-fix.patch		\
   gnu/packages/patches/lirc-localstatedir.patch			\
-  gnu/packages/patches/libpthread-glibc-preparation.patch	\
   gnu/packages/patches/lm-sensors-hwmon-attrs.patch		\
   gnu/packages/patches/lua51-liblua-so.patch\
   gnu/packages/patches/luajit-no_ldconfig.patch			\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 67bdab4..64eea3a 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -697,18 +697,16 @@ command.")
 (define-public glibc/hurd
   (package (inherit glibc)
 (name "glibc-hurd")
-(version "2.18")
+(version "2.19")
 (source (origin
-  (method git-fetch)
-  (uri (git-reference
-(url "git://git.sv.gnu.org/hurd/glibc")
-(commit "cc94b3cfe65523f980359e5f0e93a26196bda1d3")))
+  (method url-fetch)
+  (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-";
+  version "-hurd+libpthread-20150515" ".tar.gz"))
   (sha256
(base32
-"17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
-  (file-name (string-append name "-" version))
-  (patches (map search-patch
-'("glibc-hurd-extern-inline.patch")
+"0fkmn1kfsbhyrkf1wqqvc47dl5bzflnbcggjjfp5s9c489z916zw"))
+  (patches (list (search-patch "glibc-hurd-libs.patch")
+ (search-patch "libpthread-remove-duplicate.patch")
 
 ;; Libc provides , which includes a bunch of Hurd and Mach headers,
 ;; so both should be propagated.
@@ -717,18 +715,8 @@ command.")
  ("hurd-minimal" ,hurd-minimal)))
 (native-inputs
  `(,@(package-native-inputs glibc)
-   ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
("mig" ,mig)
-   ("perl" ,perl)
-   ("libpthread" ,(origin
-(method git-fetch)
-(uri (git-reference
-  (url "git://git.sv.gnu.org/hurd/libpthread")
-   

Re: [PATCH 08/10] gnu: base: Updated glibc-hurd to 2.19 and removed patches.

2015-06-08 Thread Manolis Ragkousis
Updated patch. Ok to push to wip-hurd?
From ee55055398b8b135d5ba8ac42ef051df606fdc8c Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Thu, 21 May 2015 16:57:23 +0300
Subject: [PATCH] gnu: base: Updated glibc-hurd to 2.19 and removed patches.

* gnu/packages/base.scm (glibc/hurd): Update to 2.19
* gnu/packages/patches/glibc-hurd-extern-inline.patch: Rename to ...
* gnu/packages/patches/glibc-hurd-libs.patch: ... this and removed a patch.
* gnu/packages/patches/libpthread-glibc-preparation.patch: Remove.
* gnu-system.am (dist_patch_DATA): Removed it and adapt to renamed file.
---
 gnu-system.am  |   3 +-
 gnu/packages/base.scm  |  38 ++
 .../patches/glibc-hurd-extern-inline.patch |  35 -
 gnu/packages/patches/glibc-hurd-libs.patch |  19 +++
 .../patches/libpthread-glibc-preparation.patch | 146 -
 5 files changed, 28 insertions(+), 213 deletions(-)
 delete mode 100644 gnu/packages/patches/glibc-hurd-extern-inline.patch
 create mode 100644 gnu/packages/patches/glibc-hurd-libs.patch
 delete mode 100644 gnu/packages/patches/libpthread-glibc-preparation.patch

diff --git a/gnu-system.am b/gnu-system.am
index 8b4f703..f15d4e9 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -436,9 +436,9 @@ dist_patch_DATA =		\
   gnu/packages/patches/glibc-bootstrap-system.patch		\
   gnu/packages/patches/glibc-ldd-x86_64.patch			\
   gnu/packages/patches/glibc-locales.patch			\
+  gnu/packages/patches/glibc-hurd-libs.patch			\
   gnu/packages/patches/gmp-arm-asm-nothumb.patch		\
   gnu/packages/patches/gnutls-fix-duplicate-manpages.patch	\
-  gnu/packages/patches/glibc-hurd-extern-inline.patch		\
   gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \
   gnu/packages/patches/gobject-introspection-cc.patch		\
   gnu/packages/patches/gobject-introspection-girepository.patch	\
@@ -475,7 +475,6 @@ dist_patch_DATA =		\
   gnu/packages/patches/libvpx-vp9-out-of-bounds-access.patch	\
   gnu/packages/patches/linux-libre-libreboot-fix.patch		\
   gnu/packages/patches/lirc-localstatedir.patch			\
-  gnu/packages/patches/libpthread-glibc-preparation.patch	\
   gnu/packages/patches/lm-sensors-hwmon-attrs.patch		\
   gnu/packages/patches/lua51-liblua-so.patch\
   gnu/packages/patches/luajit-no_ldconfig.patch			\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 67bdab4..c69221c 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -697,18 +697,16 @@ command.")
 (define-public glibc/hurd
   (package (inherit glibc)
 (name "glibc-hurd")
-(version "2.18")
+(version "2.19")
 (source (origin
-  (method git-fetch)
-  (uri (git-reference
-(url "git://git.sv.gnu.org/hurd/glibc")
-(commit "cc94b3cfe65523f980359e5f0e93a26196bda1d3")))
+  (method url-fetch)
+  (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-";
+  version "-hurd+libpthread-20150515" ".tar.gz"))
   (sha256
(base32
-"17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
-  (file-name (string-append name "-" version))
+"0fkmn1kfsbhyrkf1wqqvc47dl5bzflnbcggjjfp5s9c489z916zw"))
   (patches (map search-patch
-'("glibc-hurd-extern-inline.patch")
+'("glibc-hurd-libs.patch")
 
 ;; Libc provides , which includes a bunch of Hurd and Mach headers,
 ;; so both should be propagated.
@@ -717,18 +715,8 @@ command.")
  ("hurd-minimal" ,hurd-minimal)))
 (native-inputs
  `(,@(package-native-inputs glibc)
-   ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
("mig" ,mig)
-   ("perl" ,perl)
-   ("libpthread" ,(origin
-(method git-fetch)
-(uri (git-reference
-  (url "git://git.sv.gnu.org/hurd/libpthread")
-  (commit "0ef7b75c4ba91b6660f0d3d8b51d14d25e3d5bfb")))
-(sha256
- (base32
-  "031py18fls15z0wprni33mf762kg6fx8xqijppimhp83yp6ky3l3"))
-(file-name "libpthread")
+   ("perl" ,perl)))
 
 (arguments
  (substitute-keyword-arguments (package-arguments glibc)
@@ -747,17 +735,7 @@ command.")
  ;; "linux-headers" input, to prevent errors.
  (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
 ,@%build-inputs)))
-   ,original-configure-flags
-   ((#:phases phases)
-`(alist-cons-after
-  'unpack 'prepare-libpthread
-  (lambda* (#:key inputs #:allow-other-keys)
-(copy-recursive

Re: [PATCH] doc: Add 'help2man' to HACKING.

2015-06-08 Thread Ludovic Courtès
Alex Kost  skribis:

> From f75411cd7ad1c8cd5ce19a486344f33a7b2b4011 Mon Sep 17 00:00:00 2001
> From: Alex Kost 
> Date: Mon, 8 Jun 2015 12:12:37 +0300
> Subject: [PATCH] doc: Add 'help2man' to HACKING.
>
> * HACKING: Mention 'help2man'.
> ---
>  HACKING | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/HACKING b/HACKING
> index cf10ba5..1e742c8 100644
> --- a/HACKING
> +++ b/HACKING
> @@ -20,6 +20,7 @@ addition to those mentioned in the installation 
> instructions:
>- [[http://www.gnu.org/software/automake/][GNU Automake]]
>- [[http://www.gnu.org/software/gettext/][GNU Gettext]]
>- [[http://www.graphviz.org/][Graphviz]]
> +  - [[http://www.gnu.org/software/help2man/][GNU Help2man]] (optional)

This is the right place: Someone building from a tarball won’t need it.

OK to push.

Thanks,
Ludo’.



Re: [PATCH] gnu: Add proof-general

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

> From e9d66801024e66c39b8ee0d84a10ddc4e6b7a18b Mon Sep 17 00:00:00 2001
> From: Mark H Weaver 
> Date: Mon, 8 Jun 2015 05:05:23 -0400
> Subject: [PATCH] gnu: Add proof-general.
>
> * gnu/packages/ocaml.scm (proof-general): New variable.

Sure, thank you!

Ludo’.



Re: [PATCH 2/2] emacs: Add shell completions for "guix" command.

2015-06-08 Thread Ludovic Courtès
Alex Kost  skribis:

> Ludovic Courtès (2015-06-07 18:36 +0300) wrote:

[...]

>> However it’s important to fall back to file name completions for things
>> that are not handled, so that at least it is not worse than without the
>> pcomplete code.
>
> Yes, it is the current behaviour (I mean the file names completion).

Perfect.

>>> Completing may lag a bit from time to time.  It happens because shell
>>> commands (like ‘guix ... --help’) are called when necessary to find
>>> options, packages, etc.  But the found entries are "memoized" so next
>>> time the same entries will be completed much faster.
>>
>> I wonder if ‘guix-pcomplete-run-guix’ couldn’t run the command in a REPL
>> instead of spawning a process.  That is, when completing ‘guix build’,
>> it would evaluate something like:
>>
>>   (with-output-to-string
>> (lambda ()
>>   (catch 'quit
>> (lambda ()
>>   ((@ (guix scripts build) guix-build) "--help"))
>> (const #t
>>
>> How does that sound?
>
> It was the initial deliberate decision to separate completions code from
> interacting with "guix repl", to make completing independent.  I imagine
> that a user wouldn't like to see that some "Guix REPL has been started"
> just because he presses TAB after ‘guix pa’ in his shell buffer.  Well,
> at least I wouldn't use such strange completions.
>
> I think lags made by spawning the guix processes are bearable and not
> repeatable (I mean the next time ‘guix pa’ is completed
> immediately), so I would not like to change the code to use a REPL if
> you don't mind :-)
>
> (Perhaps in the future there will be added some option (e.g., a boolean
> `guix-pcomplete-use-repl' variable) to choose what a user prefers)

Right, it makes sense to have that module independent of the rest.
I just tried and it feels faster than the Bash completion anyway.  :-)

Thank you!

Ludo’.

PS: I wonder if something could also be done for “./pre-inst-env guix”...



Re: MIPS bootstrap problem in core-updates

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

> This (lightly tested) patch may work:
>
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index ab16660..6dd4d55 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -139,6 +139,19 @@
>   (arguments
>`(#:guile ,%bootstrap-guile
>  #:implicit-inputs? #f
> +
> +#:phases (alist-cons-after
> +  'install 'add-gas-symlink
> +  (lambda* (#:key outputs #:allow-other-keys)
> +;; The cross-gcc invokes 'as', not the cross-'as', so add
> +;; an 'as' symlink.
> +(let ((out (assoc-ref outputs "out")))
> +  (with-directory-excursion (string-append out "/bin")
> +(symlink (string-append ,(boot-triplet) "-as")
> + "as")
> +#t)))
> +  %standard-phases)
> +
>  ,@(substitute-keyword-arguments (package-arguments binutils)
>  ((#:configure-flags cf)
>   `(cons ,(string-append "--target=" (boot-triplet))
> @@ -274,10 +287,7 @@
>;; 2nd stage inputs.
>`(("gcc" ,gcc-boot0)
>  ("binutils-cross" ,binutils-boot0)
> -
> -;; Keep "binutils" here because the cross-gcc invokes `as', not the
> -;; cross-`as'.
> -,@%boot0-inputs))
> +,@(alist-delete "binutils" %boot0-inputs)))
>  
>  (define glibc-final-with-bootstrap-bash
>;; The final libc, "cross-built".  If everything went well, the resulting

Sounds good.

> Could you try it on MIPS, on top of ‘core-updates’?

I tried this and it turned out that 'ld' was also needed.  I added an
'ld' symlink and then discovered than 'ar' was needed as well.  I'm now
trying it with symlinks for _all_ of the programs in binutils' /bin
directory.

To be continued...

 Thanks,
   Mark



Update on GuixSD containers

2015-06-08 Thread Thompson, David
Hey folks,

I'd like to give a quick update on the state of wip-container branch.
As of this morning, one can run the below commands and have a somewhat
functional GuixSD container:

  # Hardcoded /tmp/container as the container root directory until I
  # add a command line switch.
  mkdir /tmp/container
  guix system container container-config.scm

Where 'container-config.scm' is:

(use-modules (gnu))

;; Minimal GuixSD configuration suitable for a Linux container.
(operating-system
  (host-name "container-test")
  (timezone "America/New_York")
  (locale "en_US.UTF-8")
  ;; Unused
  (bootloader (grub-configuration (device "/dev/sdX")))
  ;; Dummy FS
  (file-systems (cons (file-system
(mount-point "/")
(device "dummy")
(type "dummy"))
  %base-file-systems))

  (users (cons (user-account
(name "alice")
(comment "Bob's sister")
(group "users")
(supplementary-groups '("wheel" "audio" "video"))
(home-directory "/home/alice"))
   %base-user-accounts)))

The activation and boot scripts for the system have been tweaked to
DTRT for a container, and DMD is able to start successfully and start
all of the base services, sans the console-font-tty services for some
reason.

So, this is cool, but much work remains to be done.  Our containers
operate in 5 of 6 possible Linux namespaces: mount, PID, UTS, IPC, and
network.  The remaining namespace to get working is the user
namespace, which is especially tricky.  I don't think even Docker can
use user namespaces properly yet, but I might be wrong.  Additionally,
our containers have a loopback device, but have no way of accessing an
outside network such as your LAN or a virtual network on the host
system.  There's also no support for cgroups, which would allow us to
limit the resource usage of containers like you can with a VM
hypervisor.

For the long term, we'll need a container daemon to keep track of all
containers on the system to allow for easily starting and stopping
them (right now you have to 'sudo kill -9 '), spawning new
processes within them (for example, launching bash for an interactive
environment), and whatever else we might want.

In closing, things aren't exactly usable, but I encourage
brave/curious people to take 'guix system container' for a spin and
hack on it to make Guix the best container management tool yet!  Also,
I think the code is very easy to follow (unlike Docker's
libcontainer), so if you want to understand what containers *really*
are beyond a buzzword, have a look at gnu/build/linux-container.scm
and gnu/system/linux-container.scm.

Happy hacking,

- Dave



Re: [PATCH] gnu: sed: Set PATH_MAX for HURD systems.

2015-06-08 Thread Ludovic Courtès
Manolis Ragkousis  skribis:

> I think this one should go to core-updates. WDYT?
>
> From 827ad2cf704aa0123b509f7f01da8d4413d97113 Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis 
> Date: Mon, 8 Jun 2015 16:04:07 +0300
> Subject: [PATCH] gnu: sed: Set PATH_MAX for HURD systems.
>
> * gnu/packages/patches/sed-hurd-path-max.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

Please use the patch below instead as ‘sed-hurd-path-max.patch’: It’s
the one from upstream (slightly edited for compactness), and we’ll
directly see that it’s from upstream.

OK to push to ‘core-updates’ with this change.

Thanks!

Ludo’.

7bb8d35d0330161a5af5341471d0c183a067e8c2
Author: Jose E. Marchesi 
Date:   Sun Oct 6 14:43:38 2013 +0200

Set PATH_MAX to some constant in case it is not defined in system
headers.

2013-10-06  Jose E. Marchesi  

	* basicdefs.h (PATH_MAX): Defined to some constant in case it is
	not defined by system headers.
	* sed/utils.c: Do not include pathmax.h anymore.
	* bootstrap.conf (gnulib_modules): Do not use the gnulib module
	pathmax.

--- a/basicdefs.h
+++ b/basicdefs.h
@@ -40,6 +41,13 @@ typedef unsigned long countT;
 #define obstack_chunk_alloc  ck_malloc
 #define obstack_chunk_free   free
 
+/* MAX_PATH is not defined in some platforms, most notably GNU/Hurd.
+   In that case we define it here to some constant.  Note however that
+   this relies in the fact that sed does reallocation if a buffer
+   needs to be larger than PATH_MAX.  */
+#ifndef PATH_MAX
+# define PATH_MAX 200
+#endif
 


Re: [PATCH] gnu: sed: Set PATH_MAX for HURD systems.

2015-06-08 Thread Ludovic Courtès
Also, nitpicking: The proper spelling is “Hurd”, not “HURD”.

Ludo’.


Re: MIPS bootstrap problem in core-updates

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

> In core-updates, 'glibc-final-with-bootstrap-bash' fails to build on
> MIPS, because 'gcc-boot0' doesn't work.  The problem is that we've
> switched to gcc-4.9, which on MIPS now emits a new ".nan" assembler
> directive which is not understood by the assembler in binutils-2.23.2,
> the version in our binutils-bootstrap-0.
>
> The assembler in binutils-2.25 understands ".nan", and that version of
> binutils is an input to 'glibc-final-with-bootstrap-bash' (via
> %boot1-inputs), so one might expect this to work.  There's just one
> problem: the assembler in 'binutils-boot0' is named
> 'mips64el-guix-linux-gnu-as', but the compiler in 'gcc-boot0' runs 'as'.
>
> Historically, we've worked around this by including the bootstrap
> binutils in %boot1-inputs:
>
> (define %boot1-inputs
>   ;; 2nd stage inputs.
>   `(("gcc" ,gcc-boot0)
> ("binutils-cross" ,binutils-boot0)
>
> ;; Keep "binutils" here because the cross-gcc invokes `as', not the
> ;; cross-`as'.
> ,@%boot0-inputs))

Thanks for the detailed analysis!

This (lightly tested) patch may work:

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ab16660..6dd4d55 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -139,6 +139,19 @@
  (arguments
   `(#:guile ,%bootstrap-guile
 #:implicit-inputs? #f
+
+#:phases (alist-cons-after
+  'install 'add-gas-symlink
+  (lambda* (#:key outputs #:allow-other-keys)
+;; The cross-gcc invokes 'as', not the cross-'as', so add
+;; an 'as' symlink.
+(let ((out (assoc-ref outputs "out")))
+  (with-directory-excursion (string-append out "/bin")
+(symlink (string-append ,(boot-triplet) "-as")
+ "as")
+#t)))
+  %standard-phases)
+
 ,@(substitute-keyword-arguments (package-arguments binutils)
 ((#:configure-flags cf)
  `(cons ,(string-append "--target=" (boot-triplet))
@@ -274,10 +287,7 @@
   ;; 2nd stage inputs.
   `(("gcc" ,gcc-boot0)
 ("binutils-cross" ,binutils-boot0)
-
-;; Keep "binutils" here because the cross-gcc invokes `as', not the
-;; cross-`as'.
-,@%boot0-inputs))
+,@(alist-delete "binutils" %boot0-inputs)))
 
 (define glibc-final-with-bootstrap-bash
   ;; The final libc, "cross-built".  If everything went well, the resulting

Could you try it on MIPS, on top of ‘core-updates’?

It looks like the simplest solution.

Thanks,
Ludo’.


[PATCH] gnu: patch: Set PATH_MAX for HURD systems.

2015-06-08 Thread Manolis Ragkousis
I think this one should also go to core-updates. WDYT?
From 075b0321ed609ee74f8c827081b2e9c9a19a9f4d Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Mon, 8 Jun 2015 16:19:58 +0300
Subject: [PATCH] gnu: patch: Set PATH_MAX for HURD systems.

* gnu/packages/patches/patch-hurd-path-max.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am  |  1 +
 gnu/packages/base.scm  |  3 ++-
 gnu/packages/patches/patch-hurd-path-max.patch | 19 +++
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/patch-hurd-path-max.patch

diff --git a/gnu-system.am b/gnu-system.am
index 8b4f703..a3aea0a 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -507,6 +507,7 @@ dist_patch_DATA =		\
   gnu/packages/patches/patchelf-page-size.patch			\
   gnu/packages/patches/patchelf-rework-for-arm.patch		\
   gnu/packages/patches/patchutils-xfail-gendiff-tests.patch	\
+  gnu/packages/patches/patch-hurd-path-max.patch		\
   gnu/packages/patches/pavucontrol-sigsegv.patch		\
   gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \
   gnu/packages/patches/perl-module-pluggable-search.patch	\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 67bdab4..b074e71 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -164,7 +164,8 @@ standard utility.")
   version ".tar.xz"))
   (sha256
(base32
-"16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"
+"16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"))
+  (patches (list (search-patch "patch-hurd-path-max.patch")
(build-system gnu-build-system)
(native-inputs `(("ed", ed)))
(synopsis "Apply differences to originals, with optional backups")
diff --git a/gnu/packages/patches/patch-hurd-path-max.patch b/gnu/packages/patches/patch-hurd-path-max.patch
new file mode 100644
index 000..b77e19d
--- /dev/null
+++ b/gnu/packages/patches/patch-hurd-path-max.patch
@@ -0,0 +1,19 @@
+Define PATH_MAX for HURD systems.
+
+diff --git a/lib/pathmax.h b/lib/pathmax.h
+index bd0bc00..8835c98 100644
+--- a/lib/pathmax.h
 b/lib/pathmax.h
+@@ -45,6 +45,10 @@
+ 
+ # include 
+ 
++# ifndef PATH_MAX
++#  define PATH_MAX 8192
++# endif
++
+ # ifndef _POSIX_PATH_MAX
+ #  define _POSIX_PATH_MAX 256
+ # endif
+-- 
+2.4.2
\ No newline at end of file
-- 
2.4.2



[PATCH] gnu: sed: Set PATH_MAX for HURD systems.

2015-06-08 Thread Manolis Ragkousis
I think this one should go to core-updates. WDYT?
From 827ad2cf704aa0123b509f7f01da8d4413d97113 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis 
Date: Mon, 8 Jun 2015 16:04:07 +0300
Subject: [PATCH] gnu: sed: Set PATH_MAX for HURD systems.

* gnu/packages/patches/sed-hurd-path-max.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am|  1 +
 gnu/packages/base.scm|  3 ++-
 gnu/packages/patches/sed-hurd-path-max.patch | 19 +++
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/sed-hurd-path-max.patch

diff --git a/gnu-system.am b/gnu-system.am
index 6a82170..8b4f703 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -538,6 +538,7 @@ dist_patch_DATA =		\
   gnu/packages/patches/ratpoison-shell.patch			\
   gnu/packages/patches/readline-link-ncurses.patch		\
   gnu/packages/patches/ripperx-libm.patch			\
+  gnu/packages/patches/sed-hurd-path-max.patch			\
   gnu/packages/patches/scheme48-tests.patch			\
   gnu/packages/patches/scotch-test-threading.patch		\
   gnu/packages/patches/sdl-libx11-1.6.patch			\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index db50652..67bdab4 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -105,7 +105,8 @@ including, for example, recursive directory searching.")
 ".tar.bz2"))
 (sha256
  (base32
-  "1myvrmh99jsvk7v3d7crm0gcrq51hmmm1r2kjyyci152in1x2j7h"
+  "1myvrmh99jsvk7v3d7crm0gcrq51hmmm1r2kjyyci152in1x2j7h"))
+(patches (list (search-patch "sed-hurd-path-max.patch")
(build-system gnu-build-system)
(synopsis "Stream editor")
(arguments
diff --git a/gnu/packages/patches/sed-hurd-path-max.patch b/gnu/packages/patches/sed-hurd-path-max.patch
new file mode 100644
index 000..b77e19d
--- /dev/null
+++ b/gnu/packages/patches/sed-hurd-path-max.patch
@@ -0,0 +1,19 @@
+Define PATH_MAX for HURD systems.
+
+diff --git a/lib/pathmax.h b/lib/pathmax.h
+index bd0bc00..8835c98 100644
+--- a/lib/pathmax.h
 b/lib/pathmax.h
+@@ -45,6 +45,10 @@
+ 
+ # include 
+ 
++# ifndef PATH_MAX
++#  define PATH_MAX 8192
++# endif
++
+ # ifndef _POSIX_PATH_MAX
+ #  define _POSIX_PATH_MAX 256
+ # endif
+-- 
+2.4.2
\ No newline at end of file
-- 
2.4.2



Re: GSoC: Porting Guix to Hurd week 3+4 report.

2015-06-08 Thread Manolis Ragkousis
Hello

> Now, from a discussion we had on IRC, I think the problem reported at
> the beginning of this thread is fixed.  Manolis, can you confirm?

Yes, I am doing a local cleanup and I am sending the patches to the list.

> Also, I think the target should be 4.9 or 4.8, but definitely not 4.7.
> See also
> .

Yes it was a mistake from my part.

Manolis



Re: GSoC: Porting Guix to Hurd week 3+4 report.

2015-06-08 Thread Ludovic Courtès
Thomas Schwinge  skribis:

> On Thu, 04 Jun 2015 22:48:48 +0200, l...@gnu.org (Ludovic 
> =?utf-8?Q?Court=C3=A8s?=) wrote:
>> Manolis Ragkousis  skribis:

[...]

>>   autoreconf && ./configure --localstatedir=/var \
>> --with-libgcrypt-prefix=/gnu/store/... && make
>
> (Not relevant right now, but why is the libgcrypt path not communicated
> via the environment variables set up with guix environment?  Is that just
> because there are no appropriate environment variables, or something
> else?)  Also, I wanted to note that I, very guixy, computed that path
> using:
>
> $ guix build libgcrypt
> warning: failed to install locale: Invalid argument
> /gnu/store/r16v30hlw2d6n232rm37p53qy8rpr7f2-libgcrypt-1.6.3
> /gnu/store/42ls5n7k6lai1k6xfa8v8wks7nn9g3gn-libgcrypt-1.6.3-debug

Yes, that’s fine.

> Next, I ran:
>
> $ ./pre-inst-env guix build --target=i686-pc-gnu gcc-4.7 -K -c 8
>
>> > After it fails
>
> ..., and eventually reproduced the problem.  However, that took a series
> of steps that was much longer that I had anticipated:

It turns out that hydra.gnu.org is not (yet) serving pre-built binaries
for this branch, so you ended up rebuilding the world, including doing a
complete bootstrap of the distro (info "(guix) Bootstrapping").

I realize this is terribly inconvenient, so apologies for that!

I hope we can soon merge the changes to the “core” packages in the
‘core-updates’ branch, and have ‘wip-hurd’ contain only very specific
patches.  That way, most of the things will have pre-built binaries
available on hydra.gnu.org.

> Assuming I need to patch the GCC sources, do I just do that in
> /tmp/nix-build-gcc-4.7.4.drv-0/gcc-4.7.4/, and then, to continue the
> build, just run the same guix build command again?  (I guess I'll also
> have to preserve my changes elsewhere, as that temporary working tree
> will be removed upon a successful build?)

The simplest way is to use the --with-source option of ‘guix build’,
which allows you to specify an alternate source tarball (info "(guix)
Invoking guix build").

Now, from a discussion we had on IRC, I think the problem reported at
the beginning of this thread is fixed.  Manolis, can you confirm?

Also, I think the target should be 4.9 or 4.8, but definitely not 4.7.
See also
.

Thank you!

Ludo’.



Re: [PATCH] gnu: evince: Add inputs.

2015-06-08 Thread 宋文武
David Hashe  writes:

> * gnu/packages/gnome.scm (evince): Add 'djvulibre' as an input.
> ---
>  gnu/packages/gnome.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 34658e1..e02a430 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -38,6 +38,7 @@
>#:use-module (gnu packages cups)
>#:use-module (gnu packages curl)
>#:use-module (gnu packages databases)
> +  #:use-module (gnu packages djvu)
>#:use-module (gnu packages flex)
>#:use-module (gnu packages docbook)
>#:use-module (gnu packages glib)
> @@ -348,7 +349,7 @@ forgotten when the session ends.")
> #:tests? #f))
>  (inputs
>   `(("libspectre" ,libspectre)
> -   ;; ("djvulibre" ,djvulibre)
> +   ("djvulibre" ,djvulibre)
> ("ghostscript" ,ghostscript)
> ("poppler" ,poppler)
> ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
> -- 
> 1.9.1
I applied the patch, and update it to 3.16.1 with more inputs added.

Thanks!



Re: Kernel recompilation on Novena

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

> l...@gnu.org (Ludovic Courtès) writes:
>
>> Thanks for the info!
>>
>> I wonder what the status of our linux-libre package is on armhf.  I
>> guess we first need a config file for that platform, based on the x86
>> ones.
>
> I may be showing my ignorance, but it seems to me that kernels built for
> armhf and mips machines usually need custom patches and configuration
> that vary from one machine to another.  Or at least the armhf and mips
> machines that I have access to (Novena and Loongson-based laptops)
> require additional patches and custom configuration.

Yeah, right.  I don’t know how much per-machine customization is needed.

> They also typically use bootloaders other than GRUB.  The Loongson-based
> machines use PMON and the Novena uses U-Boot.

Yes, but: .
It would be wonderful if we could stick to GRUB.

> IMO, the first step is to make it easier to create custom linux-libre
> packages with custom patches and additional configuration.

Patches going in that direction would be great.

Ludo’.



Re: GSoC: Porting Guix to Hurd week 3+4 report.

2015-06-08 Thread Manolis Ragkousis
Hello Thomas

Actually I did a mistake last time, I should have told you to build gcc-4.8,
not gcc-4.7, because that's what make-bootstrap.scm use.

Btw I managed to build the bootstrap-tarballs. Per Ludo's suggestion I removed
"--disable-decimal-float" flag from %gcc-static and we got the binaries. :-)

> Did that.
>
>> From there:
>>
>>   git clone git://git.savannah.gnu.org/guix.git
>
> (Per Manolis' suggestion, I'm using his GitHub repository.)

I am cleaning up my local patches so we can just use wip-hurd from Savannah.
>
>>   cd guix
>>   git checkout wip-hurd
>>   guix environment guix
>
> (Very pedantically, is that last commant completely "correct"?  My
> understanding is that it sets up an environment for building the version
> of the guix package that is current known to Guix, and not the version
> From the checkout of the wip-hurd branch.  Of course, the underlying
> assumption must be that these two versions have the same dependencies, so
> their environment setup will be the same.)

You are correct, these two versions have the same dependencies, so
their environment setup will be the same.

>
>>   autoreconf && ./configure --localstatedir=/var \
>> --with-libgcrypt-prefix=/gnu/store/... && make
>
> (Not relevant right now, but why is the libgcrypt path not communicated
> via the environment variables set up with guix environment?  Is that just
> because there are no appropriate environment variables, or something
> else?)  Also, I wanted to note that I, very guixy, computed that path
> using:
>
> $ guix build libgcrypt
> warning: failed to install locale: Invalid argument
> /gnu/store/r16v30hlw2d6n232rm37p53qy8rpr7f2-libgcrypt-1.6.3
> /gnu/store/42ls5n7k6lai1k6xfa8v8wks7nn9g3gn-libgcrypt-1.6.3-debug
>

It will be better if Ludo answers that.

> Next, I ran:
>
> $ ./pre-inst-env guix build --target=i686-pc-gnu gcc-4.7 -K -c 8
>
>> > After it fails
>
> ..., and eventually reproduced the problem.  However, that took a series
> of steps that was much longer that I had anticipated:
>
> $ ls -lrt /var/log/guix/drvs/*/*

> I have not yet made an attempt to understand all of that.  ;-)

Keep in mind that "ls -lrt /var/log/guix/drvs/*/* " will show you all
the logs. You will probably
only need to check the last ones.

>
>> > go to /tmp/nix-build-gcc-4.7...  and there you can find
>> > the failed build. Everything will be there.
>
> Assuming I need to patch the GCC sources, do I just do that in
> /tmp/nix-build-gcc-4.7.4.drv-0/gcc-4.7.4/, and then, to continue the
> build, just run the same guix build command again?  (I guess I'll also
> have to preserve my changes elsewhere, as that temporary working tree
> will be removed upon a successful build?)

You will need to patch the source at gcc-4.7 in gcc.scm.To add a new patch,
first place the new patch in gnu/packages/patches/a-new-patch.patch,
then add it in gnu-system.am
in the base directory under "patchdir" and the add it in the source
field of the package you want.
Search for "patches" inside gnu/packages/ in files *.scm on how to do
that. There are plenty of examples.

> Also, in case it should be necessary to restart this build step from
> scratch, do I just remove the /tmp/nix-build-gcc-4.7.4.drv-0/build
> directory, and then run the same guix build command again?

You just rerun the same command. It will just create a new one (drv-1,
2, 3 and so on) in /tmp.
No need to delete anything.

> In case I need to modify the build instructions of an earlier build step,
> I guess I need to do this "the Guix way", that is, edit the respective
> *.scm file, and re-run guix build?  Do I need to invalidate the earlier
> build, or will that happen "automatically"?  How do I patch the sources
> of an earlier build step, that is, rebuild a package using the same build
> instructions but with a different set of sources (say, from a local Git
> checkout)?

It will happen "automatically". You patch the source of each package in the way
I described you above. If you want to change the source, you just
change the source field
of the package. Search for "git-fetch" in gnu/packages and you will
understand how to make it
use a remote git (I am not sure how to make it use a local repo, Ludo
please help :-)). Keep in mind
that everytime you change the source you should update the hash of
those sources. You can get the
hash of a source tarball or a git repo with "guix hash".

Manolis



Re: Guix binary tarball

2015-06-08 Thread Alex Kost
Ludovic Courtès (2015-06-07 19:14 +0300) wrote:

> Thomas Schwinge  skribis:
>
>> I'm not a fan of extracting tarballs inside populated directories; so I'm
>> in favor on the suggested change to extract inside a temporary directory,
>> and then move everything in place as a separate step.
>
> OK.  I had come to the conclusion that yes, doing it in two steps is
> reasonable, but it’s the user’s choice, and I wondered whether
> describing the additional steps in the manual would make things look
> more complicated than they are.  WDYT?

I agree with Thomas.  I believe it would be better to split this step.
(OTOH a user who installs Guix should probably know what to do with a
tarball without additional documentation)

[...]
>> It's very common, but I don't think there's a hard requirement for the
>> root user's home directory to be /root.  Maybe instead of shipping it in
>> the tarball, the symbolic link should be created by an explicit command?
>>
>> $ sudo ln -sf /var/guix/profiles/per-user/root/guix-profile 
>> ~root/.guix-profile
>
> Yes, why not.  What do people think?

I totally agree, I think there is no need to put "/root" into the
tarball, and to add this step instead.

-- 
Alex



[PATCH] doc: Add 'help2man' to HACKING.

2015-06-08 Thread Alex Kost
Since now help2man is needed to build man pages, I think it is worth
mentioning somewhere in the documentation.  Though I'm not sure where.

>From f75411cd7ad1c8cd5ce19a486344f33a7b2b4011 Mon Sep 17 00:00:00 2001
From: Alex Kost 
Date: Mon, 8 Jun 2015 12:12:37 +0300
Subject: [PATCH] doc: Add 'help2man' to HACKING.

* HACKING: Mention 'help2man'.
---
 HACKING | 1 +
 1 file changed, 1 insertion(+)

diff --git a/HACKING b/HACKING
index cf10ba5..1e742c8 100644
--- a/HACKING
+++ b/HACKING
@@ -20,6 +20,7 @@ addition to those mentioned in the installation instructions:
   - [[http://www.gnu.org/software/automake/][GNU Automake]]
   - [[http://www.gnu.org/software/gettext/][GNU Gettext]]
   - [[http://www.graphviz.org/][Graphviz]]
+  - [[http://www.gnu.org/software/help2man/][GNU Help2man]] (optional)
 
 Run ‘./bootstrap’ to download the Nix daemon source code and to generate the
 build system infrastructure using autoconf.  It reports an error if an
-- 
2.2.1



[PATCH] gnu: Add proof-general

2015-06-08 Thread Mark H Weaver
>From e9d66801024e66c39b8ee0d84a10ddc4e6b7a18b Mon Sep 17 00:00:00 2001
From: Mark H Weaver 
Date: Mon, 8 Jun 2015 05:05:23 -0400
Subject: [PATCH] gnu: Add proof-general.

* gnu/packages/ocaml.scm (proof-general): New variable.
---
 gnu/packages/ocaml.scm | 81 ++
 1 file changed, 81 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 5a86b79..5baf24c 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -24,6 +24,9 @@
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages emacs)
+  #:use-module (gnu packages texinfo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages commencement)
@@ -304,3 +307,81 @@ It is developed using Objective Caml and Camlp5.")
 ;; The code is distributed under lgpl2.1.
 ;; Some of the documentation is distributed under opl1.0+.
 (license (list lgpl2.1 opl1.0+
+
+(define-public proof-general
+  (package
+(name "proof-general")
+(version "4.2")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+"http://proofgeneral.inf.ed.ac.uk/releases/";
+"ProofGeneral-" version ".tgz"))
+  (sha256
+   (base32
+"09qb0myq66fw17v4ziz401ilsb5xlxz1nl2wsp69d0vrfy0bcrrm"
+(build-system gnu-build-system)
+(native-inputs
+ `(("which" ,which)
+   ("emacs" ,emacs-no-x)
+   ("texinfo" ,texinfo)))
+(inputs
+ `(("host-emacs" ,emacs)
+   ("perl" ,perl)
+   ("coq" ,coq)))
+(arguments
+ `(#:tests? #f  ; no check target
+   #:make-flags (list (string-append "PREFIX=" %output)
+  (string-append "DEST_PREFIX=" %output))
+   #:modules ((guix build gnu-build-system)
+  (guix build utils)
+  (guix build emacs-utils))
+   #:imported-modules (,@%gnu-build-system-modules
+   (guix build emacs-utils))
+   #:phases
+   (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'disable-byte-compile-error-on-warn
+(lambda _
+  (substitute* "Makefile"
+(("\\(setq byte-compile-error-on-warn t\\)")
+ "(setq byte-compile-error-on-warn nil)"))
+  #t))
+ (add-after 'unpack 'patch-hardcoded-paths
+(lambda* (#:key inputs outputs #:allow-other-keys)
+  (let ((out   (assoc-ref outputs "out"))
+(coq   (assoc-ref inputs "coq"))
+(emacs (assoc-ref inputs "host-emacs")))
+(define (coq-prog name)
+  (string-append coq "/bin/" name))
+(emacs-substitute-variables "coq/coq.el"
+  ("coq-prog-name"   (coq-prog "coqtop"))
+  ("coq-compiler"(coq-prog "coqc"))
+  ("coq-dependency-analyzer" (coq-prog "coqdep")))
+(substitute* "Makefile"
+  (("/sbin/install-info") "install-info"))
+(substitute* "bin/proofgeneral"
+  (("^PGHOMEDEFAULT=.*" all)
+   (string-append all
+  "PGHOME=$PGHOMEDEFAULT\n"
+  "EMACS=" emacs "/bin/emacs")))
+#t)))
+ (add-after 'unpack 'clean
+(lambda _
+  ;; Delete the pre-compiled elc files for Emacs 23.
+  (zero? (system* "make" "clean"
+ (add-after 'install 'install-doc
+(lambda* (#:key make-flags #:allow-other-keys)
+  ;; XXX FIXME avoid building/installing pdf files,
+  ;; due to unresolved errors building them.
+  (substitute* "Makefile"
+((" [^ ]*\\.pdf") ""))
+  (zero? (apply system* "make" "install-doc"
+make-flags)))
+(home-page "http://proofgeneral.inf.ed.ac.uk/";)
+(description "Generic front-end for proof assistants based on Emacs")
+(synopsis
+ "Proof General is a major mode to turn Emacs into an interactive proof
+assistant to write formal mathematical proofs using a variety of theorem
+provers.")
+(license gpl2+)))
-- 
2.2.1




Re: [PATCH] doc emacs: Improve documentation on initial setup.

2015-06-08 Thread Alex Kost
Ludovic Courtès (2015-06-07 22:42 +0300) wrote:

> Alex Kost  skribis:
>
>> From f14f533935169be164a94ecdcfeeecf6690bc07f Mon Sep 17 00:00:00 2001
>> From: Alex Kost 
>> Date: Sun, 7 Jun 2015 21:43:58 +0300
>> Subject: [PATCH] doc emacs: Improve documentation on initial setup.
>>
>> Reported by ngz on #guix.
>>
>> * doc/emacs.texi (Emacs Initial Setup): Describe how to configure
>>   "guix.el" in the case of binary installation and when Guix is not
>>   installed.
>
> Good idea!
>
>> +alike.  However it is not recommended to use a direct store directory,
>
> ... recommended to refer directly to a store directory.  Instead, you
> can ...
>
> OK with this change!

Thank you, changed and pushed.

-- 
Alex



Re: [PATCH 2/2] emacs: Add shell completions for "guix" command.

2015-06-08 Thread Alex Kost
Ludovic Courtès (2015-06-07 18:36 +0300) wrote:

> Alex Kost  skribis:
>
>> It should complete almost everything except suboptions of subcommands, I
>> mean those ‘import’ modules (e.g., it will not complete
>> ‘--no-test-dependencies’ option for ‘guix import hackage’ command).
>
> I think that’s fine.  We wouldn’t want to maintain relatively custom
> completion code for all these things anyway.
>
> However it’s important to fall back to file name completions for things
> that are not handled, so that at least it is not worse than without the
> pcomplete code.

Yes, it is the current behaviour (I mean the file names completion).

>> Completing may lag a bit from time to time.  It happens because shell
>> commands (like ‘guix ... --help’) are called when necessary to find
>> options, packages, etc.  But the found entries are "memoized" so next
>> time the same entries will be completed much faster.
>
> I wonder if ‘guix-pcomplete-run-guix’ couldn’t run the command in a REPL
> instead of spawning a process.  That is, when completing ‘guix build’,
> it would evaluate something like:
>
>   (with-output-to-string
> (lambda ()
>   (catch 'quit
> (lambda ()
>   ((@ (guix scripts build) guix-build) "--help"))
> (const #t
>
> How does that sound?

It was the initial deliberate decision to separate completions code from
interacting with "guix repl", to make completing independent.  I imagine
that a user wouldn't like to see that some "Guix REPL has been started"
just because he presses TAB after ‘guix pa’ in his shell buffer.  Well,
at least I wouldn't use such strange completions.

I think lags made by spawning the guix processes are bearable and not
repeatable (I mean the next time ‘guix pa’ is completed
immediately), so I would not like to change the code to use a REPL if
you don't mind :-)

(Perhaps in the future there will be added some option (e.g., a boolean
`guix-pcomplete-use-repl' variable) to choose what a user prefers)

>> Many thanks to Ludovic for the great idea of this package!
>
> Well I’m always impressed by your productivity!

Thanks, but it is far from yours!!

>> From 9ed30b97519afad84c58f1a7166f11a5e22ecda1 Mon Sep 17 00:00:00 2001
>> From: Alex Kost 
>> Date: Sat, 6 Jun 2015 22:19:51 +0300
>> Subject: [PATCH 2/2] emacs: Add shell completions for "guix" command.
>>
>> * emacs/guix-pcomplete.el: New file.
>> * emacs.am (ELFILES): Add it.
>> * doc/emacs.texi (Emacs Completions): New node.
>
> LGTM!  OK to push.
[...]
>> + ((and (command? "publish")
>> +   (option? "-u" "--user"))
>> +  (complete* (pcmpl-unix-user-names)))
>> +
>> + ((and (command? "refresh")
>> +   (option? "-s" "--select"))
>> +  (complete* guix-pcomplete-refresh-subsets)
>
> I like that this is very accurate.  I was first slightly concerned about
> the risk of this becoming out of sync, but I think we’d quickly notice
> and it seems easy to update anyway.

Yes, I think we'll notice, thanks.

I have pushed this commit, so if someone notices that something is not
completed properly, please report.

-- 
Alex