unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Ekaitz Zarraga <ekaitz@elenq.tech>
Cc: "44170@debbugs.gnu.org" <44170@debbugs.gnu.org>
Subject: [bug#44170] [PATCH] gnu: Correct Inkscape extension dependencies
Date: Sat, 24 Oct 2020 20:55:18 +0100	[thread overview]
Message-ID: <87mu0bbdqx.fsf@cbaines.net> (raw)
In-Reply-To: <xtWDFjfh0a5STiw0YCHBoY6znQvYFe1eF7FgAnpC0LzS1PrUaFxnqdGfL-B2N4AK4cDBf2Zd54AMGy2NgSOOPT8oFrpxBLp-reD9nFJG6yI=@elenq.tech>

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


Ekaitz Zarraga <ekaitz@elenq.tech> writes:

> Updated with file-name thanks to Christopher Baines' help.
>
> Guix lint is not complaining anymore about the file name.
>
> (it complains about the version but it's because of a bad naming system
> upstream)

I've had a proper look at this patch now. In general, especially for
adding new packages, do one thing per commit. I've split out the
addition of python-scour in to it's own commit and pushed that now.

I had some thoughts on the inkscape changes though.

> From 931147a8dfe30f96e634a9aabc58955d2ff1b475 Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz@elenq.tech>
> Date: Wed, 21 Oct 2020 19:08:20 +0200
> Subject: [PATCH] gnu: Correct Inkscape extension dependencies
>
>     * gnu/packages/inkscape.scm (inkscape@1.0.1): Add dependencies.
>     * gnu/packages/python-xyz.scm (python-scour): New variable.
> ---
>  gnu/packages/inkscape.scm   | 28 ++++++++++++++++++++++++++--
>  gnu/packages/python-xyz.scm | 27 +++++++++++++++++++++++++++
>  2 files changed, 53 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm
> index 4ac3cf3966..85b4b5020f 100644
> --- a/gnu/packages/inkscape.scm
> +++ b/gnu/packages/inkscape.scm
> @@ -6,6 +6,7 @@
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
>  ;;; Copyright © 2020 Boris A. Dekshteyn <boris.dekshteyn@gmail.com>
> +;;; Copyright © 2020 Ekaitz Zarraga <ekaitz@elenq.tech>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -44,6 +45,7 @@
>    #:use-module (gnu packages pdf)
>    #:use-module (gnu packages popt)
>    #:use-module (gnu packages python)
> +  #:use-module (gnu packages python-xyz)
>    #:use-module (gnu packages xml)
>    #:use-module (gnu packages ghostscript)
>    #:use-module (gnu packages fontutils)
> @@ -250,7 +252,25 @@ endif()~%~%"
>           (add-after 'install 'glib-or-gtk-compile-schemas
>             (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
>           (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
> -           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
> +           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
> +         (add-after 'install 'wrap-program
> +           ;; Ensure correct Python at runtime.
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (python (assoc-ref inputs "python"))
> +                    (file (string-append out "/bin/inkscape"))
> +                    (path (string-append
> +                           out
> +                           "/lib/python"
> +                           ,(version-major+minor
> +                             (package-version python))
> +                           "/site-packages:"

I had a look in the output, and it doesn't contain lib/python, so this
bit won't do anything as far as I can see? The PYTHONPATH bit is fine.

> +                           (getenv "PYTHONPATH"))))
> +               (wrap-program file
> +                 `("PYTHONPATH" ":" prefix (,path))
> +                 `("PATH" ":" prefix
> +                   (,(string-append python "/bin:")))))

The : after /bin is unnecessary.

Also, it looks like python-wrapper is already referenced lots in the
output, did you have a specific reason why wrapping inkscape with the
PATH was useful?

> +             #t)))))
>      (inputs
>       `(("aspell" ,aspell)
>         ("autotrace" ,autotrace)
> @@ -283,7 +303,11 @@ endif()~%~%"
>         ("googletest" ,googletest)
>         ("perl" ,perl)
>         ("pkg-config" ,pkg-config)
> -       ("python" ,python-wrapper)))
> +       ("python" ,python-wrapper)
> +       ("python-scour" ,python-scour)
> +       ("python-pyserial" ,python-pyserial)
> +       ("python-numpy" ,python-numpy)
> +       ("python-lxml" ,python-lxml)))

So, before python-wrapper was a native-input, and you've added some
Python packages as native inputs.

The distinction for inkscape between an input and a native input is
mostly academic at this point, because the meson build system doesn't
support cross builds.

However, inkscape already uses references python-wrapper in its output,
so it should probably be an input. With this change, you're also setting
out that inkscape should be able to use these Python libraries at
runtime, hence they should be inputs (matching the architecture you're
building for), rather than native inputs (matching the architecture
you're building on).

Does that make sense?

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

  reply	other threads:[~2020-10-24 19:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 10:32 [bug#44170] [PATCH] gnu: Correct Inkscape extension dependencies Ekaitz Zarraga
2020-10-23 23:03 ` Ekaitz Zarraga
2020-10-24 19:55   ` Christopher Baines [this message]
2020-10-24 21:31     ` Ekaitz Zarraga
2020-10-24 22:14       ` Christopher Baines
2020-10-25 12:23         ` Ekaitz Zarraga
2020-10-26 15:56           ` bug#44170: " Christopher Baines

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=87mu0bbdqx.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=44170@debbugs.gnu.org \
    --cc=ekaitz@elenq.tech \
    /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).