From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#22808: Add a function to simplify many of the new python2-foo definitions Date: Tue, 26 Apr 2016 15:09:15 +0200 Message-ID: <87oa8wtt38.fsf@gnu.org> References: <87vb5cebm6.fsf@dustycloud.org> <8760xbyrxd.fsf@gnu.org> <87lh40wv8r.fsf@gnu.org> <20160426124428.GA12637@debian-netbook> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av2ki-0000iQ-Fh for bug-guix@gnu.org; Tue, 26 Apr 2016 09:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av2kc-0000rg-NW for bug-guix@gnu.org; Tue, 26 Apr 2016 09:10:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:35245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av2kc-0000rc-K8 for bug-guix@gnu.org; Tue, 26 Apr 2016 09:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1av2kc-00057q-Gj for bug-guix@gnu.org; Tue, 26 Apr 2016 09:10:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20160426124428.GA12637@debian-netbook> (Efraim Flashner's message of "Tue, 26 Apr 2016 15:44:28 +0300") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Efraim Flashner Cc: 22808@debbugs.gnu.org Efraim Flashner skribis: > On Tue, Apr 26, 2016 at 11:54:28AM +0200, Ludovic Court=C3=A8s wrote: >> ludo@gnu.org (Ludovic Court=C3=A8s) skribis: [...] >> What about this: >>=20 > >> --- 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)) >>=20=20 >> +(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") > >>=20 >> Then we need to change all the occurrences of this pattern to use this >> new procedure. >>=20 >> Thoughts? >>=20 >> Ludo=E2=80=99. > > Would we still need the properties field in python-foo? Yes. > What would this mean for packages that need python2-setuptools and other > python2- specific packages? Specifically, would all the calls to > package-native-inputs cause a slowdown in computing the package? It wouldn=E2=80=99t change anything, since this exact same pattern is alrea= dy used in many different places in python.scm (search for =E2=80=9Cpython2-setuptools=E2=80=9D and you=E2=80=99ll see :-)). It would= simply allow us to factorize it. Ludo=E2=80=99.