From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: [PATCH] gnu: wrap-python3: Use a bash wrapper for 'python3-config'. (was: python-pycairo in core-updates) Date: Sun, 16 Oct 2016 11:21:13 +0800 Message-ID: <87k2d9ou6u.fsf_-_@member.fsf.org> References: <87d1mxn33e.fsf@gnu.org> <87inwpwq1r.fsf@member.fsf.org> <87lh1ki3p5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvc1D-0001vk-Q2 for guix-devel@gnu.org; Sat, 15 Oct 2016 23:21:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvc1A-0007hN-M5 for guix-devel@gnu.org; Sat, 15 Oct 2016 23:21:47 -0400 Received: from smtp16.openmailbox.org ([62.4.1.50]:34770 helo=smtp1.openmailbox.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvc1A-0007gd-D0 for guix-devel@gnu.org; Sat, 15 Oct 2016 23:21:44 -0400 In-Reply-To: <87lh1ki3p5.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 02 Jul 2016 15:12:38 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The revert isn't in 'core-updates', python-pycairo is broken again for the same reason. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi, > > iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD=A6) skribis: > >> Hi, python-wrapper has a broken `python3-config', which >> output cflags to the wrapper instead of the origin python3, >> leading the build failure of python-pycairo. > > So it appears to resolve the CFLAGS it returns relative to its own > argv[0] or /proc/self/exe, right? > > Eventually we should fix this and reinstate this commit, but reverting > it was the right thing in the short term. > Here is a fix:=20 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-wrap-python3-Use-a-bash-wrapper-for-python3-conf.patch >From b7badcf695fcb245224ffdf51cdb016b45f9a2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sun, 16 Oct 2016 10:44:29 +0800 Subject: [PATCH] gnu: wrap-python3: Use a bash wrapper for 'python3-config'. See for details. * gnu/packages/python.scm (wrap-python3)[arguments]: Use a bash wrapper instead of a symlink for python3-config. --- gnu/packages/python.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 02ec731..9aa704b 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -52,6 +52,7 @@ #:use-module (gnu packages adns) #:use-module (gnu packages attr) #:use-module (gnu packages backup) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages django) @@ -379,6 +380,7 @@ data types.") (source #f) (build-system trivial-build-system) (outputs '("out")) + (inputs `(("bash" ,bash))) (propagated-inputs `(("python" ,python))) (arguments `(#:modules ((guix build utils)) @@ -392,8 +394,20 @@ data types.") (lambda (old new) (symlink (string-append python old) (string-append bin "/" new))) - `("python3" ,"pydoc3" ,"idle3" ,"pip3" ,"python3-config") - `("python" ,"pydoc" ,"idle" ,"pip" ,"python-config")))))) + `("python3" ,"pydoc3" ,"idle3" ,"pip3") + `("python" ,"pydoc" ,"idle" ,"pip")) + ;; python-config outputs search paths based upon its location, + ;; use a bash wrapper to avoid changing its behavior. + (let ((bash (string-append (assoc-ref %build-inputs "bash") + "/bin/bash")) + (old (string-append python "python3-config")) + (new (string-append bin "/python-config"))) + (with-output-to-file new + (lambda () + (format #t "#!~a~%" bash) + (format #t "exec \"~a\" \"$@\"~%" old) + (chmod new #o755) + #t))))))) (synopsis "Wrapper for the Python 3 commands") (description "This package provides wrappers for the commands of Python@tie{}3.x such -- 2.10.0 --=-=-=--