all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Erik Edrosa <erik.edrosa@gmail.com>
To: guix-devel@gnu.org
Subject: Re: Trying to fix an error in the pypi-importer
Date: Sat, 2 Jan 2016 13:26:20 -0500	[thread overview]
Message-ID: <5688164C.8050605@gmail.com> (raw)
In-Reply-To: <257e9ac376ee2c97785c0e63715ed38c@riseup.net>

On 01/02/2016 12:10 PM, swedebugia@riseup.net wrote:
> On 2016-01-01 19:10, swedebugia@riseup.net wrote:
>> On 2015-12-30 23:00, Cyril Roelandt wrote:
>>> On 12/30/2015 08:53 PM, swedebugia@riseup.net wrote:
>>>> I am trying to fix this error in the pypi-importer:
>>>
>>> Could you send your fix as a unified diff? If you work from the git
>>> repo, you can just run "git diff" to produce one.
>>
>> diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
>> index 2532210..f9b88d2 100644
>> --- a/guix/build-system/python.scm
>> +++ b/guix/build-system/python.scm
>> @@ -41,13 +41,18 @@
>>  ;;
>>  ;; Code:
>>
>> -(define (pypi-uri name version)
>> +(define (pypi-uri name version ending)
>>    "Return a URI string for the Python package hosted on the Python
>> Package
>> -Index (PyPI) corresponding to NAME and VERSION."
>> -  (string-append "https://pypi.python.org/packages/source/"
>> +Index (PyPI) corresponding to NAME, VERSION and optionally ENDING."
>> +  (if (zero? ending)
>> +      (string-append "https://pypi.python.org/packages/source/"
>>                   (string-take name 1) "/" name "/"
>> -                 name "-" version ".tar.gz"))
>> -
>> +                 name "-" version ".tar.gz")
>> +  ;else
>> +      (string-append "https://pypi.python.org/packages/source/"
>> +                 (string-take name 1) "/" name "/"
>> +                 name "-" version "." ending ))
>> +
>>  (define %python-build-system-modules
>>    ;; Build-side modules imported by default.
>>    `((guix build python-build-system)
> 
> During compilation after applying my patch above I get this error.
> 
>   GUILEC guix/build-system/python.go
> ice-9/boot-9.scm:106:20: In procedure #<procedure 8bbb4e0 at
> ice-9/boot-9.scm:97:6 (thrown-k . args)>:
> ice-9/boot-9.scm:106:20: In procedure scm_i_lreadparen:
> guix/build-system/python.scm:216:1: end of file
> Makefile:4604: recipe for target 'guix/build-system/python.go' failed
> 
> So removing the (else -> to a comment and adjusting the parentheses did
> not work.
> 
> Could somebody point me to relevant documentation about how to write
> conditional statements in guile?
> 

Here is the conditionals in the guile manual
https://www.gnu.org/software/guile/manual/html_node/Conditionals.html#Conditionals

This might be a useful book on learning scheme
http://ds26gte.github.io/tyscheme/index.html

You might find more useful intro books to scheme at
http://schemers.org/Documents/#all-texts

Regarding the changes, I think the ending argument might be better as an
optional argument (see
https://www.gnu.org/software/guile/manual/html_node/lambda_002a-and-define_002a.html#lambda_002a-and-define_002a
about optional arguments) so packages with files ending in .tar.gz do
not need to be modified.

So a package can be (pypi-uri "foo" "1.0.0") or (pypi-uri "bar" "1.0.0"
".tar.bz2")

  parent reply	other threads:[~2016-01-02 18:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 19:53 Trying to fix an error in the pypi-importer swedebugia
     [not found] ` <56844BF3.10701@uq.edu.au>
2015-12-30 21:27   ` Ben Woodcroft
2015-12-30 22:00 ` Cyril Roelandt
2016-01-01 18:10   ` swedebugia
2016-01-02 17:10     ` swedebugia
2016-01-02 18:06       ` How to test changes to guix locally? (Was: Re: Trying to fix an error in the pypi-importer) swedebugia
2016-01-02 18:58         ` Ricardo Wurmus
2016-01-02 18:26       ` Erik Edrosa [this message]
2016-01-03 14:09       ` Trying to fix an error in the pypi-importer Ludovic Courtès
2016-01-03 16:29         ` swedebugia
2016-01-03 18:47       ` Ricardo Wurmus
2015-12-31 11:22 ` Efraim Flashner
2016-01-01 18:15   ` swedebugia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5688164C.8050605@gmail.com \
    --to=erik.edrosa@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.