GNU bug report logs - #48999
[PATCH] import: hackage: Accept local source for package.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Sun, 13 Jun 2021 09:47:02 UTC

Severity: normal

Tags: patch

Full log


Message #17 received at 48999 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>, Xinglu Chen
 <public <at> yoctocell.xyz>
Cc: 48999 <at> debbugs.gnu.org
Subject: Re: [bug#48999] [PATCH] import: hackage: Accept local source for
 package.
Date: Wed, 30 Jun 2021 16:10:51 +0200
Hi,

On Wed, 30 Jun 2021 at 11:17, Ludovic Courtès <ludo <at> gnu.org> wrote:
>>> Xinglu Chen <public <at> yoctocell.xyz> skribis:

>>>>   (define-values (ghc-haskeme deps)
>>>>     (call-with-input-file "haskeme.cabal"
>>>>       (lambda (port)
>>>>         (hackage->guix-package
>>>>          "haskeme"
>>>>          #:port port
>>>>          #:source (local-file "." "haskeme-checkout"
>>>>                               #:recursive? #t
>>>>                               #:select? hg-predicate)))))
>>>>
>>>>   ghc-haskeme
>>>>
>>>> Invoking ‘guix build -f guix.scm’ would then always build an up-to-date
>>>> version of the package.

[...]

>>> What I don’t get is that this functionality doesn’t seem to be available
>>> from the CLI, which the patch doesn’t change.  Or am I missing
>>> something?
>>
>> No, I don’t think this functionality is available from the CLI since
>> ‘hackage->guix-package’ is not called with the #:source keyword
>> argument.
>
> IOW, this functionality is not accessible, unless you use the Scheme API
> as in the example above, right?
>
>> Once all the other importers (or those where it makes sense to do
>> this) get this functionality, it would be a good idea to add an option
>> for reading a .cabal/setup.py/whatever file and generating a package
>> definition from that.
>
> ‘guix import hackage’ could support it even if other importers don’t
> have equivalent functionality, no?

From my understanding, there are 2 levels:

 1. simplify the Scheme snippet for developing local “foreign” package,
 i.e., “guix build -f guix.scm” with a simpler ’guix.scm’ file.

 2. an option to import local package,
 e.g., “guix import hackage --path=.”

and this for (almost) all the importers.


Cheers,
simon




This bug report was last modified 3 years and 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.