Re: GSoC slots

2013-05-08 Thread Xue Fuqiao
On Wed, May 8, 2013 at 9:18 AM, Nikita Karetnikov nik...@karetnikov.org wrote:
 I’m sorry to announce that Guix will probably not have a GSoC slot.
 This is largely my fault: GNU had to give Google a number of slots by
 yesterday noon, and all this happened while I was away (see
 https://lists.gnu.org/archive/html/summer-of-code/2013-05/msg2.html
 and 
 https://lists.gnu.org/archive/html/summer-of-code/2013-05/msg00028.html.)

 Still, there is a chance.

Great.  Although I may not participate, I wish Guix successfully obtain
slots!

 There are 32 slots [1].  These include the desired ones [2] too.  I
 guess it should be possible to convince other projects to share.

 Note that mentors must register on the website and provide their contact
 details [2].  Please do it as soon as possible.

 [1] https://lists.gnu.org/archive/html/summer-of-code/2013-05/msg00031.html
 [2] https://lists.gnu.org/archive/html/summer-of-code/2013-05/msg00028.html

--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/



Re: 'python-build-system'

2013-05-08 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis:

 If you append (package-native-search-paths python) to the list of search
 paths, then PYTHONPATH will automagically be defined appropriately (see
 http://lists.gnu.org/archive/html/bug-guix/2013-03/msg00158.html.)

 If you don’t, then PYTHONPATH will be undefined, unless you explicitly
 define it in build/python-build-system.scm, which is not the recommended
 option.

 So just mimic the change made in the above commit for perl-build-system.

 OK, I've added it.  Should I remove the following part?

 +  (let* ((out  (assoc-ref outputs out))
 + (var `(PYTHONPATH prefix
 +(,(string-append out /lib/python
 + python-version /site-packages)
 +(for-each (lambda (dir)
 +(let ((files (list-of-files dir)))
 +  (for-each (cut wrap-program  var)
 +files)))
 +  bindirs)))

 Or is it a different issue?

Yes, see below.

[...]

 +(define* (python-build store name source inputs
 +   #:key
 +   (python (@ (gnu packages python) python))
 +   (python-version
 +(string-take (package-version
 +  (@ (gnu packages python) python)) 3))
 +   (tests? #t)
 +   (configure-flags ''())
 +   (phases '(@ (guix build python-build-system)
 +   %standard-phases))
 +   (outputs '(out))
 +   (search-paths '())
 +   (system (%current-system))
 +   (guile #f)
 +   (imported-modules '((guix build python-build-system)
 +   (guix build gnu-build-system)
 +   (guix build utils)))
 +   (modules '((guix build python-build-system)
 +  (guix build gnu-build-system)
 +  (guix build utils
 +  Build SOURCE using PYTHON, and with INPUTS.  This assumes that SOURCE
 +provides a 'setup.py' file as its build system.
 +  (define python-search-paths
 +(append (package-native-search-paths python)
 +(standard-search-paths)))
 +
 +  (define builder
 +`(begin
 +   (use-modules ,@modules)
 +   (python-build #:name ,name
 + #:source ,(if (and source (derivation-path? source))
 +   (derivation-path-output-path source)
 +   source)
 + #:configure-flags ,configure-flags
 + #:system ,system
 + #:test-target test
 + #:tests? ,tests?
 + #:outputs %outputs
 + #:python-version ,python-version
 + #:search-paths ',(map search-path-specification-sexp
 +   (append python-search-paths
 +   (standard-search-paths)))

Typo here.  Should be:

  (append python-search-paths search-paths)

Otherwise the ‘search-paths’ argument would not be honored.

[...]

 +(define* (wrap #:key outputs python-version #:allow-other-keys)
 +  (define (list-of-files dir)
 +(map (cut string-append dir / )
 + (or (scandir dir (lambda (f)
 +(let ((s (stat (string-append dir / f
 +  (eq? 'regular (stat:type s)
 + '(
 +
 +  (define bindirs
 +(append-map (match-lambda
 + ((_ . dir)
 +  (list (string-append dir /bin)
 +(string-append dir /sbin
 +outputs))
 +
 +  (let* ((out  (assoc-ref outputs out))
 + (var `(PYTHONPATH prefix
 +(,(string-append out /lib/python
 + python-version /site-packages)

We also need to account for extra Python modules the package depends on:

  (let* (...
 (var `(PYTHONPATH prefix
,(cons (string-append out /lib/python
  python-version /site-packages)
   (search-path-as-string-list
(or (getenv PYTHONPATH) )
...)

To answer your previous question, this ‘wrap’ phase serves a different
(but related) purpose than the ‘native-search-paths’ thing: it ensures
that the ‘bzr’ program, when run by the user, finds all its Python
modules.

[...]

 +(define-public bazaar
 +  (package
 +(name bazaar)
 +(version 2.5.1)
 +(source
 + (origin
 +  (method url-fetch)
 +  (uri (string-append https://launchpad.net/bzr/2.5/; version
 +  /+download/bzr- version .tar.gz))
 +  (sha256
 +   (base32
 +

Re: GSoC slots

2013-05-08 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis:

 I’m sorry to announce that Guix will probably not have a GSoC slot.
 This is largely my fault: GNU had to give Google a number of slots by
 yesterday noon, and all this happened while I was away (see
 https://lists.gnu.org/archive/html/summer-of-code/2013-05/msg2.html
 and 
 https://lists.gnu.org/archive/html/summer-of-code/2013-05/msg00028.html.)

 Still, there is a chance.

 There are 32 slots [1].  These include the desired ones [2] too.  I
 guess it should be possible to convince other projects to share.

Thanks for the heads-up, I just emailed summer-of-code@ to see if we
could find a solution.

Ludo’.



Re: 'python-build-system'

2013-05-08 Thread Nikita Karetnikov
 With these changes in place, OK to commit.

I've just pushed both patches.  Please have a look.

 To answer your previous question, this ‘wrap’ phase serves a different
 (but related) purpose than the ‘native-search-paths’ thing: it ensures
 that the ‘bzr’ program, when run by the user, finds all its Python
 modules.

I know.  But why do we need to use 'native-search-paths' to set
PYTHONPATH if we wrap all executables anyway?  What is the purpose of
'native-search-paths' in this case?


pgp0dtUQNo6x9.pgp
Description: PGP signature