unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: iyzsong@member.fsf.org (宋文武)
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
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	[thread overview]
Message-ID: <87k2d9ou6u.fsf_-_@member.fsf.org> (raw)
In-Reply-To: <87lh1ki3p5.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sat, 02 Jul 2016 15:12:38 +0200")

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]


The revert isn't in 'core-updates', python-pycairo is broken again for
the same reason.

ludo@gnu.org (Ludovic Courtès) writes:

> Hi,
>
> iyzsong@member.fsf.org (宋文武) 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: 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-wrap-python3-Use-a-bash-wrapper-for-python3-conf.patch --]
[-- Type: text/x-patch, Size: 2558 bytes --]

From b7badcf695fcb245224ffdf51cdb016b45f9a2a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Sun, 16 Oct 2016 10:44:29 +0800
Subject: [PATCH] gnu: wrap-python3:  Use a bash wrapper for 'python3-config'.

See <http://lists.gnu.org/archive/html/guix-devel/2016-07/msg00008.html>
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


  reply	other threads:[~2016-10-16  3:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01  9:02 core-updates! Ludovic Courtès
2016-07-01 11:33 ` python-pycairo in core-updates (Re: core-updates!) 宋文武
2016-07-01 15:33   ` Andreas Enge
2016-07-01 21:06     ` Leo Famulari
2016-07-02 13:12   ` Ludovic Courtès
2016-10-16  3:21     ` 宋文武 [this message]
2016-10-16 18:14       ` [PATCH] gnu: wrap-python3: Use a bash wrapper for 'python3-config'. (was: python-pycairo in core-updates) Leo Famulari
2016-10-17 10:58         ` [PATCH] gnu: wrap-python3: Use a bash wrapper for 'python3-config' 宋文武
2016-07-01 20:59 ` core-updates! Leo Famulari

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87k2d9ou6u.fsf_-_@member.fsf.org \
    --to=iyzsong@member.fsf.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).