unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Guillaume Le Vaillant <glv@posteo.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: branch master updated: gnu: gnuradio: Fix runtime python environment for plugins.
Date: Sat, 02 May 2020 10:40:44 +0200	[thread overview]
Message-ID: <87a72qpw4z.fsf@yamatai> (raw)
In-Reply-To: <87v9lfcpiw.fsf@gnu.org>

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


Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

> Hi Guillaume,
>
> guix-commits@gnu.org skribis:
>
>>      (native-search-paths
>> +     ;; Variables required to find third-party plugins at runtime.
>>       (list (search-path-specification
>>              (variable "GRC_BLOCKS_PATH")
>> -            (files '("/share/gnuradio/grc/blocks")))))
>> +            (files '("share/gnuradio/grc/blocks")))
>> +           (search-path-specification
>> +            (variable "PYTHONPATH")
>> +            (files (list (string-append "lib/python"
>> +                                        (version-major+minor
>> +                                         (package-version python))
>> +                                        "/site-packages"))))))
>>      (synopsis "Toolkit for software-defined radios")
>
> It’s not OK to have PYTHONPATH in here because that variable “belongs”
> to Python, not to GNU Radio.
>
> A profile containing both gnuradio and python will have PYTHONPATH
> correctly set.  However, I guess you want to ensure that PYTHONPATH is
> correct even when Python is not in the profile, right?
>
> In that case, I’d recommend wrapping the gnuradio executables such that
> PYTHONPATH is correct.
>
> Does that make sense?
>
> See also one of our oldest bugs: <https://issues.guix.gnu.org/issue/22138>.
>
> (Apologies if I missed a previous discussion!)
>
> Thanks,
> Ludo’.

The gnuradio-companion program generates a Python script based on the
user's flowchart of signal processing blocks, and then executes it.

Some extra "gnuradio blocks" can be added as plugin, like the
gnuradio-osmosdr and gnuradio-iqbalance packages. For the Python script
to be able to import the plugins installed in the Guix profile (or Guix
environment), the PYTHONPATH variable must be defined in the profile (or
environment).
I got the idea of putting PYTHONPATH in native-search-paths from the
Gajim package. I guess it will have to be fixed as well.

What would be the best way to have PYTHONPATH set to the runtime profile
or environment without putting it in native-search-paths?

- Make python a native-input?
- Wrap binaries with
  "PYTHONPATH=$GUIX_ENVIRONMENT/lib/python/3.7/site-packages:$GUIX_PROFILE/lib/python/3.7/site-packages:$PYTHONPATH"?
- Something else?

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

      reply	other threads:[~2020-05-02  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200430082115.25315.99707@vcs0.savannah.gnu.org>
2020-05-01 21:29 ` branch master updated: gnu: gnuradio: Fix runtime python environment for plugins Ludovic Courtès
2020-05-02  8:40   ` Guillaume Le Vaillant [this message]

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=87a72qpw4z.fsf@yamatai \
    --to=glv@posteo.net \
    --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).