Subject: bug#29292: closed (Re: [bug#29292] [PATCH] Scribus: Fix No module named _sysconfigdata_nd)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 20 Nov 2017 17:27:02 +0000

Your bug report

#29292: [PATCH] Scribus: Fix No module named _sysconfigdata_nd

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
29292: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29292
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#29292] [PATCH] Scribus: Fix No module named _sysconfigdata_nd
From: Nicolas Goaziou <[email-masked]>
To: [email-masked] (Ludovic Courtès)
Cc: [email-masked]
Date: Mon, 20 Nov 2017 18:26:14 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

[email-masked] (Ludovic Courtès) writes:

> Please make it “Fixes <https://bugs.gnu.org/25035>.” so we can more
> easily grep the git log.

Fixed.

>> +       (modify-phases %standard-phases
>> +         (add-after 'install 'wrap-program
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             ;; Fix "ImportError: No module named _sysconfigdata_nd" where
>> +             ;; Scribus checks PATH and eventually runs system's Python
>> +             ;; instead of package's.
>> +             (let* ((out (assoc-ref outputs "out"))
>> +                    (py2 (assoc-ref inputs "python")))
>> +               (wrap-program (string-append out "/bin/scribus")
>> +                 `("PATH" ":" prefix (,(string-append py2 "/bin")))))
>
> Did you identify the part of the code that invokes “python”?  If so,
> instead of adding a wrapper, we could patch that file to use the
> absolute file name of “python”, which would be even better.

I know, but I couldn't find the culprit, unfortunately. It may be easier
for someone more knowledgeable in the Python world.

> Anyway, congrats on finding out what was wrong!

To be fair, the IRC crew did all the work.

I applied the patch. Thank you.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

Subject: [PATCH] Scribus: Fix No module named _sysconfigdata_nd
From: Nicolas Goaziou <[email-masked]>
To: [email-masked]
Date: Tue, 14 Nov 2017 00:44:25 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

This patch is an attempt to fix bug #25035, thanks to the Guix people on
IRC.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738
>From 445ce30a90250d6c584a98ac60fddb4b96f1a3a7 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <[email-masked]>
Date: Tue, 14 Nov 2017 00:35:46 +0100
Subject: [PATCH] gnu: scribus: Fix No module named _sysconfigdata_nd

* gnu/packages/scribus.scm (scribus): Wrap PATH with expected Python around
  executable.

This fixes #25035.
---
 gnu/packages/scribus.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/scribus.scm b/gnu/packages/scribus.scm
index 6230195ed..860d34677 100644
--- a/gnu/packages/scribus.scm
+++ b/gnu/packages/scribus.scm
@@ -81,7 +81,19 @@
     (arguments
      `(#:tests? #f                      ;no test target
        #:configure-flags
-       '("-DWANT_GRAPHICSMAGICK=1")))
+       '("-DWANT_GRAPHICSMAGICK=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Fix "ImportError: No module named _sysconfigdata_nd" where
+             ;; Scribus checks PATH and eventually runs system's Python
+             ;; instead of package's.
+             (let* ((out (assoc-ref outputs "out"))
+                    (py2 (assoc-ref inputs "python")))
+               (wrap-program (string-append out "/bin/scribus")
+                 `("PATH" ":" prefix (,(string-append py2 "/bin")))))
+             #t)))))
     (inputs
      `(("boost" ,boost)
        ("cairo" ,cairo)
-- 
2.14.3