Re: [PATCH 1/1] gnu: Add scrypt.

2017-01-15 Thread Leo Famulari
On Mon, Jan 16, 2017 at 12:43:14AM -0500, Leo Famulari wrote:
> * gnu/packages/crypto.scm (scrypt): New variable.

> +(arguments
> + `(#:phases (modify-phases %standard-phases
> + (add-after 'unpack 'patch-command-invocations

I realized this indentation is too far to the right.

> +(synopsis "Memory-hard key derivation function")

And the synopsis should probably be something like "Memory-hard
encryption tool". At least, it should include "encryption tool".



[PATCH 1/1] gnu: Add scrypt.

2017-01-15 Thread Leo Famulari
* gnu/packages/crypto.scm (scrypt): New variable.
---
 gnu/packages/crypto.scm | 38 +-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index e4a8a4bd5..e27cf45d7 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson 
 ;;; Copyright © 2015 Ricardo Wurmus 
-;;; Copyright © 2016 Leo Famulari 
+;;; Copyright © 2016, 2017 Leo Famulari 
 ;;; Copyright © 2016 Lukas Gradl 
 ;;; Copyright © 2016 Tobias Geerinckx-Rice 
 ;;; Copyright © 2016 ng0 
@@ -378,3 +378,39 @@ no man page, refer to the home page for usage details.")
 storage files: it can be operated from commandline and it can integrate with a
 user's graphical desktop.")
 (license license:gpl3+)))
+
+(define-public scrypt
+  (package
+(name "scrypt")
+(version "1.2.0")
+(source
+  (origin
+(method url-fetch)
+(uri (string-append "https://www.tarsnap.com/scrypt/scrypt-";
+version ".tgz"))
+(sha256
+ (base32
+  "1m39hpfby0fdjam842773i5w7pa0qaj7f0r22jnchxsj824vqm0p"
+(build-system gnu-build-system)
+(arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-after 'unpack 'patch-command-invocations
+   (lambda _
+ (substitute* '("Makefile.in" "autocrap/Makefile.am")
+   (("command -p") ""))
+ #t))
+ (add-after 'install 'install-docs
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref %outputs "out"))
+(misc (string-append out "/share/doc/scrypt")))
+   (install-file "FORMAT" misc)
+   #t))
+(inputs
+ `(("openssl" ,openssl)))
+(home-page "https://www.tarsnap.com/scrypt.html";)
+(synopsis "Memory-hard key derivation function")
+(description "This packages provides a simple password-based encryption
+utility as a demonstration of the @code{scrypt} key derivation function.
+@code{Scrypt} is designed to be far more resistant against hardware brute-force
+attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
+(license license:bsd-2)))
-- 
2.11.0




Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Leo Famulari
On Sun, Jan 15, 2017 at 06:05:02PM -0500, Mark H Weaver wrote:
> Hi Leo,
> 
> Leo Famulari  writes:
> 
> > From 34cc0dc9d9451d540f8733ebca2a3db54a073aa0 Mon Sep 17 00:00:00 2001
> > From: Marius Bakke 
> > Date: Thu, 12 Jan 2017 19:06:55 +0100
> > Subject: [PATCH 1/2] gnu: mupdf: Fix CVE-2016-{10132,10133} in bundled mujs.
> >
> > * gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch,
> > gnu/packages/patches/mupdf-mujs-CVE-2016-10133.patch: New files.
> > * gnu/local.mk (dist_patch_DATA): Add them.
> > * gnu/packages/pdf.scm (mupdf)[replacement]: New field.
> 
> We should indeed add a 'replacement' field to 'mupdf', but that part of
> the patch seems to have gotten lost:

I suspected something was wrong. Thank you for catching this.

And thanks to Marius as well! I'm happy to be collaborating on these
commits.

I pushed the changes as 8afabb2eca954af6fbba8c6ae37e8f0bc3047840.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add notmuch-vim.

2017-01-15 Thread Marius Bakke
ng0  writes:

> Marius Bakke  writes:
>
>> ng0  writes:
>>
>>> * gnu/packages/vim.scm (notmuch-vim): New variable.
>>
>> Thanks for this! I tried installing this plugin, but get an error while
>> loading it according to upstream instructions[0]:
>>
>> Error detected while processing command line:
>> E492: Not an editor command: :NotMuch 
>>
>> Any ideas? The README seems to suggest this depends on the notmuch ruby
>> bindings as well, which is not currently built on Guix. How did you test
>> this?
>
> I really assumed that vim-full provides the ruby bindings and
> that they meant just just, and not just another bindings
> set. Grml... Okay.

I suspect we just need to package 'ruby-notmuch' in a similar vein to
'python-notmuch' and propagate it with the plugin. Possibly also make
sure the 'ruby' executable is referenced by vim/this plugin.

> Do you use vim? I don't do so currently, so I assumed it just works
> when it copied.

I don't use vim often, but when I do, it's to try out plugins from
software I trust ;-) it's more fun when it works, though.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add ghc-flac.

2017-01-15 Thread Marius Bakke
Danny Milosavljevic  writes:

> * gnu/packages/haskell.scm (ghc-flac): New variable.

Cool!

[...]

> +(native-inputs
> + `(("ghc-hspec" ,ghc-hspec)
> +   ("hspec-discover" ,hspec-discover)))

Are these referenced by the built product? If so, they should be in
[inputs]. You can check references with `guix gc -R`, or try something
like `guix graph -t references ghc-flac | dot -T png | feh -` for a tree
view. Or grep the store paths for a "shotgun" approach :-)

The indentation is off some places, but otherwise this LGTM.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Fix load-extension path in packaging of guile-ncurses.

2017-01-15 Thread Mark H Weaver
John Darrington  writes:

> On Sat, Dec 24, 2016 at 10:39:40AM -0500, Mark H Weaver wrote:
>  John Darrington  writes:
>  
>  > We can argue about this till we're blue in the face.
>  >
>  > But on a pragmatic level, Mark's question demonstrates perfectly
>  > that our current system is lacking.
>  
>  No it doesn't.  Our convention, taken from the GNU coding standards, is
>  that the rationale for non-obvious code belongs in the code itself.  My
>  question demonstrates perfectly that you should have done _that_.
>  
>  For what it's worth, I agree that there are some cases where adding
>  rationale comments to the code itself doesn't make sense (e.g. when
>  removing code), but this is clearly not one of those cases.
>  
>  >  > Having it in the commit message would certainly have avoided me 
>  >  > having to explain the situation to Mark too.
>  >  
>  >  Perhaps. I doubt it. I can't speak for Mark, but most confusion
>  >  seemed to stem from the commit message's accuracy, not its length.
>  
>  Yes, exactly.
>  
>  To be honest, I find it unsettling that after all that has been pointed
>  out in this thread, you still seem unwilling to admit that you made any
>  mistake here.
>  
>  Have you looked at the build log, and specifically the part of the build
>  log that corresponds to your 'fix-libguile-ncurses-file-name' phase?
>  
>  Have you noticed how the 'build' and 'install' phases consist mostly of
>  commands that were already run in your custom phase?
>  
>  Do you still think that "Install shared object before attempting to
>  build the package" is an accurate statement?
>  
> I offered to change this comment.  You have ignored my offer.

It's impossible to change that comment, because it's in the commit log.
That's yet another reason why the source code itself is a better place
for documentation than the commit logs.

  Mark



Re: Guix IceCat users have had early access to security fixes

2017-01-15 Thread Mark H Weaver
Hi,

julien lepiller  writes:

> Le 2016-12-15 02:00, Mark H Weaver a écrit :
>> Yesterday, Mozilla released Firefox ESR 45.6 and announced several CVEs
>> fixed by it:
>>
>>   https://www.mozilla.org/en-US/security/advisories/mfsa2016-95/
>>
>> I'm pleased to announce that Guix users of IceCat have had early access
>> all of these fixes.
>>
>> Since November 30 (commit 9689e71d2f2b5e766415a40d5f5ab267768d217d),
>> we've had fixes for CVE-2016-9897, CVE-2016-9898, CVE-2016-9899,
>> CVE-2016-9900, CVE-2016-9904, and 4 out of 11 patches for
>> CVE-2016-9893.
>>
>> Since December 3 (commit 5bdec7d634ce0058801cd212e9e4ea56e914ca0c),
>> we've had the fixes that were later announced as CVE-2016-9901,
>> CVE-2016-9902, CVE-2016-9905, and another patch for CVE-2016-9893.
>>
>> On December 10 (commit 56c394ee4397015d6144dab002ee43fc7e32a331), I
>> cherry-picked the remaining fixes from the not-yet-released Firefox
>> ESR 45.6: CVE-2016-9895, and the final six patches for CVE-2016-9893.
>>
>>   Mark
>
> Impressive, thank you!
>
> I'm a bit curious though, how did you get these patches? Were they
> already advertised as vulnerability fixes at the time you applied
> them? Were they already publicly-available?

I cherry-picked them from the mozilla-esr45 mercurial repository.  They
were not yet advertised as vulnerability fixes.  Often they are only
labeled with a mozilla bug number, and the relevant bug reports are not
publicly accessible.  However, in practice most of the bug fixes applied
to that branch are potentially exploitable.

 Mark



Re: hplip: Add qt5 gui, try to fix policykit support

2017-01-15 Thread ng0
Andy Patterson  writes:

> Hey ng0,
>
>
> On Thu, 29 Dec 2016 14:05:51 +
> ng0  wrote:
>
>
>> I really have no idea how hplip is supposed to be used in Guix after
>> reading the note about the base service. So we are not supposed to
>> run and install it as users in profiles? Will it be in the cups
>> service where I would have no idea how to add it in there? 
>
> I've been printing with an hp for a little while now, and in my system
> configuration I have this:
>
> (service cups-service-type
>  (cups-configuration
>   (web-interface? #t)
>   (extensions
>(list cups-filters hplip
>
> Maybe you've already done that, but I'm just guessing based on what you
> wrote.
>
> I've found that with that configuration, all of hplip's ppd files show
> up when adding the printer via the web interface (which is how I added
> my printer). hp-setup also seems to work ok, and will auto-detect your
> ppd file, but can't print out the test page.
>
> Anyway, I hope that helps.
>
> --
> Andy
>

Hm! Okay, I will try this as soon as I can.
I've been a bit slow with splitting out the qt5 gui, but I will
update the patch soon.

Thanks!
-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/



Re: [PATCH] gnu: add proj4.

2017-01-15 Thread Danny Milosavljevic
Hi,

> * gnu/packages/geo.scm:139:13: proj4-4.9.3: invalid license field
> 
> But the documentation explicitly speaks about list values. What's wrong?

You quoted the list. That means that all the symbols in it stay symbols and are 
not resolved. Instead of substituting the actual license license:asl2.0, it 
will literally put 'license:asl2.0 into the list.

I'd just use something like (list license:a license:b) .

It would also be possible to use quasiquote but I'd not do that in this case. 
It's too obtuse. `(,license:a ,license:b)

> * /home/bjoern/guix/gnu/packages/geo.scm:100:2: proj4-4.9.3: line 125 is way 
> too long (102 characters)

It's an URL in a comment - I'd be fine with it as-is and I wouldn't break it 
anywhere.

> About the package name: The official name is "proj.4", so I left it as that.

Seems reasonable.

> As variable name, I chose "proj4". Is that correct?

Why not use the variable name "proj.4" too then? *scratches head*



[PATCH] gnu: Add ghc-flac.

2017-01-15 Thread Danny Milosavljevic
* gnu/packages/haskell.scm (ghc-flac): New variable.
---
 gnu/packages/haskell.scm | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index b26234d40..b2ee11b2a 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -43,6 +43,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages zip)
@@ -8162,4 +8163,37 @@ Rust syntax.  It is intended to be useful for two 
different purposes:
 files in Haskell.")
 (license license:bsd-3)))
 
+(define-public ghc-flac
+  (package
+(name "ghc-flac")
+(version "0.1.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+ "https://hackage.haskell.org/package/flac/flac-";
+ version
+ ".tar.gz"))
+  (sha256
+(base32
+  "0gl707qcxyzc8cbqsajhxm7j648iv23mpfdayyfc7pwvndy2idsq"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-data-default-class"
+,ghc-data-default-class)
+   ("ghc-exceptions" ,ghc-exceptions)
+  ("ghc-mtl" ,ghc-mtl)
+   ("ghc-text" ,ghc-text)
+   ("ghc-vector" ,ghc-vector)
+   ("ghc-wave" ,ghc-wave)
+   ("ghc-semigroups" ,ghc-semigroups)
+   ("ghc-temporary" ,ghc-temporary)
+   ("flac" ,flac)))
+(native-inputs
+ `(("ghc-hspec" ,ghc-hspec)
+   ("hspec-discover" ,hspec-discover)))
+(home-page "https://github.com/mrkkrp/flac";)
+(synopsis "Haskell binding to libFLAC")
+(description "Complete high-level binding to libFLAC for Haskell.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here



Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Mark H Weaver
Hi Leo,

Leo Famulari  writes:

> From 34cc0dc9d9451d540f8733ebca2a3db54a073aa0 Mon Sep 17 00:00:00 2001
> From: Marius Bakke 
> Date: Thu, 12 Jan 2017 19:06:55 +0100
> Subject: [PATCH 1/2] gnu: mupdf: Fix CVE-2016-{10132,10133} in bundled mujs.
>
> * gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch,
> gnu/packages/patches/mupdf-mujs-CVE-2016-10133.patch: New files.
> * gnu/local.mk (dist_patch_DATA): Add them.
> * gnu/packages/pdf.scm (mupdf)[replacement]: New field.

We should indeed add a 'replacement' field to 'mupdf', but that part of
the patch seems to have gotten lost:

> diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
> index 9b3571e67..5efc5e6d1 100644
> --- a/gnu/packages/pdf.scm
> +++ b/gnu/packages/pdf.scm
> @@ -6,10 +6,11 @@
>  ;;; Copyright © 2016 Roel Janssen 
>  ;;; Coypright © 2016 ng0 
>  ;;; Coypright © 2016 Efraim Flashner 
> -;;; Coypright © 2016 Marius Bakke 
> +;;; Coypright © 2016, 2017 Marius Bakke 
>  ;;; Coypright © 2016 Ludovic Courtès 
>  ;;; Coypright © 2016 Julien Lepiller 
>  ;;; Copyright © 2016 Arun Isaac 
> +;;; Copyright © 2017 Leo Famulari 
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -538,6 +539,18 @@ line tools for batch rendering (pdfdraw), rewriting 
> files (pdfclean),
>  and examining the file structure (pdfshow).")
>  (license license:agpl3+)))
>  
> +(define mupdf/fixed
> +  (package
> +(inherit mupdf)
> +(source
> +  (origin
> +(inherit (package-source mupdf))
> +(patches
> +  (append
> +(origin-patches (package-source mupdf))
> +(search-patches "mupdf-mujs-CVE-2016-10132.patch"
> +"mupdf-mujs-CVE-2016-10133.patch")))
> +
>  (define-public qpdf
>(package
> (name "qpdf")

Also, you should probably add a "Co-authored-by:" header in the commit
log for yourself :)

Otherwise it looks good to me.
Thanks to both of you for working on it!

  Mark



Re: [PATCH] gnu: Add notmuch-vim.

2017-01-15 Thread ng0
Marius Bakke  writes:

> ng0  writes:
>
>> * gnu/packages/vim.scm (notmuch-vim): New variable.
>
> Thanks for this! I tried installing this plugin, but get an error while
> loading it according to upstream instructions[0]:
>
> Error detected while processing command line:
> E492: Not an editor command: :NotMuch 
>
> Any ideas? The README seems to suggest this depends on the notmuch ruby
> bindings as well, which is not currently built on Guix. How did you test
> this?

I really assumed that vim-full provides the ruby bindings and
that they meant just just, and not just another bindings
set. Grml... Okay. Do you use vim? I don't do so currently, so I
assumed it just works when it copied.

> [0] https://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/



Re: Idea: "guix log"

2017-01-15 Thread Ludovic Courtès
Hi!

ng0  skribis:

> Next tool, next idea (the guix log family): A log viewer. Gentoo
> has more than one. The way we currently save logs could be more
> human friendly. It doesn't need a restructuring of the folders
> (yes I know about the switch for logfiles) but we could have
> something similar to https://github.com/gentoo/elogv which
> provides an easy way to read thelogs (nothing more). In addition
> to that, our log reader could extract the log and save it if
> requested to do so.

‘guix-build-log-mode’ in Emacs does that and it’s awesome.  We could
have a log colorizing & navigation tool outside of Emacs, though that’s
probably quite a bit of work.

> Furthermore, a log parser which can tell you how long a build
> took, on average/every time. This is similar to
> https://wiki.gentoo.org/wiki/Genlop
> (https://gitweb.gentoo.org/repo/gentoo.git/tree/app-portage/genlop/genlop-0.30.10-r1.ebuild).
> You don't want to query hydra via emacs or your webbrowser every
> time (at least I don't do this), so a small programm to read out
> the start and finish time of a log would be great.

We could provide a bunch of procedures to extract this info from build
logs.

My 2¢,
Ludo’.



Re: [PATCH] gnu: Add emacs-git-timemachine.

2017-01-15 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> * gnu/packages/emacs.scm (emacs-git-timemachine): New variable.

[...]

> +(home-page "https://github.com/pidu/git-timemachine";)
> +(synopsis "Step through historic versions of git-controlled files")
> +(description "This package enables you to step through historic versions
> +of files under git version control from within Emacs.")

s/git/Git/  :-)

Otherwise LGTM, looks like a fun tool.

Ludo’.



Re: It’s building!

2017-01-15 Thread Ludovic Courtès
Hello Guix!

l...@gnu.org (Ludovic Courtès) skribis:

> The machine was initially installed using substitutes from
> hydra.gnu.org, but ever since it has been building stuff on its own (it
> does not offload to any other machine at this point).  Thus it can be
> used to check for reproducibility issues:
>
>   guix challenge gdk-pixbuf \
> --substitute-urls="https://mirror.hydra.gnu.org 
> https://bayfront.guixsd.org";

As mentioned in another thread, this is now summarized here:

  https://www.gnu.org/software/guix/packages/reproducibility.html

The code for this page uses the API of ‘guix challenge’:

  
http://git.savannah.gnu.org/cgit/guix/guix-artwork.git/tree/website/www/packages.scm#n467

Although for many packages we can’t tell anything because bayfront
hasn’t built them yet, we can already see that a number of packages have
reproducibility issues, some of which were already filed at
.

Let’s address these!

To investigate reproducibility issues, you need to extract the nars
linked from the page above with ‘guix archive -x’, as shown at:

  
https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-challenge.html

(Remember that those from hydra.gnu.org are bzip2-compressed, while
those from bayfront are gzipped.)

Ludo’.



Re: hplip: Add qt5 gui, try to fix policykit support

2017-01-15 Thread Andy Patterson
Hey ng0,


On Thu, 29 Dec 2016 14:05:51 +
ng0  wrote:


> I really have no idea how hplip is supposed to be used in Guix after
> reading the note about the base service. So we are not supposed to
> run and install it as users in profiles? Will it be in the cups
> service where I would have no idea how to add it in there? 

I've been printing with an hp for a little while now, and in my system
configuration I have this:

(service cups-service-type
 (cups-configuration
  (web-interface? #t)
  (extensions
   (list cups-filters hplip

Maybe you've already done that, but I'm just guessing based on what you
wrote.

I've found that with that configuration, all of hplip's ppd files show
up when adding the printer via the web interface (which is how I added
my printer). hp-setup also seems to work ok, and will auto-detect your
ppd file, but can't print out the test page.

Anyway, I hope that helps.

--
Andy



Re: [PATCH] gnu: add proj4.

2017-01-15 Thread Björn Höfling
Hi list,

this im my first patch to Guix, so please tell me what you think.

Here are my remarks:

Linter complains:

* gnu/packages/geo.scm:139:13: proj4-4.9.3: invalid license field

But the documentation explicitly speaks about list values. What's wrong?

* /home/bjoern/guix/gnu/packages/geo.scm:100:2: proj4-4.9.3: line 125 is way 
too long (102 characters)

Yes, this is very long. But it's a URL. Is there any rule on how to break it? 
Or leave it?

About the package name: The official name is "proj.4", so I left it as that.
As variable name, I chose "proj4". Is that correct?

Björn



On Sun, 15 Jan 2017 23:21:47 +0100
Björn Höfling  wrote:

> * gnu/packages/geo.scm (proj4): New variable.
> ---
>  gnu/packages/geo.scm | 58
> ++-- 1 file changed,
> 56 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
> index 86828e717..06321932d 100644
> --- a/gnu/packages/geo.scm
> +++ b/gnu/packages/geo.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2016 Leo Famulari 
>  ;;; Copyright © 2016 Alex Griffin 
> +;;; Copyright © 2017 Björn Höfling
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -19,8 +20,9 @@
>  
>  (define-module (gnu packages geo)
>#:use-module (guix build-system glib-or-gtk)
> +  #:use-module (guix build-system gnu)
>#:use-module (guix download)
> -  #:use-module (guix licenses)
> +  #:use-module ((guix licenses) #:prefix license:)
>#:use-module (guix packages)
>#:use-module (guix utils)
>#:use-module (gnu packages glib)
> @@ -92,4 +94,56 @@
>  the OpenStreetMap project.  It can provide directions for walking,
> bicycling, and driving.")
>  (home-page "https://wiki.gnome.org/Apps/Maps";)
> -(license gpl2+)))
> +(license license:gpl2+)))
> +
> +(define-public proj4
> +  (package
> +(name "proj.4")
> +(version "4.9.3")
> +(source (origin
> +  (method url-fetch)
> +  (uri (string-append
> "http://download.osgeo.org/proj/proj-";
> +  version
> +  ".tar.gz"))
> +  (sha256
> +   (base32
> +
> "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"
> +(build-system gnu-build-system)
> +(arguments `(#:phases
> + (modify-phases %standard-phases
> +   (add-after
> +   'unpack 'patch-test-shebangs
> + (lambda _
> +   (substitute* '("nad/test27"
> +  "nad/test83"
> +  "nad/testvarious"
> +  "nad/testdatumfile"
> +  "nad/testflaky"
> +  "nad/testIGNF")
> + (("/bin/rm") (which "rm")
> +   ;; Precision problems on i686 and other
> platforms. See:
> +   ;;
> https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
> +   ;; Disable failing test.
> +   (add-after
> +   'patch-test-shebangs 'ignore-failing-tests
> + (lambda _
> +   (substitute* '("nad/Makefile.in")
> + (("\tPROJ_LIB.*" all) (string-append  "#"
> all
> +(inputs
> + `(("glib" ,glib)))
> +(home-page "http://proj4.org/";)
> +(synopsis "Cartographic Projections Library")
> +(description
> + "Proj.4 is a library for converting coordinates between
> cartographic projections. +")
> +(license '(license:expat
> +   ;; config.guess, config.sub
> +   license:gpl3+
> +   ;; libtool
> +   license:gpl2+
> +   ;; src/PJ_patterson.c
> +   license:asl2.0
> +   ;; src/geodesic.c/h
> +   license:x11
> +   ;; cmake/*
> +   license:boost1.0






Re: [PATCH] gnu: Mark /gnu/store as needed for boot.

2017-01-15 Thread Ludovic Courtès
John Darrington  skribis:

> On Sat, Jan 14, 2017 at 10:30:43PM +0100, Ludovic Court??s wrote:
>  
>  > * gnu/system/file-systems.scm (all-subpaths): New procedure.
>  > (file-system-needed-for-boot?): Use it to check for ancestors
>  > of %store-directory.
>  
>  I guess the idea is to have ???needed-for-boot automatically set for
>  users who store /gnu or /gnu/store on a separate partition, right?
>
> Correct.
>  
>  The problem is that we need to exclude bind mounts, as done in
>  ???store-file-system??? in (gnu system).
>
> Thanks for pointing that out.
>  
>  What about:
>  
>(define (file-system-needed-for-boot? fs)
>  (or (%file-system-needed-for-boot? fs)
>  (and (string-prefix? (file-system-mount-point fs) 
> (%store-directory))
>   (not (memq 'bind-mount (file-system-flags fs))
>  
>
> Perhaps I am misunderstanding something, but
>
>  (string-prefix? (file-system-mount-point fs) (%store-directory))
>  
> will erroneously return #t when (file-system-mount-point fs) evaluates
> to "/gn"  and (%store-directory) to "/gnu/store".  Will it not???
>
> That is why I wrote a procedure to fix that problem.

Good point.

Then maybe this:

  (define (file-system-needed-for-boot? fs)
(or (%file-system-needed-for-boot? fs)
(and (file-prefix? (file-system-needed-for-boot? fs)
   (%store-directory))
 (not (memq 'bind-mount (file-system-flags fs))

with:

--8<---cut here---start->8---
scheme@(guile-user)>   (define (file-prefix? file1 file2)
 (define not-slash
   (char-set-complement (char-set #\/)))
 (and (string-prefix? "/" file1)
  (let loop ((file1 (string-tokenize file1 
not-slash))
 (file2 (string-tokenize file2 
not-slash)))
(match file1
  (()
   #t)
  ((head1 tail1 ...)
   (match file2
 ((head2 tail2 ...)
  (and (string=? head1 head2)
   (loop tail1 tail2)))
 (()
  #f)))
scheme@(guile-user)> (file-prefix? "/gn" "/gnu/store")
$13 = #f
scheme@(guile-user)> (file-prefix? "/gnu/store/foo" "/gnu/store")
$14 = #f
scheme@(guile-user)> (file-prefix? "/gnu/store" "/gnu/store")
$15 = #t
scheme@(guile-user)> (file-prefix? "/gnu" "/gnu/store")
$16 = #t
scheme@(guile-user)> (file-prefix? "/" "/gnu/store")
$17 = #t
--8<---cut here---end--->8---

This seems more natural to me than computing the set of prefixes like
‘all-subpaths’ does.

WDYT?

If that’s fine with you I can commit this.

Thanks!

Ludo’.



[PATCH] gnu: add proj4.

2017-01-15 Thread Björn Höfling

* gnu/packages/geo.scm (proj4): New variable.
---
 gnu/packages/geo.scm | 58 ++--
 1 file changed, 56 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 86828e717..06321932d 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Leo Famulari 
 ;;; Copyright © 2016 Alex Griffin 
+;;; Copyright © 2017 Björn Höfling 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,8 +20,9 @@
 
 (define-module (gnu packages geo)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system gnu)
   #:use-module (guix download)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (gnu packages glib)
@@ -92,4 +94,56 @@
 the OpenStreetMap project.  It can provide directions for walking, bicycling,
 and driving.")
 (home-page "https://wiki.gnome.org/Apps/Maps";)
-(license gpl2+)))
+(license license:gpl2+)))
+
+(define-public proj4
+  (package
+(name "proj.4")
+(version "4.9.3")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://download.osgeo.org/proj/proj-";
+  version
+  ".tar.gz"))
+  (sha256
+   (base32
+"1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"
+(build-system gnu-build-system)
+(arguments `(#:phases
+ (modify-phases %standard-phases
+   (add-after
+   'unpack 'patch-test-shebangs
+ (lambda _
+   (substitute* '("nad/test27"
+  "nad/test83"
+  "nad/testvarious"
+  "nad/testdatumfile"
+  "nad/testflaky"
+  "nad/testIGNF")
+ (("/bin/rm") (which "rm")
+   ;; Precision problems on i686 and other platforms. See:
+   ;; 
https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
+   ;; Disable failing test.
+   (add-after
+   'patch-test-shebangs 'ignore-failing-tests
+ (lambda _
+   (substitute* '("nad/Makefile.in")
+ (("\tPROJ_LIB.*" all) (string-append  "#" all
+(inputs
+ `(("glib" ,glib)))
+(home-page "http://proj4.org/";)
+(synopsis "Cartographic Projections Library")
+(description
+ "Proj.4 is a library for converting coordinates between cartographic 
projections.
+")
+(license '(license:expat
+   ;; config.guess, config.sub
+   license:gpl3+
+   ;; libtool
+   license:gpl2+
+   ;; src/PJ_patterson.c
+   license:asl2.0
+   ;; src/geodesic.c/h
+   license:x11
+   ;; cmake/*
+   license:boost1.0
-- 
2.11.0






Re: [PATCH 2/2] gnu: Add openvpn service.

2017-01-15 Thread Ludovic Courtès
Alex Kost  skribis:

> Ludovic Courtès (2017-01-14 22:16 +0100) wrote:
>
>>> +(define (uglify-field-name name)
>>> +  (match name
>>> + ('verbosity "verb")
>>> + (_ (let ((str (symbol->string name)))
>>> +  (if (string-suffix? "?" str)
>>> +  (substring str 0 (1- (string-length str)))
>>> +  str)
>>
>> Not sure why but indent-code.el got ‘match’ indentation wrong, although
>> it works for me.  Alex, any ideas?
>
> Because 'scheme-mode' does not provide indentation rules for 'match'
> (and many other keywords).  Geiser indents 'match' properly for you.

I see.  So maybe we should just add a rule for ‘match’ in
.dir-locals.el; any downside to that?

Ludo’.



Re: Anomalies in Python search-path

2017-01-15 Thread Ludovic Courtès
Maxim Cournoyer  skribis:

> After more testing, the Python search-path we form is always problematic
> for pip since the system site-packages will always appear in front of the
> user site location (~/.local/...).

You’re talking about the search path formed by ‘guix environment’,
right?

> My last reporting that pip was working correctly in non-environment was
> wrong because I had failed to logout/login after installing the python
> package; after doing so, the behavior is the same as in an environment:
> the user site location (~/.local/...) comes after site-packages rather
> than before, as would normally be the case. Apparently this is due to
> setting a site-packages location with the environment variable
> PYTHONPATH, which has precedence over the user site location.

~/.guix-profile/etc/profile prepends things to the search paths, but
it’s up to the user whether to source it before or after other
definitions have been provided (in .bash_profile or similar).

On GuixSD, for instance, my GUILE_LOAD_PATH has:

  ~/.local and similar entries
  then ~/.guix-profile/share/guile/site/2.0
  then /run/current-system/profile/share/guile/site/2.0

Ludo’.



Re: guix environment & Ctrl-C

2017-01-15 Thread Ludovic Courtès
Hi!

Danny Milosavljevic  skribis:

> could it be that we broke Ctrl-C in guix environment when we fixed Ctrl-C 
> within guix build?

We did not “fix” Ctrl-C in ‘guix build’, did we?

> When I press Ctrl-C anywhen (for example on the shell) while in a guix 
> environment [env] it will hang...

It seems to work for me… or am I missing something?

Ludo’.



Re: [PATCH] gnu: Add notmuch-vim.

2017-01-15 Thread Marius Bakke
ng0  writes:

> * gnu/packages/vim.scm (notmuch-vim): New variable.

Thanks for this! I tried installing this plugin, but get an error while
loading it according to upstream instructions[0]:

Error detected while processing command line:
E492: Not an editor command: :NotMuch 

Any ideas? The README seems to suggest this depends on the notmuch ruby
bindings as well, which is not currently built on Guix. How did you test
this?

[0] https://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README


signature.asc
Description: PGP signature


[PATCH] gnu: Add notmuch-vim.

2017-01-15 Thread ng0
* gnu/packages/vim.scm (notmuch-vim): New variable.
---
 gnu/packages/vim.scm | 34 +-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 7ba4e6ac3..3eba994fa 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Cyril Roelandt 
 ;;; Copyright © 2016 Efraim Flashner 
-;;; Copyright © 2016 ng0 
+;;; Copyright © 2016, 2017 ng0 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +36,7 @@
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages mail)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -207,3 +208,34 @@ from the @command{vi}-editor:
 @end enumerate
 With the package comes a plugin to use vifm as a vim file selector.")
 (license license:gpl2+)))
+
+(define-public notmuch-vim
+  (package
+(name "notmuch-vim")
+(version (package-version notmuch))
+;; The vim plugin is distributed via the notmuch release tarball.
+(source (package-source notmuch))
+(build-system gnu-build-system)
+(propagated-inputs
+ ;; XXX: This is a plugin, it will not be functional without
+ ;; vim-full (ruby), ruby-mail, and notmuch.
+ `(("ruby-mail" ,ruby-mail)))
+(arguments
+ `(#:tests? #f  ; no "test" target
+   #:make-flags (list
+ (string-append "prefix="
+(assoc-ref %outputs "out")
+"/share/vim/vim80"))
+   #:phases
+   (modify-phases %standard-phases
+ (delete 'configure)
+ ;; This package lives in a subdirectory of the notmuch source
+ ;; tree, so chdir into it before building.
+ (add-after 'unpack 'enter-vim-dir
+   (lambda _ (chdir "vim") #t)
+(home-page (package-home-page notmuch))
+(synopsis "Vim plugin of the Notmuch mail indexing library")
+(description
+ "This package provides a Vim plugin to enable access to the
+Notmuch mail indexing and search library in Vim.")
+(license license:gpl3+)))
-- 
2.11.0




notmuch-vim ,v2

2017-01-15 Thread ng0
Updated: moved package to vim.scm.




[PATCH] gnu: Add emacs-sx.

2017-01-15 Thread ng0
From: ng0 

* gnu/packages/emacs.scm (emacs-sx): New variable.
---
 gnu/packages/emacs.scm | 26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 50cea7685..ca038bcb2 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2016 David Thompson 
 ;;; Copyright © 2016 Matthew Jordan 
 ;;; Copyright © 2016 Roel Janssen 
-;;; Copyright © 2016 ng0 
+;;; Copyright © 2016, 2017 ng0 
 ;;; Copyright © 2016 Alex Griffin 
 ;;; Copyright © 2016 Nicolas Goaziou 
 ;;; Copyright © 2016 Alex Vong 
@@ -1391,6 +1391,30 @@ allows easily move between them.")
 strings.")
 (license license:gpl3+)))
 
+(define-public emacs-sx
+  (package
+(name "emacs-sx")
+(version "0.4")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/vermiculus/sx.el/";
+   "archive/v" version ".tar.gz"))
+   (file-name (string-append name "-" version ".tar"))
+   (sha256
+(base32
+ "1w0xghfljqg31axcnv8gzlrd8pw25nji6idnrhflq0af9qh1dw03"
+(build-system emacs-build-system)
+(inputs
+ `(("emacs-markdown-mode" ,emacs-markdown-mode)
+   ("let-alist" ,let-alist)))
+(home-page "https://github.com/vermiculus/sx.el/";)
+(synopsis "Emacs StackExchange client")
+(description
+ "Emacs StackExchange client.  Ask and answer questions on
+Stack Overflow, Super User, and other StackExchange sites.")
+(license license:gpl3+)))
+
 (define-public emacs-f
   (package
 (name "emacs-f")
-- 
2.11.0




emacs-sx ,v2

2017-01-15 Thread ng0
Updated the source to use a tagged released (tarball) from github.




[PATCH] gnu: Add guildhall.

2017-01-15 Thread Ricardo Wurmus
* gnu/packages/guile.scm (guildhall): New variable.
---
 gnu/packages/guile.scm | 50 +-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 7ce668368..61f62cc24 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2014, 2015 Mark H Weaver 
 ;;; Copyright © 2015, 2017 Christopher Allan Webber 
 ;;; Copyright © 2016 Alex Sassmannshausen 
-;;; Copyright © 2016 Ricardo Wurmus 
+;;; Copyright © 2016, 2017 Ricardo Wurmus 
 ;;; Copyright © 2016 Erik Edrosa 
 ;;; Copyright © 2016 Eraim Flashner 
 ;;; Copyright © 2016 Alex Kost 
@@ -321,6 +321,54 @@ applicable."
 (files '("lib/guile/2.0/site-ccache"
  "share/guile/site/2.0")))
 
+;; There has not been any release yet.
+(define-public guildhall
+  (let ((commit "2fe2cc539f4b811bbcd69e58738db03eb5a2b778")
+(revision "1"))
+(package
+  (name "guildhall")
+  (version (string-append "0-" revision "." (string-take commit 9)))
+  (source (origin
+(method git-fetch)
+(uri (git-reference
+  (url "https://github.com/ijp/guildhall.git";)
+  (commit commit)))
+(file-name (string-append name "-" version "-checkout"))
+(sha256
+ (base32
+  "115bym7bg66h3gs399yb2vkzc2ygriaqsn4zbrg8f054mgy8wzn1"
+  (build-system gnu-build-system)
+  (arguments
+   `(;; FIXME: tests fail for unknown reason.  They seem to try to load
+ ;; the bash executable as a Scheme file.  See bug report at
+ ;; https://github.com/ijp/guildhall/issues/22
+ #:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+   (add-before 'configure 'autogen
+ (lambda _
+   (zero? (system* "sh" "autogen.sh")))
+  (inputs
+   `(("guile" ,guile-2.0)))
+  (native-inputs
+   `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("texinfo" ,texinfo)))
+  (synopsis "Package manager for Guile")
+  (description
+   "Guildhall is a package manager written for Guile Scheme.  A guild is
+an association of independent craftspeople.  A guildhall is where they meet.
+This Guildhall aims to make a virtual space for Guile wizards and journeyfolk
+to share code.
+
+On a practical level, Guildhall lets you share Scheme modules and programs
+over the internet, and install code that has been shared by others.  Guildhall
+can handle dependencies, so when a program requires several libraries, and
+each of those has further dependencies, all of the prerequisites for the
+program can be installed in one go.")
+  (home-page "https://github.com/ijp/guildhall";)
+  (license gpl3+
+
 
 ;;;
 ;;; Extensions.
-- 
2.11.0





Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Marius Bakke
Leo Famulari  writes:

> On Sun, Jan 15, 2017 at 08:05:48PM +0100, Marius Bakke wrote:
>> Is it possible to use the 'package-input-rewriting' procedure here? See
>> example at the end of section 5.1.0:
>> 
>> https://www.gnu.org/software/guix/manual/guix.html#Defining-Packages
>> 
>> Otherwise this LGTM, thanks a lot!
>
> Okay, please test this updated patch series :)

That looks great, thanks! :-)


signature.asc
Description: PGP signature


Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Leo Famulari
On Sun, Jan 15, 2017 at 08:05:48PM +0100, Marius Bakke wrote:
> Is it possible to use the 'package-input-rewriting' procedure here? See
> example at the end of section 5.1.0:
> 
> https://www.gnu.org/software/guix/manual/guix.html#Defining-Packages
> 
> Otherwise this LGTM, thanks a lot!

Okay, please test this updated patch series :)
From 34cc0dc9d9451d540f8733ebca2a3db54a073aa0 Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 12 Jan 2017 19:06:55 +0100
Subject: [PATCH 1/2] gnu: mupdf: Fix CVE-2016-{10132,10133} in bundled mujs.

* gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch,
gnu/packages/patches/mupdf-mujs-CVE-2016-10133.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/pdf.scm (mupdf)[replacement]: New field.
(mupdf/fixed): New variable.
---
 gnu/local.mk   |   2 +
 .../patches/mupdf-mujs-CVE-2016-10132.patch| 188 +
 .../patches/mupdf-mujs-CVE-2016-10133.patch|  36 
 gnu/packages/pdf.scm   |  15 +-
 4 files changed, 240 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch
 create mode 100644 gnu/packages/patches/mupdf-mujs-CVE-2016-10133.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 81d774eb6..58554160d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -755,6 +755,8 @@ dist_patch_DATA =   
\
   %D%/packages/patches/multiqc-fix-git-subprocess-error.patch  \
   %D%/packages/patches/mumps-build-parallelism.patch   \
   %D%/packages/patches/mupdf-build-with-openjpeg-2.1.patch \
+  %D%/packages/patches/mupdf-mujs-CVE-2016-10132.patch \
+  %D%/packages/patches/mupdf-mujs-CVE-2016-10133.patch \
   %D%/packages/patches/mupen64plus-ui-console-notice.patch \
   %D%/packages/patches/musl-CVE-2016-8859.patch\
   %D%/packages/patches/mutt-store-references.patch \
diff --git a/gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch 
b/gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch
new file mode 100644
index 0..e752e57ec
--- /dev/null
+++ b/gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch
@@ -0,0 +1,188 @@
+Fix CVE-2016-10132:
+
+https://bugs.ghostscript.com/show_bug.cgi?id=697381
+http://seclists.org/oss-sec/2017/q1/74
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10132
+
+Patch lifted from upstream source repository:
+
+http://git.ghostscript.com/?p=mujs.git;h=fd003eceda531e13fbdd1aeb6e9c73156496e569
+
+From fd003eceda531e13fbdd1aeb6e9c73156496e569 Mon Sep 17 00:00:00 2001
+From: Tor Andersson 
+Date: Fri, 2 Dec 2016 14:56:20 -0500
+Subject: [PATCH] Fix 697381: check allocation when compiling regular
+ expressions.
+
+Also use allocator callback function.
+---
+ thirdparty/mujs/jsgc.c |  2 +-
+ thirdparty/mujs/jsregexp.c |  2 +-
+ thirdparty/mujs/jsstate.c  |  6 --
+ thirdparty/mujs/regexp.c   | 45 +++--
+ thirdparty/mujs/regexp.h   |  7 +++
+ 5 files changed, 44 insertions(+), 18 deletions(-)
+
+diff --git a/thirdparty/mujs/jsgc.c b/thirdparty/mujs/jsgc.c
+index 4f7e7dc..f80111e 100644
+--- a/thirdparty/mujs/jsgc.c
 b/thirdparty/mujs/jsgc.c
+@@ -46,7 +46,7 @@ static void jsG_freeobject(js_State *J, js_Object *obj)
+   jsG_freeproperty(J, obj->head);
+   if (obj->type == JS_CREGEXP) {
+   js_free(J, obj->u.r.source);
+-  js_regfree(obj->u.r.prog);
++  js_regfreex(J->alloc, J->actx, obj->u.r.prog);
+   }
+   if (obj->type == JS_CITERATOR)
+   jsG_freeiterator(J, obj->u.iter.head);
+diff --git a/thirdparty/mujs/jsregexp.c b/thirdparty/mujs/jsregexp.c
+index a2d5156..7b09c06 100644
+--- a/thirdparty/mujs/jsregexp.c
 b/thirdparty/mujs/jsregexp.c
+@@ -16,7 +16,7 @@ void js_newregexp(js_State *J, const char *pattern, int 
flags)
+   if (flags & JS_REGEXP_I) opts |= REG_ICASE;
+   if (flags & JS_REGEXP_M) opts |= REG_NEWLINE;
+ 
+-  prog = js_regcomp(pattern, opts, &error);
++  prog = js_regcompx(J->alloc, J->actx, pattern, opts, &error);
+   if (!prog)
+   js_syntaxerror(J, "regular expression: %s", error);
+ 
+diff --git a/thirdparty/mujs/jsstate.c b/thirdparty/mujs/jsstate.c
+index 638cab3..fd5bcf6 100644
+--- a/thirdparty/mujs/jsstate.c
 b/thirdparty/mujs/jsstate.c
+@@ -9,12 +9,6 @@
+ 
+ static void *js_defaultalloc(void *actx, void *ptr, int size)
+ {
+-  if (size == 0) {
+-  free(ptr);
+-  return NULL;
+-  }
+-  if (!ptr)
+-  return malloc((size_t)size);
+   return realloc(ptr, (size_t)size);
+ }
+ 
+diff --git a/thirdparty/mujs/regexp.c b/thirdparty/mujs/regexp.c
+index 9852be2..01c18a3 100644
+--- a/thirdparty/mujs/regexp.c
 b/thirdparty/mujs/regexp.c
+@@ -807,23 +807,31 @@ static void dumpprog(Reprog *prog)
+ }
+ #endif
+ 
+-Reprog *regcomp(const char *pattern, int

[PATCH] gnu: Add emacs-stripe-buffer.

2017-01-15 Thread Ricardo Wurmus
* gnu/packages/emacs.scm (emacs-stripe-buffer): New variable.
---
 gnu/packages/emacs.scm | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index bd34a489a..95558e099 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver 
 ;;; Copyright © 2014, 2015, 2016, 2017 Alex Kost 
 ;;; Copyright © 2015 Federico Beffa 
-;;; Copyright © 2015, 2016 Ricardo Wurmus 
+;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus 
 ;;; Copyright © 2016 Chris Marusich 
 ;;; Copyright © 2015, 2016 Christopher Allan Webber 
 ;;; Copyright © 2016 humanitiesNerd 
@@ -1734,6 +1734,27 @@ evaluated in the browser, just like Emacs does with an 
inferior Lisp process
 in Lisp modes.")
 (license license:unlicense)))
 
+(define-public emacs-stripe-buffer
+  (package
+(name "emacs-stripe-buffer")
+(version "0.2.5")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/sabof/stripe-buffer/";
+   "archive/" version ".tar.gz"))
+   (file-name (string-append name "-" version ".tar.gz"))
+   (sha256
+(base32
+ "1p515dq7raly5hw94kiwm3vzsfih0d8af622q4ipvvljsm98aiik"
+(build-system emacs-build-system)
+(home-page "https://github.com/sabof/stripe-buffer/";)
+(synopsis "Add stripes to list buffers")
+(description
+ "This Emacs package adds faces to add stripes to list buffers and org
+tables.")
+(license license:gpl2+)))
+
 (define-public emacs-rich-minority
   (package
 (name "emacs-rich-minority")
-- 
2.11.0





[PATCH 4/6] gnu: Add rocksdb.

2017-01-15 Thread Marius Bakke
* gnu/packages/databases.scm (rocksdb): New variable.
---
 gnu/packages/databases.scm | 86 ++
 1 file changed, 86 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 4bbe55bab..610749d98 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -54,8 +54,10 @@
   #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages parallel)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages popt)
   #:use-module (gnu packages rdf)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages bison)
@@ -480,6 +482,90 @@ types are supported, as is encryption.")
 (license gpl3+)
 (home-page "http://www.gnu.org/software/recutils/";)))
 
+(define-public rocksdb
+  (package
+(name "rocksdb")
+(version "5.0.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/facebook/rocksdb";
+  "/archive/v" version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"0kija4q6nbkjaj1x94q6qb73abgc5i49rakppxj3a368pg9nwz54"))
+  (modules '((guix build utils)))
+  (snippet
+   '(begin
+  ;; TODO: unbundle gtest.
+  (delete-file "build_tools/gnu_parallel")
+  #t
+(build-system gnu-build-system)
+(arguments
+ '(#:make-flags (list "CC=gcc"
+  ;; Make the resulting library position-independent 
so the
+  ;; static version can be included in shared objects.
+  "EXTRA_CXXFLAGS=-fPIC"
+  (string-append "INSTALL_PATH="
+ (assoc-ref %outputs "out")))
+   #:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'patch-source
+   (lambda _
+ (substitute* "Makefile"
+   (("build_tools/gnu_parallel") "parallel")
+   (("#!/bin/sh") (string-append "#!" (which "sh"
+ #t))
+ (delete 'configure)
+ (add-before 'check 'disable-failing-tests
+   (lambda _
+ (substitute* "Makefile"
+   ;; These tests reliably fail due to "Too many open files".
+   (("^[[:blank:]]+env_test[[:blank:]]+") "\\")
+   (("^[[:blank:]]+persistent_cache_test[[:blank:]]+") "\\"))
+ #t))
+ (add-after 'check 'build-release-libraries
+   ;; The 'check' target depends on the default target which
+   ;; is compiled with debug symbols. The 'install' target depends
+   ;; on custom release targets so we build them here for clarity.
+   ;; TODO: Add debug output.
+   (lambda* (#:key (make-flags '()) #:allow-other-keys)
+ ;; Prevent the build from adding machine-specific optimizations.
+ ;; This does not work if passed as a make flag...
+ (setenv "PORTABLE" "1")
+ (and (zero? (apply system* "make" "static_lib" make-flags))
+  (zero? (apply system* "make" "shared_lib" make-flags)
+ (add-after 'install 'move-static-library
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(lib (string-append out "/lib"))
+(static (assoc-ref outputs "static"))
+(slib (string-append static "/lib")))
+   (mkdir-p slib)
+   (for-each (lambda (file)
+   (install-file file slib)
+   (delete-file file))
+ (find-files lib "\\.l?a$"))
+   #t))
+(outputs
+ '("out" "static"))
+(native-inputs
+ `(("parallel" ,parallel)
+   ("perl" ,perl)
+   ("procps" ,procps)
+   ("python" ,python-2)))
+(inputs
+ `(("bzip2" ,bzip2)
+   ("gflags" ,gflags)
+   ("snappy" ,snappy)
+   ("zlib" ,zlib)))
+(home-page "http://rocksdb.org/";)
+(synopsis "Persistent key-value store for fast storage")
+(description
+ "RocksDB is an embeddable, persistent key-value storage library that is
+designed for flash and RAM storage.")
+(license bsd-3)))
+
 (define-public sparql-query
   (package
 (name "sparql-query")
-- 
2.11.0




[PATCH 6/6] gnu: fio: Enable rbd support.

2017-01-15 Thread Marius Bakke
* gnu/packages/benchmark.scm (fio)[inputs]: Add ceph:lib.
---
 gnu/packages/benchmark.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index 465c81b43..6b3c28df3 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -22,6 +22,7 @@
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages distributed-filesystems)
   #:use-module (gnu packages linux))
 
 (define-public fio
@@ -49,7 +50,8 @@
(zero? (system* "./configure"
(string-append "--prefix=" out)
 (inputs
- `(("libaio" ,libaio)
+ `(("ceph" ,ceph "lib")
+   ("libaio" ,libaio)
("zlib" ,zlib)))
 (home-page "https://github.com/axboe/fio";)
 (synopsis "Flexible I/O tester")
-- 
2.11.0




[PATCH 5/6] gnu: Add ceph.

2017-01-15 Thread Marius Bakke
* gnu/packages/distributed-filesystems.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk |   1 +
 gnu/packages/distributed-filesystems.scm | 172 +++
 2 files changed, 173 insertions(+)
 create mode 100644 gnu/packages/distributed-filesystems.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 81d774eb6..417e7a0a5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -102,6 +102,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/dillo.scm   \
   %D%/packages/disk.scm\
   %D%/packages/display-managers.scm\
+  %D%/packages/distributed-filesystems.scm \
   %D%/packages/django.scm  \
   %D%/packages/djvu.scm\
   %D%/packages/dns.scm \
diff --git a/gnu/packages/distributed-filesystems.scm 
b/gnu/packages/distributed-filesystems.scm
new file mode 100644
index 0..f215a847e
--- /dev/null
+++ b/gnu/packages/distributed-filesystems.scm
@@ -0,0 +1,172 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 Marius Bakke 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu packages distributed-filesystems)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages crypto)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages gnuzilla)
+  #:use-module (gnu packages jemalloc)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml))
+
+(define-public ceph
+  (package
+(name "ceph")
+(version "10.2.5")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://download.ceph.com/tarballs/ceph-";
+  version ".tar.gz"))
+  (sha256
+   (base32
+"1x6m69il34x4rjhybk5cpw4yiad4a193l9vgy57vidwfy5ql5pc2"))
+  (modules '((guix build utils)))
+  (snippet
+   '(begin
+  ;; Delete bundled software.
+  (delete-file-recursively "src/test/downloads") ; python-cram
+  (delete-file-recursively "src/rocksdb")
+  ;; TODO: unbundle gtest, civetweb, DPDK, SPDK, xxHash.
+  #t
+(build-system gnu-build-system)
+(arguments
+ `(#:configure-flags
+   (list (string-append "--exec_prefix=" (assoc-ref %outputs "out"))
+ (string-append "--libdir=" (assoc-ref %outputs "lib") "/lib")
+ (string-append "--includedir=" (assoc-ref %outputs "lib") 
"/include")
+ "--localstatedir=/var"
+ "--sysconfdir=/etc"
+ "--enable-static=no" ; TODO: separate output
+ "--with-man-pages"
+ (string-append "--with-systemd-unit-dir="
+(assoc-ref %outputs "out") "/etc/systemd/system")
+ "--without-libxfs" ; TODO: enable when xfsprogs is added.
+ ;; Use jemalloc instead of tcmalloc.
+ "--with-jemalloc")
+   #:make-flags
+   ;; Pass sysconfdir here too so that the sample configuration files
+   ;; and directories are installed to the output instead of root level.
+   (list (string-append "sysconfdir=" (assoc-ref %outputs "out") "/etc")
+ (string-append "LDFLAGS=-Wl,-rpath="
+(assoc-ref %outputs "lib") "/lib")
+ ;; The python libraries depend on the ceph libraries,
+ ;; so make sure they are in RUNPATH.
+ (string-append "PYTHON_LDFLAGS=-Wl,-rpath="
+(assoc-ref %outputs "lib") "/lib"))
+   #:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'patch-source
+   (lambda* (#:key inputs outputs #:allow-other-ke

[PATCH 0/6] gnu: Add ceph.

2017-01-15 Thread Marius Bakke
Hello Guix,

This series adds the Ceph distributed filesystem to Guix.

Ceph is not fully working yet, the executables need to be wrapped with
PYTHONPATH at the very least. But the library seems to work.

Feedback wanted, will send updated Ceph patch when I've tested it.

Note: "crypto++" ended up unused in favor of "nss" since that is what
upstream uses in their release builds.

Marius Bakke (6):
  gnu: Add leveldb.
  gnu: Add crypto++.
  gnu: Add python-cram.
  gnu: Add rocksdb.
  gnu: Add ceph.
  gnu: fio: Enable rbd support.

 gnu/local.mk |   1 +
 gnu/packages/benchmark.scm   |   4 +-
 gnu/packages/crypto.scm  |  90 +++-
 gnu/packages/databases.scm   | 123 ++
 gnu/packages/distributed-filesystems.scm | 172 +++
 gnu/packages/python.scm  |  64 +++-
 6 files changed, 451 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/distributed-filesystems.scm

-- 
2.11.0




[PATCH 2/6] gnu: Add crypto++.

2017-01-15 Thread Marius Bakke
* gnu/packages/crypto.scm (crypto++): New variable.
---
 gnu/packages/crypto.scm | 90 -
 1 file changed, 89 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index e4a8a4bd5..2bf64f1f6 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2016 Tobias Geerinckx-Rice 
 ;;; Copyright © 2016 ng0 
 ;;; Copyright © 2016 Eric Bavier 
+;;; Copyright © 2017 Marius Bakke 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,12 +47,99 @@
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages zip)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+  #:use-module (srfi srfi-26)
+  #:use-module (ice-9 match))
+
+(define-public crypto++
+  (package
+(name "crypto++")
+(version "5.6.5")
+(source (origin
+  (method url-fetch)
+  (uri (let ((numeric-version
+  (match (string-split version #\.)
+((first-digit other-digits ...)
+ (string-append first-digit
+(string-concatenate
+ other-digits))
+ (string-append "https://cryptopp.com/cryptopp";
+numeric-version ".zip")))
+  (sha256
+   (base32
+"0d1cqdz369ivi082k59025wvxzywvkizw7i0pf5h0a1izs3g8pm7"
+(build-system gnu-build-system)
+(arguments
+ `(#:make-flags
+   (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+ (string-append "BINDIR=" (assoc-ref %outputs "bin") "/bin")
+ (string-append "DATADIR=" (assoc-ref %outputs "doc") "/share")
+ "DISABLE_CXXFLAGS_OPTIMIZATIONS=1"
+ ;; Override "/sbin/ldconfig" with simply "echo" since
+ ;; we don't need ldconfig(8).
+ "LDCONF=echo")
+   #:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'enter-source
+   ;; ??? Why are we in the TestData folder.
+   (lambda _ (chdir "..") #t))
+ (add-after 'enter-source 'disable-optimizations
+   (lambda _
+ ;; XXX: The disable optimizations flag above is not recognized in
+ ;; the current version. See 
https://github.com/weidai11/cryptopp/pull/354 .
+ ;; For now, just remove it the dirty way.
+ (substitute* "GNUmakefile"
+   (("-march=native") ""))
+ #t))
+ (delete 'configure)
+ (add-after 'build 'build-shared
+   (lambda _
+ ;; By default, only the static library is built.
+ (zero? (system* "make" "shared"
+ (add-after 'install 'move-static-library
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(lib (string-append out "/lib"))
+(static (assoc-ref outputs "static"))
+(slib (string-append static "/lib")))
+   (mkdir-p slib)
+   (for-each (lambda (file)
+   (install-file file slib)
+   (delete-file file))
+ (find-files lib "\\.l?a$"))
+   #t)))
+ (add-after 'move-static-library 'add-so-version-symlink
+   ;; The library is named MAJOR.MINOR.PATCHLEVEL. Some programs
+   ;; expect a MAJOR.MINOR symlink.
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+   (major+minor ,(version-major+minor version)))
+   (with-directory-excursion (string-append out "/lib")
+ (symlink (string-append "libcryptopp.so." ,version)
+  (string-append "libcryptopp.so." major+minor))
+ #t)))
+(outputs '("out"  ; 6.4M shared library and headers
+   "bin"  ; 6.3M cryptest.exe
+   "doc"  ; 6.4M documentation and examples
+   "static")) ; 15M static library
+(native-inputs
+ `(("unzip" ,unzip)))
+(synopsis "C++ class library of cryptographic schemes")
+(description
+ "Crypto++ is a large collection of cryptograhic algorithms and related
+utilities for C++.")
+(home-page "https://cryptopp.com";)
+;; The compilation is licensed under Boost 1.0, while most individual
+;; files are in the public domain.
+(license (list license:boost1.0
+   license:public-doma

[PATCH 1/6] gnu: Add leveldb.

2017-01-15 Thread Marius Bakke
* gnu/packages/databases.scm (leveldb): New variable.
---
 gnu/packages/databases.scm | 37 +
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index e05a337e4..4bbe55bab 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2016 David Craven 
 ;;; Copyright © 2016 Jan Nieuwenhuizen 
 ;;; Copyright © 2016 Andy Patterson 
+;;; Copyright © 2017 Marius Bakke 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -207,6 +208,42 @@ SQL, Key/Value, XML/XQuery or Java Object storage for 
their data model.")
(base32
 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))
 
+(define-public leveldb
+  (package
+(name "leveldb")
+(version "1.19")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/google/leveldb";
+  "/archive/v" version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"00jjgs9xlwycfkg0xd7n1rj6v9zrx7xc7hann6zalrjyhap18ykx"
+(build-system gnu-build-system)
+(arguments
+ '(#:make-flags (list "CC=gcc")
+   #:phases
+   (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'install
+   ;; There is no install target, so we do it here.
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(lib (string-append out "/lib"))
+(include (string-append out "/include")))
+   (for-each (lambda (file)
+   (install-file file lib))
+ (find-files "out-shared" "^libleveldb.so.*"))
+   (copy-recursively "include" include)
+   #t))
+(home-page "http://leveldb.org/";)
+(synopsis "Fast key-value storage library")
+(description
+ "LevelDB is a fast key-value storage library that provides an ordered
+mapping from string keys to string values.")
+(license bsd-3)))
+
 (define-public mysql
   (package
 (name "mysql")
-- 
2.11.0




[PATCH 3/6] gnu: Add python-cram.

2017-01-15 Thread Marius Bakke
* gnu/packages/python.scm (python-cram, python2-cram): New variables.
---
 gnu/packages/python.scm | 64 -
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ddf276de0..e61d7d1fb 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -26,7 +26,7 @@
 ;;; Copyright © 2016 ng0 
 ;;; Copyright © 2016 Dylan Jeffers 
 ;;; Copyright © 2016 David Craven 
-;;; Copyright © 2016 Marius Bakke 
+;;; Copyright © 2016, 2017 Marius Bakke 
 ;;; Copyright © 2016 Stefan Reichoer 
 ;;; Copyright © 2016 Dylan Jeffers 
 ;;; Copyright © 2016 Alex Vong 
@@ -6057,6 +6057,68 @@ pseudo terminal (pty), and interact with both the 
process and its pty.")
 (define-public python2-ptyprocess
   (package-with-python2 python-ptyprocess))
 
+(define-public python-cram
+  (package
+(name "python-cram")
+(version "0.7")
+(home-page "https://bitheap.org/cram/";)
+(source (origin
+  (method url-fetch)
+  (uri (list (string-append home-page "cram-"
+version ".tar.gz")
+ (pypi-uri "cram" version)))
+  (sha256
+   (base32
+"0bvz6fwdi55rkrz3f50zsy35gvvwhlppki2yml5bj5ffy9d499vx"
+(arguments
+ '(#:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'patch-source
+   (lambda _
+ (substitute* (find-files "cram" ".*\\.py")
+   ;; Replace default shell path. This is necessary for tests,
+   ;; and convenient for programs using the main "cram" binary
+   ;; in environments lacking /bin/sh (e.g. if this program is
+   ;; used in other builds).
+   (("/bin/sh") (which "sh")))
+ (substitute* (find-files "tests" ".*\\.t")
+   (("md5") "md5sum")
+   (("/bin/bash") (which "bash"))
+   (("/bin/sh") (which "sh")))
+ (substitute* "cram/_test.py"
+   ;; This hack works around a bug triggered by substituting
+   ;; the /bin/sh paths. "tests/usage.t" compares the output of
+   ;; "cram -h", which breaks the output at 80 characters. This
+   ;; causes the line showing the default shell to break into two
+   ;; lines, but the test expects a single line...
+   (("env\\['COLUMNS'\\] = '80'")
+"env['COLUMNS'] = '160'"))
+ #t))
+ (delete 'check)
+ (add-after 'install 'check
+   ;; The test phase uses the built binary and library.
+   ;; It's easier to run it after install since the build
+   ;; directory contains version-specific PATH.
+   (lambda* (#:key inputs outputs #:allow-other-keys)
+ (add-installed-pythonpath inputs outputs)
+ (setenv "PATH" (string-append (getenv "PATH") ":"
+   (assoc-ref outputs "out") "/bin"))
+ (zero? (system* "make" "test")))
+(build-system python-build-system)
+(native-inputs
+ `(("python-coverage" ,python-coverage)
+   ("which" ,which)))
+(synopsis "Simple testing framework for command line applications")
+(description
+ "Cram is a functional testing framework for command line applications.
+Cram tests look like snippets of interactive shell sessions.  Cram runs each
+command and compares the command output in the test with the command’s actual
+output.")
+(license license:gpl2+)))
+
+(define-public python2-cram
+  (package-with-python2 python-cram))
+
 (define-public python-terminado
   (package
 (name "python-terminado")
-- 
2.11.0




Re: [PATCH] gnu: Add emacs-sx.

2017-01-15 Thread ng0
Alex Kost  writes:

> ng0 (2017-01-15 02:33 +) wrote:
>
>> From: ng0 
>>
>> * gnu/packages/emacs.scm (emacs-sx): New variable.
>> ---
>>  gnu/packages/emacs.scm | 26 +-
>>  1 file changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
>> index 50cea7685..2e04414b3 100644
>> --- a/gnu/packages/emacs.scm
>> +++ b/gnu/packages/emacs.scm
>> @@ -12,7 +12,7 @@
>>  ;;; Copyright © 2016 David Thompson 
>>  ;;; Copyright © 2016 Matthew Jordan 
>>  ;;; Copyright © 2016 Roel Janssen 
>> -;;; Copyright © 2016 ng0 
>> +;;; Copyright © 2016, 2017 ng0 
>>  ;;; Copyright © 2016 Alex Griffin 
>>  ;;; Copyright © 2016 Nicolas Goaziou 
>>  ;;; Copyright © 2016 Alex Vong 
>> @@ -1391,6 +1391,30 @@ allows easily move between them.")
>>  strings.")
>>  (license license:gpl3+)))
>>  
>> +(define-public emacs-sx
>> +  (package
>> +(name "emacs-sx")
>> +(version "20161222.1205")
>> +(source
>> + (origin
>> +   (method url-fetch)
>> +   (uri (string-append "https://melpa.org/packages/sx-";
>> +   version ".tar"))
>
> I can only repeat that we don't use tarballs from MELPA.  See:
>
> http://lists.gnu.org/archive/html/guix-devel/2016-10/msg00678.html
> http://lists.gnu.org/archive/html/guix-devel/2016-11/msg00678.html

Yikes. Thanks!
I forget this so often that I think we should change the elpa
importer for --archive=melpa to reflect this OR print a note on
this (for example lint).
I will send in a new patch.

>> +   (file-name (string-append name "-" version ".tar"))
>> +   (sha256
>> +(base32
>> + "0alllpglv7v686ilg2dkncs0yf8g5rrgj17rx7qx9q81icwdcwxq"
>> +(build-system emacs-build-system)
>> +(inputs
>> + `(("emacs-markdown-mode" ,emacs-markdown-mode)
>> +   ("let-alist" ,let-alist)))
>> +(home-page "https://github.com/vermiculus/sx.el/";)
>> +(synopsis "Emacs StackExchange client")
>> +(description
>> + "Emacs StackExchange client.  Ask and answer questions on
>> +Stack Overflow, Super User, and other StackExchange sites.")
>> +(license license:gpl3+)))
>> +
>>  (define-public emacs-f
>>(package
>>  (name "emacs-f")
>
> -- 
> Alex
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/



[PATCH] gnu: Add emacs-git-timemachine.

2017-01-15 Thread Ricardo Wurmus
* gnu/packages/emacs.scm (emacs-git-timemachine): New variable.
---
 gnu/packages/emacs.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 50cea7685..bd34a489a 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1440,6 +1440,26 @@ Git, Mercurial, Subversion and Bazaar are supported, and 
many parts of the
 display and behaviour is easily customisable.")
 (license license:gpl3+)))
 
+(define-public emacs-git-timemachine
+  (package
+(name "emacs-git-timemachine")
+(version "3.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/pidu/git-timemachine/";
+   "archive/" version ".tar.gz"))
+   (file-name (string-append name "-" version ".tar.gz"))
+   (sha256
+(base32
+ "1l4g0r69wfrnjsywv03v4bpdd53byg6zdx6mzabfxyymss3kvisa"
+(build-system emacs-build-system)
+(home-page "https://github.com/pidu/git-timemachine";)
+(synopsis "Step through historic versions of git-controlled files")
+(description "This package enables you to step through historic versions
+of files under git version control from within Emacs.")
+(license license:gpl3+)))
+
 (define-public emacs-el-mock
   (package
 (name "emacs-el-mock")
-- 
2.11.0





Idea: "guix log"

2017-01-15 Thread ng0
TL;DR: thoughts about a potential new guix command, guix log.

I have a couple of ideas and two of them can be combined into a
new guix subcommand family, guix log, while the other (pfl
inspiration) is open.

I used and developed with/for Gentoo for a while and I always
found `pfl' nice. The bad thing is that it queries
http://www.portagefilelist.de/ (if you tell it to do so) and
without portage it is kinda useless. I haven't tried packaging
portage with stripped features for guix yet (I have some Gentoo
tools packaged), because I think we can do better. Quote from pfl:

   Portage File List collects which files are installed by which
   ebuild on users machines. It shares this data publicly for
   searching/browsing.
   It allows user to search for files that are not installed on
   their system and figure out which ebuild they need to install in
   order to obtain it.

Here is what I think we can do: We can record the file names
of every build, and do the queries offline (for software the
local machine has) or query hydra.


Next tool, next idea (the guix log family): A log viewer. Gentoo
has more than one. The way we currently save logs could be more
human friendly. It doesn't need a restructuring of the folders
(yes I know about the switch for logfiles) but we could have
something similar to https://github.com/gentoo/elogv which
provides an easy way to read thelogs (nothing more). In addition
to that, our log reader could extract the log and save it if
requested to do so.
Furthermore, a log parser which can tell you how long a build
took, on average/every time. This is similar to
https://wiki.gentoo.org/wiki/Genlop
(https://gitweb.gentoo.org/repo/gentoo.git/tree/app-portage/genlop/genlop-0.30.10-r1.ebuild).
You don't want to query hydra via emacs or your webbrowser every
time (at least I don't do this), so a small programm to read out
the start and finish time of a log would be great.


What do you think?
-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/



Re: [PATCH 1/2] doc: Symlink daemon start-up files.

2017-01-15 Thread Marius Bakke
Leo Famulari  writes:

> On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote:
>> On Fri, Nov 18, 2016 at 12:00:33PM +0100, Hartmut Goebel wrote:
>> > This patch ensures that always the current profile's daemon will be used.
>> > 
>> > The .service file contains the path to the guix-daemon within the store. 
>> > Thus
>> > when copying the file, it will point to the very version of guix-daemon 
>> > used
>> > at the time of copying – even after system upgrade or when this version has
>> > been garbage collected from the store.
>
> I think we should go back to the "old way" of instructing users to copy
> the file...
>
>> I'd argue it should point to /var/guix/profiles/per-user/root/...
>
> ... and make the service file execute this path.
>
>> >  @example
>> > -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \
>> > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \
>> >  /etc/systemd/system/
>> >  # systemctl start guix-daemon && systemctl enable guix-daemon
>
> Debian Jessie (their current stable release) doesn't support symlinked
> systemd service files yet [0], and we are frequently having to explain
> to new users why this step doesn't work for them. And, we also have to
> explain that the ExecStart value that contains the absolute store path
> must be changed to point to '/var/guix/profiles...'.
>
> Doing it that way has the same effect of a symlinked file that is
> updated automatically: the daemon is always the latest in root's
> profile.
>
> It feels like we having to walk new users through this on IRC or
> help-guix every day.
>
> It takes our time and makes their first experience with Guix harder than
> it should be.
>
> WDYT?

This seems reasonable to me. I've started using /var/guix/profiles.. on
foreign distros as well, even those with recent systemd. In addition to
the above, using that path also avoids having to call 'systemctl
daemon-reload' before restarting guix-daemon after updates...


signature.asc
Description: PGP signature


Re: [PATCH: gnu: lua-lpeg: Update to 1.0.1.

2017-01-15 Thread Marius Bakke
Jose Miguel Sánchez García  writes:


> * gnu/packages/lua.scm (lua-lpeg): Update to 1.0.1.

Applied, thanks!


signature.asc
Description: PGP signature


Re: Anomalies in Python search-path

2017-01-15 Thread Maxim Cournoyer

Hi Hartmut! I was hoping you'd join this thread!

Hartmut Goebel  writes:

> Am 06.01.2017 um 19:41 schrieb Maxim Cournoyer:
>> One thing which I discovered while testing pip on Guix was that
>> depending on how you use Python on Guix the PYTHONPATH differs:
>
> I analysed this problem and found set we have another serious problem
> here. But good news: There is an easy solution for both problems.
>
> Result of the analysis (as explained below): We must not extend
> PYTHONPATH for adding the profile's site-packages directory.

Right! site.py will put prepend any previously set PYTHONPATH to the one
it forms. If a site-packages is present there it will appear before the
user site location, which is not good. I had missed this particular
problem before by failing to restart my user session after installing
python (the custom PYTHONPATH we set was not yet in effect).

>
> Proposed solution: The standard library module "site" already contains a
> place where we can hook in:
>
># Prefixes for site-packages; add additional prefixes like /usr/local
> here
> PREFIXES = [sys.prefix, sys.exec_prefix]
>
> So we simply prepend $GUIX_ENVIRONMENT to this list:
>
> PREFIXES = [os.path.expandvar(GUIX_ENVIRONMENT), sys.prefix,
> sys.exec_prefix]
>

I think your approach is correct! Any directory we add to PREFIXES will
get picked by the `addsitepackages` function in site.py, and this
function is called *following* the `addusersitepackages` function in
site.main(), which means those entries will appear after the user site
location in sys.path, which is what we want.

What is currently responsible for exporting PYTHONPATH to
".guix-profile/lib/python2.7/site-packages" ? It looks like it might be
the `native-search-paths' fields of our python-2.7 package?

(native-search-paths
 (list (search-path-specification
(variable "PYTHONPATH")
(files '("lib/python2.7/site-packages")

This should rather be added with a patch adding it to the PREFIXES
variable of the site.py module, as you suggested.

This is the value of PYTHONPATH in my profile, after installing python@2
and re-login:

$ echo $PYTHONPATH
/home/maxim/.guix-profile/lib/python2.7/site-packages

Also, if we no longer rely on manipulating the PYTHONPATH directly, we
should also remove the "python-2.7-site-prefixes.patch" patch, which
adds /gnu/store entries found in PYTHONPATH to the PREFIXES variable.

> Prepending to speed up searches, since within an environment almost all
> site-packages will end in GUIX_ENVIRONMENT. There is no need to check if
> $GUIX_ENVIRONMENT is set, since if it is not, it will be left unchanged
> and the non-existing path will be skipped out automatically
>
> This would solve both the problem Maxim described and the problem
> described below, since the Guix site-packages behave exactly like any
> other global site-packages directory.
>
> When following this proposal, we *may* even remove some "wrapping" stuff
> in the python-build-system. But this has to be investigated first.
>

Yes, it will be interesting to see if the changes proposed here would
remove the need for the wrap phase. I hope it does :).

>
> Analysis (proof see below):
>
> The python interpreter was two command line options, which are rarely
> used, though:
>
> -E ignores environment variables, esp. PYTHONPATH
> -S Disable  the  import  of the module site and the site-dependent
> manipulations of sys.path.
>
> This means:
> a) When passing -E, the Guix environment's site-packages are ignored
> (together with PYTHONPATH), while they should not.
> b) When passing -S, the Guix environment's site-packages should be
> ignored, but is not (since it is specified in $PYTHONPATH, which is not
> ignored)
>
> Conclusion: We should must not use PYTHONPATH to specify the Guix's
> environment's site-package directory.
>

Right. In general, we can generalize the PYTHONPATH rule to "we must not use
PYTHONPATH" ;)

>
> Analysis details:
>
> (guix)$ which python3
> /gnu/store/zcnb…-profile/bin/python3
>
>
> Without any options:
>
> -> /home/USER/.local/lib/python3.5/site-packages and
>/gnu/store/zcnb…-profile/lib/python3.5/site-packages
>should be in sys.path
>
> (base)$ python3 -c 'import sys ; print("\n".join(sys.path))'
>
> /usr/lib64/python34.zip
> /usr/lib64/python3.4
> /usr/lib64/python3.4/plat-linux
> /usr/lib64/python3.4/lib-dynload
> /home/USER/.local/lib/python3.4/site-packages
> /usr/lib64/python3.4/site-packages
> /usr/lib/python3.4/site-packages
>
> (guix)$ python3 -c 'import sys ; print("\n".join(sys.path))'
>
> /gnu/store/zcnb…-profile/lib/python3.5/site-packages
> /gnu/store/alk9…-python-3.5.2/lib/python35.zip
> /gnu/store/alk9…-python-3.5.2/lib/python3.5
> /gnu/store/alk9…-python-3.5.2/lib/python3.5/plat-linux
> /gnu/store/alk9…-python-3.5.2/lib/python3.5/lib-dynload
> /home/USER/.local/lib/python3.5/site-packages
> /gnu/store/alk9…-python-3.5.2/lib/python3.5/site-packages
>
>
> -E Ignore environment variables  like  PYTH

Re: [PATCH 2/2] gnu: Add notmuch-vim.

2017-01-15 Thread Marius Bakke
ng0  writes:

> Marius Bakke  writes:
>
>> ng0  writes:
>>
>>> Marius Bakke  writes:
>>>
 ng0  writes:

> * gnu/packages/mail.scm (notmuch-vim): New variable.

 I think vim plugins should go in vim.scm, even if it relates to a
 package residing elsewhere. Could you send an updated patch? TIA!
>>>
>>> I disagree. Then we should split up the notmuch emacs integration
>>> and move it into emacs.scm by the same logic.
>>
>> The emacs files are installed with the 'notmuch' package. If they are
>> split out, I would argue that they should go in emacs.scm as well.
>>
>> I don't see the point in that though, since they are less than 1MB and
>> do not carry any extra dependencies.
>
> With the vim removed from the inputs, I'd say this could be just
> another output?
>
> notmuch:vim
> notmuch:emacs

This seems fine to me, if it is possible to add propagation of
ruby-mail on a specific output. Otherwise we should use a proper package
declaration.


signature.asc
Description: PGP signature


Re: [PATCH 2/2] gnu: Add notmuch-vim.

2017-01-15 Thread Marius Bakke
ng0  writes:

> Marius Bakke  writes:
>
>> ng0  writes:
>>
>>> * gnu/packages/mail.scm (notmuch-vim): New variable.
>>> ---
>>>  gnu/packages/mail.scm | 37 -
>>>  1 file changed, 36 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
>>> index 206055751..89aa2444d 100644
>>> --- a/gnu/packages/mail.scm
>>> +++ b/gnu/packages/mail.scm
>>> @@ -15,7 +15,7 @@
>>>  ;;; Copyright © 2016 Lukas Gradl 
>>>  ;;; Copyright © 2016 Alex Kost 
>>>  ;;; Copyright © 2016 Troy Sankey 
>>> -;;; Copyright © 2016 ng0 
>>> +;;; Copyright © 2016, 2017 ng0 
>>>  ;;; Copyright © 2016 Clément Lassieur 
>>>  ;;; Copyright © 2016 Arun Isaac 
>>>  ;;; Copyright © 2016 John Darrington 
>>> @@ -71,6 +71,7 @@
>>>#:use-module (gnu packages perl)
>>>#:use-module (gnu packages python)
>>>#:use-module (gnu packages readline)
>>> +  #:use-module (gnu packages ruby)
>>>#:use-module (gnu packages search)
>>>#:use-module (gnu packages texinfo)
>>>#:use-module (gnu packages compression)
>>> @@ -83,6 +84,7 @@
>>>#:use-module (gnu packages screen)
>>>#:use-module (gnu packages tls)
>>>#:use-module (gnu packages networking)
>>> +  #:use-module (gnu packages vim)
>>>#:use-module (gnu packages web)
>>>#:use-module (gnu packages xml)
>>>#:use-module (gnu packages xorg)
>>> @@ -587,6 +589,39 @@ invoking @command{notifymuch} from the post-new hook.")
>>>  ing, and tagging large collections of email messages.")
>>>  (license gpl3+)))
>>>  
>>> +(define-public notmuch-vim
>>> +  (package
>>> +(name "notmuch-vim")
>>> +(version (package-version notmuch))
>>> +;; The vim plugin is distributed via the notmuch release tarball.
>>> +(source (package-source notmuch))
>>> +(build-system gnu-build-system)
>>> +(propagated-inputs
>>> + ;; XXX: This is a plugin, it will not be functional without
>>> + ;; vim-full (ruby), ruby-mail, and notmuch.
>>> + `(("notmuch" ,notmuch)
>>> +   ("vim-full" ,vim-full)
>>
>> I think if someone installs this plugin, they already have vim and
>> notmuch, and may want to use other versions etc. So those can be
>> omitted.
>>
>>> +   ("ruby-mail" ,ruby-mail)))
>>> +(arguments
>>> + `(#:tests? #f  ; no "test" target
>>> +   ;; XXX: Replace the "vim80" folder with a dynamic name.
>>> +   #:make-flags (list (string-append "prefix="
>>> + (assoc-ref %outputs "out")
>>> + "/share/vim/vim80"))
>>^^
>> You can use (version-major+minor (package-version vim)) here.
>
> That's not the same as vim80 though... resulting structure:

Oops, you're right. I forgot that the dot was included. Let's just keep
it 'hard-coded' for now. We can add a helper function to determine the
correct directory if/when this becomes a problem / recurring theme.

Yet another reason to put it in vim.scm.. ;-)


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add emacs-ag

2017-01-15 Thread Alex Kost
Christopher Baines (2017-01-15 11:25 +) wrote:

> * gnu/packages/emacs.scm (emacs-ag): New variable.
> ---
>  gnu/packages/emacs.scm | 27 +++
>  1 file changed, 27 insertions(+)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 50cea7685..6933dcc35 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -46,6 +46,7 @@
>#:use-module (guix build-system glib-or-gtk)
>#:use-module (guix build-system trivial)
>#:use-module (gnu packages)
> +  #:use-module (gnu packages code)
>#:use-module (gnu packages guile)
>#:use-module (gnu packages gtk)
>#:use-module (gnu packages gnome)
> @@ -1066,6 +1067,32 @@ like.  It can be linked with various Emacs mail 
> clients (Message and Mail
>  mode, Rmail, Gnus, MH-E, and VM).  BBDB is fully customizable.")
>  (license license:gpl3+)))
>  
> +(define-public emacs-ag
> +  (package
> +(name "emacs-ag")
> +(version "0.47")
> +(source (origin
> + (method url-fetch)
> + (uri (string-append
> +   "https://github.com/Wilfred/ag.el/archive/";
> +   version ".tar.gz"))
> + (file-name (string-append name "-" version ".tar.gz"))
> + (sha256
> +  (base32
> +   "1rlmp6wnyhqfg86dbz17r914msp58favn4kd4yrdwyia265a4lar"
> +(build-system emacs-build-system)
> +(propagated-inputs
> + `(("the-silver-searcher" ,the-silver-searcher)

Is it propagated just because "ag" executable is needed?  If so, then
it's better to keep it in 'inputs' and to change the value of
'ag-executable' variable (in "ag.el") using 'emacs-substitute-variables'.
See 'emacs-slime', 'emacs-w3m', etc. for examples.

> +   ("dash" ,emacs-dash)
> +   ("s" ,emacs-s)))
> +(home-page "https://github.com/Wilfred/ag.el";)
> +(synopsis "Front-end for ag (the-silver-searcher) for Emacs")
> +(description "This package provides the ability to use the silver
> +searcher, also called @code{ag}.  Features include version control system
> +awareness, use of Perl compatible regular expressions, editing the search
> +results directly and searching file names rather than the contents of 
> files.")
> +(license license:gpl3+)))
> +
>  (define-public emacs-async
>(package
>  (name "emacs-async")

-- 
Alex



Re: Openbox: Add obconf.

2017-01-15 Thread Marius Bakke
ng0  writes:

> ng0  writes:
>
>> Marius Bakke  writes:
>>
>>> ng0  writes:
>>>
 [PATCH] gnu: Add obconf.

 I noticed we don't have obconf, the configuration tool for openbox.
 Nix creates an wrapper for this application 
 (https://github.com/NixOS/nixpkgs/blob/56904d7c423f2b13b37fbd29f39bbb4b52bc7824/pkgs/tools/X11/obconf/default.nix#L18)
  I don't know if we'll need this. Running from within openbox it seemed to 
 execute and go through the tabs without crashing.
 I haven't tried changing any settings so far.
>>>
>>> Could you try changing some stuff and make sure it works? IIRC obconf
>>> does a lot of funky XML stuff which may require some patching or
>>> wrapping.
>>>
>>> I don't want to add a package just to get a bug report about it not
>>> working :-)
>>
>> Okay, I'm currently reconfiguring a system with this branch,
>> might take a really long time.
>
> Done, I can confirm that changing settings works.

Cool, thanks for checking! Pushed after sorting module imports.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Marius Bakke
Leo Famulari  writes:

> On Thu, Jan 12, 2017 at 07:59:40PM -0500, Mark H Weaver wrote:
>> Here's what we can do: in addition to mupdf itself, we can also add a
>> graft for cups-filters (our only package that includes mupdf as an
>> input).  The replacement for cups-filters would change its mupdf input
>> to refer directly to the fixed version of mupdf.
>> 
>> What do you think?
>
> I've attached two patches that should do this.

Thanks for doing this!
  
> +(define cups-filters/fixed
> +  (package
> +(inherit cups-filters)
> +(inputs
> + `(("avahi",avahi)
> +   ("fontconfig"   ,fontconfig)
> +   ("freetype" ,freetype)
> +   ("font-dejavu"  ,font-dejavu) ; also needed by test suite
> +   ("ghostscript"  ,(force ghostscript/cups))
> +   ("ijs"  ,ijs)
> +   ("dbus" ,dbus)
> +   ("lcms" ,lcms)
> +   ("libjpeg"  ,libjpeg)
> +   ("libpng"   ,libpng)
> +   ("libtiff"  ,libtiff)
> +   ("mupdf",(@@ (gnu packages pdf) mupdf/fixed))
> +   ("glib" ,glib)
> +   ("qpdf" ,qpdf)
> +   ("poppler"  ,poppler)
> +   ("cups-minimal" ,cups-minimal)

Is it possible to use the 'package-input-rewriting' procedure here? See
example at the end of section 5.1.0:

https://www.gnu.org/software/guix/manual/guix.html#Defining-Packages

Otherwise this LGTM, thanks a lot!


signature.asc
Description: PGP signature


Re: 01/01: gnu: cups-filters: Update to 1.11.5.

2017-01-15 Thread Leo Famulari
On Sat, Oct 29, 2016 at 11:08:42PM +, Tobias Geerinckx-Rice wrote:

Hi Tobias!

> nckx pushed a commit to branch core-updates
> in repository guix.
> 
> commit 4ab016e0ab9bfff2f108d1fc6f0ed3b0e1eff735
> Author: Tobias Geerinckx-Rice 
> Date:   Sun Oct 30 00:07:08 2016 +0200
> 
> gnu: cups-filters: Update to 1.11.5.
> 
> * gnu/packages/cups.scm (cups-filters): Update to 1.11.5.
> [arguments]: Add ‘--with-gs-path=’ to #:configure-flags.
> [inputs]: Add mupdf.

I wonder, do you have a use for the "mutool" integration that this
enabled, or did you add it simply because the configure phase fails
without it?

If the latter, I think we should instead pass '--disable-mutool', so
that cups-filters doesn't depend on two different PDF libraries.

Otherwise, we should make cups-filters refer directly to mupdf's mutool,
instead of looking for it on PATH.

Your thoughts?


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add emacs-sx.

2017-01-15 Thread Alex Kost
ng0 (2017-01-15 02:33 +) wrote:

> From: ng0 
>
> * gnu/packages/emacs.scm (emacs-sx): New variable.
> ---
>  gnu/packages/emacs.scm | 26 +-
>  1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 50cea7685..2e04414b3 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -12,7 +12,7 @@
>  ;;; Copyright © 2016 David Thompson 
>  ;;; Copyright © 2016 Matthew Jordan 
>  ;;; Copyright © 2016 Roel Janssen 
> -;;; Copyright © 2016 ng0 
> +;;; Copyright © 2016, 2017 ng0 
>  ;;; Copyright © 2016 Alex Griffin 
>  ;;; Copyright © 2016 Nicolas Goaziou 
>  ;;; Copyright © 2016 Alex Vong 
> @@ -1391,6 +1391,30 @@ allows easily move between them.")
>  strings.")
>  (license license:gpl3+)))
>  
> +(define-public emacs-sx
> +  (package
> +(name "emacs-sx")
> +(version "20161222.1205")
> +(source
> + (origin
> +   (method url-fetch)
> +   (uri (string-append "https://melpa.org/packages/sx-";
> +   version ".tar"))

I can only repeat that we don't use tarballs from MELPA.  See:

http://lists.gnu.org/archive/html/guix-devel/2016-10/msg00678.html
http://lists.gnu.org/archive/html/guix-devel/2016-11/msg00678.html

> +   (file-name (string-append name "-" version ".tar"))
> +   (sha256
> +(base32
> + "0alllpglv7v686ilg2dkncs0yf8g5rrgj17rx7qx9q81icwdcwxq"
> +(build-system emacs-build-system)
> +(inputs
> + `(("emacs-markdown-mode" ,emacs-markdown-mode)
> +   ("let-alist" ,let-alist)))
> +(home-page "https://github.com/vermiculus/sx.el/";)
> +(synopsis "Emacs StackExchange client")
> +(description
> + "Emacs StackExchange client.  Ask and answer questions on
> +Stack Overflow, Super User, and other StackExchange sites.")
> +(license license:gpl3+)))
> +
>  (define-public emacs-f
>(package
>  (name "emacs-f")

-- 
Alex



Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Leo Famulari
On Thu, Jan 12, 2017 at 07:59:40PM -0500, Mark H Weaver wrote:
> Here's what we can do: in addition to mupdf itself, we can also add a
> graft for cups-filters (our only package that includes mupdf as an
> input).  The replacement for cups-filters would change its mupdf input
> to refer directly to the fixed version of mupdf.
> 
> What do you think?

I've attached two patches that should do this.
From 4216ccff0b032bdad8c730ba9929b94f389fb19d Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 12 Jan 2017 19:06:55 +0100
Subject: [PATCH 1/2] gnu: mupdf: Fix CVE-2016-{10132,10133} in bundled mujs.

* gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch,
gnu/packages/patches/mupdf-mujs-CVE-2016-10133.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/pdf.scm (mupdf)[replacement]: New field.
(mupdf/fixed): New variable.
---
 gnu/local.mk   |   2 +
 .../patches/mupdf-mujs-CVE-2016-10132.patch| 188 +
 .../patches/mupdf-mujs-CVE-2016-10133.patch|  36 
 gnu/packages/pdf.scm   |  15 +-
 4 files changed, 240 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch
 create mode 100644 gnu/packages/patches/mupdf-mujs-CVE-2016-10133.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 81d774eb6..58554160d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -755,6 +755,8 @@ dist_patch_DATA =   
\
   %D%/packages/patches/multiqc-fix-git-subprocess-error.patch  \
   %D%/packages/patches/mumps-build-parallelism.patch   \
   %D%/packages/patches/mupdf-build-with-openjpeg-2.1.patch \
+  %D%/packages/patches/mupdf-mujs-CVE-2016-10132.patch \
+  %D%/packages/patches/mupdf-mujs-CVE-2016-10133.patch \
   %D%/packages/patches/mupen64plus-ui-console-notice.patch \
   %D%/packages/patches/musl-CVE-2016-8859.patch\
   %D%/packages/patches/mutt-store-references.patch \
diff --git a/gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch 
b/gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch
new file mode 100644
index 0..e752e57ec
--- /dev/null
+++ b/gnu/packages/patches/mupdf-mujs-CVE-2016-10132.patch
@@ -0,0 +1,188 @@
+Fix CVE-2016-10132:
+
+https://bugs.ghostscript.com/show_bug.cgi?id=697381
+http://seclists.org/oss-sec/2017/q1/74
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10132
+
+Patch lifted from upstream source repository:
+
+http://git.ghostscript.com/?p=mujs.git;h=fd003eceda531e13fbdd1aeb6e9c73156496e569
+
+From fd003eceda531e13fbdd1aeb6e9c73156496e569 Mon Sep 17 00:00:00 2001
+From: Tor Andersson 
+Date: Fri, 2 Dec 2016 14:56:20 -0500
+Subject: [PATCH] Fix 697381: check allocation when compiling regular
+ expressions.
+
+Also use allocator callback function.
+---
+ thirdparty/mujs/jsgc.c |  2 +-
+ thirdparty/mujs/jsregexp.c |  2 +-
+ thirdparty/mujs/jsstate.c  |  6 --
+ thirdparty/mujs/regexp.c   | 45 +++--
+ thirdparty/mujs/regexp.h   |  7 +++
+ 5 files changed, 44 insertions(+), 18 deletions(-)
+
+diff --git a/thirdparty/mujs/jsgc.c b/thirdparty/mujs/jsgc.c
+index 4f7e7dc..f80111e 100644
+--- a/thirdparty/mujs/jsgc.c
 b/thirdparty/mujs/jsgc.c
+@@ -46,7 +46,7 @@ static void jsG_freeobject(js_State *J, js_Object *obj)
+   jsG_freeproperty(J, obj->head);
+   if (obj->type == JS_CREGEXP) {
+   js_free(J, obj->u.r.source);
+-  js_regfree(obj->u.r.prog);
++  js_regfreex(J->alloc, J->actx, obj->u.r.prog);
+   }
+   if (obj->type == JS_CITERATOR)
+   jsG_freeiterator(J, obj->u.iter.head);
+diff --git a/thirdparty/mujs/jsregexp.c b/thirdparty/mujs/jsregexp.c
+index a2d5156..7b09c06 100644
+--- a/thirdparty/mujs/jsregexp.c
 b/thirdparty/mujs/jsregexp.c
+@@ -16,7 +16,7 @@ void js_newregexp(js_State *J, const char *pattern, int 
flags)
+   if (flags & JS_REGEXP_I) opts |= REG_ICASE;
+   if (flags & JS_REGEXP_M) opts |= REG_NEWLINE;
+ 
+-  prog = js_regcomp(pattern, opts, &error);
++  prog = js_regcompx(J->alloc, J->actx, pattern, opts, &error);
+   if (!prog)
+   js_syntaxerror(J, "regular expression: %s", error);
+ 
+diff --git a/thirdparty/mujs/jsstate.c b/thirdparty/mujs/jsstate.c
+index 638cab3..fd5bcf6 100644
+--- a/thirdparty/mujs/jsstate.c
 b/thirdparty/mujs/jsstate.c
+@@ -9,12 +9,6 @@
+ 
+ static void *js_defaultalloc(void *actx, void *ptr, int size)
+ {
+-  if (size == 0) {
+-  free(ptr);
+-  return NULL;
+-  }
+-  if (!ptr)
+-  return malloc((size_t)size);
+   return realloc(ptr, (size_t)size);
+ }
+ 
+diff --git a/thirdparty/mujs/regexp.c b/thirdparty/mujs/regexp.c
+index 9852be2..01c18a3 100644
+--- a/thirdparty/mujs/regexp.c
 b/thirdparty/mujs/regexp.c
+@@ -807,23 +807,31 @@ static void dumpprog(Reprog *p

Re: [PATCH 2/2] gnu: Add openvpn service.

2017-01-15 Thread Alex Kost
Ludovic Courtès (2017-01-14 22:16 +0100) wrote:

>> +(define (uglify-field-name name)
>> +  (match name
>> + ('verbosity "verb")
>> + (_ (let ((str (symbol->string name)))
>> +  (if (string-suffix? "?" str)
>> +  (substring str 0 (1- (string-length str)))
>> +  str)
>
> Not sure why but indent-code.el got ‘match’ indentation wrong, although
> it works for me.  Alex, any ideas?

Because 'scheme-mode' does not provide indentation rules for 'match'
(and many other keywords).  Geiser indents 'match' properly for you.

-- 
Alex



Re: [PATCH 1/2] doc: Symlink daemon start-up files.

2017-01-15 Thread Leo Famulari
On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote:
> On Fri, Nov 18, 2016 at 12:00:33PM +0100, Hartmut Goebel wrote:
> > This patch ensures that always the current profile's daemon will be used.
> > 
> > The .service file contains the path to the guix-daemon within the store. 
> > Thus
> > when copying the file, it will point to the very version of guix-daemon used
> > at the time of copying – even after system upgrade or when this version has
> > been garbage collected from the store.

I think we should go back to the "old way" of instructing users to copy
the file...

> I'd argue it should point to /var/guix/profiles/per-user/root/...

... and make the service file execute this path.

> >  @example
> > -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \
> > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \
> >  /etc/systemd/system/
> >  # systemctl start guix-daemon && systemctl enable guix-daemon

Debian Jessie (their current stable release) doesn't support symlinked
systemd service files yet [0], and we are frequently having to explain
to new users why this step doesn't work for them. And, we also have to
explain that the ExecStart value that contains the absolute store path
must be changed to point to '/var/guix/profiles...'.

Doing it that way has the same effect of a symlinked file that is
updated automatically: the daemon is always the latest in root's
profile.

It feels like we having to walk new users through this on IRC or
help-guix every day.

It takes our time and makes their first experience with Guix harder than
it should be.

WDYT?

[0] Jessie uses Systemd 215:
https://packages.debian.org/search?keywords=systemd
What about CentOS 7? Other distros?


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add emacs-ag

2017-01-15 Thread ng0
Hartmut Goebel  writes:

> Am 15.01.2017 um 17:13 schrieb ng0:
>>> Am 15.01.2017 um 12:25 schrieb Christopher Baines:
 the silver searcher
>>> Please explain shortly what this is in the description.
>>>
>> Why? In my opinion this is already explained when you do
>
> As a service for those who do not know what "the solver searcher" is.
> Adding "code searching tool" to the description should not be much of a
> problem.

I've read it again and it might help when "a code searching tool"
is added.

> -- 
> Regards
> Hartmut Goebel
>
> | Hartmut Goebel  | h.goe...@crazy-compilers.com   |
> | www.crazy-compilers.com | compilers which you thought are impossible |
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/



Re: Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1)

2017-01-15 Thread Maxim Cournoyer
Hi!

l...@gnu.org (Ludovic Courtès) writes:

> Hello!
>
> Maxim Cournoyer  skribis:
>
>> l...@gnu.org (Ludovic Courtès) writes:
>
> [...]
>
>>> ‘guix environment’ without --pure adds its own entries to the front of
>>> the search paths, which is why we observe this behavior.
>>>

After more testing, the Python search-path we form is always problematic
for pip since the system site-packages will always appear in front of the
user site location (~/.local/...).

My last reporting that pip was working correctly in non-environment was
wrong because I had failed to logout/login after installing the python
package; after doing so, the behavior is the same as in an environment:
the user site location (~/.local/...) comes after site-packages rather
than before, as would normally be the case. Apparently this is due to
setting a site-packages location with the environment variable
PYTHONPATH, which has precedence over the user site location.

All of these precedence rules ared defined by the module site.py which
comes with Python. It can print information about the Python search
paths with:

$ python -m site

Normally the user site-packages location should come before any other
site-packages location so that user installed Python packages can take
precedence over packages visible at the system level (or in our profile
in the the case Guix).

>>
>> Is this specific to 'guix environment' with --pure vs without --pure?
>
> Without ‘--pure’.  Conversely, ‘--pure’ clears the environment
> variables altogether:
>
>   
> https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-environment.html
>
>> Also, would this behavior be observed for any 3rd
>> party package management system, say, the one for ruby, or 
>> language? If so maybe we could document this behavior somewhere.
>
> What would you add to the document of ‘guix environment’?  It seems
> quite clear to me at first sight.
>

I've re-read the documentation about it and yes, it is quite clear about
what it does. I'll revisit any problems with environments later, after
the root problem (which lies in the way we manage the Python search
paths in our Python package definition/python build system) is fixed.

Thanks for you time, and for Guix!

Maxim


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add emacs-ag

2017-01-15 Thread Hartmut Goebel
Am 15.01.2017 um 17:13 schrieb ng0:
>> Am 15.01.2017 um 12:25 schrieb Christopher Baines:
>>> the silver searcher
>> Please explain shortly what this is in the description.
>>
> Why? In my opinion this is already explained when you do

As a service for those who do not know what "the solver searcher" is.
Adding "code searching tool" to the description should not be much of a
problem.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |



Re: [PATCH] gnu: Add emacs-ag

2017-01-15 Thread ng0
Hartmut Goebel  writes:

> Am 15.01.2017 um 12:25 schrieb Christopher Baines:
>> the silver searcher
>
> Please explain shortly what this is in the description.
>

Why? In my opinion this is already explained when you do
"guix package -s the-silver-searcher", so the only added
explanation maybe should be a @code{the-silver-searcher}.

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/



Re: [PATCH] gnu: Add emacs-ag

2017-01-15 Thread Hartmut Goebel
Am 15.01.2017 um 12:25 schrieb Christopher Baines:
> the silver searcher

Please explain shortly what this is in the description.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |




Re: [PATCH 10/96] gnu: Add ocamlmod.

2017-01-15 Thread David Craven
You're the boss :)

Currently have to study for exams, then I'll be working on adding a
system test for efi which will involve a bunch of work - building
coreboot - add tianocore payload and making qemu flags more
configurable (the idea being that we can add system tests for uboot
using the coreboot uboot payload too). rustc needs adapting to the new
cargo based rustbuild system...



[PATCH 1/2] gnu: dwm: Use modify-phases.

2017-01-15 Thread ng0
* gnu/packages/suckless.scm (dwm): Use modify-phases.
---
 gnu/packages/suckless.scm | 26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 868939b90..a737a29dc 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013 Cyril Roelandt 
 ;;; Copyright © 2015 Amirouche Boubekki 
 ;;; Copyright © 2016 Al McElrath 
-;;; Copyright © 2016, 2017 ng0 
+;;; Copyright © 2016, 2017 ng0 
 ;;; Copyright © 2015 Dmitry Bogatov 
 ;;; Copyright © 2015 Leo Famulari 
 ;;; Copyright © 2016 Eric Bavier 
@@ -64,19 +64,17 @@
  (assoc-ref %build-inputs "freetype")
  "/include/freetype2"))
#:phases
-   (alist-replace
-'configure
-(lambda _
- (substitute* "Makefile" (("\\$\\{CC\\}") "gcc"))
- #t)
-(alist-replace
- 'install
- (lambda* (#:key outputs #:allow-other-keys)
-  (let ((out (assoc-ref outputs "out")))
-   (zero?
-(system* "make" "install"
- (string-append "DESTDIR=" out) "PREFIX="
- %standard-phases
+   (modify-phases %standard-phases
+ (replace 'configure
+   (lambda _
+ (substitute* "Makefile" (("\\$\\{CC\\}") "gcc"))
+ #t))
+(replace 'install
+  (lambda* (#:key outputs #:allow-other-keys)
+(let ((out (assoc-ref outputs "out")))
+  (zero?
+   (system* "make" "install"
+(string-append "DESTDIR=" out) "PREFIX="
 (inputs
  `(("freetype" ,freetype)
("libx11" ,libx11)
-- 
2.11.0




[PATCH 2/2] gnu: dwm: Add '.desktop' file.

2017-01-15 Thread ng0
Fixes .

* gnu/packages/suckless.scm (dwm)[arguments]: Add
'install-xsession' phase.
---
 gnu/packages/suckless.scm | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index a737a29dc..e30a0883a 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -74,7 +74,26 @@
 (let ((out (assoc-ref outputs "out")))
   (zero?
(system* "make" "install"
-(string-append "DESTDIR=" out) "PREFIX="
+(string-append "DESTDIR=" out) "PREFIX=")
+(add-after 'build 'install-xsession
+  (lambda* (#:key outputs #:allow-other-keys)
+;; Add a .desktop file to xsessions.
+(let* ((output (assoc-ref outputs "out"))
+   (xsessions (string-append output "/share/xsessions")))
+  (mkdir-p xsessions)
+  (with-output-to-file
+  (string-append xsessions "/dwm.desktop")
+(lambda _
+  (format #t
+"[Desktop Entry]~@
+ Name=dwm~@
+ Comment=Dynamic Window Manager~@
+ Exec=~a/bin/dwm~@
+ TryExec=~@*~a/bin/dwm~@
+ Icon=~@
+ Type=Application~%"
+output)))
+  #t))
 (inputs
  `(("freetype" ,freetype)
("libx11" ,libx11)
-- 
2.11.0




Re: Graphical Installer - Call for Testing.

2017-01-15 Thread John Darrington
On Sun, Jan 15, 2017 at 01:20:56AM -0800, Chris Marusich wrote:
 
 --8<---cut here---start->8---
 config_file="$(mktemp --tmpdir wireless-X.cfg)"
 trap "rm -f $config_file" EXIT
 cat > "$config_file" << EOM
 network={
 ssid="my-network-id"
 key_mgmt=NONE
 wep_key0=my-wep-key
 }
 EOM
 wpa_supplicant -i wlp2s0 -c "$config_file" -B
 dhclient -v wlp2s0
 --8<---cut here---end--->8---
 
 Does your installer assume a specific (non-WEP) wireless encryption
 protocol?  That might explain the issue.

Yes.  That will be the reason.  I've assumed that encryption if present is PSK.
I'm not sure how to determine off air what kind of encryption an AP wants. 
Maybe someone can enlighten me.
 
 > * What would you suggest instead of the "Reboot" message?
 
 I think the USB stick needs to be mounted in order for the system to
 function, right?  So it seems like we can't unmount it before
 rebooting...  I know that Ubuntu's installer ejects the installation CD
 and asks the user to remove it and then reboot, so it must be possible
 to arrange for the media to be physically removed without crashing the
 system.  I'm not sure how to do that, though.
 
 Until that's figured out, maybe just say something like: "To avoid
 accidentally booting into the installation media, please shut down the
 computer, remove the installation media, and turn the computer back on."
 How's that?  Too verbose?
 
I think it's ok in this kind of application to have verbose messages.  I'll 
think about 
something along the lines you suggest.

J'


-- 
Avoid eavesdropping.  Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.



signature.asc
Description: Digital signature


[PATCH] gnu: Add emacs-ag

2017-01-15 Thread Christopher Baines
* gnu/packages/emacs.scm (emacs-ag): New variable.
---
 gnu/packages/emacs.scm | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 50cea7685..6933dcc35 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -46,6 +46,7 @@
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
+  #:use-module (gnu packages code)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages gnome)
@@ -1066,6 +1067,32 @@ like.  It can be linked with various Emacs mail clients 
(Message and Mail
 mode, Rmail, Gnus, MH-E, and VM).  BBDB is fully customizable.")
 (license license:gpl3+)))
 
+(define-public emacs-ag
+  (package
+(name "emacs-ag")
+(version "0.47")
+(source (origin
+ (method url-fetch)
+ (uri (string-append
+   "https://github.com/Wilfred/ag.el/archive/";
+   version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+  (base32
+   "1rlmp6wnyhqfg86dbz17r914msp58favn4kd4yrdwyia265a4lar"
+(build-system emacs-build-system)
+(propagated-inputs
+ `(("the-silver-searcher" ,the-silver-searcher)
+   ("dash" ,emacs-dash)
+   ("s" ,emacs-s)))
+(home-page "https://github.com/Wilfred/ag.el";)
+(synopsis "Front-end for ag (the-silver-searcher) for Emacs")
+(description "This package provides the ability to use the silver
+searcher, also called @code{ag}.  Features include version control system
+awareness, use of Perl compatible regular expressions, editing the search
+results directly and searching file names rather than the contents of files.")
+(license license:gpl3+)))
+
 (define-public emacs-async
   (package
 (name "emacs-async")
-- 
2.11.0




Re: [PATCH] gnu: Mark /gnu/store as needed for boot.

2017-01-15 Thread John Darrington
On Sun, Jan 15, 2017 at 10:53:02AM +0100, David Craven wrote:
 > will erroneously return #t when (file-system-mount-point fs) evaluates
 > to "/gn"  and (%store-directory) to "/gnu/store".  Will it not???
 
 The trick is to revert the arguments:
 
 (string-prefix? (%store-directory) (file-system-mount-point fs))

No that will also be wrong.

(string-prefix? "/gnu/store" "/gnu") => #f

I think the procedure  I wrote does it correctly.

J'

-- 
Avoid eavesdropping.  Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.



signature.asc
Description: Digital signature


Re: [PATCH] gnu: Mark /gnu/store as needed for boot.

2017-01-15 Thread David Craven
> will erroneously return #t when (file-system-mount-point fs) evaluates
> to "/gn"  and (%store-directory) to "/gnu/store".  Will it not???

The trick is to revert the arguments:

(string-prefix? (%store-directory) (file-system-mount-point fs))



Re: Re: Re: mounting "my-home" to /home cannot work again.

2017-01-15 Thread David Craven
> make check-system TESTS="separate-store-os" ?   build guix from sources?

Assuming you have a default guixsd installation with no modifications,
you should be able to run `guix pull` to get the latest sources and
`guix reconfigure`.



[PATCH] guix: profiles: Export ca-certificate-bundle

2017-01-15 Thread Christopher Baines
* guix/profiles.scm: Export ca-certificate-bundle, such that it can be used in
other G-expressions.  This is useful where these G-expressions run programs
that require a ca-certificate-bundle, e.g. git.
---
 guix/profiles.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index e7707b654..495a9e2e7 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -92,6 +92,7 @@
 profile-manifest
 package->manifest-entry
 packages->manifest
+ca-certificate-bundle
 %default-profile-hooks
 profile-derivation
 
-- 
2.11.0




Re: Graphical Installer - Call for Testing.

2017-01-15 Thread Chris Marusich
John Darrington  writes:

> Hi Chris,
>
> Thanks for this very comprehensive feedback.  I hope you will forgive
> me if I don't respond to every point you have raised.  I have however read
> them all, and they are all relevant and useful.  So thanks very much.

My pleasure!  It's easy to give feedback; it's hard to write something
that works.  Thank you for writing something that works!

> * It would be great if you could try to find out why your wireless failed.

I'll look into it.  FWIW, the following DOES work for setting up my
wireless from the (usual release) installation image (I know WEP is
insecure, but I use it for certain reasons that are not related to the
topic of this email thread):

--8<---cut here---start->8---
config_file="$(mktemp --tmpdir wireless-X.cfg)"
trap "rm -f $config_file" EXIT
cat > "$config_file" << EOM
network={
ssid="my-network-id"
key_mgmt=NONE
wep_key0=my-wep-key
}
EOM
wpa_supplicant -i wlp2s0 -c "$config_file" -B
dhclient -v wlp2s0
--8<---cut here---end--->8---

Does your installer assume a specific (non-WEP) wireless encryption
protocol?  That might explain the issue.

> * What would you suggest instead of the "Reboot" message?

I think the USB stick needs to be mounted in order for the system to
function, right?  So it seems like we can't unmount it before
rebooting...  I know that Ubuntu's installer ejects the installation CD
and asks the user to remove it and then reboot, so it must be possible
to arrange for the media to be physically removed without crashing the
system.  I'm not sure how to do that, though.

Until that's figured out, maybe just say something like: "To avoid
accidentally booting into the installation media, please shut down the
computer, remove the installation media, and turn the computer back on."
How's that?  Too verbose?

Anyway, thanks again for the installer.  It's really nice!

-- 
Chris


signature.asc
Description: PGP signature


[PATCH] gnu: services: New exported procedures

2017-01-15 Thread Christopher Baines
* gnu/services.scm: Export service-extension-target and
service-extension-compute.  This allows for greater extensiblity of services
by enabling service extensions to be wrapped.  For example, the parameters
passed to the compute function can be modified, or the return value of the
compute function can be modified.
---
 gnu/services.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/services.scm b/gnu/services.scm
index 03112f751..4020fd37e 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -38,6 +38,8 @@
   #:use-module (ice-9 match)
   #:export (service-extension
 service-extension?
+service-extension-target
+service-extension-compute
 
 service-type
 service-type?
-- 
2.11.0




Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.

2017-01-15 Thread Mark H Weaver
Leo Famulari  writes:

> On Thu, Jan 12, 2017 at 07:59:40PM -0500, Mark H Weaver wrote:
>> Leo Famulari  writes:
>> > If we can't graft it, we should build it on a branch on Hydra.
>> 
>> Here's what we can do: in addition to mupdf itself, we can also add a
>> graft for cups-filters (our only package that includes mupdf as an
>> input).  The replacement for cups-filters would change its mupdf input
>> to refer directly to the fixed version of mupdf.
>> 
>> What do you think?
>
> That's a good idea, and I started implementing it, but then I wondered
> how cups-filters was actually using mupdf. The cups-filters package is
> only 3.7 MB, while libmupdf.a is 44 MB.
>
> It turns out that the built cups-filters doesn't refer to mupdf at all;
> mupdf is not protected from the garbage collector if you install
> cups-filters.

Static linking copies segments of code and data from the *.a into
whatever is being linked (an executable or library).  So, buggy code
might be copied from libmupdf.a into 'cups-filters', with no references
to 'mupdf' remaining.  Also, the fact that cups-filters is smaller than
libmupdf.a doesn't prove that code wasn't copied from libmupdf.a.

  Thanks,
Mark