Re: Haskell updates?

2017-06-24 Thread Federico Beffa
Mekeor Melire  writes:

> Ricardo Wurmus  writes:
>
>> is anyone working on Haskell updates?  Looks like we have some catching
>> up to do.
>
> I'm not working on it, but I'm willing to join. How do we want to
> proceed? What's the plan? What's the strategy?
>
> We have a stackage-importer now, right? Can't we just import all packages from
> stackage-lts?

Hi,

as far as I'm aware there is not formal specification of the Cabal file
format.  For this reason, when I was working on the Hackage importer, I
extracted as much information as I could from the user guide and from a
set of Cabal files belonging to specific projects.  Later, when I added
the Stackage importer I tested it with 'refresh' and noticed that some
packages are not properly imported.  All this to say that, to follow the
above route, the Hackage importer will need some love.  I believe that
it shouldn't be difficult to fix the errors that I've seen (for example,
I remember seeing a file using a capital 'IF' upsetting the importer),
but I have no plans to do so.

>
> What about the idea, developed by Federico Beffa and Troy Sankey at
>
> https://lists.gnu.org/archive/html/guix-devel/2017-02/msg00226.html
>
> , to create a package ghc-all-cabal-files as implicit dependency of those 
> ghc-*
> packages which are listed in
>
> https://github.com/commercialhaskell/all-cabal-files/tree/hackage
>
> ? Federico, Troy, are you working on this? Unfortunately, both of you
> seem to got pretty inactive lately, AFAICS.

I'm not working on it.

On the subject: I've recently seen some discussions about Cabal files
revisions in the Haskell community
<https://mail.haskell.org/pipermail/haskell-cafe/2017-June/127358.html>

Regards,
Fede



Re: Introducing ‘guix pack’

2017-03-22 Thread Federico Beffa
Andy Wingo  writes:

> On Mon 20 Mar 2017 15:14, l...@gnu.org (Ludovic Courtès) writes:
>
>> Federico Beffa  skribis:
>>
>>> If you provide an archive such as
>>> 'guile-2.2.0-pack-x86_64-linux-gnu.tar.lz' reachable from the main
>>> project page (especially without any warning about its intended
>>> purpose), I bet that many peoples will install it and keep it.  If more
>>> projects follow this example, we land to the above scenario where "rm
>>> -rf /gnu" is not practical at all.
>
> Replying to Federico: These are the same considerations as with Guix
> fwiw, unless you remove old profiles and "guix gc".

There is a very big difference.  The Guix binary installation pack
does include the 'guix' command which allows you to remove stuff from
the store.  Any other pack not including 'guix' does not.

Suppose that Guix pack bundles become popular and compare them to,
say, Mac style archives.  Let's go through Ludovic's analysis:

1. Composability: With Mac bundles you extract the archive in a
   directory.  With Guix packs it's essentially the same.
   
   i. Sharing of store items: What are the chances that two
   independent projects will generate packs from the same git checkout
   (or guix pull)?  Pretty low.  Therefore the amount of sharing
   between different packs will be pretty negligible.

   ii. Adding a program. Mac style: you just extract it.  With Guix
   pack it's essentially the same, but it creates a manually
   unmanageable network of links which entangle all packs.

   iii. Remove an item: Mac style: delete a directory.  With Guix pack
   the choice is: delete everything or keep everything.  That is, you
   keep obsolete programs/libraries with security holes on your system
   ready for exploitation and unnecessarily filling your disk, or
   ... start from scratch.  Is this composability?

2. Security: Mac style bundles are problematic, but at least you can
   easily delete old stuff and replace them with updated versions.
   Guix packs are worse: delete everything or keep it all.

3. Reproducibility: As long as you carefully take note from which git
   checkout you generate a Guix pack, Guix packs seems to be superior.
   Oh, don't you also depend on upsteam published archives of every
   single package in Guix?  They sometimes disappear or are replaced
   in place with different archives and so, after some time, your
   carefully noted git checkout will not build anymore.

4. Experimentation: Guix is great for that, but packs?  Are they
   useful for testing on other GNU/Linux systems?  Maybe.  But aren't
   all Guix packages built in isolated environments anyway?  So, do
   you really need packs to test on other systems?  Maybe, but
   probably not.

Don't get me wrong, I find that Guix proper has many great features,
but pack is not one of them.  

I find very disturbing when peoples advertise things hiding half of
the story to make them appear better than what they really are.

Fede



Re: Introducing ‘guix pack’

2017-03-20 Thread Federico Beffa
l...@gnu.org (Ludovic Courtès) writes:

> Hi Federico,
>
> Federico Beffa  skribis:
>
>> Say, developer A distributes such an archive A and developer B
>> distributes archive B (a different program/library) and someone C
>> installs both.
>
> Interestingly composability (what happens when you unpack both A and B
> on the same system) is better than what you’d get with Docker: the
> unpacked items that are identical are shared, and those parts that
> differ don’t collide.

Packs share identical items, but it becomes essentially impossible to
remove one component out of many.

>> Now developer A fixes a security hole and produces a new archive.  How
>> can C remove the library with the security hole from his system?  If he
>> just overlays the new version, the library with the security problem
>> stays on the system and could be exploited.  Deleting everything is also
>> less than ideal.
>>
>> This seems to me similar to encouraging the much criticized practice of
>> bundling required libraries with your program.
>>
>> Maybe 'pack' could at least include a 'remove-myself' thing.  Or have
>> you thought about the hole program life-cycle?
>
> Good question.  There’s a fine line here.  In Guix circles we’re very
> good at explaining why “app bundles” are a bad thing (composability- and
> security-wise notably), and here that’s precisely what we’re producing.
>
> The intended use case is mostly “one-off” packs where you just want
> people to easily test something, as opposed to putting it in
> production.  This was the case for the Guile 2.2.0 release.  In those
> cases, people would essentially “rm -rf /gnu” when they’re done.

If you provide an archive such as
'guile-2.2.0-pack-x86_64-linux-gnu.tar.lz' reachable from the main
project page (especially without any warning about its intended
purpose), I bet that many peoples will install it and keep it.  If more
projects follow this example, we land to the above scenario where "rm
-rf /gnu" is not practical at all.

> For code that is meant to be kept over time, I would recommend to either
> use Guix, or to include Guix in the pack so that people can eventually
> upgrade.

This is clear to me, but there are many peoples who do not know about
Guix, or just don't want it.  They may still be interested in, say,
Guile 2.2.

With the 'pack' command it seems to me that Guix is being promoted as a
convenient development environment where at the end you can produce
binary bundles for distribution on any system that it supports.  But,
without providing at least a way to remove things, it seems to be
heading toward a dangerous direction.

Fede



Re: Introducing ‘guix pack’

2017-03-19 Thread Federico Beffa
l...@gnu.org (Ludovic Courtès) writes:

> Hi!
>
> Andy Wingo  skribis:
>
>> On Tue 14 Mar 2017 14:42, l...@gnu.org (Ludovic Courtès) writes:
>>
>>> If we remove /var/guix/profiles, users will have to actually type
>>> /gnu/store/asasdfadfgsadfa-profile/bin/guile.  This is not great, but I
>>> don’t know what else could be done.  We could profile a
>>> /bin/guile → /gnu/store/asasdfadfgsadfa-profile/bin/guile symlink, but
>>> perhaps that’s risky too.
>>
>> As we were discussing in the channel, maybe it's OK for these binary
>> installs to claim "/opt/gnu".  Then we expose the profile in /opt/gnu,
>> so you would run Guile as /opt/gnu/bin/guile.  Additionally you could
>> actually build against that Guile, which would be pretty neat.  If the
>> user untars multiple guix packs, /gnu/store easily absorbs the union,
>> and /opt/gnu will adjoin any new profile directories/files and replace
>> any overwritten links.
>>
>> We would have to make sure the union directory in /opt/gnu has all real
>> directories and only symlink files, as per the recent patch on
>> guix-devel.
>
> Commit 5895ec8aa234ec9a4ce68ab8f94e795807630168 takes a slightly
> different approach (it doesn’t use the union thing).
>
> You can run:
>
>   guix pack guile-next \
> --symlink=/opt/gnu/bin/guile=bin/guile \
> --symlink=/opt/gnu/bin/guild=bin/guild
>
> and that does what you would expect.
>
> In addition, /var/guix is no longer included by default.
>
> Let me know what you think!

Say, developer A distributes such an archive A and developer B
distributes archive B (a different program/library) and someone C
installs both.

Now developer A fixes a security hole and produces a new archive.  How
can C remove the library with the security hole from his system?  If he
just overlays the new version, the library with the security problem
stays on the system and could be exploited.  Deleting everything is also
less than ideal.

This seems to me similar to encouraging the much criticized practice of
bundling required libraries with your program.

Maybe 'pack' could at least include a 'remove-myself' thing.  Or have
you thought about the hole program life-cycle?

Fede



Re: delete profile

2017-03-14 Thread Federico Beffa
Alex Kost  writes:

> Federico Beffa (2017-03-14 09:42 +0100) wrote:
>
>> Pjotr Prins  writes:
>> 'guix -p $HOME/guix-test-profile' lists only 1 generation (but I did
>> create another one and then I rolled-back).
>>
>> I run 'guix gc' and now I find dangling symlinks in my $HOME.
>
> What dangling symlinks?  Just remove them :-)

Of this type:

$HOME/guix-test-profile-XXX-link -> /gnu/store/...

Yes, sure, I deleted them.  It just seems strange that a GC leaves
dangling links around.

>
>> One
>> symlink is still active (the active generation) which imply that it is
>> registered as a GC root.
>
> Look at /var/guix/gcroots/auto/ to see the registered GC roots, but
> don't remove them manually, just remove the profile links you created,
> then "guix gc" should clean the store from those profiles.
>
>> However, it's not in
>> '/usr/local/var/guix/profiles' (I installed from source with the default
>> prefix=/usr/local).
>
> this var/guix/profiles is only for system and per-user profiles.
> Profiles that you create explicitly (with --profile option) are not
> placed there.
>
>> Not sure where to find it.
>
> I'm not sure what you mean: the profiles you created with "guix package
> -p $HOME/guix-test-profile -i ..." are in the store and the symlinks to
> them are these "$HOME/guix-test-profile[-XXX-link]" links.  Simply remove
> these links and run "guix gc".

As Pjotr suggested, I was expecting to have to delete a GC root
somewhere.  If this is not the case then the better.

Thanks for the explanation.
Fede



Re: delete profile

2017-03-14 Thread Federico Beffa
Pjotr Prins  writes:

> On Mon, Mar 13, 2017 at 10:35:56PM +0300, Alex Kost wrote:
>> Federico Beffa (2017-03-12 18:28 +0100) wrote:
>> 
>> > Hi,
>> >
>> > I've created a profile for test purposes with
>> >
>> > guix package -p $HOME/guix-test-profile -m test-manifest.scm
>> >
>> > that now I would like to delete.  I've looked up the documentation but
>> > not found any suitable command.  What's the recommended procedure to
>> > delete it?
>> 
>> I would simply remove it and all its generations
>> ("$HOME/guix-test-profile-XX-link") manually.  I don't know if there is
>> any recommended way to do it though.
>
> That removes the symlinks to a directory in /var/guix/profiles. I
> think you also need to remove the links in the latter if you want the
> garbage collection to work. 

'guix -p $HOME/guix-test-profile' lists only 1 generation (but I did
create another one and then I rolled-back).

I run 'guix gc' and now I find dangling symlinks in my $HOME.  One
symlink is still active (the active generation) which imply that it is
registered as a GC root.  However, it's not in
'/usr/local/var/guix/profiles' (I installed from source with the default
prefix=/usr/local).  Not sure where to find it.

Thanks for the suggestions.
Fede



delete profile

2017-03-12 Thread Federico Beffa
Hi,

I've created a profile for test purposes with

guix package -p $HOME/guix-test-profile -m test-manifest.scm

that now I would like to delete.  I've looked up the documentation but
not found any suitable command.  What's the recommended procedure to
delete it?

Thanks,
Fede



Re: updating many haskell packages

2017-02-18 Thread Federico Beffa
On Sat, Feb 18, 2017 at 6:40 PM, Troy Sankey  wrote:
> Quoting Federico Beffa (2017-02-18 04:43:51)
>> On Fri, Feb 17, 2017 at 6:47 PM, Troy Sankey  wrote:
>> > Forgive me if my understanding of build systems in Guix is flawed, but
>> > let me explain my idea with more detail:
>> >
>> > First, make a data-only package called "ghc-all-cabal-files" containing
>> > the checkout of a specific commit of the all-cabal-files repository from
>> > github.  We can periodically update this package, but there is no
>> > traditional "release"---we just keep pulling the HEAD of the hackage
>> > branch.  This package would then act as a helper package for the haskell
>> > build system---every haskell package should implicitly use this package
>> > as input.  Then we can write a post-unpack phase for the
>> > haskell-build-system which updates the unpacked .cabal file iff it finds
>> > a newer .cabal file in ghc-all-cabal-files (we know how to determine if
>> > the cabal file is newer: it will have a higher "x-revision" value, or
>> > that key will merely exist).
>> >
>> > One problem I have not fully solved is the technical debt associated
>> > with keeping the proposed ghc-all-cabal-files package up-to-date.  I
>> > believe updating it would require all haskell packages to be rebuilt.
>> > We could create a build system argument called use-newest-cabal-file to
>> > toggle the feature, in which case we would only switch it to #t if we
>> > already know the .cabal file to be stale.  Then only a small subset of
>> > packages would need to be rebuilt, and there is less technical debt than
>> > the current solution which involves monkey-patching every cabal file
>> > that needs it.
>>
>> My worry with this approach is that every time that a single cabal
>> file in 'ghc-all-cabal-files' is updated all packages will fail to
>> build (the implicit input will fail). Given that there are several
>> thousands of cabal files, I suspect that this could occur quite often.
>
> Can you elaborate on how all packages will fail to build?

I was thinking that the 'ghc-all-cabal-files' would come from a
released tar file that would change and therefore the hash would not
match.  However, as you mentioned, the package would really come from
a git checkout and would therefore not become unavailable.

My bad, sorry.

Fede



Re: updating many haskell packages

2017-02-18 Thread Federico Beffa
On Fri, Feb 17, 2017 at 6:47 PM, Troy Sankey  wrote:
> Quoting Federico Beffa (2017-02-17 03:00:04)
>> On Wed, Feb 15, 2017 at 8:31 PM, Troy Sankey  wrote:
>> > Quoting Troy Sankey (2017-02-06 16:00:29)
>> >> Quoting Federico Beffa (2017-02-06 15:34:47)
>> >> > I would consider a discrepancy between a cabal file on Hackage and the
>> >> > actual cabal file included in a tar archive a bug.  It may be helpful
>> >> > to report it to the author.
>> >>
>> >> I found this issue on the hackage github:
>> >>
>> >> https://github.com/haskell/hackage-server/issues/503
>> >>
>> >> It looks like it's a feature of hackage and/or cabal to allow multiple
>> >> revisions of cabal files per tarball release.  IIUC, the `cabal get`
>> >> utility takes care of automatically updating the cabal file to the
>> >> latest revision.
>> >>
>> >> I'll have to look more into this later.
>> >
>> > Indeed the .cabal files can be revised between releases.  Somehow the
>> > new revisions get pushed to the all-cabal-files repository [0] with an
>> > additional "x-revision" key [1], and Hackage picks up the new cabal
>> > file.  The `cabal` and `stack` utilities substitute the .cabal file from
>> > the release tarball with the revised .cabal file from Hackage if it is
>> > newer.
>> >
>> > In theory, anything in the .cabal file could be modified, not just
>> > dependency bounds.  I think guix should use the updated .cabal files for
>> > better consistency with the rest of the haskell ecosystem, and also for
>> > less per-package maintenance cost.
>> >
>> > How can guix adapt?  Should we somehow incorporate the all-cabal-files
>> > repository in the haskell build system, adding a post-unpack phase to
>> > substitute the entire .cabal file?
>>
>> Packages are build in isolated environments without network.
>> Therefore it's not possible to access Hackage with a phase of the
>> build system.  Even if it were possible it would be undesirable
>> because it would make things non reproducible.
>>
>> Files not included in the tar can be added as origin inputs to a
>> package definition (see the testsuite for GHC in the ghc package).
>> However, they are verified with hashes. Any change to those files will
>> break the package.
>>
>> Fede
>
> Forgive me if my understanding of build systems in Guix is flawed, but
> let me explain my idea with more detail:
>
> First, make a data-only package called "ghc-all-cabal-files" containing
> the checkout of a specific commit of the all-cabal-files repository from
> github.  We can periodically update this package, but there is no
> traditional "release"---we just keep pulling the HEAD of the hackage
> branch.  This package would then act as a helper package for the haskell
> build system---every haskell package should implicitly use this package
> as input.  Then we can write a post-unpack phase for the
> haskell-build-system which updates the unpacked .cabal file iff it finds
> a newer .cabal file in ghc-all-cabal-files (we know how to determine if
> the cabal file is newer: it will have a higher "x-revision" value, or
> that key will merely exist).
>
> One problem I have not fully solved is the technical debt associated
> with keeping the proposed ghc-all-cabal-files package up-to-date.  I
> believe updating it would require all haskell packages to be rebuilt.
> We could create a build system argument called use-newest-cabal-file to
> toggle the feature, in which case we would only switch it to #t if we
> already know the .cabal file to be stale.  Then only a small subset of
> packages would need to be rebuilt, and there is less technical debt than
> the current solution which involves monkey-patching every cabal file
> that needs it.

My worry with this approach is that every time that a single cabal
file in 'ghc-all-cabal-files' is updated all packages will fail to
build (the implicit input will fail). Given that there are several
thousands of cabal files, I suspect that this could occur quite often.

Maybe another approach could be: when we update the GHC packages we
follow a specific Stackage release. If a package tar includes an old
cabal file, we enable a 'jailbreak' flag such that the build system
clears version bounds. This of course relies on the fact that Stackage
verified that this is fine.

Regards,
Fede



Re: updating many haskell packages

2017-02-17 Thread Federico Beffa
On Wed, Feb 15, 2017 at 8:31 PM, Troy Sankey  wrote:
> Quoting Troy Sankey (2017-02-06 16:00:29)
>> Quoting Federico Beffa (2017-02-06 15:34:47)
>> > I would consider a discrepancy between a cabal file on Hackage and the
>> > actual cabal file included in a tar archive a bug.  It may be helpful
>> > to report it to the author.
>>
>> I found this issue on the hackage github:
>>
>> https://github.com/haskell/hackage-server/issues/503
>>
>> It looks like it's a feature of hackage and/or cabal to allow multiple
>> revisions of cabal files per tarball release.  IIUC, the `cabal get`
>> utility takes care of automatically updating the cabal file to the
>> latest revision.
>>
>> I'll have to look more into this later.
>
> Indeed the .cabal files can be revised between releases.  Somehow the
> new revisions get pushed to the all-cabal-files repository [0] with an
> additional "x-revision" key [1], and Hackage picks up the new cabal
> file.  The `cabal` and `stack` utilities substitute the .cabal file from
> the release tarball with the revised .cabal file from Hackage if it is
> newer.
>
> In theory, anything in the .cabal file could be modified, not just
> dependency bounds.  I think guix should use the updated .cabal files for
> better consistency with the rest of the haskell ecosystem, and also for
> less per-package maintenance cost.
>
> How can guix adapt?  Should we somehow incorporate the all-cabal-files
> repository in the haskell build system, adding a post-unpack phase to
> substitute the entire .cabal file?

Packages are build in isolated environments without network.
Therefore it's not possible to access Hackage with a phase of the
build system.  Even if it were possible it would be undesirable
because it would make things non reproducible.

Files not included in the tar can be added as origin inputs to a
package definition (see the testsuite for GHC in the ghc package).
However, they are verified with hashes. Any change to those files will
break the package.

Fede



Re: Broken tests

2017-02-13 Thread Federico Beffa
On Sat, Feb 11, 2017 at 6:15 PM, David Craven  wrote:
> Hi!
>
>> Revert "import: json: Explicitly ask for JSON data."
>> This reverts commit 81e0bc1834490a1a8092c75a0733b15c2b407285.
>
> I reverted this commit in my local repository for now, it breaks the
> pypi, crate and some other test I can't recall (gem and/or cpan).

The importers seems to be working as before. I believe that the
problem is with the tests. They replace the function 'http-fetch', but
do not replicate the signature of the original function and instead
use a different one.



Re: [PATCH 1/2] build: Generalize 'package-with-explicit-python'.

2017-02-13 Thread Federico Beffa
On Fri, Feb 10, 2017 at 5:18 PM, Ludovic Courtès  wrote:
> Hello!
>
> Federico Beffa  skribis:
>
>> +(define* (package-with-explicit-compiler compiler bs-name
>> + old-prefix new-prefix
>> + #:key variant-property)
>> +  "Return a procedure of one argument, P.  The procedure creates a package
>> +with the same fields as P, which is assumed a build-system named BS-NAME, 
>> such
>> +that it is compiled with COMPILER instead.  The inputs are changed 
>> recursively
>> +accordingly.  If the name of P starts with OLD-PREFIX, this is replaced by
>> +NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name.
>> +
>> +When VARIANT-PROPERTY is present, it is used as a key to search for
>> +pre-defined variants of this transformation recorded in the 'properties' 
>> field
>> +of packages.  The property value must be the promise of a package.  This is 
>> a
>> +convenient way for package writers to force the transformation to use
>> +pre-defined variants."
>
> Great idea, along with --with-compiler.
>
> However, I think this:
>
>> +  (define compiler-keyword
>> +(case bs-name
>> +  ((haskell python emacs perl r ruby) (symbol->keyword bs-name))
>> +  (else
>> +   (leave (_ "Operation not supported by the build system: ~A~%") 
>> bs-name
>
> and this:
>
>> + ;; Otherwise build the new package object graph.
>> + ((eq? (build-system-name (package-build-system p)) bs-name)
>
> are kind of hacks (the build system name is supposed to be used for
> debugging purposes only, and not for identification) and not very
> extensible (we’d have to extend the ‘case’ above for every new build
> system.)
>
> What we’re trying to achieve here is similar to
> ‘package-input-rewriting’ and --with-input, except that it should
> additionally take into account implicit inputs.
>
> For that reason I’d suggest a new ‘package-input-rewriting*’ that would:
>
>   1. Call ‘package-input-rewriting’;
>
>   2. Change the ‘build-system’ field of the result and inject a “proxy”
>  build system in order to be able to change the inputs of the bag
>  (which includes the package’s implicit inputs).
>
> Then we could change --with-input to use this new procedure, and
> --with-input=r=my-r would DTRT.

I agree with everything you said and that's a nice plan forward.  But
there are other considerations as well.

We have many outdated Haskell packages which do not work with the latest
GHC.  I'm using it and would love to see the ecosystem being upgraded,
but currently can't invest enough time to do the job myself.  Now,
somebody offered to do the job (that's upgrading a couple 100s of
packages!) and asked if tools are available to test compatibility with
a new compiler.  Given that we are using 'package-with-explicit-python'
since 2013 and that with a simple hack we can make it work with several
other build-systems, I thought that offering it as an interim solution
would be simple and acceptable.

As far I can see, this hack doesn't have widespread consequences and
offers an immediate aid.  Once the elegant and super general solution will be
ready we can easily replace it.

Regards,
Fede



Re: [PATCH 2/2] import: Add stackage importer and updater.

2017-02-09 Thread Federico Beffa
On Wed, Feb 8, 2017 at 4:30 PM, Ludovic Courtès  wrote:
> Hello Federico,
>
> Federico Beffa  skribis:

> [...]

>> +(if name-version
>> +(hackage->guix-package name-version
>> +   #:include-test-dependencies?
>> +   include-test-dependencies?)
>> +(begin
>> +  (format (current-error-port)
>> +  "guix import stackage: package not found: ~a~%" 
>> package-name)
>> +  #f
>
> The ‘if’ is unnecessary here: (guix scripts import) produces an error
> message when an importer returns something other than a ‘package’ sexp.

I've implemented all suggested changes apart from this one for two reasons:

* If the package is not included in an LTS release then the procedure
generating name-version returns #f. If I remove the 'if' then
hackage->guix-package will be called with a boolean instead of a
string as the first parameter and that will throw an exception.

* Here we can give a more accurate error message: we can say that the
package was not found in the LTS release, while, by returning, the
error would be "failed to download cabal file" which is somewhat
misleading.

Thanks for the review.
Fede



Re: [PATCH 1/2] build: Generalize 'package-with-explicit-python'.

2017-02-08 Thread Federico Beffa
On Wed, Feb 8, 2017 at 8:09 PM, Ricardo Wurmus  wrote:
>
> Federico Beffa  writes:
>
>> Generalize the Python procedure to recursively replace compiler/interpreter.
>> From a8220b430d196e5bb079e23ac63b1acd16fdaaee Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Wed, 8 Feb 2017 18:55:32 +0100
>> Subject: [PATCH 1/2] build: Generalize 'package-with-explicit-python'.
>>
>> * guix/build-system/python.scm (package-with-explicit-python): Remove it and
>>   replace it with the generalized procedure 'package-with-explicit-compiler'
>>   in the new file. (package-with-python2): Adapt it.
>> * guix/build-system/utils.scm: New file with the generalized procedure.
>> * Makefile.am (MODULES): Add new file.
>
> The goal here is to override packages in build system arguments, right?
> This is great and we really need something like this to make building
> package variants simpler.  (I ran into a problem that would be solved by
> this when I tried to build Perl modules for different variants of Perl.)

Hi Ricardo,

The goal is to exploit the compiler keyword argument of many
build-systems (such as #:python, #:haskell, ...) to pass the desired
compiler instead of the default one.

> Looking over the patch it feels inelegant to have a whitelist of
> permitted arguments, as in “compiler-keyword”.  We already have a
> procedure called “package-input-rewriting” that replaces any (explicit
> input-) package in the dependency graph with a different package.  What
> I like about that is that it is generic.  Is there a way we could extend
> it to include packages pulled in by the build system, e.g. by making it
> work at the level of bags?

The procedure was not written by me: 99% of it comes from the
python-build-system.  The only thing that I did is to replace the
hard-coded '#:python' keyword with a variable one such that it can be
used with some other build systems. This seemed to me as one step in
the right direction, but if you have a better idea then please go
ahead and write it.  I will not feel offended ;-)

Regards,
Fede



[PATCH 2/2] build: Add new '--with-compiler' option.

2017-02-08 Thread Federico Beffa
... and try to make it easy to test new compilers.

There actually was a request on help-guix
https://lists.gnu.org/archive/html/help-guix/2017-02/msg3.html

Regards,
Fede
From 84b68a1a3faf6609a0e1922bafe7987d908e5694 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Wed, 8 Feb 2017 18:57:13 +0100
Subject: [PATCH 2/2] build: Add new '--with-compiler' option.

* guix/scripts/build.scm (package-name-prefix, transform-package-compiler):
  New procedures.  (%transformations, %transformation-options,
  show-transformation-options-help): Add new option '--with-compiler'.
---
 guix/scripts/build.scm | 59 +++---
 1 file changed, 56 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 68402fda1..1bc69b179 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès 
 ;;; Copyright © 2013 Mark H Weaver 
+;;; Copyright © 2017 Federico Beffa 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,8 @@
   #:use-module ((guix utils) #:hide (package-name->name+version))
   #:use-module ((guix build utils) #:select (package-name->name+version))
 
+  #:use-module (guix build-system)
+  #:use-module (guix build-system utils)
   #:use-module (guix monads)
   #:use-module (guix gexp)
   #:autoload   (guix http-client) (http-fetch http-get-error?)
@@ -231,6 +234,50 @@ current 'gnutls' package, after which version 3.5.4 is grafted onto them."
   (rewrite obj)
   obj
 
+;; XXX: Can we use a more robust method?
+(define* (package-name-prefix package #:optional (default ""))
+  "Return the package name prefix used by convention by PACKAGE."
+  (let ((name (package-name package))
+(bs (package-build-system package)))
+(case (build-system-name bs)
+  ((haskell) "ghc-")
+  ((python)
+   (if (string-prefix? "python2-" name)
+   "python2-"
+   "python-"))
+  ((emacs perl r ruby)
+   (let ((prefix (string-append (symbol->string bs) "-")))
+ (if (string-prefix? prefix name)
+ prefix
+ default)))
+  (else default
+
+(define (transform-package-compiler compiler-spec)
+"Return a procedure that, when passed a package, replaces the default
+compiler used to build it by COMPILER-SPEC.  The package inputs are changed
+recursively accordingly.  Currently only packages built using one of the
+following build-systems are supported: haskell, python. emacs, perl, r or
+ruby."
+  (define (new-prefix old-prefix compiler)
+(let ((name (package-name compiler))
+  (version (package-version compiler)))
+  (string-append old-prefix "with" name version "-")))
+
+  (let* ((compiler (match compiler-spec
+ ((spec) (specification->package spec))
+ (_ (leave (_ "Wrong compiler specification: ~A~%"))
+(lambda (store obj)
+  (match obj
+((? package? p)
+ (let* ((bs-name (build-system-name (package-build-system p)))
+(prefix (package-name-prefix p)))
+   ((package-with-explicit-compiler compiler bs-name
+prefix
+(new-prefix prefix compiler))
+p)))
+(_
+ obj)
+
 (define %transformations
   ;; Transformations that can be applied to things to build.  The car is the
   ;; key used in the option alist, and the cdr is the transformation
@@ -238,7 +285,8 @@ current 'gnutls' package, after which version 3.5.4 is grafted onto them."
   ;; things to build.
   `((with-source . ,transform-package-source)
 (with-input  . ,transform-package-inputs)
-(with-graft  . ,transform-package-inputs/graft)))
+(with-graft  . ,transform-package-inputs/graft)
+(with-compiler . ,transform-package-compiler)))
 
 (define %transformation-options
   ;; The command-line interface to the above transformations.
@@ -252,7 +300,9 @@ current 'gnutls' package, after which version 3.5.4 is grafted onto them."
   (option '("with-input") #t #f
   (parser 'with-input))
   (option '("with-graft") #t #f
-  (parser 'with-graft)
+  (parser 'with-graft))
+  (option '("with-compiler") #t #f
+  (parser 'with-compiler)
 
 (define (show-transformation-options-help)
   (display (_ "
@@ -263,7 +313,10 @@ current 'gnutls' package, after which version 3.5.4 is grafted onto them."
  replace dependency PACKAGE by REPLACEMENT

[PATCH 1/2] build: Generalize 'package-with-explicit-python'.

2017-02-08 Thread Federico Beffa
Generalize the Python procedure to recursively replace compiler/interpreter.
From a8220b430d196e5bb079e23ac63b1acd16fdaaee Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Wed, 8 Feb 2017 18:55:32 +0100
Subject: [PATCH 1/2] build: Generalize 'package-with-explicit-python'.

* guix/build-system/python.scm (package-with-explicit-python): Remove it and
  replace it with the generalized procedure 'package-with-explicit-compiler'
  in the new file. (package-with-python2): Adapt it.
* guix/build-system/utils.scm: New file with the generalized procedure.
* Makefile.am (MODULES): Add new file.
---
 Makefile.am  |   1 +
 guix/build-system/python.scm |  71 +++--
 guix/build-system/utils.scm  | 105 +++
 3 files changed, 112 insertions(+), 65 deletions(-)
 create mode 100644 guix/build-system/utils.scm

diff --git a/Makefile.am b/Makefile.am
index 360c356f1..2d2544a7b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -76,6 +76,7 @@ MODULES =	\
   guix/build-system/r.scm			\
   guix/build-system/ruby.scm			\
   guix/build-system/trivial.scm			\
+  guix/build-system/utils.scm			\
   guix/ftp-client.scm\
   guix/http-client.scm\
   guix/gnupg.scm\
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index 17173f121..8b3eb4008 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès 
 ;;; Copyright © 2013 Andreas Enge 
 ;;; Copyright © 2013 Nikita Karetnikov 
+;;; Copyright © 2017 Federico Beffa 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@
   #:use-module (guix search-paths)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system utils)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -70,75 +72,14 @@ extension, such as '.tar.gz'."
   (let ((python (resolve-interface '(gnu packages python
 (module-ref python 'python-2)))
 
-(define* (package-with-explicit-python python old-prefix new-prefix
-   #:key variant-property)
-  "Return a procedure of one argument, P.  The procedure creates a package with
-the same fields as P, which is assumed to use PYTHON-BUILD-SYSTEM, such that
-it is compiled with PYTHON instead.  The inputs are changed recursively
-accordingly.  If the name of P starts with OLD-PREFIX, this is replaced by
-NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name.
-
-When VARIANT-PROPERTY is present, it is used as a key to search for
-pre-defined variants of this transformation recorded in the 'properties' field
-of packages.  The property value must be the promise of a package.  This is a
-convenient way for package writers to force the transformation to use
-pre-defined variants."
-  (define transform
-;; Memoize the transformations.  Failing to do that, we would build a huge
-;; object graph with lots of duplicates, which in turns prevents us from
-;; benefiting from memoization in 'package-derivation'.
-(mlambdaq (p)
-  (let* ((rewrite-if-package
-  (lambda (content)
-;; CONTENT may be a file name, in which case it is returned,
-;; or a package, which is rewritten with the new PYTHON and
-;; NEW-PREFIX.
-(if (package? content)
-(transform content)
-content)))
- (rewrite
-  (match-lambda
-((name content . rest)
- (append (list name (rewrite-if-package content)) rest)
-
-(cond
- ;; If VARIANT-PROPERTY is present, use that.
- ((and variant-property
-   (assoc-ref (package-properties p) variant-property))
-  => force)
-
- ;; Otherwise build the new package object graph.
- ((eq? (package-build-system p) python-build-system)
-  (package
-(inherit p)
-(location (package-location p))
-(name (let ((name (package-name p)))
-(string-append new-prefix
-   (if (string-prefix? old-prefix name)
-   (substring name
-  (string-length old-prefix))
-   name
-(arguments
- (let ((python (if (promise? python)
-   (force python)
-   python)))
-   (ensure-keyword-arguments (package-arguments p)
- `(#:python ,python
-(inputs (map rewrite (package-inputs p)))
-(propagated-inputs (map rewrite (package-propagated-inputs p)))
-(native-

Re: [PATCH 2/2] import: Add stackage importer and updater.

2017-02-08 Thread Federico Beffa
On Tue, Feb 7, 2017 at 8:36 AM, Federico Beffa  wrote:
> An importer/updater for Stackage built on top of the Hackage one.

I've cleaned it up a bit.
From 168ce15a10ed0b76bb339e31ae5b8998564d7d43 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 6 Feb 2017 18:19:26 +0100
Subject: [PATCH 2/2] import: Add stackage importer and updater.

* guix/import/stackage.scm: New file.
* guix/scripts/import/stackage.scm: New file.
* Makefile.am (MODULES): Add new files.
* guix/scripts/import.scm (importers): Add "stackage".
* guix/scripts/refresh.scm (%updaters): Add %stackage-updater.
* doc/guix.texi (Invoking 'guix import'): Document the importer.
  (Invoking 'guix refresh'): Add stackage to option --type valid values.
---
 Makefile.am  |   2 +
 doc/guix.texi|  33 -
 guix/import/stackage.scm | 153 +++
 guix/scripts/import.scm  |   3 +-
 guix/scripts/import/stackage.scm | 115 +
 guix/scripts/refresh.scm |   2 +
 6 files changed, 306 insertions(+), 2 deletions(-)
 create mode 100644 guix/import/stackage.scm
 create mode 100644 guix/scripts/import/stackage.scm

diff --git a/Makefile.am b/Makefile.am
index 360c356f1..18501bddf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -126,6 +126,7 @@ MODULES =	\
   guix/import/cabal.scm\
   guix/import/cran.scm\
   guix/import/hackage.scm			\
+  guix/import/stackage.scm			\
   guix/import/elpa.scm   			\
   guix/scripts.scm\
   guix/scripts/download.scm			\
@@ -147,6 +148,7 @@ MODULES =	\
   guix/scripts/import/gnu.scm			\
   guix/scripts/import/nix.scm			\
   guix/scripts/import/hackage.scm		\
+  guix/scripts/import/stackage.scm		\
   guix/scripts/import/elpa.scm  		\
   guix/scripts/environment.scm			\
   guix/scripts/publish.scm			\
diff --git a/doc/guix.texi b/doc/guix.texi
index 6acde6621..8caf1d68d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31,7 +31,8 @@ Copyright @copyright{} 2016 Jan Nieuwenhuizen@*
 Copyright @copyright{} 2016 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2017 Clément Lassieur@*
-Copyright @copyright{} 2017 Mathieu Othacehe
+Copyright @copyright{} 2017 Mathieu Othacehe@*
+Copyright @copyright{} 2017 Federico Beffa
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -5340,6 +5341,34 @@ package name by an at-sign and a version number as in the following example:
 guix import hackage mtl@@2.1.3.1
 @end example
 
+@item stackage
+@cindex stackage
+The @code{stackage} importer is a wrapper around the @code{hackage} one.
+It takes a package name, looks up the package version included in an LTS
+@uref{https://www.stackage.org/, Stackage} release and uses the
+@code{hackage} importer to retrieve its metadata.  Note that it is up to
+you to select an LTS release compatible with the GHC compiler used by
+Guix.
+
+Specific command-line options are:
+
+@table @code
+@item --no-test-dependencies
+@itemx -t
+Do not include dependencies required only by the test suites.
+@item --lts-version=@var{version}
+@itemx -r @var{version}
+@var{version} is the desired LTS release version.  If omitted the latest
+release is used.
+@end table
+
+The command below imports metadata for the @code{HTTP} Haskell package
+included in the LTS Stackage release version 7.18:
+
+@example
+guix import stackage --lts-version=7.18 HTTP
+@end example
+
 @item elpa
 @cindex elpa
 Import metadata from an Emacs Lisp Package Archive (ELPA) package
@@ -5504,6 +5533,8 @@ the updater for @uref{https://rubygems.org, RubyGems} packages.
 the updater for @uref{https://github.com, GitHub} packages.
 @item hackage
 the updater for @uref{https://hackage.haskell.org, Hackage} packages.
+@item stackage
+the updater for @uref{https://www.stackage.org, Stackage} packages.
 @item crate
 the updater for @uref{https://crates.io, Crates} packages.
 @end table
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
new file mode 100644
index 0..57b07f24e
--- /dev/null
+++ b/guix/import/stackage.scm
@@ -0,0 +1,153 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 Federico Beffa 
+;;;
+;;; 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

playing nice with other OSs

2017-02-07 Thread Federico Beffa
Hi,

I'm looking into the possibility of installing GuixSD in parallel with
another operating system on a single machine (dual boot).  Looking
into the code (gnu system grub) I see that the GRUB "linux" and
"initrd" commands are hardwired into the code.  This appears to make
the definition of a  for another operating system
(GNU/Hurd, NetBSD, Windows, ...) impossible.  Am I right, or am I
overlooking something?

If the above is correct and we want to make GuixSD play nicely with
others, then I suppose that we will have to modify the 
record.  I see two possibilities:

* We could try to generalize the fields along the lines of linux ->
kernel, initrd -> kernel-boot-helpers, ...

* Define operating system specific records such as ,
, , ..., where the content of
the fields for the systems not handled by GuixSD would come from the
user operating-system file configuration.

I personally prefer the second approach. What do you think?

Regards,
Fede



[PATCH 2/2] import: Add stackage importer and updater.

2017-02-06 Thread Federico Beffa
An importer/updater for Stackage built on top of the Hackage one.

Regards,
Fede
From 50891dc929a21327405c6a3b58638126456deeed Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 6 Feb 2017 18:19:26 +0100
Subject: [PATCH 2/2] import: Add stackage importer and updater.

* guix/import/stackage.scm: New file.
* guix/scripts/import/stackage.scm: New file.
* Makefile.am (MODULES): Add new files.
* guix/scripts/import.scm (importers): Add "stackage".
* guix/scripts/refresh.scm (%updaters): Add %stackage-updater.
* doc/guix.texi (Invoking 'guix import'): Document the importer.
  (Invoking 'guix refresh'): Add stackage to option --type valid values.
---
 Makefile.am  |   2 +
 doc/guix.texi|  33 +++-
 guix/import/stackage.scm | 178 +++
 guix/scripts/import.scm  |   3 +-
 guix/scripts/import/stackage.scm | 115 +
 guix/scripts/refresh.scm |   2 +
 6 files changed, 331 insertions(+), 2 deletions(-)
 create mode 100644 guix/import/stackage.scm
 create mode 100644 guix/scripts/import/stackage.scm

diff --git a/Makefile.am b/Makefile.am
index 360c356f1..18501bddf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -126,6 +126,7 @@ MODULES =	\
   guix/import/cabal.scm\
   guix/import/cran.scm\
   guix/import/hackage.scm			\
+  guix/import/stackage.scm			\
   guix/import/elpa.scm   			\
   guix/scripts.scm\
   guix/scripts/download.scm			\
@@ -147,6 +148,7 @@ MODULES =	\
   guix/scripts/import/gnu.scm			\
   guix/scripts/import/nix.scm			\
   guix/scripts/import/hackage.scm		\
+  guix/scripts/import/stackage.scm		\
   guix/scripts/import/elpa.scm  		\
   guix/scripts/environment.scm			\
   guix/scripts/publish.scm			\
diff --git a/doc/guix.texi b/doc/guix.texi
index 6acde6621..8caf1d68d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31,7 +31,8 @@ Copyright @copyright{} 2016 Jan Nieuwenhuizen@*
 Copyright @copyright{} 2016 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2017 Clément Lassieur@*
-Copyright @copyright{} 2017 Mathieu Othacehe
+Copyright @copyright{} 2017 Mathieu Othacehe@*
+Copyright @copyright{} 2017 Federico Beffa
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -5340,6 +5341,34 @@ package name by an at-sign and a version number as in the following example:
 guix import hackage mtl@@2.1.3.1
 @end example
 
+@item stackage
+@cindex stackage
+The @code{stackage} importer is a wrapper around the @code{hackage} one.
+It takes a package name, looks up the package version included in an LTS
+@uref{https://www.stackage.org/, Stackage} release and uses the
+@code{hackage} importer to retrieve its metadata.  Note that it is up to
+you to select an LTS release compatible with the GHC compiler used by
+Guix.
+
+Specific command-line options are:
+
+@table @code
+@item --no-test-dependencies
+@itemx -t
+Do not include dependencies required only by the test suites.
+@item --lts-version=@var{version}
+@itemx -r @var{version}
+@var{version} is the desired LTS release version.  If omitted the latest
+release is used.
+@end table
+
+The command below imports metadata for the @code{HTTP} Haskell package
+included in the LTS Stackage release version 7.18:
+
+@example
+guix import stackage --lts-version=7.18 HTTP
+@end example
+
 @item elpa
 @cindex elpa
 Import metadata from an Emacs Lisp Package Archive (ELPA) package
@@ -5504,6 +5533,8 @@ the updater for @uref{https://rubygems.org, RubyGems} packages.
 the updater for @uref{https://github.com, GitHub} packages.
 @item hackage
 the updater for @uref{https://hackage.haskell.org, Hackage} packages.
+@item stackage
+the updater for @uref{https://www.stackage.org, Stackage} packages.
 @item crate
 the updater for @uref{https://crates.io, Crates} packages.
 @end table
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
new file mode 100644
index 0..1e536debb
--- /dev/null
+++ b/guix/import/stackage.scm
@@ -0,0 +1,178 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 Federico Beffa 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix import st

[PATCH 1/2] import: json: Explicitly ask for JSON data.

2017-02-06 Thread Federico Beffa
Some sites, if not explicitly asked for JSON data, answer with HTML.
One of them is Stackage.

Regards,
Fede
From 2576e7390c9f8660fbb52e2a72eb782564b8865e Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 5 Feb 2017 14:42:10 +0100
Subject: [PATCH 1/2] import: json: Explicitly ask for JSON data.

* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
---
 guix/import/json.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/import/json.scm b/guix/import/json.scm
index 5940f5e48..c76bc9313 100644
--- a/guix/import/json.scm
+++ b/guix/import/json.scm
@@ -29,7 +29,8 @@
   (guard (c ((and (http-get-error? c)
   (= 404 (http-get-error-code c)))
  #f))   ;"expected" if package is unknown
-(let* ((port (http-fetch url))
+(let* ((port (http-fetch url #:headers '((user-agent . "GNU Guile")
+ (Accept . "application/json"
(result (hash-table->alist (json->scm port
   (close-port port)
   result)))
-- 
2.11.0



Re: updating many haskell packages

2017-02-06 Thread Federico Beffa
On Mon, Feb 6, 2017 at 4:23 PM, Troy Sankey  wrote:
> Hm, I should have been following a stackage LTS.  Maybe I wouldn't need
> to relax any dependency versions.  I also wonder if I could have avoided
> some discrepancies between hackage and released .cabal files regarding
> dependency versions (there are quite a few [0]).

As far as I know in the past NIX was aggressively removing upper
version constraints, but this seems to have led to problems and they
changed policy:
http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015608.html

Having a set of compatible packages is one of the key Stackage goals
https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package
If the project takes traction (as it seems) this problem should disappear.

I would consider a discrepancy between a cabal file on Hackage and the
actual cabal file included in a tar archive a bug.  It may be helpful
to report it to the author.

Regards,
Fede

[...]

> [0]
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L1375
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L1404
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L1537
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L1594
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L1944
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L1987
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L2018
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L5902
> https://github.com/pwnage101/guix/blob/00cc2021d9f3019c8dc69383ff2038eb54d1ba5a/gnu/packages/haskell.scm#L8793



Re: updating many haskell packages

2017-02-06 Thread Federico Beffa
On Mon, Feb 6, 2017 at 9:03 AM, Federico Beffa  wrote:

> (ii) The latest LTS still uses GHC 8.0.1.  I'm not sure if this is
> because of some real problem (GHC 8.0.2 introduces some
> incompatibilities) or if it is because changing things takes time.

Looks like LTS8 is on its way http://lwm.github.io/stackage-8.0.2/



Re: updating many haskell packages

2017-02-06 Thread Federico Beffa
Troy Sankey  writes:

> I have a WIP branch which contains many haskell package updates and
> additions, and makes haskell-build-system use the latest ghc (8.0.2).
>
> https://github.com/pwnage101/guix/tree/add-gitit
>
> It started as a small project to create a Gitit package (hence the name
> of the branch), but blew up into something larger.  It's hard work, so I
> just wanted to check in with you all to see if this seems like the right
> direction.
>
> As of this writing, I have over 66 packages updated, 16 added, and
> various fixes on existing packages to get everything buildable against
> ghc@8.0.2.  I'm debating whether I should systematically update all the
> haskell packages while I'm at it, or just make sure everything is
> buildable under 8.0.2.  There are over 277 haskell packages in all.
>
> I wonder how I should send these patches after I'm all done.  git
> send-email?  That seems crazy.

I agree, it's a lot of work and guaranteeing package compatibility is
not straightforward.  To simplify things I would like to suggest to
exploit the work done by Stackage (www.stackage.org) and follow the
latest LTS release.

I prepared a 'stackage' importer.  It looks up the list of packages at
https://www.stackage.org/lts (can select which LTS version), extract the
version used there and downloads that version of the package from
hackage (with the hackage importer).

Two points are open:

(i) I still need to finish the updater (to work with 'refresh').

(ii) The latest LTS still uses GHC 8.0.1.  I'm not sure if this is
because of some real problem (GHC 8.0.2 introduces some
incompatibilities) or if it is because changing things takes time.

I will probably be able to share the importer/updater in one week (don't
have much time to work on it during the week).

Regards,
Fede



Re: hackage importer broken

2017-02-05 Thread Federico Beffa
On Fri, Feb 3, 2017 at 2:53 PM, Federico Beffa  wrote:
> Hi,
>
> I notice that with a recent Guix checkout (commit
> d8e85b20325073d90cfaf3060889d59d91362deb) the hackage importer doesn't
> work and the problem seems to be with Guile itself or the lalr parser
> coming with it:
>
> ---
> GNU Guile 2.0.13
> Copyright (C) 1995-2016 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> ,m (guix import hackage)
> scheme@(guix import hackage)> (canonical-newline-port (http-fetch
> "https://hackage.haskell.org/package/hmatrix/hmatrix.cabal";
> #:verify-certificate? #f))
> $2 = #
> scheme@(guix import hackage)> (read-cabal $2)
> system/base/lalr.upstream.scm:1851:2: In procedure ___push:
> system/base/lalr.upstream.scm:1851:2: Wrong number of arguments to
> #
>
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(guix import hackage) [1]> ,locals
>   Local variables:
>   $3 = delta = 1
>   $4 = new-category = 6
>   $5 = lvalue = (# #)
> While executing meta-command:
> ERROR: In procedure frame-local-ref: Argument 2 out of range: 3
> scheme@(guix import hackage) [1]>
> ---
>
> Notice that inspecting the stack of the backtrace results in an error!
>
> The importer does work as expected with Guile 2.0.11:
>
> ---
> GNU Guile 2.0.11
> Copyright (C) 1995-2014 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> ,m (guix import hackage)
> scheme@(guix import hackage)> (canonical-newline-port (http-fetch
> "https://hackage.haskell.org/package/hmatrix/hmatrix.cabal";
> #:verify-certificate? #f))
> $1 = #
> scheme@(guix import hackage)> (read-cabal $1)
> $2 = (("name" ("hmatrix")) ("version" ("0.18.0.0")) ("license"
> ("BSD3")) ("license-file" ("LICENSE")) ("author" ("Alberto Ruiz"))
> ("maintainer" ("Alberto Ruiz")) ("stability" ("provisional"))
> ("homepage" ("https://github.com/albertoruiz/hmatrix";)) ("synopsis"
> ("Numeric Linear Algebra")) ("description" ("Linear systems, matrix
> decompositions, and other numerical computations based on BLAS and
> LAPACK. . Standard interface: \"Numeric.LinearAlgebra\". . Safer
> interface with statically checked dimensions:
> \"Numeric.LinearAlgebra.Static\". . Code examples:
> <http://dis.um.es/~alberto/hmatrix/hmatrix.html>")) ("category"
> ("Math")) ("tested-with" ("GHC==8.0")) ("cabal-version" (">=1.8"))
> ("build-type" ("Simple")) ("extra-source-files" ("THANKS.md
> CHANGELOG")) ("extra-source-files" ("src/Internal/C/lapack-aux.h"))
> (section flag "openblas" (("description" ("Link with OpenBLAS
> (https://github.com/xianyi/OpenBLAS) optimized libraries."))
> ("default" ("False")) ("manual" ("True" (section library
> (("build-depends" ("base >= 4.8 && < 5, binary, array, deepseq,
> random, split, bytestring, storable-complex, vector >= 0.8"))
> ("hs-source-dirs" ("src")) ("exposed-modules" ("Numeric.LinearAlgebra
> Numeric.LinearAlgebra.Devel Numeric.LinearAlgebra.Data
> Numeric.LinearAlgebra.HMatrix Numeric.LinearAlgebra.Static"))
> ("other-modules" ("Internal.Vector Internal.Devel Internal.Vectorized
> Internal.Matrix Internal.ST Internal.IO Internal.Element
> Internal.Conversion Internal.LAPACK Internal.Numeric
> Internal.Algorithms Internal.Random Internal.Container Internal.Sparse
> Internal.Convolution Internal.Chain Numeric.Vector Internal.CG
> Numeric.Matrix Internal.Util Internal.Modular Internal.Static"))
> ("c-sources" ("src/Intern

Re: guix can't find (gnutls)

2017-02-05 Thread Federico Beffa
On Sun, Feb 5, 2017 at 9:38 AM, Alex Vong  wrote:
> Federico Beffa  writes:
>
>> Hi,
>>
>> for some reason Guix can't find (gnutls) despite the module being
>> installed and usable in Guile:
>>
> Are you running guixsd or runnign guix on a foreign distro?

I'm on Debian testing.

> I personally run guix on debian and had the same problem. I solved the
> problem by building gnutls from source and installing it into
> /usr/local. The problem is debian's gnutls doesn't contain
> gnutls-guile.
>
> One might suggests to install guix's gnutls and build guix using it, but
> it doesnt't work for me, so I resort to building from source.

I had a similar experience: I installed gnutls manually in /usr/local
and successfully compiled Guix.

However, for various reasons, I then wanted to recompile Guix with
Guix (and remove the manually installed gnutls and Debian Guile) and
that's where I was struggling to make things work. I fixed things as
in my reply to Alex Kost.

Thanks for your reply.
Fede



Re: guix can't find (gnutls)

2017-02-05 Thread Federico Beffa
On Sat, Feb 4, 2017 at 8:02 PM, Alex Kost  wrote:
> Federico Beffa (2017-02-04 15:50 +0100) wrote:
>
>> Hi,
>>
>> for some reason Guix can't find (gnutls) despite the module being
>> installed and usable in Guile:
> [...]
>> Any suggestion?
>
> Check that guix-daemon is also started with GUILE_LOAD_[COMPILED_]PATH
> environment containing gnutls modules.


That's it!

I was test starting the daemon with "sudo guix-daemon
--build-users-group=guixbuild" from a shell with the GUILE_*
environment variables set correctly and things didn't work. Now I
defined those variables in the guix-daemon.system systemd unit and
things do work (I'm on Debian testing). I'm not sure of why the formed
didn't work, but the latter did it.

Thanks,
Fede



guix can't find (gnutls)

2017-02-04 Thread Federico Beffa
Hi,

for some reason Guix can't find (gnutls) despite the module being
installed and usable in Guile:

--
$ echo $GUILE_LOAD_PATH
/home/beffa/.guix-profile/share/guile/site/2.0:/usr/local/share/guile/site/2.0:/usr/share/guile/site:/usr/share/guile/site/2.0
$ echo $GUILE_LOAD_COMPILED_PATH
/home/beffa/.guix-profile/lib/guile/2.0/site-ccache:/home/beffa/.guix-profile/share/guile/site/2.0
$ ls /home/beffa/.guix-profile/share/guile/site/2.0
cairo  cairo.scm  gnutls  gnutls.scm  json  json.go  json.scm
minikanren  minikanren.go  minikanren.scm  ssh
$ guix environment --ad-hoc ghc
substitute: warning: failed to install locale: Invalid argument
The following derivations will be built:
   /gnu/store/rgzwdcw04i0x56ywmg3glicvrn8xk7sd-profile.drv
   /gnu/store/rrakjd0ym7q2qcx1kr3xsp7y9kxf4sdv-fonts-dir.drv
   /gnu/store/r48q6lmxwlsxjq30h2mrv1sp30ahx0fw-ghc-package-cache.drv
   /gnu/store/p2ijlnhbbc0sj8v5qcd2vj5fxgm3qaim-ca-certificate-bundle.drv
   /gnu/store/50l8wnbkmw98svirfsjcamxfsdsiyjly-info-dir.drv
The following file will be downloaded:
   /gnu/store/h2zf6y4f52wmh4qa8lckssxzffnxjvrv-ghc-8.0.2
warning: failed to install locale: Invalid argument
Downloading 
https://mirror.hydra.gnu.org/nar/h2zf6y4f52wmh4qa8lckssxzffnxjvrv-ghc-8.0.2
(1011.3MiB installed)...
;;; Failed to autoload make-session in (gnutls):
;;; ERROR: missing interface for module (gnutls)
Backtrace:
In ice-9/boot-9.scm:
 160: 9 [catch #t # ...]
In unknown file:
   ?: 8 [apply-smob/1 #]
In ice-9/boot-9.scm:
  66: 7 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 6 [eval # #]
In ice-9/boot-9.scm:
2404: 5 [save-module-excursion #]
4056: 4 [#]
1727: 3 [%start-stack load-stack ...]
1732: 2 [#]
In unknown file:
   ?: 1 [primitive-load "/usr/local/bin/guix"]
In guix/ui.scm:
1228: 0 [run-guix-command substitute "--substitute" ...]

guix/ui.scm:1228:8: In procedure run-guix-command:
guix/ui.scm:1228:8: In procedure module-lookup: Unbound variable: make-session
guix environment: error: build failed: some substitutes for the
outputs of derivation
`/gnu/store/y8ih837wbsxlhsscj8yg37pa6ycarrp8-ghc-8.0.2.drv' failed
(usually happens due to networking issues); try `--fallback' to build
derivation from source
--

I can load the module in Guile without problems:
--
$ guile
GNU Guile 2.0.13
Copyright (C) 1995-2016 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,use (gnutls)
scheme@(guile-user)> make-session
$1 = #
scheme@(guile-user)>

--

Any suggestion?

Thanks,
Fede



hackage importer broken

2017-02-03 Thread Federico Beffa
Hi,

I notice that with a recent Guix checkout (commit
d8e85b20325073d90cfaf3060889d59d91362deb) the hackage importer doesn't
work and the problem seems to be with Guile itself or the lalr parser
coming with it:

---
GNU Guile 2.0.13
Copyright (C) 1995-2016 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m (guix import hackage)
scheme@(guix import hackage)> (canonical-newline-port (http-fetch
"https://hackage.haskell.org/package/hmatrix/hmatrix.cabal";
#:verify-certificate? #f))
$2 = #
scheme@(guix import hackage)> (read-cabal $2)
system/base/lalr.upstream.scm:1851:2: In procedure ___push:
system/base/lalr.upstream.scm:1851:2: Wrong number of arguments to
#

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix import hackage) [1]> ,locals
  Local variables:
  $3 = delta = 1
  $4 = new-category = 6
  $5 = lvalue = (#)
While executing meta-command:
ERROR: In procedure frame-local-ref: Argument 2 out of range: 3
scheme@(guix import hackage) [1]>
---

Notice that inspecting the stack of the backtrace results in an error!

The importer does work as expected with Guile 2.0.11:

---
GNU Guile 2.0.11
Copyright (C) 1995-2014 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m (guix import hackage)
scheme@(guix import hackage)> (canonical-newline-port (http-fetch
"https://hackage.haskell.org/package/hmatrix/hmatrix.cabal";
#:verify-certificate? #f))
$1 = #
scheme@(guix import hackage)> (read-cabal $1)
$2 = (("name" ("hmatrix")) ("version" ("0.18.0.0")) ("license"
("BSD3")) ("license-file" ("LICENSE")) ("author" ("Alberto Ruiz"))
("maintainer" ("Alberto Ruiz")) ("stability" ("provisional"))
("homepage" ("https://github.com/albertoruiz/hmatrix";)) ("synopsis"
("Numeric Linear Algebra")) ("description" ("Linear systems, matrix
decompositions, and other numerical computations based on BLAS and
LAPACK. . Standard interface: \"Numeric.LinearAlgebra\". . Safer
interface with statically checked dimensions:
\"Numeric.LinearAlgebra.Static\". . Code examples:
")) ("category"
("Math")) ("tested-with" ("GHC==8.0")) ("cabal-version" (">=1.8"))
("build-type" ("Simple")) ("extra-source-files" ("THANKS.md
CHANGELOG")) ("extra-source-files" ("src/Internal/C/lapack-aux.h"))
(section flag "openblas" (("description" ("Link with OpenBLAS
(https://github.com/xianyi/OpenBLAS) optimized libraries."))
("default" ("False")) ("manual" ("True" (section library
(("build-depends" ("base >= 4.8 && < 5, binary, array, deepseq,
random, split, bytestring, storable-complex, vector >= 0.8"))
("hs-source-dirs" ("src")) ("exposed-modules" ("Numeric.LinearAlgebra
Numeric.LinearAlgebra.Devel Numeric.LinearAlgebra.Data
Numeric.LinearAlgebra.HMatrix Numeric.LinearAlgebra.Static"))
("other-modules" ("Internal.Vector Internal.Devel Internal.Vectorized
Internal.Matrix Internal.ST Internal.IO Internal.Element
Internal.Conversion Internal.LAPACK Internal.Numeric
Internal.Algorithms Internal.Random Internal.Container Internal.Sparse
Internal.Convolution Internal.Chain Numeric.Vector Internal.CG
Numeric.Matrix Internal.Util Internal.Modular Internal.Static"))
("c-sources" ("src/Internal/C/lapack-aux.c
src/Internal/C/vector-aux.c")) ("extensions"
("ForeignFunctionInterface")) ("ghc-options" ("-Wall
-fno-warn-missing-signatures -fno-warn-orphans -fprof-auto"))
("cc-options" ("-O4 -Wall")) (if (arch "x86_64") (("cc-options"
("-msse2"))) ()) (if (arch "i386") (("cc-options" ("-msse2"))) ()) (if
(os "OSX") ((if (flag "openblas") (("extra-lib-dirs"
("/opt/local/lib/openblas/lib")) ("extra-libraries" ("openblas")))
(("extra-libraries" ("blas lapack" ("extra-lib-dirs"
("/opt/local/lib/")) ("include-dirs" ("/opt/local/include/"))
("extra-lib-dirs" ("/usr/local/lib/")) ("include-dirs"
("/usr/local/include/")) (if (arch "i386") (("cc-options" ("-arch
i386"))) ()) ("frameworks" ("Accelerate"))) ()) (if (os "freebsd")
((if (flag "openblas") (("extra-lib-dirs"
("/usr/local/lib/openblas/lib")) ("extra-libraries" ("openblas")))
(("extra-libraries" ("blas lapack") ()) ("extra-lib-dirs"
("/usr/local/lib")) ("include-dirs" ("/usr/local/include"))
("extra-libraries" ("gfortran")) (if (os "windows") ((if (flag
"openblas") (("extra-libraries" ("libopenblas, libgcc_

Re: gnu: ghc-8: Update to 8.0.2

2017-01-30 Thread Federico Beffa
On Sat, Jan 28, 2017 at 12:35 AM, Ludovic Courtès  wrote:
> Hi Federico,
>
> Federico Beffa  skribis:
>
>> I've updated our ghc-8 Haskell compiler to the latest version (8.0.2)
>> and in doing so I've investigated why both 8.0.1 and 8.0.2 do not work
>> without setting LD_LIBRARY_PATH to the required system libraries.
>> I've found that NIX had the same problem.  The root cause for them was
>> that their gcc-wrapper was not able to properly handle arguments
>> passed through response files.  I suspect that we have the same
>> problem.
>
> We do.  (This and more was discussed at
> <https://gcc.gnu.org/ml/gcc/2016-10/threads.html#00122>.)
>
> But really, “response files” are relics.  OTOH, it may not be hard to
> change ‘ld-wrapper’ to read them (and there’s a good opportunity now
> that we’re working on ‘core-updates’, if you want to give it a try.
> :-)).

Thanks for the pointer.  At the moment I do not have time to work on it.

>
>> For the moment I've borrowed a patch for GHC that they did use before
>> fixing the gcc-wrapper. Going forward it would probably be wise to fix
>> our gcc/ld wrapper as well.
>
> Sounds good.
>
>> From 35c4fa12cf2eb7316583b41c0c4e8b60f7a59bdc Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Wed, 25 Jan 2017 18:21:43 +0100
>> Subject: [PATCH] gnu: ghc-8: Update to 8.0.2.
>>
>> * gnu/packages/haskell.scm (ghc-8): Update to 8.0.2.
>
> Please mention the changes to ‘arguments’ (deleted phase, etc.)
>
>> * gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch:
>>   New file.
>> * gnu/local.mk (dist_patch_DATA): Add it.
>
>
>> +++ 
>> b/gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch
>> @@ -0,0 +1,24 @@
>> +See 
>> https://github.com/NixOS/nixpkgs/commit/a421e7bd4a28c69bded8b17888325e31554f61a1
>
> Maybe add “Don’t add linker flags via ‘response files’ since ld-wrapper
> doesn’t handle them.”
>
> Also: https://gcc.gnu.org/ml/gcc/2016-10/msg00151.html
>
> OK with these changes.

Done and pushed as commit d8e85b20325073d90cfaf3060889d59d91362deb.

Regards,
Fede



Re: python-mistune

2017-01-26 Thread Federico Beffa
On Thu, Jan 26, 2017 at 11:23 AM, Ludovic Courtès  wrote:
> Hi Federico,
>
> Federico Beffa  skribis:
[...]
>> error: failed to run download program
>> '/usr/local/libexec/guix/download': No such file or directory
>
> This error is the root of the problem.
>
> Starting from 0.12 (and a bit earlier than that), the daemon relies on
> this ‘download’ helper, aka. ‘guix perform-download’, to realize
> fixed-output derivations.
>
> It looks like you have an up-to-date daemon but somehow it lacks its
> helper, or its helper has been removed or something like that.

Indeed I'm using the deamon from a fresh master checkout, but I didn't
run "make install" for several months. After running the latter
command it's working fine.

Thanks!
Fede



Re: python-mistune

2017-01-26 Thread Federico Beffa
Hi,

On Thu, Jan 26, 2017 at 8:32 AM, Tobias Geerinckx-Rice  wrote:
> Frederico,
>
> Might you've confused Thomas & me? I'm the one who updated the package
> in question. It should be fixed in master now[0].

yes, sorry about that! I have a problem with the graphics driver which
only refreshes part of windows... need to fix that very soon!

There seems to still be something wrong, but probably not related to
mistune now:

$ ./pre-inst-env guix package --upgrade .
guix package: package 'geiser-next' has been superseded by 'geiser'
The following package will be removed:
   geiser-next0.9-1.16035b9
/gnu/store/yf1m1gkikjgk4byl0apnilq863rvjdva-geiser-next-0.9-1.16035b9

error: failed to run download program
'/usr/local/libexec/guix/download': No such file or directory
builder for 
`/gnu/store/a6ckp54sarrzpwqwkl2f5s49rq5ib7wh-mistune-0.7.3.tar.gz.drv'
failed with exit code 1
cannot build derivation
`/gnu/store/19hppfz1mcxw21sllsypxivh68zf65h0-python-mistune-0.7.3.drv':
1 dependencies couldn't be built
cannot build derivation
`/gnu/store/isk5vp3gjsrma6jy1lsw40mya19j2yd9-python-ipython-4.0.3.drv':
1 dependencies couldn't be built
guix package: error: build failed: build of
`/gnu/store/isk5vp3gjsrma6jy1lsw40mya19j2yd9-python-ipython-4.0.3.drv'
failed


Anyone seeing a similar error?

Regards,
Fede



python-mistune

2017-01-25 Thread Federico Beffa
Hi Thomas,

It seems that version 0.7.3 is not present from the source that you indicated:

Starting download of
/gnu/store/iwgpsb0p487iydbs7nkblhvcl3a5wf3d-mistune-0.7.3.tar.gz
>From https://pypi.python.org/packages/source/m/mistune/mistune-0.7.3.tar.gz...
ERROR: download failed
"https://pypi.python.org/packages/source/m/mistune/mistune-0.7.3.tar.gz";
404 "Not Found"

Would you mind fixing it?

Thanks,
Fede



gnu: ghc-8: Update to 8.0.2

2017-01-25 Thread Federico Beffa
beHi,

I've updated our ghc-8 Haskell compiler to the latest version (8.0.2)
and in doing so I've investigated why both 8.0.1 and 8.0.2 do not work
without setting LD_LIBRARY_PATH to the required system libraries.
I've found that NIX had the same problem.  The root cause for them was
that their gcc-wrapper was not able to properly handle arguments
passed through response files.  I suspect that we have the same
problem.

https://github.com/NixOS/nixpkgs/issues/10752
https://github.com/NixOS/nixpkgs/issues/11762

For the moment I've borrowed a patch for GHC that they did use before
fixing the gcc-wrapper. Going forward it would probably be wise to fix
our gcc/ld wrapper as well.

Regards,
Fede
From 35c4fa12cf2eb7316583b41c0c4e8b60f7a59bdc Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Wed, 25 Jan 2017 18:21:43 +0100
Subject: [PATCH] gnu: ghc-8: Update to 8.0.2.

* gnu/packages/haskell.scm (ghc-8): Update to 8.0.2.
* gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch:
  New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk   |  1 +
 gnu/packages/haskell.scm   | 31 ++
 ...dont-pass-linker-flags-via-response-files.patch | 24 +
 3 files changed, 33 insertions(+), 23 deletions(-)
 create mode 100644 gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 24013a5..93b0c3d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -549,6 +549,7 @@ dist_patch_DATA =		\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gegl-CVE-2012-4433.patch			\
   %D%/packages/patches/geoclue-config.patch			\
+  %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch	\
   %D%/packages/patches/ghostscript-CVE-2013-5653.patch		\
   %D%/packages/patches/ghostscript-CVE-2015-3228.patch		\
   %D%/packages/patches/ghostscript-CVE-2016-7976.patch		\
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 331057a..bdcda7f 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -31,6 +31,7 @@
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
+  #:use-module (gnu packages)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages compression)
@@ -264,14 +265,17 @@ interactive environment for the functional language Haskell.")
 (define-public ghc-8
   (package
 (name "ghc")
-(version "8.0.1")
+(version "8.0.2")
 (source
  (origin
   (method url-fetch)
   (uri (string-append "https://www.haskell.org/ghc/dist/";
   version "/" name "-" version "-src.tar.xz"))
   (sha256
-   (base32 "1lniqy29djhjkddnailpaqhlqh4ld2mqvb1fxgxw1qqjhz6j1ywh"
+   (base32 "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi"))
+  (patches
+   (search-patches
+"ghc-dont-pass-linker-flags-via-response-files.patch"
 (build-system gnu-build-system)
 (supported-systems '("i686-linux" "x86_64-linux"))
 (outputs '("out" "doc"))
@@ -287,7 +291,7 @@ interactive environment for the functional language Haskell.")
  "https://www.haskell.org/ghc/dist/";
  version "/" name "-" version "-testsuite.tar.xz"))
(sha256
-(base32 "0lc1vjivkxn01aw3jg2gd7fmqb5pj7a5j987c7pn5r7caqv1cmxw"))
+(base32 "1wjc3x68l305bl1h1ijd3yhqp2vqj83lkp3kqbr94qmmkqlms8sj"))
 (native-inputs
  `(("perl" ,perl)
("python" ,python-2); for tests
@@ -309,13 +313,6 @@ interactive environment for the functional language Haskell.")
;; then complains that they don't match.
#:build #f
 
-   #:modules ((guix build gnu-build-system)
-  (guix build utils)
-  (guix build rpath)
-  (srfi srfi-26)
-  (srfi srfi-1))
-   #:imported-modules (,@%gnu-build-system-modules
-   (guix build rpath))
#:configure-flags
(list
 (string-append "--with-gmp-libraries="
@@ -363,19 +360,7 @@ interactive environment for the functional language Haskell.")
"testsuite/tests/programs/life_space_leak/life.test")
(("/bin/sh") (which "sh"))
(("/bin/rm") "rm"))
- #t))
- ;; the testsuite can't find shared libraries.
- (add-before 'check 'configure-testsuite
-   (lambda* (#:key inputs #:allow-other-k

Re: [PATCH 2/5] gnu: Add ghc-data-accessor.

2016-10-31 Thread Federico Beffa
On Fri, Oct 28, 2016 at 3:42 PM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
>> +   (uri (string-append
>> + 
>> "https://hackage.haskell.org/package/data-accessor/data-accessor-";
>
> Maybe we should consider adding a mirror://hackage in (guix download).

Done in 442c2c99a5d15c46551d2da6b2d23a4e39d9c4f4.



Re: [PATCH 5/5] gnu: Add ghc-gnuplot.

2016-10-28 Thread Federico Beffa
On Fri, Oct 28, 2016 at 3:45 PM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
>
> [...]
>
>> +(propagated-inputs `(("gnuplot" ,gnuplot)))
>
> Instead of propagating it, could we instead replace “gnuplot” with
> “/gnu/store/…/bin/gnuplot” in the relevant source file?

Good idea and easy to implement. I'll do it.

Thanks,
Fede



Re: [PATCH 2/2] gnu: Add emacs-org-trello.

2016-10-28 Thread Federico Beffa
On Fri, Oct 28, 2016 at 11:30 AM, Alex Kost  wrote:
> Ricardo Wurmus (2016-10-27 20:48 +0200) wrote:
>
>> Alex Kost  writes:
>>
 @Alex: could you please confirm this?  Should these inputs be mentioned
 at all?  If so, is it sufficient to add them to native-inputs?
>>>
>>> As for me, I don't see a reason to add these additional inputs,
>>> emacs-build-system will not run tests anyway.
>>
>> Thank you for clarifying.
>>
>> Is there a reason why we don’t run the tests?  We do this by default for
>> all other packages.
>
> How can it be done?  There is no common way for emacs packages to
> perform tests: only some packages have Makefile (with "check" phase),
> and it would be a really good luck if "make check" as is succeeded for
> them.  Usually such projects use Cask to run tests or even some custom
> scripts.  They may use just "ert" or "ert-running" package (or maybe
> something else).
>
> After all, I think that adding a 'check' phase to emacs-build-system is
> not worth an effort: there would be too much manual interventions in
> package recipes to make tests work for different emacs packages.

You said it all!

Fede



Re: [PATCH 3/5] gnu: Add ghc-data-access-transformers.

2016-10-28 Thread Federico Beffa
On Fri, Oct 28, 2016 at 3:44 PM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
>> +(synopsis "Use Accessor to access state in transformers State monad")
>
> I can’t parse “transformers State monad”, but maybe it’s just me, or is
> it missing a word, like “transformers of the State monad”, “State monad
> transformers”?

The way I understand it is: "transformers State monad" stands for the
transformer monad called StateT, itself a monad.  But I'll let you or
a native English speaker decide about the grammatical correctness of
the synopsis provided by the author :-)

Thanks,
Fede



[PATCH 5/5] gnu: Add ghc-gnuplot.

2016-10-25 Thread Federico Beffa

From f06b0a9eea5ddf055cfcf7f80fe8ac6eb62972b3 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 24 Oct 2016 17:49:35 +0200
Subject: [PATCH 5/5] gnu: Add ghc-gnuplot.

* gnu/packages/haskell.scm (ghc-gnuplot): New variable.
---
 gnu/packages/haskell.scm | 25 +
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 3f7c853..f4995ac 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7960,4 +7960,29 @@ Accessor to access state in transformers State monad.")
 helper functions for Lists, Maybes, Tuples, Functions.")
 (license license:bsd-3)))
 
+(define-public ghc-gnuplot
+  (package
+(name "ghc-gnuplot")
+(version "0.5.4.1")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://hackage.haskell.org/package/gnuplot/gnuplot-";
+ version ".tar.gz"))
+   (sha256
+(base32 "1xz8prw9xjk0rsyrkp9bsmxykzrbhpv9qhhkdapy75mdbmgwjm7s"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-temporary" ,ghc-temporary)
+   ("ghc-utility-ht" ,ghc-utility-ht)
+   ("ghc-data-accessor-transformers" ,ghc-data-accessor-transformers)
+   ("ghc-data-accessor" ,ghc-data-accessor)))
+(propagated-inputs `(("gnuplot" ,gnuplot)))
+(home-page "http://www.haskell.org/haskellwiki/Gnuplot";)
+(synopsis "2D and 3D plots using gnuplot")
+(description "This package provides a Haskell module for creating 2D and
+3D plots using gnuplot.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.10.1



[PATCH 2/5] gnu: Add ghc-data-accessor.

2016-10-25 Thread Federico Beffa

From 6885ee012c18ae14c31e23ab07b0f5421b630c4a Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 24 Oct 2016 17:30:50 +0200
Subject: [PATCH 2/5] gnu: Add ghc-data-accessor.

* gnu/packages/haskell.scm (ghc-data-accessor): New variable.
---
 gnu/packages/haskell.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index a933162..41ae191 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7902,4 +7902,24 @@ monad, as well as a typeclass abstracting their common operations, and
 a set of wrappers to use the hash tables in the IO monad.")
 (license license:bsd-3)))
 
+(define-public ghc-data-accessor
+  (package
+(name "ghc-data-accessor")
+(version "0.2.2.7")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://hackage.haskell.org/package/data-accessor/data-accessor-";
+ version ".tar.gz"))
+   (sha256
+(base32 "1vf2g1gac3rm32g97rl0fll51m88q7ry4m6khnl5j47qsmx24r9l"
+(build-system haskell-build-system)
+(home-page "http://www.haskell.org/haskellwiki/Record_access";)
+(synopsis
+ "Haskell utilities for accessing and manipulating fields of records")
+(description "This package provides Haskell modules for accessing and
+manipulating fields of records.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.10.1



[PATCH 4/5] gnu: Add ghc-utility-ht.

2016-10-25 Thread Federico Beffa

From c18d8ed86ee3793e7591ae7e040351da2ae94bcc Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 24 Oct 2016 17:43:17 +0200
Subject: [PATCH 4/5] gnu: Add ghc-utility-ht.

* gnu/packages/haskell.scm (ghc-utility-ht): New variable.
---
 gnu/packages/haskell.scm | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index c8c6f10..3f7c853 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7942,4 +7942,22 @@ manipulating fields of records.")
 Accessor to access state in transformers State monad.")
 (license license:bsd-3)))
 
+(define-public ghc-utility-ht
+  (package
+(name "ghc-utility-ht")
+(version "0.0.12")
+(home-page "https://hackage.haskell.org/package/utility-ht";)
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append home-page "/utility-ht-" version ".tar.gz"))
+   (sha256
+(base32 "1vq5bd51rl9l5lgfmaqxgiggddk38hzgngcj7qgrqnalcd1myi54"
+(build-system haskell-build-system)
+(inputs `(("ghc-quickcheck" ,ghc-quickcheck)))
+(synopsis "Haskell helper functions for Lists, Maybes, Tuples, Functions")
+(description "This package includes Hakell modules providing various
+helper functions for Lists, Maybes, Tuples, Functions.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.10.1



[PATCH 3/5] gnu: Add ghc-data-access-transformers.

2016-10-25 Thread Federico Beffa

From 675fbdda80b453dc6e1b8aa4635d4adefd7c18df Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 24 Oct 2016 17:35:27 +0200
Subject: [PATCH 3/5] gnu: Add ghc-data-access-transformers.

* gnu/packages/haskell.scm (ghc-data-access-transformers): New variable.
---
 gnu/packages/haskell.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 41ae191..c8c6f10 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7922,4 +7922,24 @@ a set of wrappers to use the hash tables in the IO monad.")
 manipulating fields of records.")
 (license license:bsd-3)))
 
+(define-public ghc-data-accessor-transformers
+  (package
+(name "ghc-data-accessor-transformers")
+(version "0.2.1.7")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://hackage.haskell.org/package/data-accessor-transformers/data-accessor-transformers-";
+ version ".tar.gz"))
+   (sha256
+(base32 "0yp030vafbpddl27m606aibbbr5ar5j5bsv4bksscz3cq4yq5j10"
+(build-system haskell-build-system)
+(inputs `(("ghc-data-accessor" ,ghc-data-accessor)))
+(home-page "http://www.haskell.org/haskellwiki/Record_access";)
+(synopsis "Use Accessor to access state in transformers State monad")
+(description "This package provides Haskell modules to allow use of
+Accessor to access state in transformers State monad.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.10.1



[PATCH 1/5] gnu: geiser-next: Re-introduce it.

2016-10-25 Thread Federico Beffa
Unfortunately it was forgot to include support files for Chibi and
Chez in the 0.9 Geiser release tar archive.  For this reason I'm
proposing to reintroduce 'chez-next'.

Regards,
Fede
From 4cb3a1774754ffec91e00b681ffb4acff3e77b4e Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 24 Oct 2016 09:56:35 +0200
Subject: [PATCH 1/5] gnu: geiser-next: Re-introduce it.

* gnu/packages/emacs.scm (geiser-next): Re-introduce it.
---
 gnu/packages/emacs.scm | 32 ++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 66a90a8..dd80709 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -298,8 +298,36 @@ metadata.")
 (license license:bsd-3)))
 
 (define-public geiser-next
-  ;; This has become "geiser".
-  (deprecated-package "geiser-next" geiser))
+  ;; Geiser's upcoming version supports Chibi and Chez, while it was forgot to
+  ;; include some required files in 0.9.  When the next Geiser release comes
+  ;; out, we can remove this.
+  (let ((commit "16035b9fa475496f7f89a57fa81455057af749a0")
+(revision "1"))
+(package
+  (inherit geiser)
+  (name "geiser-next")
+  (version (string-append "0.9-" revision "." (string-take commit 7)))
+  (source (origin
+(method git-fetch)
+(file-name (string-append name "-" version ".tar.gz"))
+(uri (git-reference
+  (url "git://git.sv.gnu.org/geiser.git")
+  (commit commit)))
+(sha256
+ (base32
+  "1rrafizrhjkai0msryjiz4c5dcdyihf0i2wmgiy8br74rwbxpyl5"
+  (native-inputs
+   `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("texinfo" ,texinfo)
+ ,@(package-native-inputs geiser)))
+  (arguments
+   (substitute-keyword-arguments (package-arguments geiser)
+ ((#:phases phases)
+  `(modify-phases ,phases
+ (add-after 'unpack 'autogen
+   (lambda _
+ (zero? (system* "sh" "autogen.sh")))
 
 (define-public paredit
   (package
-- 
2.10.1



[PATCH] gnu: Add chez-scmutils.

2016-10-22 Thread Federico Beffa

From 17cbca3cee22885f2f5ac9fb569778572c844748 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sat, 22 Oct 2016 10:58:32 +0200
Subject: [PATCH] gnu: Add chez-scmutils.

* gnu/packages/chez.scm (chez-scmutils): New variable.
---
 gnu/packages/chez.scm | 66 +++
 1 file changed, 66 insertions(+)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 91593d3..ce60e46 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -499,3 +499,69 @@ libraries for Chez Scheme.  The main goal was to provide the
 functionality required to port the program 'Scmutils' to Chez
 Scheme.")
 (license gpl3+)))
+
+(define-public chez-scmutils
+  (package
+(name "chez-scmutils")
+(version "0.1")
+(home-page "https://github.com/fedeinthemix/chez-scmutils";)
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append home-page "/archive/v" version ".tar.gz"))
+   (sha256
+(base32 "1a5j61pggaiwl1gl6m038rcy5n8r2sj5nyjmz86jydx97mm5i8hj"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system gnu-build-system)
+(inputs
+ `(("chez-srfi" ,chez-srfi)))  ; for tests
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)))
+(propagated-inputs
+ `(("chez-mit" ,chez-mit)
+   ("chez-srfi" ,chez-srfi)))
+(arguments
+ `(#:make-flags ,(chez-make-flags name version)
+   #:tests? #f ; no test suite
+   #:phases
+   (modify-phases %standard-phases
+ (replace 'configure ,chez-configure)
+ ;; Since the documentation is lacking, we install the source
+ ;; code.  For things to work correctly we have to replace
+ ;; relative paths by absolute ones in 'include' forms.  This
+ ;; in turn requires us to compile the files in the final
+ ;; destination.
+ (delete 'build)
+ (add-after 'install 'install-src
+   (lambda* (#:key (make-flags '()) #:allow-other-keys)
+ (zero? (apply system* "make" "install-src" make-flags
+ (add-after 'install-src 'absolute-path-in-scm-files
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+   (for-each (lambda (file)
+   (substitute* file
+ (("include +\"\\./scmutils")
+  (string-append "include \"" (dirname file)
+ (find-files out "\\.sls"))
+   (for-each (lambda (file)
+   (substitute* file
+ (("include +\"\\./scmutils/simplify")
+  (string-append "include \"" (dirname file)
+ (find-files out "fbe-syntax\\.scm"))
+   #t)))
+ (add-after 'absolute-path-in-scm-files 'build
+   (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(mk-file (car (find-files out "Makefile"
+   (with-directory-excursion (dirname mk-file)
+ (zero? (apply system* "make" "build" make-flags))
+ (add-after 'build 'clean-up
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+   (for-each delete-file
+ (find-files out "Makefile|compile-all\\.ss"
+(synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme")
+(description "This package provides a port of the MIT/GNU Scheme
+Scmutils program to Chez Scheme.  The port consists of a set of
+libraries providing most of the functionality of the original.")
+(license gpl3+)))
-- 
2.7.4



[PATCH 1/2] gnu: Add chez-mit.

2016-10-22 Thread Federico Beffa

From a675f70c900353a56b92963b7587e9b670dadf3c Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sat, 22 Oct 2016 10:55:36 +0200
Subject: [PATCH 1/2] gnu: Add chez-mit.

* gnu/packages/chez.scm (chez-mit): New variable.
---
 gnu/packages/chez.scm | 31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 0a74c3f..91593d3 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -19,7 +19,7 @@
 (define-module (gnu packages chez)
   #:use-module (gnu packages)
   #:use-module ((guix licenses)
-#:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat
+#:select (gpl2+ gpl3+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat
   public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -470,3 +470,32 @@ concatenating, composing and extending these formatters efficiently
 without resorting to capturing and manipulating intermediate
 strings.")
 (license bsd-3)))
+
+(define-public chez-mit
+  (package
+(name "chez-mit")
+(version "0.1")
+(home-page "https://github.com/fedeinthemix/chez-mit";)
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append home-page "/archive/v" version ".tar.gz"))
+   (sha256
+(base32 "1p11q061znwxzxrxg3vw4dbsnpv1dav12hjhnkrjnzyyjvvdm2kn"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system gnu-build-system)
+(inputs
+ `(("chez-srfi" ,chez-srfi))) ; for tests
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)))
+(arguments
+ `(#:make-flags ,(chez-make-flags name version)
+   #:test-target "test"
+   #:phases (modify-phases %standard-phases
+  (replace 'configure ,chez-configure
+(synopsis "MIT/GNU Scheme compatibility library for Chez Scheme")
+(description "This package a set of MIT/GNU Scheme compatibility
+libraries for Chez Scheme.  The main goal was to provide the
+functionality required to port the program 'Scmutils' to Chez
+Scheme.")
+(license gpl3+)))
-- 
2.7.4



[PATCH 3/3] gnu: haskell-mode: Update to 16.1.

2016-10-20 Thread Federico Beffa

From 46bd8735643b50c9c13ebce595943ad20aa1c7f1 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Thu, 20 Oct 2016 20:23:11 +0200
Subject: [PATCH 3/3] gnu: haskell-mode: Update to 16.1.

* gnu/packages/emacs.scm (haskell-mode): Update to 16.1.
  [inputs]: Add 'emacs-el-search' and 'emacs-stream'.
  [propagated-inputs]: Add 'emacs-dash'.
  [arguments]: Add modules. Adapt 'pre-build' and 'install' phases.
---
 gnu/packages/emacs.scm | 35 +++
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 3efced2..ebca936 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -575,7 +575,7 @@ process, passing on the arguments as command line arguments.")
 (define-public haskell-mode
   (package
 (name "haskell-mode")
-(version "13.14.2")
+(version "16.1")
 (source (origin
   (method url-fetch)
   (file-name (string-append name "-" version ".tar.gz"))
@@ -583,7 +583,12 @@ process, passing on the arguments as command line arguments.")
 "https://github.com/haskell/haskell-mode/archive/v";
 version ".tar.gz"))
   (sha256
-   (base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av"
+   (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"
+(inputs
+ `(("emacs-el-search" ,emacs-el-search)
+   ("emacs-stream" ,emacs-stream)))
+(propagated-inputs
+ `(("emacs-dash" ,emacs-dash)))
 (native-inputs
  `(("emacs" ,emacs-minimal)
("texinfo" ,texinfo)))
@@ -592,15 +597,37 @@ process, passing on the arguments as command line arguments.")
  `(#:make-flags (list (string-append "EMACS="
  (assoc-ref %build-inputs "emacs")
  "/bin/emacs"))
+   #:modules ((ice-9 match)
+  ,@%gnu-build-system-modules)
#:phases
(modify-phases %standard-phases
  (delete 'configure)
  (add-before
   'build 'pre-build
   (lambda* (#:key inputs #:allow-other-keys)
+(define (el-dir store-dir)
+  (match (find-files store-dir)
+((f1 f2 ...) (dirname f1))
+(_ "")))
+
 (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
   (setenv "SHELL" "sh")
+  (setenv "EMACSLOADPATH"
+  (apply string-append
+ (map (match-lambda
+(((? (lambda (n)
+   (string-prefix? "emacs-" n)) name)
+   . dir)
+ (string-append (el-dir dir) ":"))
+(_ ""))
+  inputs)))
   (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
+  (substitute* "tests/haskell-code-conventions.el"
+;; Function name recently changed in "emacs-el-search".
+(("el-search--search-pattern") "el-search-forward")
+;; Don't contact home.
+(("\\(when \\(>= emacs-major-version 25\\)")
+ "(require 'el-search) (when nil"))
   #t)))
  (replace
   'install
@@ -621,9 +648,9 @@ process, passing on the arguments as command line arguments.")
 (install-file "haskell-mode.info" info))
(copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
(copy-to-dir el-dir (find-files "." "\\.elc?"))
-   ;; these are now distributed with emacs
+   ;; These are part of other packages.
(with-directory-excursion el-dir
- (for-each delete-file '("cl-lib.el" "ert.el")))
+ (for-each delete-file '("dash.el" "ert.el")))
#t))
 (home-page "https://github.com/haskell/haskell-mode";)
 (synopsis "Haskell mode for Emacs")
-- 
2.7.4



[PATCH 2/3] gnu: Add emacs-el-search.

2016-10-20 Thread Federico Beffa

From 4e1d6cddf36c3f293006e79013fddca4c4441f34 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Thu, 20 Oct 2016 17:50:56 +0200
Subject: [PATCH 2/3] gnu: Add emacs-el-search.

* gnu/packages/emacs.scm (emacs-el-search): New variable.
---
 gnu/packages/emacs.scm | 24 
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 8debb48..3efced2 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -3270,3 +3270,27 @@ editing nginx config files.")
 (description "This library provides an implementation of streams for Emacs.
 Streams are implemented as delayed evaluation of cons cells.")
 (license license:gpl3+)))
+
+(define-public emacs-el-search
+  (let ((commit "f26277bfbb3fc3fc74beea6592f294c439796bd4")
+(revision "1"))
+(package
+  (name "emacs-el-search")
+  ;; No ufficial release.
+  (version (string-append "0.0-" revision "." (string-take commit 7)))
+  (home-page "https://github.com/emacsmirror/el-search";)
+  (source
+   (origin
+ (method git-fetch)
+ (file-name (string-append name "-" version ".tar.gz"))
+ (uri (git-reference
+   (commit commit)
+   (url (string-append home-page ".git"
+ (sha256
+  (base32 "12xf40h9sb7xxg2r97gsia94q02543mgiiiw46fzh1ac7b7993g6"
+  (build-system emacs-build-system)
+  (inputs `(("emacs-stream" ,emacs-stream)))
+  (synopsis "Expression based interactive search for emacs-lisp-mode")
+  (description "This package provides expression based interactive search
+procedures for emacs-lisp-mode.")
+  (license license:gpl3+
-- 
2.7.4



[PATCH 1/3] gnu: Add emacs-stream.

2016-10-20 Thread Federico Beffa

From 0ecbbcccb171223acc5b4824c0c22a35cb22b6f1 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Thu, 20 Oct 2016 17:32:42 +0200
Subject: [PATCH 1/3] gnu: Add emacs-stream.

* gnu/packages/emacs.scm (emacs-stream): New varaible.
---
 gnu/packages/emacs.scm | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 6e9c181..8debb48 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -3252,3 +3252,21 @@ This package contains the library runtime.")
 (description "This package provides an Emacs major mode for
 editing nginx config files.")
 (license license:gpl2+)))
+
+(define-public emacs-stream
+  (package
+(name "emacs-stream")
+(version "2.2.0")
+(home-page "https://github.com/NicolasPetton/stream";)
+(source
+ (origin
+   (method url-fetch)
+   (file-name (string-append name "-" version ".tar.gz"))
+   (uri (string-append home-page "/archive/"version ".tar.gz"))
+   (sha256
+(base32 "03ql4nqfz5pn55mjly6clhvc3g7x2d28kj7mrlqmigvjbql39xxc"
+(build-system emacs-build-system)
+(synopsis "Implementation of streams for Emacs")
+(description "This library provides an implementation of streams for Emacs.
+Streams are implemented as delayed evaluation of cons cells.")
+(license license:gpl3+)))
-- 
2.7.4



Re: [PATCH 01/15] gnu: chez-scheme: Add search-path and fix i686 build.

2016-10-19 Thread Federico Beffa
On Mon, Oct 17, 2016 at 3:34 PM, Ludovic Courtès  wrote:
> Hello Federico,
>
> Federico Beffa  skribis:
>
>> On Sun, Oct 16, 2016 at 8:25 PM, Ricardo Wurmus  wrote:
>> From 7875840eb0f0d0d844da40735faabd10b791f0dd Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Mon, 17 Oct 2016 09:01:11 +0200
>> Subject: [PATCH 02/17] gnu: chez-scheme: Fix i686 build.
>>
>> * gnu/packages/scheme.scm (chez-scheme): Add 'configure-flags', generalize
>>   'configure' phase and simplify 'install-doc' phase.

This patch was meant to fix the i686 build, but it looks like it doesn't :-(

The patch adds a 'configure-flags' argument specifying the machine
type as instructed by Chez '-/configure --help' message. In addition,
patching of the make files was generalized to recognize compiler flags
for all architectures (previously it only recognized x86_64 ones).
However, because I'm short on space I only checked that I didn't break
the 64bit version and didn't build the 32bit one.

If you are OK, I may give it one more shot. Otherwise I will leave it
for somebody interested with an i686 machine.

Regards,
Fede

P.S.: Note for ARM owners: although not advertised, It looks like
peoples have successfully managed to cross-build Chez for ARM:
https://github.com/cisco/ChezScheme/issues/13
I don't have an ARM machine. So, if you are interested, give it a try.



Re: [PATCH 06/15] gnu: Add chez-irregex.

2016-10-17 Thread Federico Beffa
On Mon, Oct 17, 2016 at 4:40 PM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
>
>> From 4293c55d921d82c0542907024a1b51abea32b6dc Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Sun, 16 Oct 2016 16:10:31 +0200
>> Subject: [PATCH 06/15] gnu: Add chez-irregex.
>>
>> * gnu/packages/chez.scm (chez-irregex): New variable.
>
> [...]
>
>> +   (uri (string-append
>> + "https://github.com/fedeinthemix/chez-irregex/archive";
>> + "/v" version ".tar.gz"))
>
> Wouldn’t it work to use the upstream Irregex as done in the
> ‘guile-irregex’ package?

The original source includes a module definition for Guile, but not
one for R6RS Scheme. This package wraps the original code in an R6RS
library definition and adds a file to make it easy to run the test
suite.

>
> Otherwise LGTM.
>
> Ludo’.



Re: [PATCH 05/15] gnu: Add chez-matchable.

2016-10-17 Thread Federico Beffa
On Mon, Oct 17, 2016 at 3:54 PM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
>
>> From 5821d3e41e37df01492141f128a0a09b5e70498f Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Sun, 16 Oct 2016 16:08:33 +0200
>> Subject: [PATCH 05/15] gnu: Add chez-matchable.
>>
>> * gnu/packages/chez.scm (chez-matchable): New variable.
>
> [...]
>
>> +;; Help function for Chez Scheme to add the current path to
>> +;; CHEZSCHEMELIBDIRS.
>> +(define chez-configure
>> +  '(lambda _
>> + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS")))
>> +   (setenv "CHEZSCHEMELIBDIRS"
>> +   (if chez-env
>> +   (string-append ".:" chez-env)
>> +   "."))
>> +   #t)))
>
> Would it make sense to define a chez-build-system?

I don't think so: There aren't so many libraries and everybody is
doing his thing.

Fede



Re: [PATCH 03/15] gnu: Add chez-web.

2016-10-17 Thread Federico Beffa
On Mon, Oct 17, 2016 at 4:43 AM, Marius Bakke  wrote:
> Federico Beffa  writes:
>
>> From 828438eb009a557cd0be5f0e2a42eebb0d59257d Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Sun, 16 Oct 2016 15:59:49 +0200
>> Subject: [PATCH 03/15] gnu: Add chez-web
>>
>> * gnu/packages/chez.scm (chez-web): New variable.
>> ---
>>  gnu/packages/chez.scm | 49 +
>>  1 file changed, 49 insertions(+)
>>
>> diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
>> index 68591da..d9f6f71 100644
>> --- a/gnu/packages/chez.scm
>> +++ b/gnu/packages/chez.scm
>> @@ -22,6 +22,7 @@
>>  #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat))
>>#:use-module (guix packages)
>>#:use-module (guix download)
>> +  #:use-module (guix git-download)
>>#:use-module (guix utils)
>>#:use-module (guix build-system gnu)
>>#:use-module (gnu packages compression)
>> @@ -222,3 +223,51 @@ and 32-bit PowerPC architectures.")
>>  (description
>>   "This package provides a collection of SRFI libraries for Chez 
>> Scheme.")
>>  (license expat)))
>> +
>> +(define-public chez-web
>> +  (package
>> +(name "chez-web")
>> +;; release 2.0 is different and doesn't work.
>
> Can you expand on this comment? Why does the released version not work?

I spent a bunch of time trying to tangle the released WEB file and I
was always getting errors (I even contacted the author).  At some
point I had enough and tried the latest commit and all of a sudden
everything was working.

>
>> +(version "2.0-1.5fd177f")
>> +(source
>> + (origin
>> +   (method git-fetch)
>> +   (uri (git-reference
>> + (url "https://github.com/arcfide/ChezWEB.git";)
>> + (commit "5fd177fe53f31f466bf88720d03c95a3711a8bea")))
>> +   (file-name (string-append name "-" version "-checkout"))
>> +   (sha256
>> +(base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b"
>> +(build-system gnu-build-system)
>> +(native-inputs
>> + `(("chez-scheme" ,chez-scheme)
>> +   ("texlive" ,texlive)))
>> +(arguments
>> + `(#:make-flags (let ((out (assoc-ref %outputs "out")))
>> +  (list (string-append "PREFIX=" out)
>> +(string-append "DOCDIR=" out "/share/doc/"
>> +   ,name "-" ,version)
>> +(string-append "LIBDIR=" out "/lib/chezweb")
>> +(string-append "TEXDIR=" out 
>> "/share/texmf-local")))
>
> You can use %output instead of (assoc-ref %outputs "out") here.

OK

>
>> +   #:tests? #f ; no tests
>> +   #:phases
>> +   (modify-phases %standard-phases
>> + (replace 'configure
>> +   (lambda* _
>> + (copy-file "config.mk.template" "config.mk")
>> + (substitute* "tangleit"
>> +   (("\\./cheztangle\\.ss" all)
>> +(string-append "chez-scheme --program " all)))
>> + (substitute* "weaveit"
>> +   (("mpost chezweb\\.mp")
>> +"mpost --tex=tex chezweb.mp")
>> +   (("\\./chezweave" all)
>> +(string-append "chez-scheme --program " all)))
>> + (substitute* "installit"
>> +   (("-g \\$GROUP -o \\$OWNER") "")))
>> +(home-page "https://github.com/arcfide/ChezWEB";)
>> +(synopsis "Hygienic Literate Programming for Chez Scheme")
>> +(description "ChezWEB is a system for doing Knuthian style WEB
>> +programming in Scheme, and more particularly, it is implemented in
>> +Chez Scheme.")
>
> I think the description up to the first comma is enough, since chez
> scheme is implied by the name.

OK thanks.



Re: [PATCH 04/15] gnu: Add chez-sockets.

2016-10-17 Thread Federico Beffa
On Mon, Oct 17, 2016 at 3:37 PM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
>
>> From d09667ff264149467b2b69e8a4ef67a1ce9b123c Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Sun, 16 Oct 2016 16:03:07 +0200
>> Subject: [PATCH 04/15] gnu: Add chez-sockets.
>>
>> * gnu/packages/chez.scm (chez-sockets): New variable.
>
> [...]
>
>> +(define-public chez-sockets
>> +  (package
>> +(name "chez-sockets")
>> +(version "0.0-1.bce9688")
>
> Please factorize the commit number (info "(guix) Version Numbers").

OK

>
>> +(native-inputs
>> + `(("chez-scheme" ,chez-scheme)
>> +   ("chez-web" ,chez-web)
>> +   ("texlive" ,texlive)))
>
> Can documentation be made available in an on-line format like HTML or
> Info?

No, this library is written in a WEB system based on Chez Scheme and LaTeX.

>
> This would be consistent with what most other packages provide and would
> avoid the TeX Live dependency.
>
> The rest LGTM, thanks!
>
> Ludo’.



Re: [PATCH 01/15] gnu: chez-scheme: Add search-path and fix i686 build.

2016-10-17 Thread Federico Beffa
On Sun, Oct 16, 2016 at 8:25 PM, Ricardo Wurmus  wrote:
> Hi Federico,
>
> it’s a bit unfortunate to mix moving of packages between modules with a
> fix and a feature addition (search paths).  I think the move to a new
> module is not necessary.

I moved Chez Scheme to a new module because I'm adding several
libraries for it and, from my point of view, it makes sense to have
them all in one place. More libraries will follow.

> Could you separate these different changes into different patches,
> please?

I've split them.

Thanks for the review.
Fede
From c25b941dc4a0b5d04a871edb590a728b6075b081 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 17 Oct 2016 08:52:48 +0200
Subject: [PATCH 01/17] gnu: chez-scheme: Add search-path.

* gnu/packages/scheme.scm (chez-scheme): Do it.
---
 gnu/packages/scheme.scm | 4 
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 9597473..c461efb 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -635,6 +635,10 @@ threads.")
  `(("texlive" ,texlive)
("ghostscript" ,ghostscript-gs)
("netpbm" ,netpbm)))
+(native-search-paths
+ (list (search-path-specification
+(variable "CHEZSCHEMELIBDIRS")
+(files (list (string-append "lib/csv" version "-site"))
 (outputs '("out" "doc"))
 (arguments
  `(#:modules ((guix build gnu-build-system)
-- 
2.7.4

From 7875840eb0f0d0d844da40735faabd10b791f0dd Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 17 Oct 2016 09:01:11 +0200
Subject: [PATCH 02/17] gnu: chez-scheme: Fix i686 build.

* gnu/packages/scheme.scm (chez-scheme): Add 'configure-flags', generalize
  'configure' phase and simplify 'install-doc' phase.
---
 gnu/packages/scheme.scm | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index c461efb..10368b2 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -645,6 +645,14 @@ threads.")
   (guix build utils)
   (ice-9 match))
#:test-target "test"
+   #:configure-flags
+   (list ,(match (or (%current-target-system) (%current-system))
+("x86_64-linux" '(list "--machine=ta6le"))
+("i686-linux" '(list "--machine=ti3le"))
+;; FIXME: Some people succeeded in cross-compiling to
+;; ARM. https://github.com/cisco/ChezScheme/issues/13
+(_
+ '(
#:phases
(modify-phases %standard-phases
  ;; Adapt the custom 'configure' script.
@@ -673,12 +681,9 @@ threads.")
(substitute* (find-files "./c" "Mf-[a-zA-Z0-9.]+")
  (("\\$\\{Kernel\\}: \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a")
   "${Kernel}: ${kernelobj}")
- (("ld -melf_x86_64 -r -X -o \\$\\{Kernel\\} \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a")
-  (string-append "ld -melf_x86_64 -r -X -o ${Kernel} ${kernelobj} "
- zlib "/lib/libz.a"))
- (("\\(cd \\.\\./zlib; CFLAGS=-m64 \\./configure --64)")
-  (which "true"))
- (("(cd \\.\\./zlib; make)")
+ (("ld ([-a-zA-Z0-9_${} ]+) \\.\\./zlib/libz\\.a" all args)
+  (string-append "ld " args " " zlib "/lib/libz.a"))
+ (("\\(cd \\.\\./zlib; ([-a-zA-Z0-9=./ ]+))")
   (which "true")))
(substitute* (find-files "mats" "Mf-.*")
  (("^[[:space:]]+(cc ) *") "\tgcc "))
@@ -715,9 +720,7 @@ threads.")
(system* "make" "docs")
(with-directory-excursion "csug"
      (substitute* "Makefile"
-   (("/tmp/csug9") doc)
-   (("^m = a6le")
-"m := $(shell echo '(machine-type)' | scheme -q)"))
+   (("/tmp/csug9") doc))
  (system* "make" "install")
  (install-file "csug.pdf" doc))
(with-directory-excursion "release_notes"
-- 
2.7.4

From 0f2766f86058762443645583b491fb9097a510a3 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Mon, 17 Oct 2016 09:05:39 +0200
Subject: [PATCH 03/17] gnu: chez-scheme: Move to new module.

* gnu/packages/scheme.scm (chez-scheme, nanopass, stex): Move variables ...

[PATCH 15/15] gnu: Add GHC 8.0.1.

2016-10-16 Thread Federico Beffa
This is the newest GHC version. I'm adding it as opposed to updating
the version of the current compiler because it is likely to break some
of the 240+ libraries that we have and currently I can't commit to fix
those.

There is a project https://www.stackage.org/ curating an LTS set of
libraries playing well together and with a specific compiler version.
It would probably make sense to sync with their work. They do use YAML
configuration files.  Is there somewhere a YAML library for Guile that
we could use?

Regards,
Fede
From 734a8f7057dd9c4947ced8abc9f4d147a47dbb05 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 17:01:46 +0200
Subject: [PATCH 15/15] gnu: Add GHC 8.0.1.

* gnu/packages/haskell.scm (ghc-8): New variable.
---
 gnu/packages/haskell.scm | 128 +++
 1 file changed, 128 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 2e0b8fa..6152d7c 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -261,6 +261,134 @@
 interactive environment for the functional language Haskell.")
 (license license:bsd-3)))
 
+(define-public ghc-8
+  (package
+(name "ghc")
+(version "8.0.1")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "https://www.haskell.org/ghc/dist/";
+  version "/" name "-" version "-src.tar.xz"))
+  (sha256
+   (base32 "1lniqy29djhjkddnailpaqhlqh4ld2mqvb1fxgxw1qqjhz6j1ywh"
+(build-system gnu-build-system)
+(supported-systems '("i686-linux" "x86_64-linux"))
+(outputs '("out" "doc"))
+(inputs
+ `(("gmp" ,gmp)
+   ("ncurses" ,ncurses)
+   ("libffi" ,libffi)
+   ("libedit" ,libedit)
+   ("ghc-testsuite"
+,(origin
+   (method url-fetch)
+   (uri (string-append
+ "https://www.haskell.org/ghc/dist/";
+ version "/" name "-" version "-testsuite.tar.xz"))
+   (sha256
+(base32 "0lc1vjivkxn01aw3jg2gd7fmqb5pj7a5j987c7pn5r7caqv1cmxw"))
+(native-inputs
+ `(("perl" ,perl)
+   ("python" ,python-2); for tests
+   ("ghostscript" ,ghostscript); for tests
+   ;; GHC is built with GHC.
+   ("ghc-bootstrap" ,ghc)))
+(arguments
+ `(#:test-target "test"
+   ;; We get a smaller number of test failures by disabling parallel test
+   ;; execution.
+   #:parallel-tests? #f
+
+   ;; The DSOs use $ORIGIN to refer to each other, but (guix build
+   ;; gremlin) doesn't support it yet, so skip this phase.
+   #:validate-runpath? #f
+
+   ;; Don't pass --build=, because the configure script
+   ;; auto-detects slightly different triplets for --host and --target and
+   ;; then complains that they don't match.
+   #:build #f
+
+   #:modules ((guix build gnu-build-system)
+  (guix build utils)
+  (guix build rpath)
+  (srfi srfi-26)
+  (srfi srfi-1))
+   #:imported-modules (,@%gnu-build-system-modules
+   (guix build rpath))
+   #:configure-flags
+   (list
+(string-append "--with-gmp-libraries="
+   (assoc-ref %build-inputs "gmp") "/lib")
+(string-append "--with-gmp-includes="
+   (assoc-ref %build-inputs "gmp") "/include")
+"--with-system-libffi"
+(string-append "--with-ffi-libraries="
+   (assoc-ref %build-inputs "libffi") "/lib")
+(string-append "--with-ffi-includes="
+   (assoc-ref %build-inputs "libffi") "/include")
+(string-append "--with-curses-libraries="
+   (assoc-ref %build-inputs "ncurses") "/lib")
+(string-append "--with-curses-includes="
+   (assoc-ref %build-inputs "ncurses") "/include"))
+   #:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'unpack-testsuite
+   (lambda* (#:key inputs #:allow-other-keys)
+ (with-directory-excursion ".."
+   (copy-file (assoc-ref inputs "ghc-testsuite")
+  "ghc-testsuite.tar.xz")
+   (zero? (system* "tar" "xvf" "ghc-testsuite.tar.xz")
+ (add-before 'build 'fix-lib-paths
+   (lambda _
+ (substitute*
+

[PATCH 14/15] gnu: Add ghc-hashtables.

2016-10-16 Thread Federico Beffa

From 7fbb4cfb5a9dcae749c62a466ca3ec8fd00c7115 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:55:18 +0200
Subject: [PATCH 14/15] gnu: Add ghc-hashtables.

* gnu/packages/haskell.scm (ghc-hashtables): New variable.
---
 gnu/packages/haskell.scm | 25 +
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 9f74f7d..2e0b8fa 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7749,4 +7749,29 @@ interface for statistics based on hmatrix and GSL.")
 Haskell, using gnuplot for rendering.")
 (license license:expat)))
 
+(define-public ghc-hashtables
+  (package
+(name "ghc-hashtables")
+(version "1.2.1.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://hackage.haskell.org/package/hashtables/hashtables-";
+ version ".tar.gz"))
+   (sha256
+(base32 "1b6w9xznk42732vpd8ili60k12yq190xnajgga0iwbdpyg424lgg"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-hashable" ,ghc-hashable)
+   ("ghc-primitive" ,ghc-primitive)
+   ("ghc-vector" ,ghc-vector)))
+(home-page "http://github.com/gregorycollins/hashtables";)
+(synopsis "Haskell Mutable hash tables in the ST monad")
+(description "This package provides a Haskell library including a
+couple of different implementations of mutable hash tables in the ST
+monad, as well as a typeclass abstracting their common operations, and
+a set of wrappers to use the hash tables in the IO monad.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.7.4



[PATCH 11/15] gnu: Add ghc-hmatrix-special.

2016-10-16 Thread Federico Beffa

From db784f9aaafe542e4f8213397c0886b83f75adf4 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:29:51 +0200
Subject: [PATCH 11/15] gnu: Add ghc-hmatrix-special.

* gnu/packages/haskell.scm (ghc-hmatrix-special): New variable.
---
 gnu/packages/haskell.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 812e984..7a6aee4 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7676,4 +7676,27 @@ interface to selected numerical computations, internally implemented
 using GSL.")
 (license license:gpl3+)))
 
+(define-public ghc-hmatrix-special
+  (package
+(name "ghc-hmatrix-special")
+(version "0.4.0.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri
+(string-append
+ "http://hackage.haskell.org/package/hmatrix-special/hmatrix-special-";
+ version ".tar.gz"))
+   (sha256
+(base32 "0cr9y3swzj7slrd84g1nhdkp1kpq4q5ihwapmiaidpr2bv3hrfhz"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-hmatrix" ,ghc-hmatrix)
+   ("ghc-hmatrix-gsl" ,ghc-hmatrix-gsl)))
+(home-page "https://github.com/albertoruiz/hmatrix";)
+(synopsis "Haskell interface to GSL special functions")
+(description "This library provides an interface to GSL special
+functions for Haskell.")
+(license license:gpl3+)))
+
 ;;; haskell.scm ends here
-- 
2.7.4



[PATCH 10/15] gnu: Add ghc-hmatrix-gsl.

2016-10-16 Thread Federico Beffa

From 6a3e22a85352587d4edb786919e59b4a486f2be3 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:27:41 +0200
Subject: [PATCH 10/15] gnu: Add ghc-hmatrix-gsl.

* gnu/packages/haskell.scm (ghc-hmatrix-gsl): New variable.
---
 gnu/packages/haskell.scm | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 4203227..812e984 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7650,4 +7650,30 @@ dealing with linear systems, matrix decompositions, and other
 numerical computations based on BLAS and LAPACK.")
 (license license:bsd-3)))
 
+(define-public ghc-hmatrix-gsl
+  (package
+(name "ghc-hmatrix-gsl")
+(version "0.17.0.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://hackage.haskell.org/package/hmatrix-gsl/hmatrix-gsl-";
+ version ".tar.gz"))
+   (sha256
+(base32 "1jbqwn9d2nldc4klhy0n8gcxr889h0daw2mjfhwgksfy1bwfjl7w"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-hmatrix" ,ghc-hmatrix)
+   ("ghc-vector" ,ghc-vector)
+   ("ghc-random" ,ghc-random)
+   ("gsl" ,gsl)))
+(native-inputs `(("pkg-config" ,pkg-config)))
+(home-page "https://github.com/albertoruiz/hmatrix";)
+(synopsis "Haskell GSL binding")
+(description "This Haskell library provides a purely functional
+interface to selected numerical computations, internally implemented
+using GSL.")
+(license license:gpl3+)))
+
 ;;; haskell.scm ends here
-- 
2.7.4



[PATCH 08/15] gnu: Add ghc-storable-complex.

2016-10-16 Thread Federico Beffa

From 1c9a41b100d482f25bd7b3c930afa56fb630223b Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:19:32 +0200
Subject: [PATCH 08/15] gnu: Add ghc-storable-complex.

* gnu/packages/haskell.scm (ghc-storable-complex): New variable.
---
 gnu/packages/haskell.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 52e4bc3..50b09ef 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7598,4 +7598,25 @@ versions of these packages distributed with different versions of GHC.
 In particular, this library supports working with POSIX files that have paths
 which can't be decoded in the current locale encoding.")
 (license license:expat)))
+
+(define-public ghc-storable-complex
+  (package
+(name "ghc-storable-complex")
+(version "0.2.2")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://hackage.haskell.org/package/storable-complex/storable-complex-";
+ version ".tar.gz"))
+   (sha256
+(base32 "01kwwkpbfjrv26vj83cd92px5qbq1bpgxj0r45534aksqhany1xb"
+(build-system haskell-build-system)
+(home-page "https://github.com/cartazio/storable-complex";)
+(synopsis "Haskell Storable instance for Complex")
+(description "This package provides a Haskell library including a
+Storable instance for Complex which is binary compatible with C99, C++
+and Fortran complex data types.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.7.4



[PATCH 06/15] gnu: Add chez-irregex.

2016-10-16 Thread Federico Beffa

From 4293c55d921d82c0542907024a1b51abea32b6dc Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:10:31 +0200
Subject: [PATCH 06/15] gnu: Add chez-irregex.

* gnu/packages/chez.scm (chez-irregex): New variable.
---
 gnu/packages/chez.scm | 33 +
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index bc763df..34fd225 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -397,3 +397,36 @@ Chez Scheme.")
 Scheme 'match' package by Andrew Wright, written in fully portable
 'syntax-rules' and thus preserving hygiene.")
 (license public-domain)))
+
+(define-public chez-irregex
+  (package
+(name "chez-irregex")
+(version "0.9.4")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://github.com/fedeinthemix/chez-irregex/archive";
+ "/v" version ".tar.gz"))
+   (sha256
+(base32 "0ywy5syaw549a58viz68dmgnv756ic705rcnlqxgjq27lnaim53b"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system gnu-build-system)
+(inputs
+ `(("chez-matchable" ,chez-matchable))) ; for tests
+(propagated-inputs
+ `(("chez-srfi" ,chez-srfi))) ; for irregex-utils
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)))
+(arguments
+ `(#:make-flags ,(chez-make-flags name version)
+   #:test-target "test"
+   #:phases (modify-phases %standard-phases
+  (replace 'configure ,chez-configure
+(home-page "https://github.com/fedeinthemix/chez-irregex";)
+(synopsis "Portable regular expression library for Scheme")
+(description "This package provides a portable and efficient
+R[4567]RS implementation of regular expressions, supporting both POSIX
+syntax with various (irregular) PCRE extensions, as well as SCSH's SRE
+syntax, with various aliases for commonly used patterns.")
+(license bsd-3)))
-- 
2.7.4



[PATCH 12/15] gnu: Add ghc-hmatrix-gsl-stats.

2016-10-16 Thread Federico Beffa

From 50a023bc5dcda5181f7bc77f0e414c673b249e7b Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:32:03 +0200
Subject: [PATCH 12/15] gnu: Add ghc-hmatrix-gsl-stats.

* gnu/packages/haskell.scm (ghc-hmatrix-gsl-stats): New variable.
---
 gnu/packages/haskell.scm | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 7a6aee4..8779aea 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -7699,4 +7699,30 @@ using GSL.")
 functions for Haskell.")
 (license license:gpl3+)))
 
+(define-public ghc-hmatrix-gsl-stats
+  (package
+(name "ghc-hmatrix-gsl-stats")
+(version "0.4.1.3")
+(source
+ (origin
+   (method url-fetch)
+   (uri
+(string-append
+ "http://hackage.haskell.org/package/hmatrix-gsl-stats/hmatrix-gsl-stats-";
+ version ".tar.gz"))
+   (sha256
+(base32 "0f3pzi494n4js0xiq5b38n07cnby0h9da6gmwywf8plvxm9271fl"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-vector" ,ghc-vector)
+   ("ghc-storable-complex" ,ghc-storable-complex)
+   ("ghc-hmatrix" ,ghc-hmatrix)
+   ("gsl" ,gsl)))
+(native-inputs `(("pkg-config" ,pkg-config)))
+(home-page "http://code.haskell.org/hmatrix-gsl-stats";)
+(synopsis "GSL Statistics interface for Haskell")
+(description "This Haskell library provides a purely functional
+interface for statistics based on hmatrix and GSL.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.7.4



[PATCH 04/15] gnu: Add chez-sockets.

2016-10-16 Thread Federico Beffa

From d09667ff264149467b2b69e8a4ef67a1ce9b123c Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:03:07 +0200
Subject: [PATCH 04/15] gnu: Add chez-sockets.

* gnu/packages/chez.scm (chez-sockets): New variable.
---
 gnu/packages/chez.scm | 76 +++
 1 file changed, 76 insertions(+)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index d9f6f71..6579b81 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -271,3 +271,79 @@ and 32-bit PowerPC architectures.")
 programming in Scheme, and more particularly, it is implemented in
 Chez Scheme.")
 (license expat)))
+
+(define-public chez-sockets
+  (package
+(name "chez-sockets")
+(version "0.0-1.bce9688")
+(source
+ (origin
+   (method git-fetch)
+   (uri (git-reference
+ (url "https://github.com/arcfide/chez-sockets.git";)
+ (commit "bce96881c06bd69a6757a6bff139744153924140")))
+   (file-name (string-append name "-" version "-checkout"))
+   (sha256
+(base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m"
+(build-system gnu-build-system)
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)
+   ("chez-web" ,chez-web)
+   ("texlive" ,texlive)))
+(arguments
+ `(#:tests? #f  ; no tests
+   #:phases
+   (modify-phases %standard-phases
+ (replace 'configure
+   (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(chez-web (assoc-ref inputs "chez-web"))
+(chez (assoc-ref inputs "chez-scheme"))
+(chez-h (dirname (car (find-files chez "scheme\\.h")
+   (substitute* "Makefile"
+ (("(SCHEMEH=).*$" all var)
+  (string-append var chez-h)))
+   #t)))
+ (add-before 'build 'tangle
+   (lambda _
+ ;; just using "make" tries to build the .c files before
+ ;; they are created.
+ (and (zero? (system* "make" "sockets"))
+  (zero? (system* "make")
+ (replace 'build
+   (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(chez-site (string-append out "/lib/csv"
+  ,(package-version chez-scheme)
+  "-site/arcfide")))
+   ;; make sure Chez Scheme can find the shared libraries.
+   (substitute* "sockets.ss"
+ (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\""
+   all cmd so)
+  (string-append cmd " \"" chez-site "/" so "\""))
+ (("sockets-stub\\.[sd][oy].*" all)
+  (string-append chez-site "/" all)))
+   ;; to compile chez-sockets, the .so files must be
+   ;; installed (because of the absolute path we
+   ;; inserted above).
+   (for-each (lambda (f d) (install-file f d))
+ '("socket-ffi-values.so" "sockets-stub.so")
+ (list chez-site chez-site))
+   (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q")
+ (replace 'install
+   (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(lib (string-append out "/lib/chez-sockets"))
+(doc (string-append out "/share/doc/" ,name "-" ,version))
+(chez-site (string-append out "/lib/csv"
+  ,(package-version chez-scheme)
+  "-site/arcfide")))
+   (for-each (lambda (f d) (install-file f d))
+ '("sockets.pdf" "sockets.so")
+ (list doc chez-site))
+   #t))
+(home-page "https://github.com/arcfide/chez-sockets";)
+(synopsis "Extensible sockets library for Chez Scheme")
+(description "Chez-sockets is an extensible sockets library for
+Chez Scheme.")
+(license expat)))
-- 
2.7.4



[PATCH 01/15] gnu: chez-scheme: Add search-path and fix i686 build.

2016-10-16 Thread Federico Beffa

From e03430859c864c3b868994143fe729f0558297ab Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sat, 15 Oct 2016 21:23:31 +0200
Subject: [PATCH 01/15] gnu: chez-scheme: Add search-path and Fix i686 build.

* gnu/packages/scheme.scm (chez-scheme, nanopass, stex): Move variables ...
* gnu/packages/chez.scm (chez-scheme, nanopass, stex): ... here, to a new file.
  (chez-scheme)[arguments]: Add 'configure-flags', generalize 'configure' phase
  and simplify 'install-doc' phase.
  [native-search-path]: Add it.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add new file.
---
 gnu/local.mk|   1 +
 gnu/packages/chez.scm   | 196 
 gnu/packages/scheme.scm | 154 -
 3 files changed, 197 insertions(+), 154 deletions(-)
 create mode 100644 gnu/packages/chez.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 521ba2d..9de9b1b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -68,6 +68,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/cdrom.scm			\
   %D%/packages/certs.scm			\
   %D%/packages/check.scm			\
+  %D%/packages/chez.scm\
   %D%/packages/ci.scm\
   %D%/packages/cmake.scm			\
   %D%/packages/code.scm\
diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
new file mode 100644
index 000..9009865
--- /dev/null
+++ b/gnu/packages/chez.scm
@@ -0,0 +1,196 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Federico Beffa 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages chez)
+  #:use-module (gnu packages)
+  #:use-module ((guix licenses)
+#:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat))
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix utils)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages tex)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages xorg)
+  #:use-module (ice-9 match))
+
+(define nanopass
+  (let ((version "1.9"))
+(origin
+  (method url-fetch)
+  (uri (string-append
+"https://github.com/nanopass/nanopass-framework-scheme/archive";
+"/v" version ".tar.gz"))
+  (sha256 (base32 "11pwyy4jiwhcl2am3a4ciczacjbjkyvdizqzdglb3l1hj2gj6nv2"))
+  (file-name (string-append "nanopass-" version ".tar.gz")
+
+(define stex
+  (let ((version "1.2.1"))
+(origin
+  (method url-fetch)
+  (uri (string-append
+"https://github.com/dybvig/stex/archive";
+"/v" version ".tar.gz"))
+  (sha256 (base32 "03pl3f668h24dn51vccr1sj5lsba9zq3j37bnxjvdadcdaj4qy5z"))
+  (file-name (string-append "stex-" version ".tar.gz")
+
+(define-public chez-scheme
+  (package
+(name "chez-scheme")
+(version "9.4")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/cisco/ChezScheme/archive/";
+   "v" version ".tar.gz"))
+   (sha256
+(base32 "0lprmpsjg2plc6ykgkz482zyvhkzv6gd0vnar71ph21h6zknyklz"))
+   (file-name (string-append "chez-scheme-" version ".tar.gz"
+(build-system gnu-build-system)
+(inputs
+ `(("ncurses" ,ncurses)
+   ("libx11" ,libx11)
+   ("xorg-rgb" ,xorg-rgb)
+   ("nanopass" ,nanopass)
+   ("zlib" ,zlib)
+   ("stex" ,stex)))
+(native-inputs
+ `(("texlive" ,texlive)
+   ("ghostscript" ,ghostscript-gs)
+   ("netpbm" ,netpbm)))
+   (native-search-paths
+(list (search-path-specification
+(variable "CHEZSCHEMELIBDIRS")
+(files (list (string-append "lib/csv" version "-site"))
+   (outputs '("out" "doc"))
+(arguments
+ `(#:modules ((guix build gnu-build-system)
+   

[PATCH 09/15] gnu: Add ghc-hmatrix.

2016-10-16 Thread Federico Beffa

From 9cbbc66e111c5446f818ce1f9aa8f1bc52300bec Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:25:26 +0200
Subject: [PATCH 09/15] gnu: Add ghc-hmatrix.

* gnu/packages/haskell.scm (ghc-hmatrix): New variable.
---
 gnu/packages/haskell.scm | 33 -
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 50b09ef..4203227 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015 Federico Beffa 
+;;; Copyright © 2015, 2016 Federico Beffa 
 ;;; Copyright © 2015 Siniša Biđin 
 ;;; Copyright © 2015 Paul van der Walt 
 ;;; Copyright © 2015 Eric Bavier 
@@ -44,6 +44,7 @@
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages python)
@@ -7619,4 +7620,34 @@ Storable instance for Complex which is binary compatible with C99, C++
 and Fortran complex data types.")
 (license license:bsd-3)))
 
+(define-public ghc-hmatrix
+  (package
+(name "ghc-hmatrix")
+(version "0.17.0.2")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://hackage.haskell.org/package/hmatrix/hmatrix-";
+ version ".tar.gz"))
+   (sha256
+(base32 "1fgsrh2y9y971pzrd3767rg97bjr1ghpdvwmn1nn65s90rc9bv98"
+(build-system haskell-build-system)
+(inputs
+ `(("ghc-random" ,ghc-random)
+   ("ghc-split" ,ghc-split)
+   ("ghc-storable-complex" ,ghc-storable-complex)
+   ("ghc-vector" ,ghc-vector)
+   ;;("openblas" ,openblas)
+   ("lapack" ,lapack)))
+;;; Guix's OpenBLAS is built with the floag "NO_LAPACK=1" which
+;;; disables inclusion of the LAPACK functions.
+;;(arguments `(#:configure-flags '("--flags=openblas")))
+(home-page "https://github.com/albertoruiz/hmatrix";)
+(synopsis "Haskell numeric linear algebra library")
+(description "The HMatrix package provices a Haskell library for
+dealing with linear systems, matrix decompositions, and other
+numerical computations based on BLAS and LAPACK.")
+(license license:bsd-3)))
+
 ;;; haskell.scm ends here
-- 
2.7.4



[PATCH 07/15] gnu: Add chez-fmt.

2016-10-16 Thread Federico Beffa

From c6d0839666e90da4074a1ae6af9a355907a9cdd8 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:12:25 +0200
Subject: [PATCH 07/15] gnu: Add chez-fmt.

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

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 34fd225..3661a20 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -430,3 +430,41 @@ R[4567]RS implementation of regular expressions, supporting both POSIX
 syntax with various (irregular) PCRE extensions, as well as SCSH's SRE
 syntax, with various aliases for commonly used patterns.")
 (license bsd-3)))
+
+(define-public chez-fmt
+  (package
+(name "chez-fmt")
+(version "0.8.11")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "http://synthcode.com/scheme/fmt/fmt-"; version ".tar.gz"))
+   (sha256
+(base32 "1zxqlw1jyg85yzclylh8bp2b3fwcy3l3xal68jw837n5illvsjcl"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system gnu-build-system)
+(propagated-inputs
+ `(("chez-srfi" ,chez-srfi))) ; for irregex-utils
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)))
+(arguments
+ `(#:make-flags ,(chez-make-flags name version)
+   #:test-target "chez-check"
+   #:phases
+   (modify-phases %standard-phases
+ (replace 'configure ,chez-configure)
+ (replace 'build
+   (lambda* (#:key (make-flags '()) #:allow-other-keys)
+ (zero? (apply system* "make" "chez-build" make-flags
+ (replace 'install
+   (lambda* (#:key (make-flags '()) #:allow-other-keys)
+ (zero? (apply system* "make" "chez-install" make-flags)))
+(home-page "http://synthcode.com/scheme/fmt";)
+(synopsis "Combinator formatting library for Chez Scheme")
+(description "This package provides a library of procedures for
+formatting Scheme objects to text in various ways, and for easily
+concatenating, composing and extending these formatters efficiently
+without resorting to capturing and manipulating intermediate
+strings.")
+(license bsd-3)))
-- 
2.7.4



[PATCH 05/15] gnu: Add chez-matchable.

2016-10-16 Thread Federico Beffa

From 5821d3e41e37df01492141f128a0a09b5e70498f Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 16:08:33 +0200
Subject: [PATCH 05/15] gnu: Add chez-matchable.

* gnu/packages/chez.scm (chez-matchable): New variable.
---
 gnu/packages/chez.scm | 52 ++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 6579b81..bc763df 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -19,7 +19,8 @@
 (define-module (gnu packages chez)
   #:use-module (gnu packages)
   #:use-module ((guix licenses)
-#:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat))
+#:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat
+  public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -347,3 +348,52 @@ Chez Scheme.")
 (description "Chez-sockets is an extensible sockets library for
 Chez Scheme.")
 (license expat)))
+
+;; Help function for Chez Scheme to add the current path to
+;; CHEZSCHEMELIBDIRS.
+(define chez-configure
+  '(lambda _
+ (let ((chez-env (getenv "CHEZSCHEMELIBDIRS")))
+   (setenv "CHEZSCHEMELIBDIRS"
+   (if chez-env
+   (string-append ".:" chez-env)
+   "."))
+   #t)))
+
+;; Help function to define make flags for some Chez Scheme custom make
+;; files.
+(define (chez-make-flags name version)
+  `(let ((out (assoc-ref %outputs "out")))
+ (list (string-append "PREFIX=" out)
+   (string-append "DOCDIR=" out "/share/doc/"
+  ,name "-" ,version
+
+(define-public chez-matchable
+  (package
+(name "chez-matchable")
+(version "20160306")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://github.com/fedeinthemix/chez-matchable/archive";
+ "/v" version ".tar.gz"))
+   (sha256
+(base32 "0cl4vc6487pikjq159pj4n5ghyaax31nywb5n4yn1682h3ir1hs0"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system gnu-build-system)
+(inputs
+ `(("chez-srfi" ,chez-srfi))) ; for tests
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)))
+(arguments
+ `(#:make-flags ,(chez-make-flags name version)
+   #:test-target "test"
+   #:phases (modify-phases %standard-phases
+  (replace 'configure ,chez-configure
+(home-page "https://github.com/fedeinthemix/chez-matchable";)
+(synopsis "Portable hygienic pattern matcher for Scheme")
+(description "This package provides a superset of the popular
+Scheme 'match' package by Andrew Wright, written in fully portable
+'syntax-rules' and thus preserving hygiene.")
+(license public-domain)))
-- 
2.7.4



[PATCH 03/15] gnu: Add chez-web.

2016-10-16 Thread Federico Beffa

From 828438eb009a557cd0be5f0e2a42eebb0d59257d Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 15:59:49 +0200
Subject: [PATCH 03/15] gnu: Add chez-web

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

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 68591da..d9f6f71 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -22,6 +22,7 @@
 #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages compression)
@@ -222,3 +223,51 @@ and 32-bit PowerPC architectures.")
 (description
  "This package provides a collection of SRFI libraries for Chez Scheme.")
 (license expat)))
+
+(define-public chez-web
+  (package
+(name "chez-web")
+;; release 2.0 is different and doesn't work.
+(version "2.0-1.5fd177f")
+(source
+ (origin
+   (method git-fetch)
+   (uri (git-reference
+ (url "https://github.com/arcfide/ChezWEB.git";)
+ (commit "5fd177fe53f31f466bf88720d03c95a3711a8bea")))
+   (file-name (string-append name "-" version "-checkout"))
+   (sha256
+(base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b"
+(build-system gnu-build-system)
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)
+   ("texlive" ,texlive)))
+(arguments
+ `(#:make-flags (let ((out (assoc-ref %outputs "out")))
+  (list (string-append "PREFIX=" out)
+(string-append "DOCDIR=" out "/share/doc/"
+   ,name "-" ,version)
+(string-append "LIBDIR=" out "/lib/chezweb")
+(string-append "TEXDIR=" out "/share/texmf-local")))
+   #:tests? #f ; no tests
+   #:phases
+   (modify-phases %standard-phases
+ (replace 'configure
+   (lambda* _
+ (copy-file "config.mk.template" "config.mk")
+ (substitute* "tangleit"
+   (("\\./cheztangle\\.ss" all)
+(string-append "chez-scheme --program " all)))
+ (substitute* "weaveit"
+   (("mpost chezweb\\.mp")
+"mpost --tex=tex chezweb.mp")
+   (("\\./chezweave" all)
+(string-append "chez-scheme --program " all)))
+ (substitute* "installit"
+   (("-g \\$GROUP -o \\$OWNER") "")))
+(home-page "https://github.com/arcfide/ChezWEB";)
+(synopsis "Hygienic Literate Programming for Chez Scheme")
+(description "ChezWEB is a system for doing Knuthian style WEB
+programming in Scheme, and more particularly, it is implemented in
+Chez Scheme.")
+(license expat)))
-- 
2.7.4



[PATCH 02/15] gnu: Add chez-srfi.

2016-10-16 Thread Federico Beffa

From 1433f85bd0ba7fa0239b200f693e9b2ffcc8e039 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 16 Oct 2016 15:49:36 +0200
Subject: [PATCH 02/15] gnu: Add chez-srfi.

* gnu/packages/chez.scm (chez-srfi): New variable.
---
 gnu/packages/chez.scm | 28 
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 9009865..68591da 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -194,3 +194,31 @@ Revised^6 Report on Scheme (R6RS), with numerous extensions.  The compiler
 generates native code for each target processor, with support for x86, x86_64,
 and 32-bit PowerPC architectures.")
 (license asl2.0)))
+
+(define-public chez-srfi
+  (package
+(name "chez-srfi")
+(version "1.0")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append
+ "https://github.com/fedeinthemix/chez-srfi/archive";
+ "/v" version ".tar.gz"))
+   (sha256
+(base32 "17i4wly7bcr5kb5hf04ljpbvv4r5hsr9xsmw650fj43z9jr303gs"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system gnu-build-system)
+(native-inputs
+ `(("chez-scheme" ,chez-scheme)))
+(arguments
+ `(#:make-flags (let ((out (assoc-ref %outputs "out")))
+  (list (string-append "PREFIX=" out)))
+   #:test-target "test"
+   #:phases (modify-phases %standard-phases
+  (delete 'configure
+(home-page "https://github.com/fedeinthemix/chez-srfi";)
+(synopsis "SRFI libraries for Chez Scheme")
+(description
+ "This package provides a collection of SRFI libraries for Chez Scheme.")
+(license expat)))
-- 
2.7.4



Re: OpenBLAS

2016-10-09 Thread Federico Beffa
On Sun, Oct 9, 2016 at 2:19 PM, Pjotr Prins  wrote:
> On Sat, Oct 08, 2016 at 10:13:39PM +0200, Federico Beffa wrote:
>> Hi,
>>
>> I'm wondering why our OpenBLAS package is built with the flag
>> "NO_LAPACK=1". It is my understanding that with this optional flag
>> OpenBLAS doesn't include LAPACK, while without this flag and by
>> default it does include the LAPACK functions.  In the latter case
>> OpenBLAS could be used by a larger number of packages which do require
>> LAPACK functions.
>>
>> https://github.com/xianyi/OpenBLAS/issues/203
>
> NO_LAPACK=0 does not use external libs. NO_LAPACK=1 uses external
> liblapack. They both cover LAPACK functionality.
>
> NO_LAPACK=1 is the conservative choice - it still is what most
> software has been developed against today.
>
> OpenBLAS has merged LAPACK code and they have been changing things,
> claiming their version is better performing. But since it is less well
> tested, new bugs are quite possible. I have hit at least one OpenBLAS
> bug, so far.

Thanks for the info.  OpenBLAS is now around since several years and
has gained in popularity. I'm sure that any bug report will be
addressed timely.

In any case, I find that with "NO_LAPACK=1" hmatrix can't use it
http://hackage.haskell.org/package/hmatrix

>
> Personally I think we should have both options in Guix, but we should
> probably keep defaulting to NO_LAPACK=1.

For the moment I will use LAPACK.  If your proposal will happen I will switch.

Thanks for the reply,
Fede



OpenBLAS

2016-10-08 Thread Federico Beffa
Hi,

I'm wondering why our OpenBLAS package is built with the flag
"NO_LAPACK=1". It is my understanding that with this optional flag
OpenBLAS doesn't include LAPACK, while without this flag and by
default it does include the LAPACK functions.  In the latter case
OpenBLAS could be used by a larger number of packages which do require
LAPACK functions.

https://github.com/xianyi/OpenBLAS/issues/203

Regards,
Fede



Re: [PATCH 2/2] gnu: ghc-process: Replace reference to /bin/sh.

2016-10-02 Thread Federico Beffa
Ricardo Wurmus  writes:

> The importer should probably avoid adding standard packages to the
> inputs.

The importer does filter standard packages. The list may just have to
be updated.



Re: propagating inputs in ghc-* packages

2016-10-02 Thread Federico Beffa
On Sun, Oct 2, 2016 at 6:21 AM, Ricardo Wurmus  wrote:
>> That sounds great! Just to be sure: you are saying that if you install
>> any library (call it A) and the GHC compiler into your profile then you
>> are able to compile your program (making use of library A) without
>> also having to manually install any input of library A?
>
> This seems to be the case.  Here is an example ghci session in which I’m
> using “ghc-pandoc” as a library without having to install any of the
> numerous inputs to “ghc-pandoc” (and their inputs):
>
> ~~
> ./pre-inst-env guix environment --ad-hoc ghc ghc-pandoc
> […]
> rekado in guix-wip [env]: ghci
> GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
> Prelude> import Text.Pandoc
> Prelude Text.Pandoc> readMarkdown def "Hello"
> Right (Pandoc (Meta {unMeta = fromList []}) [Para [Str "Hello"]])
> Prelude Text.Pandoc> :q
> Leaving GHCi.
> rekado in guix-wip [env]:
> ~~

Nice. Thanks for checking.



[PATCH 1/2] gnu: Do not propagate inputs in haskell.scm.

2016-10-01 Thread Federico Beffa
Ricardo Wurmus  writes:

> * gnu/packages/haskell.scm
> (ghc-streaming-commons)[propagated-inputs]: Move ghc-random...
> [inputs]: ...to here; remove ghc-async, add ghc-directory, add
> ghc-transformers; move ghc-quickcheck, ghc-hspec...
> [native-inputs]: ...to here; add hspec-discover.
>
> (ghc-test-framework)[propagated-inputs]: Move all from here...
> [inputs]: ...to here; move ghc-hunit and ghc-quickcheck...
> [native-inputs]: ...to here.
>
> (ghc-attoparsec)[propagated-inputs]: Move ghc-scientific...
> [inputs]: ...to here; move ghc-quickcheck, ghc-quickcheck-unicode,
> ghc-test-framework, ghc-test-framework-quickcheck2, ghc-vector...
> [native-inputs]: ...to here.
>
> (ghc-zip-archive)[propagated-inputs]: Move all inputs from here...
> [inputs]: ...to here; move ghc-hunit from here...
> [native-inputs]: ...to here.
>
> (ghc-network-uri)[inputs]: Add ghc-parsec; move ghc-hunit from here...
> [native-inputs]: ...to here.
> [propagated-inputs]: Remove.
>
> (ghc-wai)[propagated-inputs]: Move all inputs from here...
> [inputs]: ...to here; move ghc-quickcheck, ghc-hunit, and ghc-hspec from
> here...
> [native-inputs]: ...to here.  Add hspec-discover.
>
> (ghc-wai-extra)[propagated-inputs]: Remove ghc-hspec and ghc-hunit; move
> all other inputs from here...
> [inputs]: ...to here.
> [native-inputs]: Add hspec-discover, ghc-hspec, and ghc-hunit.
>
> (ghc-resourcet, ghc-xss-sanitize, ghc-parsec, ghc-vector, ghc-http,
> ghc-base-compat, ghc-base-orphans, ghc-word8)[inputs]: Move all inputs
> from here...
> [native-inputs]: ...to here.
>
> (ghc-haddock-library, ghc-hspec-contrib, ghc-base-compat,
> ghc-base-orphans, ghc-fast-logger, ghc-word8, ghc-aeson-qq,
> ghc-logging-facade, ghc-mockery, ghc-yaml, ghc-hslua)[native-inputs]:
> Add hspec-discover.
>
> (ghc-fast-logger)[inputs]: Move ghc-hspec from here...
> [native-inputs]: ...to here.
>
> (ghc-data-default,
> ghc-data-default-instances-base,
> ghc-data-default-instances-containers,
> ghc-data-default-instances-dlist,
> ghc-haddock-api,
> ghc-happy,
> ghc-haskell-src-exts,
> ghc-resourcet,
> ghc-xss-sanitize,
> ghc-sdl-mixer,
> ghc-sdl-image,
> ghc-glut,
> ghc-gluraw,
> ghc-opengl,
> cpphs,
> ghc-old-time,
> ghc-data-default-instances-old-locale,
> cabal-install,
> ghc-x11,
> ghc-x11-xft,
> ghc-hashable,
> ghc-test-framework-hunit,
> ghc-test-framework,
> ghc-tf-random,
> ghc-transformers-base,
> ghc-unix-time,
> ghc-http-types,
> ghc-iproute,
> ghc-regex-base,
> ghc-regex-posix,
> ghc-regex-tdfa-rc,
> ghc-parsers,
> ghc-trifecta,
> ghc-distributive,
> ghc-comonad,
> ghc-polyparse,
> ghc-profunctors,
> ghc-reducers,
> ghc-xml,
> ghc-exceptions,
> ghc-temporary,
> ghc-temporary-rc,
> ghc-smallcheck,
> ghc-tasty-ant-xml,
> ghc-quickcheck-instances,
> ghc-quickcheck,
> ghc-case-insensitive,
> ghc-chasingbottoms,
> ghc-unordererd-containers,
> ghc-uniplate,
> ghc-ansi-wl-pprint,
> ghc-parsec,
> ghc-vector,
> ghc-vector-binary-instances,
> ghc-http,
> ghc-hspec,
> ghc-hspec-contrib,
> ghc-hspec-core,
> ghc-hspec-meta,
> ghc-vault,
> ghc-monad-control,
> ghc-blaze-builder,
> ghc-blaze-markup,
> ghc-blaze-html,
> ghc-async,
> ghc-optparse-applicative,
> ghc-charset,
> ghc-void,
> ghc-kan-extensions,
> ghc-statevar,
> ghc-lens,
> ghc-cheapskate,
> ghc-semigroupoids,
> ghc-contrvariant,
> ghc-semigroups,
> ghc-free,
> ghc-adjunctions,
> ghc-fast-logger,
> ghc-doctest,
> ghc-lifted-base,
> ghc-tasty-quickcheck,
> ghc-tasty-golden,
> ghc-tasty,
> ghc-cookie,
> ghc-scientific,
> ghc-aeson,
> ghc-wai-logger,
> ghc-pandoc-types,
> ghc-texmath,
> ghc-regex-pcre-builtin,
> ghc-highlighting-kate,
> ghc-cmark,
> ghc-enclosed-exceptions,
> ghc-th-lift,
> ghc-th-expand-syns,
> ghc-th-reify-many,
> ghc-th-orphans,
> ghc-haskell-src-meta,
> ghc-aeson-qq,
> ghc-conduit,
> ghc-mockery,
> ghc-yaml,
> ghc-filemanip,
> ghc-juicypixels,
> ghc-hslua,
> ghc-mime-types,
> ghc-http-client,
> ghc-hourglass,
> ghc-pem,
> ghc-asn1-types,
> ghc-asn1-encoding,
> ghc-asn1-parse,
> ghc-tasty-kat,
> ghc-cryptonite,
> ghc-x509,
> ghc-x509-store,
> ghc-x509-validation,
> ghc-x509-system,
> ghc-tls,
> ghc-socks,
> ghc-connection,
> ghc-http-client-tls,
> ghc-pandoc)[propagated-inputs]: Move inputs from here...
> [inputs]: ...to here.
> ---
>  gnu/packages/haskell.scm | 543 
> ++-
>  1 file changed, 257 insertions(+), 286 deletions(-)
>
> diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
> index 3bd3e14..d79dfd6 100644
> --- a/gnu/packages/haskell.scm
> +++ b/gnu/packages/haskell.scm
> @@ -342,7 +342,7 @@ reduce @code{UndecidableInstances}.")
> (sha256
>  (base32 "0d1hm0l9kim3kszshr4msmgzizrzha48gz2kb7b61p7n3gs70m7c"
>  (build-system haskell-build-system)
> -(propagated-inputs
> +(inputs
>   `(("ghc-data-default-class"
>  ,ghc-data-default-class)
> ("ghc-data-default-instances-base"
> @@ -394,7 +394,7 @@ packages.")
> (sha256
>  (base32 "1832nq6by91f1iw73ycvkbgn8kpra83pvf2q6

Re: propagating inputs in ghc-* packages

2016-10-01 Thread Federico Beffa
>> Ricardo Wurmus  writes:
>>
>>> Hi Guix,
>>>
>>> I’m in the middle of upgrading our Haskell packages.  (Actually, I’m
>>> just yak shaving.  I need “pandoc-citeproc” for “r-knitr”…)
>>>
>>> I noticed that upgrading Haskell packages is a pain in the neck because
>>> of propagated inputs.  It seems that not all packages have fully
>>> declared dependencies and just work accidentally because of propagated
>>> inputs of a related package.  This also makes upgrades more difficult
>>> because I can get substitutes from Hydra that depend on older versions
>>> of some Haskell packages.
>>>
>>> It looks like Haskell binaries actually embed references to other
>>> Haskell packages, so I’m not sure we actually need to propagate anything
>>> at all.  Could someone please confirm this?
>>
>> From what I recall, binary executables include references to packages,
>> but libraries do not.  So, at least at the time I wrote the first
>> version of the haskell-build-system, propagated inputs seemed to be
>> necessary for packages providing libraries, but not for ones providing
>> applications.
>
> Thanks for this comment.  With Eric Bavier’s patch this seems no longer
> necessary.  I’ve already rebuilt a lot of Haskell packages without any
> propagation (and some added inputs), and I’ve got working libraries and
> executables.  I’m still rebuilding remaining Haskell packages but I’m
> now convinced that propagation is no longer needed with the current
> version of the build system.
>
> I’m preparing a patch to remove propagation from all Haskell packages.
> Now the question is only whether to do this all in one patch or in one
> patch per package… :)

That sounds great! Just to be sure: you are saying that if you install
any library (call it A) and the GHC compiler into your profile then you
are able to compile your program (making use of library A) without
also having to manually install any input of library A?

Regards,
Fede



propagating inputs in ghc-* packages

2016-09-30 Thread Federico Beffa
Ricardo Wurmus  writes:

> Hi Guix,
>
> I’m in the middle of upgrading our Haskell packages.  (Actually, I’m
> just yak shaving.  I need “pandoc-citeproc” for “r-knitr”…)
>
> I noticed that upgrading Haskell packages is a pain in the neck because
> of propagated inputs.  It seems that not all packages have fully
> declared dependencies and just work accidentally because of propagated
> inputs of a related package.  This also makes upgrades more difficult
> because I can get substitutes from Hydra that depend on older versions
> of some Haskell packages.
>
> It looks like Haskell binaries actually embed references to other
> Haskell packages, so I’m not sure we actually need to propagate anything
> at all.  Could someone please confirm this?

>From what I recall, binary executables include references to packages,
but libraries do not.  So, at least at the time I wrote the first
version of the haskell-build-system, propagated inputs seemed to be
necessary for packages providing libraries, but not for ones providing
applications.

Regards,
Fede



Re: hackage importer problem

2016-08-26 Thread Federico Beffa
John J Foerch  writes:

> Hello,
>
> I'm seeing a problem with the hackage importer with the git-annex
> package:
>
>   $ guix import hackage git-annex
>   Syntax error: unexpected token : custom-setup (at line 316, column 0)
>   Syntax error: unexpected end of input
>   guix import: error: failed to download cabal file for package 'git-annex'
>
> git-annex.cabal is here:
>
>   http://hackage.haskell.org/package/git-annex-6.20160808/git-annex.cabal
>
> Is it a bug in the importer?

Hi,

the hackage importer only support packages using 'Build-type' of
type 'Simple'.  The packages in question uses a 'Build-type' of type
'Custom'.  See

https://www.haskell.org/cabal/users-guide/developing-packages.html#package-descriptions

I've not studied the variant 'Custom' of 'Build-type', so I could be
wrong.  But, looking at the 'git-annex' Cabal file the only offending
part is the section starting with the header 'custom-setup' on line
316.  Making the parser recognize this type of section should not be
too difficult.  If you are interested, take a look at the file
'guix/build/cabal.scm', line 149.  That's where we define the tokens for
the supported section types and where a new section of type
'custom-build' would have to be added (with related functions).

Regards,
Fede



[patch] python-numpy, python-matplotlib and openblas update, python-cycler added

2016-07-31 Thread Federico Beffa
Pjotr Prins  writes:

> Attached bumping of python-numpy, openblas and python-matplotlib. New
> package python-cycler.
>
[...]
> - matplotlib and ipython now have a circular dependency - so I removed
>   one and had to disable document generation for matplotlib

We value documentation and welcome efforts to provide/keep it.  An often
working workaround for circular dependencies is to use bootstrap
packages.  One example is the circular dependency between python-numpy
and python-matplotlib.  The former need the latter to build its
documentation, so we have an (unexported) python-numpy-bootstrap to work
around that.

Regards,
Fede



Gs

2016-07-23 Thread Federico Beffa
Andreas Enge  writes:

> Hello,
>
> the following commit
> commit eb354bdacbf4154ec66038dac07f19bf4ced1fad
> Author: Ludovic Courtès 
> Date:   Mon May 9 15:54:34 2016 +0200
>
> gnu: ghostscript: Do not build the statically-linked 'gs' binary.
>
> * gnu/packages/ghostscript.scm (ghostscript)[arguments]: Remove
> 'build-so' and 'install-so' phases.  Replace 'build' and 'install'
> phases.
>
> removes "gs" from the ghostscript package. However, this is the usual program
> that people expect. For instance, unison uses it for building its
> documentation. Is there a dynamically linked binary which replaces gs?
> If yes, should we add a symbolic link?
>
> If not, I would suggest to revert this commit.
>
> Ceterum censeo that we should not optimise for size by sacrificing
> functionality and ease of handling (cf. separate outputs).

+1

This broke 'chez-scheme' as well on core-updates.

Fede



Re: [PATCH] gnu: texlive: Fix 'texmf-local' search path.

2016-07-06 Thread Federico Beffa
pushed to core-updates



Re: [PATCH] gnu: texlive: Fix 'texmf-local' search path.

2016-06-20 Thread Federico Beffa
On Mon, Jun 20, 2016 at 10:58 AM, Andreas Enge  wrote:
> Hello Fede,
>
> apologies for not coming back to you earlier, I have little occasion to
> work on Guix right now.
>
> On Sun, Jun 12, 2016 at 10:56:40AM +0200, Federico Beffa wrote:
>>  (substitute* texmfcnf
>>(("TEXMFROOT = \\$SELFAUTOPARENT")
>> -  (string-append "TEXMFROOT = " share)))
>> +   (string-append "TEXMFROOT = " share))
>> +  (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
>> +   "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
>> +  (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
>
> As said before, this change should be benign, but also without effect:
> It still points to some place in the store, actually to the directory
>/gnu/store/...-texlive-2015/share/texmf-local ,
> which does not exist.

Hi Andreas,

you are right, TEXMFLOCAL does still point to a nonexistent store
directory, but it is the "right" directory inside of the texlive
package tree. Without this it points to a location outside of every
package/profile tree.  Consider it an aesthetics improvement ;-)

> If we keep it, for clarity I would use
>TEXMFLOCAL = $TEXMFROOT/texmf-local
> (as for the other variables defined around it), and add a comment that this
> declaration does not actually come into effect.

I think $SELFAUTODIR is the recommended way (in the TeXLive doc and in
comments inside of texmfcnf), but if you prefer we can use TEXMFROOT.

Note that the last entry in 'substitute*' is not just cosmetic: It
instructs TeX & friends not to look for ls-r databases, but to scan
the directory tree. If we would keep the '!!' prefixes to TEXMFLOCAL,
it would not work without adding a profile hook to generate the ls-r
database. As long as we do not have a large set of packages installing
into share/texmf-local, the speed penalty should be essentially
unnoticeable.

> I agree that this is a cleaner solution; maybe texmfcnf.lua needs to be
> adapted as well?

I have no idea about the purpose of this file. I don't find it
mentioned in the documentation
https://www.tug.org/texlive/doc/texlive-en/texlive-en.pdf. What is it
for?

>> +   (native-search-paths
>> +(list (search-path-specification
>> +(variable "TEXMFLOCAL")
>> +(files '("share/texmf-local")
>
> This seems to be the main goal of your patch: By redefining TEXMFLOCAL in the
> profile, it will point to $HOME/.guix-profile/share/texmf-local. So if we add
> packages to the distribution that put data there, it should be available to
> texlive. Do you have an example package in mind? Does it work? Currently
> I cannot test it on my machine.

Yes, correct. However, as explained before, it only works in
conjunction with the removal of the '!!' prefix in texmfcnf.

The attached file includes a package called 'chez-web' which installs
a TeX macro. The package 'chez-sockets' makes use of the former and
does work as expected.

>
> There would be an alternative for people running Guix on top of another
> distro: We could set TEXMFLOCAL to /usr/share/texmf; then system installed
> texlive data could be used. This would work as long as the search path is
> not overwritten by a Guix installed package (which we do not have so far).

Personally I would prefer to avoid explicit cross-referencing between
Guix packages and non-Guix ones.

Regards,
Fede

P.S.: I have the package definitions in a local module. If you want to
try the packages I can share it with you. In the future I may send
patches to include them in Guix proper.
(define-public chez-web
  (package
(name "chez-web")
;; release 2.0 is different and doesn't work.
(version "2.0-1.5fd177f")
(source
 (origin
   (method git-fetch)
   (uri (git-reference
 (url "https://github.com/arcfide/ChezWEB.git";)
 (commit "5fd177fe53f31f466bf88720d03c95a3711a8bea")))
   (sha256
(base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b"
(build-system gnu-build-system)
(native-inputs
 `(("chez-scheme" ,chez-scheme)
   ("texlive" ,texlive)))
(arguments
 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
  (list (string-append "PREFIX=" out)
(string-append "DOCDIR=" out "/share/doc/"
   ,name "-" ,version)
(string-append "LIBDIR=" out "/lib/chezweb")
(str

[PATCH] gnu: texlive: Fix 'texmf-local' search path.

2016-06-12 Thread Federico Beffa
see https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00122.html

Fede
From 0e1a6b04d0180c427aa3c4298084ff0c495c9ff9 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Sun, 12 Jun 2016 09:49:06 +0200
Subject: [PATCH] gnu: texlive: Fix 'texmf-local' search path.

* gnu/packages/texlive.scm (texlive, texlive-minimal): Add
  'native-search-paths'.
  (texlive-texmf): Correct 'TEXMFLOCAL' definition in 'texmf.cnf' in
  'texmf-config' phase.
---
 gnu/packages/texlive.scm | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm
index cbcb6c8..cc61f9e 100644
--- a/gnu/packages/texlive.scm
+++ b/gnu/packages/texlive.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge 
 ;;; Copyright © 2014 Eric Bavier 
 ;;; Copyright © 2015 Mark H Weaver 
+;;; Copyright © 2016 Federico Beffa 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -203,7 +204,10 @@ This package contains the binaries.")
 ;; Register SHARE as TEXMFROOT in texmf.cnf.
 (substitute* texmfcnf
   (("TEXMFROOT = \\$SELFAUTOPARENT")
-  (string-append "TEXMFROOT = " share)))
+   (string-append "TEXMFROOT = " share))
+  (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
+   "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
+  (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
 ;; Register paths in texmfcnf.lua, needed for context.
 (substitute* (string-append texmfroot "/texmfcnf.lua")
   (("selfautodir:") out)
@@ -238,6 +242,10 @@ This package contains the complete tree of texmf-dist data.")
(inputs `(("bash" ,bash) ; for wrap-program
  ("texlive-bin" ,texlive-bin)
  ("texlive-texmf" ,texlive-texmf)))
+   (native-search-paths
+(list (search-path-specification
+(variable "TEXMFLOCAL")
+(files '("share/texmf-local")
(arguments
 `(#:modules ((guix build utils))
   #:builder
@@ -349,6 +357,10 @@ This package contains a small subset of the texmf-dist data.")))
(inputs
 `(("texlive-texmf" ,texlive-texmf-minimal)
   ,@(alist-delete "texlive-texmf" (package-inputs texlive
+   (native-search-paths
+(list (search-path-specification
+(variable "TEXMFLOCAL")
+(files '("share/texmf-local")
(description
 "TeX Live provides a comprehensive TeX document production system.
 It includes all the major TeX-related programs, macro packages, and fonts
-- 
2.7.4



Re: build -K environment-variables

2016-06-04 Thread Federico Beffa
On Sat, Jun 4, 2016 at 9:46 PM, Thompson, David
 wrote:
> On Sat, Jun 4, 2016 at 12:23 PM, Federico Beffa  wrote:
>> Hi,
>>
>> the content of the 'environment-variables' file left after a failed
>> build do look odd...
>>
>> $ pwd
>> /tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-2
>> $ cat environment-variables | grep "drv-0"
>> export NIX_BUILD_TOP="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
>> export PWD="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0/source"
>> export TEMP="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
>> export TEMPDIR="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
>> export TMP="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
>> export TMPDIR="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
>
> What is odd about them?

That the files are placed into /tmp/drv-2, but the variables point
to /tmp/...drv-0.

Fede



Re: texlive problems

2016-06-04 Thread Federico Beffa
On Sat, Jun 4, 2016 at 8:16 PM, Andreas Enge  wrote:
> Hi Fede,
>
> On Sat, Jun 04, 2016 at 06:45:46PM +0200, Federico Beffa wrote:
>> I've found a couple of problems with our TeXLive package:
>> * the directory dedicated to local packages is configured to:
>>   /gnu/texmf-local
>>   The standard location is $prefix/texmf-local
>>   You can check it with, e.g., 'kpsewhich --show-path=.sty'.
>
> as I understand it, this directory is simply not used in our installation.
> (So the variable is wrong, but it does not matter.) It is supposed to be
> used by system administrators installing packages for all users. In our case,
> I do not quite see which directory we would like to use for that; if Guix
> is installed on another LFS distribution, we could use /usr/local/texmf or
> something similar. It cannot be $prefix/whatever, as the store is immutable.
>
> Right now, individual users should install tex things into
> $HOME/.texlive2015. For instance,
> $HOME/.texlive2015/texmf-var/tex/latex/beamerouterthemexyz.sty.

Say package A provides $prefix/texmf-local/tex/generic/my-A.tex and
package B $prefix/texmf-local/tex/generic/my-B.tex. When they are
installed in a profile they get collected into
$guix-profile/texmf-local/tex/generic/.

Local files could then be searched in $guix-profile/texmf-local.

Regards,
Fede



texlive problems

2016-06-04 Thread Federico Beffa
Hi,

I've found a couple of problems with our TeXLive package:

* the directory dedicated to local packages is configured to:
  /gnu/texmf-local
  The standard location is $prefix/texmf-local
  You can check it with, e.g., 'kpsewhich --show-path=.sty'.

* The 3rd party files installed in that directory (once fixed) are
only found if there is a the database file 'ls-r'. This would probably
require a profile hook. Another way may possibly be to remove the '!!'
in front of the path in the following definition (untested)

TEXMF = 
{$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFDIST}

in the main texmf.cnf file.

Regards,
Fede



build -K environment-variables

2016-06-04 Thread Federico Beffa
Hi,

the content of the 'environment-variables' file left after a failed
build do look odd...

$ pwd
/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-2
$ cat environment-variables | grep "drv-0"
export NIX_BUILD_TOP="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
export PWD="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0/source"
export TEMP="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
export TEMPDIR="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
export TMP="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"
export TMPDIR="/tmp/guix-build-chez-sockets-0.0-1.f90e817.drv-0"

Regards,
Fede



guix ignores --no-substitutes

2016-05-30 Thread Federico Beffa
Hi,

I find that Guix still contacts home even when passed the
'--no-substitutes' flag:

$ ./pre-inst-env guix build --no-substitutes chez-sockets
substitute: updating list of substitutes from
'https://mirror.hydra.gnu.org'... substitute: updating list of
substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
substitute: updating list of substitutes from 'https://hydra.gnu.org'... 100.0%
@ build-started ...

It would be desirable to avoid all calls home with that flag.

Regards,
Fede



Re: Why do we use ".../share/emacs/site-lisp/guix.d/"?

2016-05-21 Thread Federico Beffa
On Fri, May 20, 2016 at 11:00 PM, Alex Kost  wrote:
> Federico Beffa (2016-05-20 09:53 +0300) wrote:
>

[...]

>> (note 1): If you want an example look at emacs-slime.
>
> Sorry, I really don't understand what you want to illustrate with this
> example.

a package which includes sub-directories not including .el files.

>
>> Because I
>> prepared that package, I decided to use the emacs-build-system and so
>> the extra sub-directory doesn't reside directly under site-lisp.  But it
>
> What extra sub-directory do you mean?  Currently the package is
> installed in:
>
>   .../share/emacs/site-lisp/guix.d/slime-2.15/
>
> If we remove "guix.d", it will be:
>
>   .../share/emacs/site-lisp/slime-2.15/
>
> So what's the problem?

you can't distinguish it from a package installed with, say,
gnu-build-system including non elisp sub-directories. And you made
examples of them and said that you would prefer not to "fix" them.

I think you are missing the whole idea of the emacs-build-system. It
is intended to replicate the behavior of Emacs's packaging system,
that is to be used with emacs package tar files only. Emacs packages
are installed in ~.emacs.d/elpa and they are packaged do include
non-elisp files because Emacs run as a user has no permission to put
them in system locations. The  emacs-build-system simply replaces
~/.emacs.d/elpa with ~/.guix-profile/share/emacs/site-lisp/guix.d.
That's all. For the rest the two systems are intended to behave the
same. If you change the location of files it's likely that the
packages will not work and you open a can of worms with infinite
fixes.

Regards,
Fede



[PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.

2016-05-20 Thread Federico Beffa
Alex Kost  writes:

> * guix/build-system/emacs.scm (lower): Do not add "emacs" to
>   build-inputs if it is already specified in the native-inputs.
> @@ -73,8 +75,16 @@
>
>  ;; Keep the standard inputs of 'gnu-build-system'.
>  ,@(standard-packages)))
> - (build-inputs `(("emacs" ,emacs)
> - ,@native-inputs))
> + ;; Add emacs to build-inputs only if native-inputs do not contain
> + ;; emacs already.  This allows us to use non-default emacs for
> + ;; building.
> + (build-inputs (if (find (match-lambda
> +   (("emacs" _ ...) #t)
> +   (_ #f))
> + native-inputs)
> +   native-inputs
> +   `(("emacs" ,emacs)
> + ,@native-inputs)))

Note that for the interpreter we normally use a keyword, here #:emacs
(in a similar way as, say, for the python-build-system there is
#:python).  Your code overwrites its effect in a non-transparent way.

Please use the keyword in the packages where you need an emacs package
different from the default one, or remove all the code related to the
keyword.  If you opt for the second one, please be consistent and do the
same for all other build systems.

Fede



Re: Why do we use ".../share/emacs/site-lisp/guix.d/"?

2016-05-19 Thread Federico Beffa
l...@gnu.org (Ludovic Courtès) writes:

> Alex Kost  skribis:
>
>> Ludovic Courtès (2016-05-17 00:15 +0300) wrote:
>>
>>> Alex Kost  skribis:

[...]

>>> Federico suggests above that having “guix.d” makes it clear that a
>>> non-Guix-installed Emacs on a foreign distro may not be able to use
>>> those packages.
>>
>> I don't see how this makes it more clear.  Of course a
>> non-Guix-installed Emacs knows nothing about packages installed in a
>> Guix profile.  As for me, "~/.guix-profile" is already clear enough, and
>> there is no reason to add another "guix"-containing name part to the
>> file hierarchy.
>
> I see, I get your point, and I think I concur.
>
> Federico: is there anything we’re missing from your argument?

Given that the first point that I made appears to have been ignored, I
would think so.

Let me try to explain it once more:

There are packages which do have sub-directories containing only non
elisp files (note 1) and which therefore should not be included in
Emacs's load-path.  If you remove guix.d as you are suggesting, you can
end up with a directory layout as follows:

package-NOT-installed-with-emacs-build-system-a.el
package-NOT-installed-with-emacs-build-system-a/
package-NOT-installed-with-emacs-build-system-b.el
package-installed-with-emacs-build-system-c/
package-installed-with-emacs-build-system-d/

How can you tell which sub-directory to include in Emacs's load-path
without having to scan all of them or relying on heuristics?

Differently from this with the guix.d directory it is very clear:

package-NOT-installed-with-emacs-build-system-a.el
package-NOT-installed-with-emacs-build-system-a/
package-NOT-installed-with-emacs-build-system-b
guix.d/package-installed-with-emacs-build-system-c/
guix.d/package-installed-with-emacs-build-system-d/

you only include '.' (site-lisp) and one level below guix.d.

So, removing guix.d could result in additional directories being
included in Emacs's load-path, or could require a more sophisticated
heuristic strategy to decide which sub-directory to include.  These are
not catastrophic things, but in my opinion plain bad.

The proposed change is a change for the sake of changing things: it does
not provide any tangible technical improvement.  On the contrary, beside
the above, it will break existing installations where people have the
current Emacs package installed and will install a new package without
updating Emacs itself.

Fede

(note 1): If you want an example look at emacs-slime.  Because I
prepared that package, I decided to use the emacs-build-system and so
the extra sub-directory doesn't reside directly under site-lisp.  But it
is likely that there are other similar packages and somebody else may
prefer to install it with a build system other than the
emacs-build-system (using a provided Makefile).



Re: constants.el 2.2 no longer available

2016-05-17 Thread Federico Beffa
Updated with commits f99f3f2 and 1c29f3e.

Regards,
Fede

On Mon, May 16, 2016 at 10:51 PM, Ludovic Courtès  wrote:
> Hello!
>
> The ‘constants.el’ file that ‘emacs-constants’ refers to is no longer
> available:
> 
> currently provides version 2.6 (was 2.2), and
> ‘emacs-constants-elisp.patch’ no longer applies.
>
> Could you look into it?
>
> Thanks in advance.  :-)
>
> Ludo’.



Re: [PATCH 2/2] gnu: netpbm: Fix location of X color name database.

2016-05-16 Thread Federico Beffa
On Sun, May 15, 2016 at 10:04 PM, Ludovic Courtès  wrote:
> Alex Kost  skribis:
>
>> I think it would also be good to add #t to the end of all these phases
>> to make sure that when the phases succeed, they return non-false value.
>
> Agreed.
>
> Federico: Please commit to ‘core-updates’, since many many things depend
> on netpbm.

I noticed ;-)



Re: [PATCH 2/2] gnu: netpbm: Fix location of X color name database.

2016-05-16 Thread Federico Beffa
On Sat, May 14, 2016 at 6:25 PM, Alex Kost  wrote:
> Federico Beffa (2016-05-13 21:44 +0300) wrote:
>
>> On Fri, May 13, 2016 at 7:10 PM, Andreas Enge  wrote:
>>> Hello,
>>>
>>> On Fri, May 13, 2016 at 06:51:27PM +0200, Federico Beffa wrote:
>>>> This fixes some of the provided programs like, e.g. 'pamtogif'.
>>>
>>> I think the common practice is to separate the switch to the %modify-phases
>>> syntax and the real change into two commits; right now, the diff looks big,
>>> but I imagine it must be rather trivial.
>>
>> Indeed the change is trivial.
>>
>> Regards,
>> Fede
>>
>> From be37669b50c000ad45eb85075f32d4f23c26489d Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Fri, 13 May 2016 15:32:49 +0200
>> Subject: [PATCH 2/3] gnu: netpbm: Use 'modify-phases' syntax.
>>
>> * gnu/packages/netpbm.scm (netpbm)[arguments]: Do it.
>> ---
>>  gnu/packages/netpbm.scm | 86 
>> -
>>  1 file changed, 42 insertions(+), 44 deletions(-)
>>
>> diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
>> index 475635e..d7d8576 100644
>> --- a/gnu/packages/netpbm.scm
>> +++ b/gnu/packages/netpbm.scm
>> @@ -99,50 +99,48 @@
>> ("python" ,python-wrapper)))
>> (arguments
>>  `(#:phases
>> -  (alist-replace
>> -   'configure
>> -   (lambda _
>> -(copy-file "config.mk.in" "config.mk")
>> -(chmod "config.mk" #o664)
>> -(let ((f (open-file "config.mk" "a")))
>> - (display "CC=gcc\n" f)
>> - (display "CFLAGS_SHLIB += -fPIC\n" f)
>> - (display "TIFFLIB = libtiff.so\n" f)
>> - (display "JPEGLIB = libjpeg.so\n" f)
>> - (display "ZLIB = libz.so\n" f)
>> - (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
>> - (close-port f)))
>> -  (alist-cons-before
>> -   'check 'setup-check
>> -   (lambda _
>> - ;; install temporarily into /tmp/netpbm
>> - (system* "make" "package")
>> - ;; remove test requiring X
>> - (substitute* "test/all-in-place.test" (("pamx") ""))
>> - ;; do not worry about non-existing file
>> - (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
>> - ;; remove four tests that fail for unknown reasons
>> - (substitute* "test/Test-Order"
>> -   (("all-in-place.test") "")
>> -   (("pnmpsnr.test") "")
>> -   (("pnmremap1.test") "")
>> -   (("gif-roundtrip.test") "")))
>> -  (alist-replace
>> -   'install
>> -   (lambda* (#:key outputs make-flags #:allow-other-keys)
>> -(let ((out (assoc-ref outputs "out")))
>> - (apply system* "make" "package"
>> -(string-append "pkgdir=" out) make-flags)
>> - ;; copy static library
>> - (copy-file (string-append out "/link/libnetpbm.a")
>> -(string-append out "/lib/libnetpbm.a"))
>> - ;; remove superfluous folders and files
>> - (system* "rm" "-r" (string-append out "/link"))
>> - (system* "rm" "-r" (string-append out "/misc"))
>> - (with-directory-excursion out
>> -   (for-each delete-file
>> - '("config_template" "pkginfo" "README" "VERSION")
>> -  %standard-phases)
>> +  (modify-phases %standard-phases
>> +   (replace 'configure
>> + (lambda* (#:key inputs outputs #:allow-other-keys)
>> +   (copy-file "config.mk.in" "config.mk")
>> +   (chmod "config.mk" #o664)
>> +   (let ((f (open-file "config.mk" "a")))
>> + (display "CC=gcc\n" f)
>> + (display "CFLAGS_SHLIB += -fPIC\n" f)
>> + (display "TIFFLIB = libtiff.so\n" f)
>> + (display "JPEGLIB = libjpeg.so\n" f)
>> + (display "ZLIB = libz

Re: [PATCH] gnu: Add Chez-Scheme.

2016-05-14 Thread Federico Beffa
On Sat, May 14, 2016 at 9:28 AM, Federico Beffa  wrote:
> On Sat, May 14, 2016 at 4:51 AM, Leo Famulari  wrote:
>> On Fri, May 13, 2016 at 10:44:28PM +0200, Andreas Enge wrote:
>>> Hi Fede,
>>>
>>> just a tiny comment, as I do not have more time right now:
>>>
>>> On Fri, May 13, 2016 at 09:03:25PM +0200, Federico Beffa wrote:
>>> > There is no official release yet, so I took a snapshot of the git
>>> > repo. We can switch later.
>>> > +(define-public chez-scheme
>>> > +  (package
>>> > +(name "chez-scheme")
>>> > +(version "20160512.41d94b07")
>>>
>>> Did we not decide  on a convention that was "previous version + git commit",
>>> something like "0.0.0-41d94b07", so that the version numbers will increase
>>> with the next (or first) release and upgrades will be smooth?
>>
>> Yes, the manual describes it in 7.6.3 Version Numbers:
>>
>> https://www.gnu.org/software/guix/manual/guix.html#Version-Numbers
>
> Officially this is version 9.4 and I suppose the coming release will
> have that number. I will then use 9.3-1.41d94b07 so that going to 9.4
> will be seen as an upgrade.

Well, the new release has just appeared :-) So I will switch to it immediately.

Regards,
Fede



Re: [PATCH] gnu: Add Chez-Scheme.

2016-05-14 Thread Federico Beffa
On Sat, May 14, 2016 at 4:51 AM, Leo Famulari  wrote:
> On Fri, May 13, 2016 at 10:44:28PM +0200, Andreas Enge wrote:
>> Hi Fede,
>>
>> just a tiny comment, as I do not have more time right now:
>>
>> On Fri, May 13, 2016 at 09:03:25PM +0200, Federico Beffa wrote:
>> > There is no official release yet, so I took a snapshot of the git
>> > repo. We can switch later.
>> > +(define-public chez-scheme
>> > +  (package
>> > +(name "chez-scheme")
>> > +(version "20160512.41d94b07")
>>
>> Did we not decide  on a convention that was "previous version + git commit",
>> something like "0.0.0-41d94b07", so that the version numbers will increase
>> with the next (or first) release and upgrades will be smooth?
>
> Yes, the manual describes it in 7.6.3 Version Numbers:
>
> https://www.gnu.org/software/guix/manual/guix.html#Version-Numbers

Officially this is version 9.4 and I suppose the coming release will
have that number. I will then use 9.3-1.41d94b07 so that going to 9.4
will be seen as an upgrade.

Regards,
Fede



[PATCH] gnu: Add Chez-Scheme.

2016-05-13 Thread Federico Beffa
There is no official release yet, so I took a snapshot of the git
repo. We can switch later.

Regards,
Fede
From ccbc4ed7b9e92823b60d6ed17cf3320585f018b7 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Thu, 12 May 2016 14:57:25 +0200
Subject: [PATCH] gnu: Add Chez-Scheme.

* gnu/packages/scheme.scm (chez-scheme): New variable.
---
 gnu/packages/scheme.scm | 145 +++-
 1 file changed, 144 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 6cf75c2..86c099c 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -22,15 +22,20 @@
 
 (define-module (gnu packages scheme)
   #:use-module (gnu packages)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages emacs)
+  #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages netpbm)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages texlive)
   #:use-module (gnu packages base)
@@ -544,6 +549,144 @@ an isolated heap allowing multiple VMs to run simultaneously in different OS
 threads.")
 (license bsd-3)))
 
+(define nanopass
+  (let ((version "1.9"))
+(origin
+  (method url-fetch)
+  (uri (string-append
+"https://github.com/nanopass/nanopass-framework-scheme/archive";
+"/v" version ".tar.gz"))
+  (sha256 (base32 "11pwyy4jiwhcl2am3a4ciczacjbjkyvdizqzdglb3l1hj2gj6nv2"))
+  (file-name (string-append "nanopass-" version ".tar.gz")
+
+(define stex
+  (let ((version "1.2"))
+(origin
+  (method url-fetch)
+  (uri (string-append
+"https://github.com/dybvig/stex/archive";
+"/v" version ".tar.gz"))
+  (sha256 (base32 "0hswmckvbyzy9crj51fy4q14zprh56kvx08sj9r47vm6zkb30mki"))
+  (file-name (string-append "stex-" version ".tar.gz")
+
+(define-public chez-scheme
+  (package
+(name "chez-scheme")
+(version "20160512.41d94b07")
+(source
+ (origin
+   (method git-fetch)
+   (uri (git-reference
+ (url "https://github.com/cisco/ChezScheme.git";)
+ (commit "41d94b0793997e3b90c10d6d28aaa4e2d43857cc")))
+   (sha256
+(base32 "18cg1r0csw1fmsndw1y2hks630q16yf8vl3jvbrbgcg1c8l4hn10"))
+   (file-name (string-append "chez-scheme-" version ".tar.gz"
+(build-system gnu-build-system)
+(inputs
+ `(("ncurses" ,ncurses)
+   ("libx11" ,libx11)
+   ("xorg-rgb" ,xorg-rgb)
+   ("nanopass" ,nanopass)
+   ("zlib" ,zlib)
+   ("stex" ,stex)))
+(native-inputs
+ `(("texlive" ,texlive)
+   ("ghostscript" ,ghostscript)
+   ("netpbm" ,netpbm)))
+(outputs '("out" "doc"))
+(arguments
+ `(#:modules ((guix build gnu-build-system)
+  (guix build utils)
+  (ice-9 match))
+   #:test-target "test"
+   #:phases
+   (modify-phases %standard-phases
+ ;; Adapt the custom 'configure' script.
+ (replace 'configure
+   (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+   (nanopass (assoc-ref inputs "nanopass"))
+   (stex (assoc-ref inputs "stex"))
+   (zlib (assoc-ref inputs "zlib"))
+   (unpack (assoc-ref %standard-phases 'unpack))
+   (patch-source-shebangs
+(assoc-ref %standard-phases 'patch-source-shebangs)))
+   (map (match-lambda
+  ((src orig-name new-name)
+   (with-directory-excursion "."
+ (apply unpack (list #:source src))
+ (apply patch-source-shebangs (list #:source src)))
+   (delete-file-recursively new-name)
+   (system* "mv" orig-name new-name)))
+`((,nanopass "nanopass-framework-scheme-1.9" "nanopass")
+  (,stex "stex-1.2" "stex")))
+   ;; The Makefile wants to download and compile "zlib".  We patch
+   ;; it 

Re: [PATCH 1/2] gnu: Add the X color name database file.

2016-05-13 Thread Federico Beffa
On Fri, May 13, 2016 at 8:03 PM, Alex Kost  wrote:
> Federico Beffa (2016-05-13 19:51 +0300) wrote:
>
>> This package provides the X 'rgb.txt' color name database.  It is not
>> needed anymore by Xorg, but some packages (e.g. netpbm) still rely on
>> it.
>
> Great, thanks!  This package even has a binary (showrgb); I never knew
> this.  I have only a couple of nit-pickings that can be ignored.
>
>> From be30973db650aba34323900806adb30d2fe74b1d Mon Sep 17 00:00:00 2001
>> From: Federico Beffa 
>> Date: Fri, 13 May 2016 09:22:44 +0200
>> Subject: [PATCH 1/2] gnu: Add the X color name database file.
>>
>> * gnu/packages/xorg.scm (xorg-rgb): New variable.
>> ---
>>  gnu/packages/xorg.scm | 25 -
>>  1 file changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
>> index fd933e3..9323286 100644
>> --- a/gnu/packages/xorg.scm
>> +++ b/gnu/packages/xorg.scm
>> @@ -4281,7 +4281,30 @@ Various information is displayed depending on which 
>> options are selected.")
>>  formatted dump file, such as produced by xwd.")
>>  (license license:x11)))
>>
>> -
>> +(define-public xorg-rgb
>> +  (package
>> +(name "xorg-rgb")
>> +(version "1.0.6")
>> +(source
>> +  (origin
>> +(method url-fetch)
>> +(uri (string-append
>> +   "mirror://xorg/individual/app/rgb-"
>> +   version
>> +   ".tar.bz2"))
>
> It's your choice of course, but I would put version and ".tar.bz2" on a
> single line; I find it more good-looking in such cases.

I like better what you propose, but I've followed the style of all the
other definitions in the same file for consistency.

>
>> +(sha256
>> +  (base32
>> +"1c76zcjs39ljil6f6jpx1x17c8fnvwazz7zvl3vbjfcrlmm7rjmv"
>> +(build-system gnu-build-system)
>> +(inputs
>> +  `(("xproto" ,xproto)))
>> +(native-inputs
>> +   `(("pkg-config" ,pkg-config)))
>
> These inputs are indented too much.  I guess you made this package
> definition by copying 'xwud' (the previous one in "xorg.scm" file) and
> modifying it.  Make sure to reindent this xorg-rgb package sexp.
> Otherwise looks good to me, thanks!
>

Fixed.

Fede



Re: [PATCH 2/2] gnu: netpbm: Fix location of X color name database.

2016-05-13 Thread Federico Beffa
On Fri, May 13, 2016 at 7:10 PM, Andreas Enge  wrote:
> Hello,
>
> On Fri, May 13, 2016 at 06:51:27PM +0200, Federico Beffa wrote:
>> This fixes some of the provided programs like, e.g. 'pamtogif'.
>
> I think the common practice is to separate the switch to the %modify-phases
> syntax and the real change into two commits; right now, the diff looks big,
> but I imagine it must be rather trivial.

Indeed the change is trivial.

Regards,
Fede
From be37669b50c000ad45eb85075f32d4f23c26489d Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Fri, 13 May 2016 15:32:49 +0200
Subject: [PATCH 2/3] gnu: netpbm: Use 'modify-phases' syntax.

* gnu/packages/netpbm.scm (netpbm)[arguments]: Do it.
---
 gnu/packages/netpbm.scm | 86 -
 1 file changed, 42 insertions(+), 44 deletions(-)

diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 475635e..d7d8576 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -99,50 +99,48 @@
("python" ,python-wrapper)))
(arguments
 `(#:phases
-  (alist-replace
-   'configure
-   (lambda _
-(copy-file "config.mk.in" "config.mk")
-(chmod "config.mk" #o664)
-(let ((f (open-file "config.mk" "a")))
- (display "CC=gcc\n" f)
- (display "CFLAGS_SHLIB += -fPIC\n" f)
- (display "TIFFLIB = libtiff.so\n" f)
- (display "JPEGLIB = libjpeg.so\n" f)
- (display "ZLIB = libz.so\n" f)
- (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
- (close-port f)))
-  (alist-cons-before
-   'check 'setup-check
-   (lambda _
- ;; install temporarily into /tmp/netpbm
- (system* "make" "package")
- ;; remove test requiring X
- (substitute* "test/all-in-place.test" (("pamx") ""))
- ;; do not worry about non-existing file
- (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
- ;; remove four tests that fail for unknown reasons
- (substitute* "test/Test-Order"
-   (("all-in-place.test") "")
-   (("pnmpsnr.test") "")
-   (("pnmremap1.test") "")
-   (("gif-roundtrip.test") "")))
-  (alist-replace
-   'install
-   (lambda* (#:key outputs make-flags #:allow-other-keys)
-(let ((out (assoc-ref outputs "out")))
- (apply system* "make" "package"
-(string-append "pkgdir=" out) make-flags)
- ;; copy static library
- (copy-file (string-append out "/link/libnetpbm.a")
-(string-append out "/lib/libnetpbm.a"))
- ;; remove superfluous folders and files
- (system* "rm" "-r" (string-append out "/link"))
- (system* "rm" "-r" (string-append out "/misc"))
- (with-directory-excursion out
-   (for-each delete-file
- '("config_template" "pkginfo" "README" "VERSION")
-  %standard-phases)
+  (modify-phases %standard-phases
+   (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+   (copy-file "config.mk.in" "config.mk")
+   (chmod "config.mk" #o664)
+   (let ((f (open-file "config.mk" "a")))
+ (display "CC=gcc\n" f)
+ (display "CFLAGS_SHLIB += -fPIC\n" f)
+ (display "TIFFLIB = libtiff.so\n" f)
+ (display "JPEGLIB = libjpeg.so\n" f)
+ (display "ZLIB = libz.so\n" f)
+ (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
+ (close-port f
+   (add-before 'check 'setup-check
+ (lambda _
+   ;; install temporarily into /tmp/netpbm
+   (system* "make" "package")
+   ;; remove test requiring X
+   (substitute* "test/all-in-place.test" (("pamx") ""))
+   ;; do not worry about non-existing file
+   (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
+   ;; remove four tests that fail for unknown reasons
+   (substitute* "test/Test-Order"
+ (("all-in-place.test") "")
+ (("pnmpsnr.test") "")
+ (("pnmre

[PATCH 2/2] gnu: netpbm: Fix location of X color name database.

2016-05-13 Thread Federico Beffa
This fixes some of the provided programs like, e.g. 'pamtogif'.

Regards,
Fede
From 3658a1edfdcd21a81ea14a9627c5e8bac50bc0f8 Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Fri, 13 May 2016 15:32:49 +0200
Subject: [PATCH 2/2] gnu: netpbm: Fix location of X color name database.

* gnu/packages/netpbm.scm (netpbm)[inputs]: Add 'xorg-rgb'.
  [arguments]: Use 'modify-phases' syntax.  In the 'configure' phase, patch
  'pm_config.in.h' with the full path to the 'rgb.txt' file.
---
 gnu/packages/netpbm.scm | 92 ++---
 1 file changed, 48 insertions(+), 44 deletions(-)

diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 475635e..d0955fe 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -27,6 +27,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
   #:use-module (guix build-system gnu)
   #:use-module ((guix licenses) #:select (gpl2))
   #:use-module (guix packages)
@@ -91,6 +92,7 @@
  ("libpng" ,libpng)
  ("libtiff" ,libtiff)
  ("libxml2" ,libxml2)
+ ("xorg-rgb" ,xorg-rgb)
  ("zlib" ,zlib)))
(native-inputs
  `(("flex" ,flex)
@@ -99,50 +101,52 @@
("python" ,python-wrapper)))
(arguments
 `(#:phases
-  (alist-replace
-   'configure
-   (lambda _
-(copy-file "config.mk.in" "config.mk")
-(chmod "config.mk" #o664)
-(let ((f (open-file "config.mk" "a")))
- (display "CC=gcc\n" f)
- (display "CFLAGS_SHLIB += -fPIC\n" f)
- (display "TIFFLIB = libtiff.so\n" f)
- (display "JPEGLIB = libjpeg.so\n" f)
- (display "ZLIB = libz.so\n" f)
- (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
- (close-port f)))
-  (alist-cons-before
-   'check 'setup-check
-   (lambda _
- ;; install temporarily into /tmp/netpbm
- (system* "make" "package")
- ;; remove test requiring X
- (substitute* "test/all-in-place.test" (("pamx") ""))
- ;; do not worry about non-existing file
- (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
- ;; remove four tests that fail for unknown reasons
- (substitute* "test/Test-Order"
-   (("all-in-place.test") "")
-   (("pnmpsnr.test") "")
-   (("pnmremap1.test") "")
-   (("gif-roundtrip.test") "")))
-  (alist-replace
-   'install
-   (lambda* (#:key outputs make-flags #:allow-other-keys)
-(let ((out (assoc-ref outputs "out")))
- (apply system* "make" "package"
-(string-append "pkgdir=" out) make-flags)
- ;; copy static library
- (copy-file (string-append out "/link/libnetpbm.a")
-(string-append out "/lib/libnetpbm.a"))
- ;; remove superfluous folders and files
- (system* "rm" "-r" (string-append out "/link"))
- (system* "rm" "-r" (string-append out "/misc"))
- (with-directory-excursion out
-   (for-each delete-file
- '("config_template" "pkginfo" "README" "VERSION")
-  %standard-phases)
+  (modify-phases %standard-phases
+   (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+   (copy-file "config.mk.in" "config.mk")
+   (chmod "config.mk" #o664)
+   (let ((f (open-file "config.mk" "a")))
+ (display "CC=gcc\n" f)
+ (display "CFLAGS_SHLIB += -fPIC\n" f)
+ (display "TIFFLIB = libtiff.so\n" f)
+ (display "JPEGLIB = libjpeg.so\n" f)
+ (display "ZLIB = libz.so\n" f)
+ (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
+ (close-port f))
+   (let ((rgb (string-append (assoc-ref inputs "xorg-rgb")
+ "/share/X11/rgb.txt")))
+ (substitute* "pm_config.in.h"
+   (("/usr/share/X11/rgb.txt") rgb)
+   (add-before 'check 'setup-check
+ (lambda _
+   ;; install temp

[PATCH 1/2] gnu: Add the X color name database file.

2016-05-13 Thread Federico Beffa
This package provides the X 'rgb.txt' color name database.  It is not
needed anymore by Xorg, but some packages (e.g. netpbm) still rely on
it.

Regards,
Fede
From be30973db650aba34323900806adb30d2fe74b1d Mon Sep 17 00:00:00 2001
From: Federico Beffa 
Date: Fri, 13 May 2016 09:22:44 +0200
Subject: [PATCH 1/2] gnu: Add the X color name database file.

* gnu/packages/xorg.scm (xorg-rgb): New variable.
---
 gnu/packages/xorg.scm | 25 -
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index fd933e3..9323286 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -4281,7 +4281,30 @@ Various information is displayed depending on which options are selected.")
 formatted dump file, such as produced by xwd.")
 (license license:x11)))
 
-
+(define-public xorg-rgb
+  (package
+(name "xorg-rgb")
+(version "1.0.6")
+(source
+  (origin
+(method url-fetch)
+(uri (string-append
+   "mirror://xorg/individual/app/rgb-"
+   version
+   ".tar.bz2"))
+(sha256
+  (base32
+"1c76zcjs39ljil6f6jpx1x17c8fnvwazz7zvl3vbjfcrlmm7rjmv"
+(build-system gnu-build-system)
+(inputs
+  `(("xproto" ,xproto)))
+(native-inputs
+   `(("pkg-config" ,pkg-config)))
+(home-page "http://www.x.org/wiki/";)
+(synopsis "X color name database")
+(description
+ "This package provides the X color name database.")
+(license license:x11)))
 
 ;; packages of height 1 in the propagated-inputs tree
 
-- 
2.7.4



Re: Why do we use ".../share/emacs/site-lisp/guix.d/"?

2016-05-08 Thread Federico Beffa
On Sun, May 8, 2016 at 10:06 PM, Federico Beffa  wrote:
> On Sun, May 8, 2016 at 9:51 PM, Alex Kost  wrote:
>> Federico Beffa (2016-05-08 19:23 +0300) wrote:
>>
>>> On Sun, May 8, 2016 at 12:33 PM, Alex Kost  wrote:
>>>> I should have asked this when emacs-build-system was introduced.  Why
>>>> does it put emacs packages in sub-directories of
>>>> "/share/emacs/site-lisp/guix.d"?  It looks more natural to me just to
>>>> use "/share/emacs/site-lisp".
>>>>
>>>> I don't see any potential conflicts here: some packages will put their
>>>> elisp files right in the site-lisp dir (gnu-build-system does it by
>>>> default), and emacs-build-system can just use
>>>> "/share/emacs/site-lisp/" sub-directories.
>>>>
>>>> "guix.d" seems redundant to me.  What do people think?
>>>
>>> Answer here:
>>>
>>> https://lists.gnu.org/archive/html/guix-devel/2015-06/msg00398.html
>>
>> No it is not :-)  I think you miss-understood my point.
>>
>> You said that we should put emacs packages into subdirectories, and I
>> agree with this, but instead of the current:
>>
>>   ".../site-lisp/guix.d/PACKAGE-NAME-VERSION/"
>>
>> I suggest to use:
>>
>>   ".../site-lisp/PACKAGE-NAME-VERSION/"
>>
>> i.e., to remove "guix.d".

OK, indeed I did misunderstood.

"guix.d" was added for the following reasons.

* There are some packages generating sub-directories. If one of those
packages is not installed with the 'emacs-build-system', say because
it provides configure/make scripts, then it may not be obvious which
directory to add to the path in an automatic way. With "guix.d" you
just add one layer down into each sub-directory.

* It also makes it obvious that packages into that directory are
installed in a guix specific way. Therefore, if you try to use them
with an emacs from a foreign distro, you know that you have to do
something to make them work.

I'm therefore in favor of keeping "guix.d".

Fede



Re: Why do we use ".../share/emacs/site-lisp/guix.d/"?

2016-05-08 Thread Federico Beffa
On Sun, May 8, 2016 at 9:51 PM, Alex Kost  wrote:
> Federico Beffa (2016-05-08 19:23 +0300) wrote:
>
>> On Sun, May 8, 2016 at 12:33 PM, Alex Kost  wrote:
>>> I should have asked this when emacs-build-system was introduced.  Why
>>> does it put emacs packages in sub-directories of
>>> "/share/emacs/site-lisp/guix.d"?  It looks more natural to me just to
>>> use "/share/emacs/site-lisp".
>>>
>>> I don't see any potential conflicts here: some packages will put their
>>> elisp files right in the site-lisp dir (gnu-build-system does it by
>>> default), and emacs-build-system can just use
>>> "/share/emacs/site-lisp/" sub-directories.
>>>
>>> "guix.d" seems redundant to me.  What do people think?
>>
>> Answer here:
>>
>> https://lists.gnu.org/archive/html/guix-devel/2015-06/msg00398.html
>
> No it is not :-)  I think you miss-understood my point.
>
> You said that we should put emacs packages into subdirectories, and I
> agree with this, but instead of the current:
>
>   ".../site-lisp/guix.d/PACKAGE-NAME-VERSION/"
>
> I suggest to use:
>
>   ".../site-lisp/PACKAGE-NAME-VERSION/"
>
> i.e., to remove "guix.d".

Yes, I understand your question and the answer is at the link I gave
you (and the remainder of the thread). Here pasted for you again:

"
the reason for using separate sub-directories is that many packages
include files, such as README, ChangeLog, ..., that are likely to
clash. Even if we would delete all non ".el" files (which probably is
not safe), with more than 2500 packages on MELPA, it is possible that
we would still experience some name clashes. I can imagine that
someone preparing a package may be unaware of the existence of some
other package, possibly not very popular in his circle.
"

For further discussions follow the mentioned thread.

Fede



  1   2   3   4   5   6   >