Re: [PATCH 1/2] gnu: Add cargo.

2016-12-30 Thread Chris Marusich
David Craven  writes:

>> I understand that this is some sort of mechanism to enable cargo to build 
>> things
>> offline, but is it appropriate to put all of those other packages'
>> source into the "cargo" package that is going to be built by Guix?  I
>> haven't been following the Cargo/Rust in Guix discussion thread, so it's
>> entirely possible I just missed something that was already discussed.
>
> No it is not appropriate. There has been a lot of discussion if it is ok to 
> take
> shortcuts or not, I think the general opinion is that it is not ok.
> But it is a way to
> build cargo without a lot of work, since there are a couple of issues that 
> need
> to be addressed by the cargo-build-system, specifically the importer.

I see.  Since I haven't been involved in the discussion so far, I think
I'll defer to others for further comment on that topic.

>> OK.  That makes sense.  But I wonder why cmake and pkg-config are
>> missing from the list of references if that is the case?
>
> Wow, I don't know what I was thinking, I was convinced that cmake and 
> pkg-config
> where retained inputs :) They should be propagated-inputs
> then... Thanks!

Although making them propagated-inputs might work, another solution
might be to use 'wrap-program' to wrap cargo's executable(s).  For
example, this is what we did when we packaged Asunder:

https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00707.html

Wrapping the program might not be appropriate in every case (see email
thread discussion), but if it's appropriate in this case, it's a great
way to avoid propagated-inputs.

-- 
Chris


signature.asc
Description: PGP signature


Re: [PATCH 10/10] gnu: Add propeller-development-suite.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (propeller-development-suite): New variable.

LGTM.

Impressive piece of work, thank you!

Ludo’.



Re: [PATCH 09/10] gnu: Add spinsim.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (spinsim): New variable.

OK!



Re: [PATCH 08/10] gnu: Add spin2cpp.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (spin2cpp): New variable.

LGTM!

> + (add-before 'build 'set-cross-environment-variables
> +   (lambda* (#:key inputs #:allow-other-keys)
> + (setenv "CROSS_LIBRARY_PATH"
> + (string-append (assoc-ref inputs "propeller-toolchain")
> +"/propeller-elf/lib"))
> + (setenv "CROSS_C_INCLUDE_PATH"
> + (string-append (assoc-ref inputs "propeller-toolchain")
> +"/propeller-elf/include"))

Too bad we have to repeat this here.



Re: [PATCH 07/10] gnu: Add propeller-load.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (propeller-load): New variable.

OK!



Re: [PATCH 06/10] gnu: Add openspin.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (openspin): New variable.

LGTM, thanks!



Re: [PATCH 05/10] gnu: Add propeller-toolchain.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (propeller-toolchain): New variable.

LGTM, thanks!



Re: [PATCH 04/10] gnu: Add proplib.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (proplib): New variable.

[...]

> +(define-public proplib
> +  (let ((commit "844741fe0ceb140ab2fdf9d0667f68c1c39c31da")
> +(revision "1"))
> +(package
> +  (name "proplib")
> +  (version (string-append "0.0.0-" revision "." (string-take commit 9)))
> +  (source (origin
> +(method git-fetch)
> +(uri (git-reference
> +  (url "https://github.com/totalspectrum/proplib.git;)
> +  (commit commit)))

No release either?

LGTM, thanks!



Re: [PATCH 03/10] gnu: Add propeller-gcc.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (propeller-gcc): New variable.

[...]

> +  (native-search-paths
> +   (list (search-path-specification
> +  (variable "CROSS_C_INCLUDE_PATH")
> +  (files '("propeller-elf/include")))
> + (search-path-specification
> +  (variable "CROSS_LIBRARY_PATH")
> +  (files '("propeller-elf/lib")

Could you add a comment explaining this file layout convention?

Otherwise LGTM!



Re: [PATCH 02/10] gnu: Add propeller-binutils.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/embedded.scm (propeller-binutils): New variable.

[...]

> + ,@(substitute-keyword-arguments (package-arguments xbinutils)
> + ((#:configure-flags flags)
> +  `(cons "--disable-nls" ,flags)

That shouldn't be needed.

> +  (native-inputs
> +   `(("bison" ,bison)
> + ("flex" ,flex)
> + ("texinfo" ,texinfo)
> + ("dejagnu" ,dejagnu)

The test failures you see are because you added DejaGNU here.  The other
Binutils instances don’t have it, so few tests are run I guess.  :-)

If this is not needed for bootstrapping, I’d suggest removing it.

Otherwise LGTM, thanks!



Re: [PATCH 01/10] gnu: Add dummy linker for propeller-elf.

2016-12-30 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add case for
> propeller-elf.

OK!



Re: Per-package updaters?

2016-12-30 Thread Ludovic Courtès
Hello Guix!

Ricardo Wurmus  skribis:

> we have a couple of generic package updaters (CPAN, CRAN, Bioconductor,
> Github, GNU, etc), but they don’t nearly cover all of our packages.  I
> wonder if we should add one-off updaters for individual packages that
> don’t fall into any of the generic classes of updaters.
>
> Another question is how to implement them.  Would there be another
> optional field in package expressions containing a Guile script to run
> to determine updates for the current package?
>
> What are your opinions on this?

Currently we have ways to provide the generic updates with additional
hints.  For instance, we can provide hints to the ‘gnu’ updater:

  (define-public guile-next
(package (inherit guile-2.0)
  (name "guile-next")
  ;; …
  (properties '((upstream-name . "guile")
(ftp-server . "alpha.gnu.org")
(ftp-directory . "/gnu/guile")

I suspect that one-off updaters would most likely use methods very
close to the existing updaters.  For instance, we could have a generic
FTP updater that would apply to all packages available on FTP; or we
could have a generic updater that crawls HTML pages for release numbers
and such things.  Then we would have optional properties in packages to
specify which method to use, or something along these lines.

WDYT?  Do you have examples in mind?

Cheers,
Ludo’.



Re: [PATCH] gnu: mc: Partially fix absolute file paths.

2016-12-30 Thread Ludovic Courtès
ng0  skribis:

> Partially fixes .
>
> * gnu/packages/mc.scm (mc)[arguments]: Add new phase 'fix-absolutism.
> This substitutes absolute file paths with functional file paths.

[...]

> +   (modify-phases %standard-phases
> + ;; We need to modify certain files which keep absolute paths
> + (add-after 'patch-source-shebangs 'fix-absolutism
> +   (lambda _
> + (substitute* "misc/mcedit.menu.in"
> +   (("#! /bin/sh") (string-append "#!" (which "sh")))
> +   (("/bin/bash") (which "bash")))
> + (substitute* "misc/ext.d/misc.sh.in"
> +   (("/bin/cat") "cat")))

Committed; I moved the comment below ‘lambda’ and added #t at the end of
lambda.

Thanks!

Ludo’.



Re: [PATCH 1/2] gnu: Add cargo.

2016-12-30 Thread David Craven
> I understand that this is some sort of mechanism to enable cargo to build 
> things
> offline, but is it appropriate to put all of those other packages'
> source into the "cargo" package that is going to be built by Guix?  I
> haven't been following the Cargo/Rust in Guix discussion thread, so it's
> entirely possible I just missed something that was already discussed.

No it is not appropriate. There has been a lot of discussion if it is ok to take
shortcuts or not, I think the general opinion is that it is not ok.
But it is a way to
build cargo without a lot of work, since there are a couple of issues that need
to be addressed by the cargo-build-system, specifically the importer.

> OK.  That makes sense.  But I wonder why cmake and pkg-config are
> missing from the list of references if that is the case?

Wow, I don't know what I was thinking, I was convinced that cmake and pkg-config
where retained inputs :) They should be propagated-inputs then... Thanks!



Re: Duplicate dependencies in util-linux

2016-12-30 Thread Ludovic Courtès
Howdy!

John Darrington  skribis:

> When I run:  guix size util-linux | sort -n -k 3
>
> I get:
>
> store item   totalself
> /gnu/store/a64w9dq219a8d9k4mfz76mnzph9wsvfj-zlib-1.2.8  61.3 
> 0.4   0.4%
> /gnu/store/bm0gfw4jkw8gd0vpnnzrb6z0xncrbx3p-readline-7.045.3 
> 1.3   1.4%
> /gnu/store/rvgmixpmsq5lqr9qflhkm70kg7a4rys2-bash-static-4.4.01.4 
> 1.4   1.6%
> /gnu/store/qkw4zrwfybxww8f56nkb6hggxambk89b-bash-4.4.0  50.7 
> 5.4   6.0%
> /gnu/store/hdrli1v7q3107w842s7di8rid82xlfvl-ncurses-6.0 44.0 
> 5.7   6.3%
> /gnu/store/xydfiifs9slq0wv6n8j6p26icn2ihn88-ncurses-6.0 66.7 
> 5.7   6.3%
> /gnu/store/8b5ffm91zlmm1k5i4kq5qix59v7jm9ln-util-linux-2.28.1   90.6
> 11.2  12.3%
> /gnu/store/cdi08kw7r6r684w8mk0xq0dkgpjhfpmd-gcc-4.9.4-lib   61.0
> 22.7  25.1%
> /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24  38.3
> 36.8  40.6%
>
>
> This seems odd to me:
>
> 1. Why does it depend on two different version of ncurses6.0 ?
> 2. Why does it depend on both bash-4.4.0 and bash-static-4.4 ?

“guix graph -t references util-linux” explains this: libc depends on
‘bash-static’, and bash depends on an ncurses variant that is different
from that used by util-linux.


To fix the latter, we’d need to somehow declare a common ncurses package
to use to optimize our dependency graph.  Not sure how to do that.

HTH!

Ludo’.


Re: [PATCH] gnu: pius: Update to 2.2.2-0.891687c.

2016-12-30 Thread Ludovic Courtès
Leo Famulari  skribis:

> On Sun, Dec 25, 2016 at 01:53:19PM -0500, Troy Sankey wrote:
>> Attached is a patch to upgrade pius to a version that works with
>> gpg-agent 2.1, in my experience.  I have tested this version with
>> gnupg@2.1.17 as the gpg input and gpg-agent version, and using a new
>> style keybox (pubring.kbx) file as the keyring.
>> 
>> This also effectively reverts commit 31fbf4b6:
>> 
>>   "gnu: pius: Depend on GnuPG 2.0 rather than 2.1."
>> 
>> Another thread in guix-devel [0] suggests that pius could not deal with
>> gpg-agent 2.1 which is why it may have been configured to use gnupg-2.0.
>> The attached patch brings support for 2.1, so I think I am also allowed
>> to revert 31fbf4b6.
>> 
>> Note, however, the code comment describes a different concern:
>> 
>> > - ("gpg" ,gnupg-2.0)))  ;2.1 fails to talk to 
>> > gpg-agent 2.0
>> 
>> I have yet to test gpg/gpgme 2.1 with gpg-agent 2.0, mostly due to the
>> fact that gnupg 2.0 and 2.1 keep/expect agent sockets in completely
>> different directories.  I tried a couple of things and lost my patience.
>> I do not understand how gpg 2.1 can talk to gpg-agent 2.0 without weird
>> hackery.
>> 
>> This version installs from git because it has been 20 days since my
>> request to bump the version [1], and I got impatient.
>> 
>> Troy
>> 
>> [0] https://lists.gnu.org/archive/html/guix-devel/2016-08/msg01885.html
>> [1] https://github.com/jaymzh/pius/issues/46
>
>> From 581ff5477ad7dd0d58550ffcfa68116873a1a1bf Mon Sep 17 00:00:00 2001
>> From: Troy Sankey 
>> Date: Sat, 24 Dec 2016 22:53:07 -0500
>> Subject: [PATCH] gnu: pius: Update to 2.2.2-0.891687c.
>> 
>> * gnu/packages/gnupg.scm (pius): Update to 2.2.2-0.891687c.
>> [inputs]: Change GNUPG-2.0 to GNUPG (2.1).
>
> Thanks, this change LGTM.

+1, applied.

> I think we should start trying to move away from any dependencies on
> GnuPG 2.0, since it will be retired in ~12 months:

Agreed.

Thank you!

Ludo’.



Re: [PATCH 1/2] gnu: Add cargo.

2016-12-30 Thread Chris Marusich
David Craven  writes:

>> What does "vendored dependencies" mean?  Are there dependencies included
>> in this tarball which are not managed via Guix?
>
> Rust crates are included as source in the vendor subfolder. It uses
> the cargo vendor subcommand [0] for building cargo offline. I don't
> think that people want this merged, I only published it in case
> someone is interested and as an example of how you could deploy a
> webapplication written in rust.
>
> [0] https://github.com/alexcrichton/cargo-vendor

I'm not sure I follow.  I downloaded

  https://github.com/dvc94ch/cargo/archive/0.15.0-cargo-vendor.tar.gz

and checked out its "vendor" directory - it looks like there's a lot of
source code for other packages included right in there.  I understand
that this is some sort of mechanism to enable cargo to build things
offline, but is it appropriate to put all of those other packages'
source into the "cargo" package that is going to be built by Guix?  I
haven't been following the Cargo/Rust in Guix discussion thread, so it's
entirely possible I just missed something that was already discussed.

>> Should some of these be native-inputs?  Like cmake or pkg-config?
>
> Cargo is a build tool, it uses cmake and pkg-config at runtime to
> check for c dependencies and compile c code (like for building the
> bundled llvm in rustc).
>
> guix gc --references /gnu/store/g88cylsl8x8d4jvpqgaas1dwws77d2c1-cargo-0.15.0
> /gnu/store/4pnp5scrgmjp21flaihmgbckwrz6z4g3-libgcrypt-1.7.3
> /gnu/store/a64w9dq219a8d9k4mfz76mnzph9wsvfj-zlib-1.2.8
> /gnu/store/cdi08kw7r6r684w8mk0xq0dkgpjhfpmd-gcc-4.9.4-lib
> /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24
> /gnu/store/k9rds2a8fbk7qn8dak5y6lwmyq7ds437-libssh2-1.7.0
> /gnu/store/liib5wid6rx9rkss78spc7wcqzwb1g2k-openssl-1.0.2j
> /gnu/store/nblsf2i13xvxwsy947wmf7zyv6viadwl-curl-7.50.3

OK.  That makes sense.  But I wonder why cmake and pkg-config are
missing from the list of references if that is the case?

>> Why don't the tests work?
>
> Haven't looked into it yet, I thought ng0 wanted to experiment with
> the rust build system and needed an up-to-date cargo.

OK.

>> Don't we have to patch the shebangs to make them work?
>
> Nope. Patching shebangs at this stage is only needed for the build to
> work. The build works, all scripts that end up in the output directory
> are patched after the install phase.

I see.

> I'd also need to import the cargo-build-system in this commit.

I tried applying these two patches and, yes, I got an error because
cargo-build-system wasn't present.

-- 
Chris


signature.asc
Description: PGP signature


Re: [PATCH] gnu: gnome-tweak-tool: Use glib-or-gtk-build-system

2016-12-30 Thread Chris Marusich
Christopher Baines  writes:

> * gnu/packages/gnome.scm (gnome-tweak-tool): Switch from the gnu build
> system to the glib-or-gtk build system, to fix missing gobject
> introspection namespaces.
> ---
>  gnu/packages/gnome.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 91da7783a..5f13cdd0e 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -5288,12 +5288,12 @@ existing databases over the internet.")
>(sha256
> (base32
>  "1fj6wjvnjygzm9br3sw9gya6d18yly1rm69yaiar9spfbkvv4wai"
> -(build-system gnu-build-system)
> +(build-system glib-or-gtk-build-system)
>  (arguments
>   `(#:configure-flags '("--localstatedir=/tmp"
> "--sysconfdir=/tmp")
> #:imported-modules ((guix build python-build-system)
> -   ,@%gnu-build-system-modules)
> +   ,@%glib-or-gtk-build-system-modules)
> #:phases (modify-phases %standard-phases
>(add-after 'install 'wrap
>  (@@ (guix build python-build-system) wrap)

When I build this with --rounds=2, I get the following error:

  output ‘/gnu/store/2469sq8ny3f7dffx3v30y27d882hy5k4-module-import-compiled’ 
of ‘/gnu/store/8frm3y92vlkxjb2x0ljcrzx4qy357wv9-module-import-compiled.drv’ 
differs from previous round

I don't get that error when building the previous version of
gnome-tweak-tool, but I'm not sure if it indicates a problem with
gnome-tweak-tool or some other component.

I've also noticed that the tool doesn't work in a pure environment -
this occurs both before and after applying your patch:

--8<---cut here---start->8---
$ guix environment --pure --ad-hoc gnome-tweak-tool
substitute: updating list of substitutes from 
'https://hydra-mirror.marusich.info'... 100.0%
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 
100.0%
substitute: updating list of substitutes from 'https://hydra.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/ww98gqfb4mpfybm667d64jcgkqggadx9-profile.drv
   /gnu/store/sjfdj137hjqiig79hf3y8rz2i4p4s378-gtk-icon-themes.drv
   /gnu/store/pcj6yb9i03dffqqa8qgwhv9fbbgswvdq-fonts-dir.drv
   /gnu/store/jhiq2626lp4k6d2apn7hvb6zfjpn7v3w-xdg-mime-database.drv
   /gnu/store/bq2vhg7lpygfixi473yy1x4n3p3kpxjw-info-dir.drv
   /gnu/store/29kb6zrcy3avc70k08ph39fgmm74fv5h-gtk-im-modules.drv
   /gnu/store/1lb9d7qcrsfwmjkpk55i0yj935hvzwy1-ca-certificate-bundle.drv
warning: collision encountered: 
/gnu/store/a9w50gcm642akrdd7905jp4f3sw5rs1i-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
 
/gnu/store/2s45v3s71hcnxxgsj2b42kmfqygn0rca-gtk+-3.20.9/share/icons/hicolor/icon-theme.cache
 
warning: arbitrarily choosing 
/gnu/store/a9w50gcm642akrdd7905jp4f3sw5rs1i-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
warning: collision encountered: 
/gnu/store/vdzbg5rv8glrg7lx1sb62c00r8ll6rkw-gsettings-desktop-schemas-3.20.0/share/glib-2.0/schemas/gschemas.compiled
 
/gnu/store/2s45v3s71hcnxxgsj2b42kmfqygn0rca-gtk+-3.20.9/share/glib-2.0/schemas/gschemas.compiled
 
warning: arbitrarily choosing 
/gnu/store/vdzbg5rv8glrg7lx1sb62c00r8ll6rkw-gsettings-desktop-schemas-3.20.0/share/glib-2.0/schemas/gschemas.compiled
[0] [env] marusich@garuda:~/guix
$ type gnome-tweak-tool 
gnome-tweak-tool is 
/gnu/store/xmfcs5p27cyfrm7xqvk5dvmglrglqw13-profile/bin/gnome-tweak-tool
[0] [env] marusich@garuda:~/guix
$ gnome-tweak-tool 
WARNING : Shell not installed or running

(.gnome-tweak-tool-real:32567): Gtk-WARNING **: Could not find the icon 
'gnome-tweak-tool'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not 
be saved or shared with other applications.

(.gnome-tweak-tool-real:32567): GLib-GIO-ERROR **: Settings schema 
'org.gnome.settings-daemon.plugins.xsettings' is not installed

Trace/breakpoint trap
[133] [env] marusich@garuda:~/guix
$ 
--8<---cut here---end--->8---

Do you know anything about these issues?

-- 
Chris


signature.asc
Description: PGP signature


Happy new hacking

2016-12-30 Thread Daniel Pimentel (d4n1)
Happy new hacking Guix!

The GuixSD 0.12 with LUKS was a gifts for me :)

Happy new hacking,

Re: [PATCH] gnu: Add kakoune

2016-12-30 Thread Carlo Zancanaro

On Fri, Dec 30 2016, Leo Famulari wrote
>> diff --git a/gnu/packages/patches/kakoune-fix-bash-path.patch 
>> b/gnu/packages/patches/kakoune-fix-bash-path.patch
>> diff --git a/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch 
>> b/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch
>
> Patches require some commentary explaining what problem they are solving
> and, if the approach they take is unclear, how they do it. If they are
> copied from somewhere else, they need attribution.
>
> In this case, we need to explain why upstream's approach of finding a
> POSIX shell doesn't work.

Perhaps you can give me a hint on this. I've patched it myself because
the original code uses confstr with _CS_PATH, but within the build
environment (and presumably outside of it, too) it gives back
"/bin:/usr/bin". Within the build environment this is invalid (as
neither directory exists), so the tests all fail. There is a bug[1]
about this already, but it was closed without fixing the issue (due to
some complexity/ambiguity in doing so, and no immediate need to fix it).

I can try to come up with a better way to patch this, but I don't know
if I should actually use the PATH environment variable. The patch that
changed this code to use _CS_PATH instead of PATH was made fifteen days
ago and was apparently to "use a POSIX guaranteed way of getting the
shell path"[2].

I could package the commit from just before the patch instead (which
would make this problem go away for now), or we can try to come up with
a real solution to the problem.

[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23112.
[2]: 
https://github.com/mawww/kakoune/commit/9a879262a272bd4c6458fcfa07a9289ee41d7220

>> +   (add-before 'configure 'patch-bash-path
>> + (lambda* (#:key inputs #:allow-other-keys)
>> +   (substitute* "src/shell_manager.cc"
>> + (("__BASH_PATH__")
>> +  (assoc-ref inputs "bash")
>
> I wonder if we can do this change all in the same place. It's sort of
> complicated to use a patch and a substitution.
>
> Also, using a patch to get half-way there will cause the source code
> given by `guix build --source` to be unbuildable, right? So, I think we
> should find another way to fix whatever is wrong with the shell-finding
> logic. Perhaps it will require cooperation with the upstream
> maintainers, I don't know.

I hadn't thought about the effect this would have on `guix build
--source`. That's a fairly big problem.

Everything else that I haven't responded to is fine. I'll fix them up
and send a new patch once I have some direction on the _CS_PATH issue.

Carlo


signature.asc
Description: PGP signature


Re: [PATCH 1/2] gnu: Add cargo.

2016-12-30 Thread David Craven
> What does "vendored dependencies" mean?  Are there dependencies included
> in this tarball which are not managed via Guix?

Rust crates are included as source in the vendor subfolder. It uses
the cargo vendor subcommand [0] for building cargo offline. I don't
think that people want this merged, I only published it in case
someone is interested and as an example of how you could deploy a
webapplication written in rust.

[0] https://github.com/alexcrichton/cargo-vendor

> Should some of these be native-inputs?  Like cmake or pkg-config?

Cargo is a build tool, it uses cmake and pkg-config at runtime to
check for c dependencies and compile c code (like for building the
bundled llvm in rustc).

guix gc --references /gnu/store/g88cylsl8x8d4jvpqgaas1dwws77d2c1-cargo-0.15.0
/gnu/store/4pnp5scrgmjp21flaihmgbckwrz6z4g3-libgcrypt-1.7.3
/gnu/store/a64w9dq219a8d9k4mfz76mnzph9wsvfj-zlib-1.2.8
/gnu/store/cdi08kw7r6r684w8mk0xq0dkgpjhfpmd-gcc-4.9.4-lib
/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24
/gnu/store/k9rds2a8fbk7qn8dak5y6lwmyq7ds437-libssh2-1.7.0
/gnu/store/liib5wid6rx9rkss78spc7wcqzwb1g2k-openssl-1.0.2j
/gnu/store/nblsf2i13xvxwsy947wmf7zyv6viadwl-curl-7.50.3

> Why don't the tests work?

Haven't looked into it yet, I thought ng0 wanted to experiment with
the rust build system and needed an up-to-date cargo.

> Don't we have to patch the shebangs to make them work?

Nope. Patching shebangs at this stage is only needed for the build to
work. The build works, all scripts that end up in the output directory
are patched after the install phase.

> Perhaps we can give a better description?  The guide has more info;
> maybe we can adapt some of that info to a more detailed description:

Sure.

> Your comment says "GPL2" but the code says "gpl2+".  Doesn't "gpl2+"
> mean "GPL2 or later"?  I don't think those are the same thing.

Ah yes, it is only GPL2.

I'd also need to import the cargo-build-system in this commit.



Re: [PATCH 1/2] gnu: Add cargo.

2016-12-30 Thread Chris Marusich
David Craven  writes:

> +(define-public cargo
> +  (package
> +(name "cargo")
> +(version (cargo-version (rustc-version 
> %rust-bootstrap-binaries-version)))
> +(source (origin
> +  (method url-fetch)
> +  ;; Use a cargo tarball with vendored dependencies and a cargo

What does "vendored dependencies" mean?  Are there dependencies included
in this tarball which are not managed via Guix?

> +(inputs
> + `(("cmake" ,cmake)
> +   ("curl" ,curl)
> +   ("libgit2" ,libgit2)
> +   ("libssh2" ,libssh2)
> +   ("openssl" ,openssl)
> +   ("pkg-config" ,pkg-config)
> +   ("python-2" ,python-2)
> +   ("zlib" ,zlib)))

Should some of these be native-inputs?  Like cmake or pkg-config?

> +(arguments
> + `(#:cargo ,cargo-bootstrap
> +   #:tests? #f ; FIXME

Why don't the tests work?

> +   #:phases
> +   (modify-phases %standard-phases
> + ;; Avoid cargo complaining about missmatched checksums.
> + (delete 'patch-source-shebangs)
> + (delete 'patch-generated-file-shebangs)
> + (delete 'patch-usr-bin-file)

Don't we have to patch the shebangs to make them work?

> + ;; Set CARGO_HOME to use the vendored dependencies.
> + (add-after 'unpack 'set-cargo-home
> +   (lambda* (#:key inputs #:allow-other-keys)
> + (let* ((gcc (assoc-ref inputs "gcc"))
> +(cc (string-append gcc "/bin/gcc")))
> +   (setenv "CARGO_HOME" (string-append (getcwd) "/cargohome"))
> +   (setenv "CMAKE_C_COMPILER" cc)
> +   (setenv "CC" cc))
> + #t)
> +(home-page "https://github.com/rust-lang/cargo;)
> +(synopsis "Build tool and package manager for Rust")
> +(description "Cargo downloads your Rust project’s dependencies and 
> compiles
> +your project.")

Perhaps we can give a better description?  The guide has more info;
maybe we can adapt some of that info to a more detailed description:

http://doc.crates.io/guide.html

> +;; Cargo is dual licensed Apache and MIT. Also contains
> +;; code from openssl which is GPL2 with linking exception.
> +(license (list license:asl2.0 license:expat license:gpl2+

Your comment says "GPL2" but the code says "gpl2+".  Doesn't "gpl2+"
mean "GPL2 or later"?  I don't think those are the same thing.

-- 
Chris


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add nethack.

2016-12-30 Thread Kei Kebreau
Chris Marusich  writes:

> Hi Kei,
>
> I felt the need to play a game, so I was looking into packaging Nethack.
> But I then found this email thread and saw that you already tried it!
> Inspired by the RPG theme, I decided to perform thread necromancy! :-)
>
> How did this pan out?  It looks like Nethack didn't wind up in the Guix
> git repo.  Was there a blocking issue?  The plan to create a ~/.nethack
> directory sounds like a good idea.
>

Creating the ~/.nethack directory does in fact work, but the last
NetHack patch in that thread messes with the user's home directory as
part of the installation process, which is forbidden for official Guix
packages. The correct fix for this would be to patch NetHack's source
code so that writing to files in the store (this is why I used the
~/.nethack directory workaround) would be unnecessary.

> Kei Kebreau  writes:
>
>> I haven't asked NetHack maintainers for advice yet. It seems like that
>> would be the next logical step, though.
>
> Did you ever talk with them about the issues you found?

I emailed them but never received a response.

P.S. I've been pondering on the patch for a while now, and IIRC Chris
Webber had a WIP angband patch on the mailing list as well. Help with
either package would be well appreciated! :-)


signature.asc
Description: PGP signature


Re: [PATCH 01/10] gnu: Add dummy linker for propeller-elf.

2016-12-30 Thread Kei Kebreau
Ricardo Wurmus  writes:

> * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add case for
> propeller-elf.
> ---
>  gnu/packages/bootstrap.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
> index 11ebd79..dd922c3 100644
> --- a/gnu/packages/bootstrap.scm
> +++ b/gnu/packages/bootstrap.scm
> @@ -174,6 +174,7 @@ successful, or false to signal an error."
>  ((string=? system "arm-eabi") "no-ld.so")
>  ((string=? system "xtensa-elf") "no-ld.so")
>  ((string=? system "avr") "no-ld.so")
> +((string=? system "propeller-elf") "no-ld.so")
>  ((string=? system "i686-mingw") "no-ld.so")
>  
>  (else (error "dynamic linker name not known for this system"

Linting complains about propeller-gcc's patch file name(s) not starting
with the package name. Also, openspin does not build reproducibly. Other
than those two things, this LGTM.


signature.asc
Description: PGP signature


[PATCH] gnu: Add emacs-git-gutter

2016-12-30 Thread Christopher Baines
* gnu/packages/emacs.scm (emacs-git-gutter): New variable.
---
 gnu/packages/emacs.scm | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 5b6b9900a..f062a7557 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1414,6 +1414,32 @@ strings.")
 files and directories.")
 (license license:gpl3+)))
 
+(define-public emacs-git-gutter
+  (package
+(name "emacs-git-gutter")
+(version "0.90")
+(source (origin
+ (method url-fetch)
+ (uri (string-append
+   "https://github.com/syohex/; name "/archive/"
+   version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+  (base32
+   "1nmhvhpq1l56mj2yq3ag23rw3x4xgnsy8szp30s26l0yjnkhc4qg"
+(build-system emacs-build-system)
+(home-page "https://github.com/syohex/emacs-git-gutter;)
+(synopsis "See and manage hunks of text in a version control system")
+(description
+ "This package is an Emacs minor mode for displaying and interacting with
+hunks of text managed in a version control system.  Added modified and deleted
+areas can be indicated with symbols on the edge of the buffer, and commands
+can be used to move between and perform actions on these hunks.
+
+Git, Mercurial, Subversion and Bazaar are supported, and many parts of the
+display and behaviour is easily customisable.")
+(license license:gpl3+)))
+
 (define-public emacs-el-mock
   (package
 (name "emacs-el-mock")
-- 
2.11.0




Re: 01/01: gnu: Add Nagios.

2016-12-30 Thread Leo Famulari
On Wed, Nov 30, 2016 at 10:31:09PM +, Ludovic Court�s wrote:
> civodul pushed a commit to branch master
> in repository guix.
> 
> commit d30e578a0011b05d1e7d8b3ba7ee38588eba301c
> Author: Ludovic Courtès 
> Date:   Wed Nov 30 23:26:57 2016 +0100
> 
> gnu: Add Nagios.
> 
> * gnu/packages/monitoring.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

> +(version "4.0.8")
> +;; XXX: Newer versions such as 4.2.3 bundle a copy of AngularJS.

This version of Nagios includes some severe security vulnerabilities:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9566
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9565

They allow remote attackers to read and write arbitrary files (leading
to remote code execution) or to escalate privilege to the superuser.

What should we do?


signature.asc
Description: PGP signature


[PATCH 2/4] gnu: gnome-tweak-tool: Include GI_TYPELIB_PATH

2016-12-30 Thread Christopher Baines
* gnu/packages/gnome.scm (gnome-tweak-tool): Add another wrap phase to
include GI_TYPELIB_PATH.
---
 gnu/packages/gnome.scm | 8 
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 5f13cdd0e..12a30d12d 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5295,6 +5295,14 @@ existing databases over the internet.")
#:imported-modules ((guix build python-build-system)
,@%glib-or-gtk-build-system-modules)
#:phases (modify-phases %standard-phases
+  (add-after
+  'install 'wrap-program
+(lambda* (#:key outputs #:allow-other-keys)
+  (let ((out   (assoc-ref outputs "out"))
+(gi-typelib-path   (getenv "GI_TYPELIB_PATH")))
+(wrap-program (string-append out 
"/bin/gnome-tweak-tool")
+  `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path
+  #t))
   (add-after 'install 'wrap
 (@@ (guix build python-build-system) wrap)
 (native-inputs
-- 
2.11.0




[PATCH 1/4] gnu: gnome-tweak-tool: Use glib-or-gtk-build-system

2016-12-30 Thread Christopher Baines
* gnu/packages/gnome.scm (gnome-tweak-tool): Switch from the gnu build
system to the glib-or-gtk build system, to fix missing gobject
introspection namespaces.
---
 gnu/packages/gnome.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 91da7783a..5f13cdd0e 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5288,12 +5288,12 @@ existing databases over the internet.")
   (sha256
(base32
 "1fj6wjvnjygzm9br3sw9gya6d18yly1rm69yaiar9spfbkvv4wai"
-(build-system gnu-build-system)
+(build-system glib-or-gtk-build-system)
 (arguments
  `(#:configure-flags '("--localstatedir=/tmp"
"--sysconfdir=/tmp")
#:imported-modules ((guix build python-build-system)
-   ,@%gnu-build-system-modules)
+   ,@%glib-or-gtk-build-system-modules)
#:phases (modify-phases %standard-phases
   (add-after 'install 'wrap
 (@@ (guix build python-build-system) wrap)
-- 
2.11.0




[PATCH 4/4] gnu: gnome-tweak-tool: Add missing inputs

2016-12-30 Thread Christopher Baines
* gnu/packages/gnome.scm (gnome-tweak-tool)[inputs]: Add gnome-desktop
and libsoup.
---
 gnu/packages/gnome.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index a76ec2f4e..3bed2768d 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5311,6 +5311,8 @@ existing databases over the internet.")
 (inputs
  `(("python" ,python-2)
("python2-pygobject" ,python2-pygobject)
+   ("gnome-desktop" ,gnome-desktop)
+   ("libsoup" ,libsoup)
("libnotify" ,libnotify)
("gobject-introspection" ,gobject-introspection)
("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
-- 
2.11.0




Re: [PATCH] gnu: gnome-tweak-tool: Use glib-or-gtk-build-system

2016-12-30 Thread Christopher Baines
On 29/12/16 18:05, Ludovic Courtès wrote:
> Hi!
> 
> Christopher Baines  skribis:
> 
>> * gnu/packages/gnome.scm (gnome-tweak-tool): Switch from the gnu build
>> system to the glib-or-gtk build system, to fix missing gobject
>> introspection namespaces.
> 
> Using ‘glib-or-gtk-build-system’ sounds right here, but with this patch,
> I get:
> 
> --8<---cut here---start->8---
> $ ./pre-inst-env guix build gnome-tweak-tool 
> /gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1
> ludo@pluto ~/src/guix$ 
> /gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/bin/gnome-tweak-tool
>  
> Traceback (most recent call last):
>   File 
> "/gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/bin/..gnome-tweak-tool-real-real",
>  line 24, in 
> gi.require_version("Gtk", "3.0")
>   File 
> "/gnu/store/dhcvv1qczvqwsj7fdi1qpny8myrqydb8-python2-pygobject-3.20.0/lib/python2.7/site-packages/gi/__init__.py",
>  line 102, in require_version
> raise ValueError('Namespace %s not available' % namespace)
> ValueError: Namespace Gtk not available
> --8<---cut here---end--->8---
> 
> and:
> 
> --8<---cut here---start->8---
> $ ./pre-inst-env guix environment --ad-hoc gnome-tweak-tool -- 
> gnome-tweak-tool
> 
> [...]
> 
> ** (..gnome-tweak-tool-real-real:27638): WARNING **: Error retrieving 
> accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The 
> name org.a11y.Bus was not provided by any .service files
> WARNING : Shell not installed or running
> Traceback (most recent call last):
>   File 
> "/gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/lib/python2.7/site-packages/gtweak/app.py",
>  line 39, in do_activate
> self.win = Window(self, model)
>   File 
> "/gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/lib/python2.7/site-packages/gtweak/tweakview.py",
>  line 58, in __init__
> self._model.load_tweaks(self)
>   File 
> "/gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/lib/python2.7/site-packages/gtweak/tweakmodel.py",
>  line 125, in load_tweaks
> mods = __import__("gtweak.tweaks", globals(), locals(), tweak_files, 0)
>   File 
> "/gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/lib/python2.7/site-packages/gtweak/tweaks/tweak_group_shell.py",
>  line 98, in 
> sw = StaticWorkspaceTweak(size_group=sg, loaded=_shell_loaded)
>   File 
> "/gnu/store/p6g06x6l1b3iw7hm447ys9sqr8bh2nbp-gnome-tweak-tool-3.20.1/lib/python2.7/site-packages/gtweak/tweaks/tweak_group_shell.py",
>  line 50, in __init__
> default = 
> self.STATUS.keys()[self.STATUS.values().index(self.settings[self.key_name])]
> ValueError: None is not in list
> --8<---cut here---end--->8---
> 
> Is this a different error?

I seem to remember this change being sufficient, but I can reproduce the
behavior above when not using GuixSD. I'll send a new set of patches
that attempt to further improve the package.



signature.asc
Description: OpenPGP digital signature


[PATCH 3/4] gnu: gnome-tweak-tool: Make propagated-inputs just inputs

2016-12-30 Thread Christopher Baines
* gnu/packages/gnome.scm (gnome-tweak-tool): Just use inputs, as these
are now referenced by the package.
---
 gnu/packages/gnome.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 12a30d12d..a76ec2f4e 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5310,9 +5310,8 @@ existing databases over the internet.")
("pkg-config" ,pkg-config)))
 (inputs
  `(("python" ,python-2)
-   ("python2-pygobject" ,python2-pygobject)))
-(propagated-inputs
- `(("libnotify" ,libnotify)
+   ("python2-pygobject" ,python2-pygobject)
+   ("libnotify" ,libnotify)
("gobject-introspection" ,gobject-introspection)
("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
("gtk+" ,gtk+)))
-- 
2.11.0




Re: [PATCH] gnu: Add kakoune

2016-12-30 Thread Leo Famulari
On Fri, Dec 30, 2016 at 03:44:13PM +1100, Carlo Zancanaro wrote:
> From 57b2f9e6af20606e302fc4040515d7a92bde73fc Mon Sep 17 00:00:00 2001
> From: Carlo Zancanaro 
> Date: Fri, 30 Dec 2016 02:15:59 +1100
> Subject: [PATCH] gnu: Add kakoune
> To: guix-devel@gnu.org
> 
> * gnu/packages/patches/kakoune-fix-bash-path.patch: New file.
> * gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register patches.
> * gnu/packages/text-editors.scm (kakoune): New variable.

Thank you!

> diff --git a/gnu/packages/patches/kakoune-fix-bash-path.patch 
> b/gnu/packages/patches/kakoune-fix-bash-path.patch
> diff --git a/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch 
> b/gnu/packages/patches/kakoune-leave-manpages-uncompressed.patch

Patches require some commentary explaining what problem they are solving
and, if the approach they take is unclear, how they do it. If they are
copied from somewhere else, they need attribution.

In this case, we need to explain why upstream's approach of finding a
POSIX shell doesn't work.

> diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm

> +(define-public kakoune
> +  (let ((commit "4f986776423f5cd5fd80a16735f873ae23c10da2"))

Can you say why you chose this commit? Is it simply the most recent
commit when you made the package?

> +(package
> +  (name "kakoune")
> +  (version (string-append "0.0.1-" (string-take commit 7)))

Please add a revision counter, as described in the manual, section 7.6.3
Version Numbers. The resulting version will look like this:


> +  (version (string-append "0.0.0-" revision "." (string-take commit 7)))

> + (file-name (string-append "kakoune-" version))

Please append '-checkout' to the end of the file-name.

> +   (add-before 'configure 'patch-bash-path
> + (lambda* (#:key inputs #:allow-other-keys)
> +   (substitute* "src/shell_manager.cc"
> + (("__BASH_PATH__")
> +  (assoc-ref inputs "bash")

I wonder if we can do this change all in the same place. It's sort of
complicated to use a patch and a substitution.

Also, using a patch to get half-way there will cause the source code
given by `guix build --source` to be unbuildable, right? So, I think we
should find another way to fix whatever is wrong with the shell-finding
logic. Perhaps it will require cooperation with the upstream
maintainers, I don't know.

> +   ;; Kakoune doesn't have a configure script, but it still
> +   ;; requires us to do some setup/configuration.
> +   (replace 'configure
> + (lambda* (#:key outputs #:allow-other-keys)
> +   ;; Make has to be run in the src/ directory, so let's
> +   ;; move there now.
> +   (chdir "src")
> +   ;; Boost is compiled with the older ABI, so we can't use
> +   ;; the new ABI if we want to link againt it.
> +   (setenv "CPPFLAGS" "-D_GLIBCXX_USE_CXX11_ABI=0")
> +   (setenv "PREFIX" (assoc-ref outputs "out"

I think that CPPFLAGS and PREFIX should be set in #:make-flags. This
phase would then be renamed to 'chdir' and we'd delete the 'configure'
phase.

> +   (add-before 'check 'fix-test-permissions
> + (lambda* _
> +   ;; The tests fail if they can't write over files in the
> +   ;; test directory, so make sure we can write everywhere
> +   ;; we might possibly need to.
> +   (system* "chmod" "-R" "u+w" "../test"))

This seems like a bug. Can you report it upstream?


signature.asc
Description: PGP signature


riscv cross toolchain - C_INCLUDE_PATH

2016-12-30 Thread David Craven
Hi guix,

I'm trying to build a riscv cross toolchain. Why do I have to reset
C_INCLUDE_PATH to get glibc to build? It seems to me that all the
cross packages shouldn't be in the C_INCLUDE_PATH. Some insight would
be greatly appreciated.

export 
C_INCLUDE_PATH="/gnu/store/sjg2km4jy29wbwpisaab8z0jl5h9v9mn-riscv-glibc-2.24.90-1.e84d3a5-checkout/include:/gnu/store/7nqgj7nz2ypl7dwmjkx0hswbjf0w1a63-gcc-cross-sans-libc-riscv64-unknown-linux-gnu-6.1.0-1.287c5cb/include:/gnu/store/pd7w87bjcq2n4dr481gk14d4y1p2iiaz-binutils-cross-riscv64-unknown-linux-gnu-2.27-1.8c5f683/include:/gnu/store/zpkwh5b3b3hrlpckdpb0givgqg5rf8gn-gettext-minimal-0.19.8.1/include:/gnu/store/d5nscny560slzpljixqzim6b8ms7hhv2-bzip2-1.0.6/include:/gnu/store/4yg6q1kp856m68arkpqc85hqgbffhpxf-xz-5.2.2/include:/gnu/store/06icf5h4z83mw5g17a58fy26z14dsj9z-file-5.28/include:/gnu/store/k03y1lfaj1xw0d7j2lxdil8ii5c67fdy-gawk-4.1.4/include:/gnu/store/c5ihjcdxsm9086323bn2j67v7z34lc1a-make-4.2.1/include:/gnu/store/4xxd00drj8gjcr84xdfna44qak2vhwmf-binutils-2.27/include:/gnu/store/y1g6991kxvdk4vxhsq07r5saww30v8dq-gcc-4.9.4/include:/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include:/gnu/store/p1qnhavlg6d9mgv6569c8pici37v2dak-linux-libre-headers-cross-riscv64-unknown-linux-gnu-4.4.18/include:/gnu/store/jc898psn5yc9s328nn8fya3sc2daf037-linux-libre-headers-4.4.18/include"

(define-public (riscv-cross-glibc target)
  (let ((glibc (cross-libc target
   (riscv-cross-gcc target)
   (riscv-cross-binutils target)
   (riscv-cross-kernel-headers target)))
(commit "e84d3a58c42e29cc162efa0446bb0a1e3554dde4")
(revision "1"))
(package
  (inherit glibc)
  (version (string-append "2.24.90-" revision "."
  (string-take commit 7)))
  (source (origin
(method git-fetch)
(uri (git-reference
  (url "https://github.com/riscv/riscv-glibc;)
  (commit commit)))
(file-name (string-append "riscv-glibc-" version "-checkout"))
(sha256
 (base32
  "0pbg4f7y7l5kwvb6z8c7s6cp8nrypkvz6cgcc2m03k671p1zwgpi"
  (arguments
   (substitute-keyword-arguments (package-arguments glibc)
 ((#:configure-flags configure-flags)
  `(cons "--disable-werror" ,configure-flags))
 ((#:phases phases)
  `(modify-phases ,phases
 (add-before 'build 'reset-c-include-path
   (lambda* (#:key inputs #:allow-other-keys)
 (setenv "C_INCLUDE_PATH"
 (string-append (assoc-ref inputs "kernel-headers")
"/include")))



[PATCH 1/3] gnu: Add mozjs-38.

2016-12-30 Thread ng0
From: ng0 

* gnu/packages/gnuzilla.scm (mozjs-38): New variable.
---
 gnu/packages/gnuzilla.scm | 123 ++
 1 file changed, 123 insertions(+)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 07ed2af0b..4ad4218eb 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2015 Sou Bunnbu 
 ;;; Copyright © 2016 Efraim Flashner 
 ;;; Copyright © 2016 Alex Griffin 
+;;; Copyright © 2016 ng0 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,6 +41,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages libevent)
@@ -149,6 +151,127 @@ in C/C++.")
  `(("libffi" ,libffi)
("zlib" ,zlib)
 
+(define-public mozjs-38
+  (package (inherit mozjs)
+(name "mozjs")
+(version "38.2.1.rc0")
+(source (origin
+  (method url-fetch)
+  (uri (list
+;; The upstream server at people.mozilla.org produces
+;; a tls handshake error, the file at people.freebsd.org
+;; is identical and produces no such error.
+(string-append
+ "https://people.freebsd.org/~sunpoet/distfiles/;
+ name "-" version ".tar.bz2")
+;; XXX: The upstream server at people.mozilla.org
+;; TODO: Use revision control system checkout?
+(string-append
+ "https://people.mozilla.org/~sstangl/;
+ name "-" version ".tar.bz2")))
+  ;; TODO: Unbundle icu ("intl" dir)
+  (sha256
+   (base32
+"0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"
+(arguments
+ `(;; XXX: parallel build fails, lacking:
+   ;;   mkdir -p "system_wrapper_js/"
+   ;; #:parallel-build? #f
+   ;; Tests fail due to missing module 'xpt':
+   ;; ImportError: No module named xpt
+   #:tests? #f
+   #:phases
+   (modify-phases %standard-phases
+ (replace 'configure
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+   (chdir "js/src")
+   ;; configure fails if it is followed by SHELL and CONFIG_SHELL
+   (setenv "SHELL" (which "sh"))
+   (setenv "CONFIG_SHELL" (which "sh"))
+   (setenv "LIBXUL_DIST" (assoc-ref %outputs "out"))
+   ;; TODO: Use exact version, if we leave this empty it
+   ;; will be empty in the .pc file.
+   ;; (setenv "MOZILLA_VERSION" "38.2.1")
+   ;; (setenv "MOZJS_MAJOR_VERSION" "38")
+   ;; (setenv "MOZJS_MINOR_VERSION" "2")
+   ;; (setenv "MOZJS_PATCH_VERSION" "1")
+   ;;
+   ;; (substitute* "js.pc.in"
+   ;;   ;;(("@MOZILLA_VERSION@") "38.2.1"))
+   ;;   (("@MOZILLA_VERSION@") "38.0.0"))
+   (zero? (system* "./configure"
+   (string-append "--prefix=" out)
+   "--with-system-nspr"
+   "--enable-system-ffi"
+   "--enable-threadsafe"
+   "--with-system-icu"
+   "--with-system-zlib"
+   "--enable-readline"
+
+   ;; These are required by 0ad and they may
+   ;; or may not be good defaults for other
+   ;; uses.
+   "--enable-gcgenerational"
+   "--enable-shared-js")
+ (add-after 'install 'fix-header-symlinks
+   ;; The headers are symlinks to a directory that does not
+   ;; get put into the store location, so they end up broken.
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(inc (string-append out "/include/mozjs-"))
+(incjs (string-append inc "/js"))
+(moz (string-append inc "/mozilla")))
+   ;; TODO: for-each
+   (chdir "../..") ; Change to root of build directory
+   (delete-file-recursively incjs)
+   (copy-recursively "js/public/" incjs)
+   ;; Remove stuff we don't need:
+   (delete-file-recursively moz)
+   (copy-recursively "mfbt" moz)
+   (delete-file (string-append inc "/jsalloc.h"))
+   (delete-file (string-append inc "/jsapi.h"))
+   

[PATCH 2/3] gnu: Add 0ad-data.

2016-12-30 Thread ng0
From: ng0 

* gnu/packages/games.scm (0ad-data): New variable.
---
 gnu/packages/games.scm | 46 ++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index a3b9f04b9..69c72a55f 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3068,3 +3068,49 @@ symbols, the game needs graphics to render the 
non-euclidean world.")
 for Un*x systems with X11.")
 (home-page "http://olofson.net/kobodl/;)
 (license license:gpl2+)))
+
+(define 0ad-data
+  (package
+(name "0ad-data")
+(version "0.0.21-alpha")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://releases.wildfiregames.com/0ad-;
+ version "-unix-data.tar.xz"))
+   (file-name (string-append name "-" version ".tar.xz"))
+   (sha256
+(base32
+ "15xadyrpvq27lm9p1ny7bcmmv56m16h3xadbkdx69gfkzxc3razk"
+(build-system trivial-build-system)
+(native-inputs
+ `(("source" ,source)
+   ("tar" ,tar)
+   ("xz" ,(@ (gnu packages compression) xz
+(arguments
+ `(#:modules ((guix build utils))
+   #:builder
+   (begin
+ (use-modules (guix build utils))
+ (let ((tar (string-append
+ (assoc-ref %build-inputs "tar")
+ "/bin/tar"))
+   (install-dir (string-append %output
+   "/share/0ad/data"))
+   (path (string-append (assoc-ref %build-inputs
+   "xz")
+"/bin")))
+   (setenv "PATH" path)
+   (system* tar "xvf" (assoc-ref %build-inputs "source"))
+   (chdir (string-append "0ad-" ,version))
+   (mkdir-p install-dir)
+   (copy-recursively "." install-dir)
+(synopsis "Data for the game 0ad")
+(description
+ "Data files for 0ad.")
+(home-page "http://play0ad.com;)
+(license (list license:gpl2
+   ;; license:lppl1.3c  TODO: ADD.
+   ;; license:bitstream-vera  TODO: ADD.
+   license:cc-by-sa3.0
-- 
2.11.0




[PATCH 3/3] gnu: Add 0ad.

2016-12-30 Thread ng0
From: ng0 

* gnu/packages/games.scm (0ad): New variable.
---
 gnu/packages/games.scm | 147 -
 1 file changed, 146 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 69c72a55f..dba021619 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer 
 ;;; Copyright © 2016 Rodger Fox 
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis 
-;;; Copyright © 2016 ng0 
+;;; Copyright © 2016, 2017 ng0 
 ;;; Copyright © 2016 Albin Söderqvist 
 ;;; Copyright © 2016 Kei Kebreau 
 ;;; Copyright © 2016 Alex Griffin 
@@ -57,6 +57,7 @@
   #:use-module (gnu packages audio)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages fltk)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages game-development)
@@ -65,6 +66,7 @@
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
@@ -74,8 +76,10 @@
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages messaging)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
@@ -98,12 +102,15 @@
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages upnp)
+  #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages ruby)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
   #:use-module (guix build-system python)
@@ -3114,3 +3121,141 @@ for Un*x systems with X11.")
;; license:lppl1.3c  TODO: ADD.
;; license:bitstream-vera  TODO: ADD.
license:cc-by-sa3.0
+
+(define-public 0ad
+  (package
+(name "0ad")
+(version "0.0.21-alpha")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://releases.wildfiregames.com/0ad-;
+ version "-unix-build.tar.xz"))
+   (file-name (string-append name "-" version ".tar.xz"))
+   (sha256
+(base32
+ "1kw3hqnr737ipx4f03khz3hvsh3ha7r8iy9njppk2faa53j27gln"
+(inputs
+ `(("0ad-data" ,0ad-data)
+   ("curl" ,curl)
+   ("enet" ,enet)
+   ("perl" ,perl)
+   ("icu4c" ,icu4c)
+   ("libxml2" ,libxml2)
+   ("nspr" ,nspr)
+   ("libpng" ,libpng)
+   ("sdl2" ,sdl2)
+   ("miniupnpc" ,miniupnpc)
+   ("zlib" ,zlib)
+   ("openjpeg" ,openjpeg)
+   ("mesa" ,mesa)
+   ("libx11" ,libx11)
+   ("libxcursor" ,libxcursor)
+   ("wxwidgets" ,wxwidgets)
+   ("gloox" ,gloox) ; lobby
+   ("mozjs-38" ,mozjs-38)
+   ;; TODO: ("nvidia-texture-tools" ,nvidia-texture-tools)
+   ("libvorbis" ,libvorbis)
+   ("openal" ,openal)))
+(native-inputs
+ `(("cmake" ,cmake)
+   ("pkg-config" ,pkg-config)
+   ("boost" ,boost)
+   ("mesa" ,mesa)
+   ("zip" ,zip)
+   ("python-2" ,python-2)
+   ("python" ,python)
+   ("ruby" ,ruby)
+   ("bash" ,bash)
+   ("libsm" ,libsm)))
+(build-system gnu-build-system)
+;; NOTE:
+;; FIX MOZJS build:
+;; lrwxrwxrwx 2 root root 79 Jan  1  1970 
/gnu/store/xzq971blmjazq7bc267wcgna3bjw15js-mozjs-38.2.1.rc0/include/mozjs-/js/RequiredDefines.h
 -> 
/tmp/guix-build-mozjs-38.2.1.rc0.drv-0/mozjs-38.0.0/js/public/RequiredDefines.h
+(arguments
+ `(#:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'create-/bin/sh-symlink
+   (lambda _
+ ;; The build system creates files during build which expect
+ ;; /bin/sh to exist (shebang).
+ (let ((bash (string-append (assoc-ref %build-inputs "bash")
+   "/bin/sh")))
+   ;;(symlink bash (string-append (assoc-ref %outputs "out")
+   ;; "/bin/sh"))
+   (substitute* 
"build/premake/premake4/src/actions/xcode/xcode_common.lua"
+ (("/bin/sh") bash))
+   (substitute* 

Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?

2016-12-30 Thread ng0

These 3 patches are also in the games/0ad branch here https://pagure.io/guix-dev

No matter what I try, mozjs-38 ends up without a version in some parts and I 
need this to continue (finish) the 0ad package.
Any help is welcome.


Linking mocks_real
ar -rcs ../../../binaries/system/libmocks_real.a 
obj/mocks_real_Release/mocks_real.o 
 Building network (release) 
Creating obj/network_Release
mkdir -p obj/network_Release
precompiled.h
cp ../../../source/pch/network/precompiled.h obj/network_Release
g++ -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH 
-I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 
-I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include 
-I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -x 
c++-header -o "obj/network_Release/precompiled.h.gch" -c 
"../../../source/pch/network/precompiled.h"
NetStats.cpp
g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP 
-DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH 
-I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 
-I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include 
-I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF 
obj/network_Release/NetStats.d -MT "obj/network_Release/NetStats.o" -o 
"obj/network_Release/NetStats.o" -c "../../../source/network/NetStats.cpp"
fsm.cpp
g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP 
-DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH 
-I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 
-I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include 
-I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF 
obj/network_Release/fsm.d -MT "obj/network_Release/fsm.o" -o 
"obj/network_Release/fsm.o" -c "../../../source/network/fsm.cpp"
NetTurnManager.cpp
g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP 
-DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH 
-I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 
-I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include 
-I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF 
obj/network_Release/NetTurnManager.d -MT "obj/network_Release/NetTurnManager.o" 
-o "obj/network_Release/NetTurnManager.o" -c 
"../../../source/network/NetTurnManager.cpp"
In file included from ../../../source/scriptinterface/ScriptInterface.h:26:0,
 from 
../../../source/simulation2/helpers/SimulationCommand.h:21,
 from ../../../source/network/NetTurnManager.h:21,
 from ../../../source/network/NetTurnManager.cpp:20:
../../../source/scriptinterface/ScriptTypes.h:74:25: error: operator '!=' has 
no left operand
 #if MOZJS_MAJOR_VERSION != 38
 ^
../../../source/scriptinterface/ScriptTypes.h:82:25: error: operator '!=' has 
no left operand
 #if MOZJS_MINOR_VERSION != 3
 ^
In file included from 
/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include/signal.h:316:0,
 from 
/gnu/store/y1g6991kxvdk4vxhsq07r5saww30v8dq-gcc-4.9.4/include/c++/csignal:42,
 from ../../../source/lib/pch/pch_stdlib.h:37,
 from ../../../source/lib/precompiled.h:103,
 from ../../../source/pch/network/precompiled.h:19:
/gnu/store/9vn87bm1872c6b9w4lpqnm5ckx5h6gia-mozjs-38.2.1.rc0/include/mozjs-/jspubtd.h:459:74:
 warning: invalid access to non-static data member 
‘js::PerThreadDataFriendFields::RuntimeDummy::mainThread’  of NULL object 
[-Winvalid-offsetof]
 static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, 
mainThread);
  ^
/gnu/store/9vn87bm1872c6b9w4lpqnm5ckx5h6gia-mozjs-38.2.1.rc0/include/mozjs-/jspubtd.h:459:74:
 warning: (perhaps the ‘offsetof’ macro was used incorrectly) 
[-Winvalid-offsetof]
make[1]: *** [network.make:202: obj/network_Release/NetTurnManager.o] Error 1
make: *** [Makefile:21: network] Error 2
make: Leaving directory 
'/tmp/guix-build-0ad-0.0.21-alpha.drv-0/0ad-0.0.21-alpha/build/workspaces/gcc'
phase `build' failed after 8.8 seconds
builder for `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' 
failed with exit code 1
@ build-failed /gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv 
- 1 builder for 
`/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed with 
exit code 1
guix build: error: build failed: build of 
`/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed



Re: [PATCH 02/12] build-system: Add cargo build system.

2016-12-30 Thread Danny Milosavljevic
Hi,

when I use git-download, the files it checked out will have r-- permissions and 
thus cargo-build-system can't patch Cargo.toml .

To reproduce, try:

(define-public rust-c-vec
 (package
  (name "rust-c-vec")
  (version "1.1.0")
  (source
(origin
  (method git-fetch)
  (uri (git-reference
 (url "https://github.com/GuillaumeGomez/c_vec-rs.git;)
 (commit "ee4ccb4ecb092926175ec58c60434ee153190aa8")))
  ;(method url-fetch)
  ;(uri (crate-uri "c_vec" version))
  (file-name
(string-append name "-" version "-checkout"))
  (sha256
(base32
  "0crdx88z8cfmc3j7d71max46acjdz2fgi9izifdw2gh13nzg83rk"
  (build-system cargo-build-system)
  (native-inputs `(("rust-libc" ,rust-libc)))
  (home-page "FIXME") ; FIXME fixed manually. It said ()
  (synopsis "Structures to wrap C arrays")
  (description "Structures to wrap C arrays")
  (license (list license:asl2.0 license:expat