bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22808: Add a function to simplify many of the new python2-foo defini


From: Ludovic Courtès
Subject: bug#22808: Add a function to simplify many of the new python2-foo definitions
Date: Tue, 26 Apr 2016 11:54:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden (Ludovic Courtès) skribis:

> Christopher Allan Webber <address@hidden> skribis:
>
>> Right now we have a lot of these that look very similar:
>>
>>   (define-public python2-chardet
>>     (package
>>       (inherit (package-with-python2
>>                 (strip-python2-variant python-chardet)))
>>       (native-inputs `(("python2-setuptools" ,python2-setuptools)))))
>
> Right, we discussed before adding the python2-setuptools dependency
> automatically as part of ‘package-with-python2’.  I think this would be
> a good idea, indeed.

What about this:

--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -345,6 +345,14 @@ instead of @command{python3}.")))
 (define-public python-wrapper (wrap-python3 python))
 (define-public python-minimal-wrapper (wrap-python3 python-minimal))
 
+(define (package-with-python2+setuptools p)
+  (let ((base (package-with-python2 (strip-python2-variant p))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools)
+                       ,@(package-native-inputs base))))))
+
+
 (define-public python-psutil
   (package
     (name "python-psutil")
Then we need to change all the occurrences of this pattern to use this
new procedure.

Thoughts?

Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]