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

From: [email-masked] (Ludovic Courtès)
Date: Thu, 16 Nov 2017 10:58:17 +0100

Hi Nicolas,

Nicolas Goaziou <[email-masked]> skribis:

>>>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.

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

> +       (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.

Anyway, congrats on finding out what was wrong!

Thanks,
Ludo’.