guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: branch master updated: gnu: gnuradio: Fix runtime python environment


From: Guillaume Le Vaillant
Subject: Re: branch master updated: gnu: gnuradio: Fix runtime python environment for plugins.
Date: Sat, 02 May 2020 10:40:44 +0200
User-agent: mu4e 1.4; emacs 26.3

Hi,

Ludovic Courtès <address@hidden> skribis:

> Hi Guillaume,
>
> address@hidden 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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]