From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-devel-bounces+larch=yhetil.org@gnu.org>
Received: from mp0 ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms11 with LMTPS
	id kPztORQyrV72egAA0tVLHw
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sat, 02 May 2020 08:40:52 +0000
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp0 with LMTPS
	id AE9gFB4yrV6cZwAA1q6Kng
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sat, 02 May 2020 08:41:02 +0000
Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 875889426C3
	for <larch@yhetil.org>; Sat,  2 May 2020 08:41:01 +0000 (UTC)
Received: from localhost ([::1]:39814 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	id 1jUnhl-0004fU-Pv
	for larch@yhetil.org; Sat, 02 May 2020 04:41:01 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45726)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <glv@posteo.net>) id 1jUnhc-0004ct-1t
 for guix-devel@gnu.org; Sat, 02 May 2020 04:40:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1)
 (envelope-from <glv@posteo.net>) id 1jUnha-0003w1-VP
 for guix-devel@gnu.org; Sat, 02 May 2020 04:40:51 -0400
Received: from mout01.posteo.de ([185.67.36.65]:56871)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <glv@posteo.net>) id 1jUnha-0003jf-2n
 for guix-devel@gnu.org; Sat, 02 May 2020 04:40:50 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id F118F160061
 for <guix-devel@gnu.org>; Sat,  2 May 2020 10:40:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1588408847; bh=RvqFw8GuE9iC+53ukCmBtRH/5s0HfXyZcg1NeC7wQgc=;
 h=From:To:Cc:Subject:Date:From;
 b=FxXWP8P4Mxtvrv/LqAc4jywXCAh8KmQgqCCIXQMWXIZyYOE+d4IOXKCTTHfaMc8de
 wlLRARTDE3bXNccIVS46WiQYtmoYDbORnBsDz81ScjrIxfvKPdW1F1MGYpKD3U/M7M
 TU1kNUmLSfkTXAPixSYzzTCvKmWhYnqF7QsqHGX/vEjgrcJ+tAQ/UAbGBHYzToGI3P
 dJc29dtjHsPyiIlSgs+U8OY5n3FPTmmraFtmxCYsNDDlvKNV8nrXrT9lAdOpaGJ2Fx
 M4p/vh9/ragQ6q/Rl+cMf25XzGCLiLNdp00nAJ6n96bSGPzw/RP0UC5qptRkJz5m8f
 USrj7GVdAHSig==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 49DjHy0nqGz6tmK;
 Sat,  2 May 2020 10:40:45 +0200 (CEST)
References: <20200430082115.25315.99707@vcs0.savannah.gnu.org>
 <87v9lfcpiw.fsf@gnu.org>
User-agent: mu4e 1.4; emacs 26.3
From: Guillaume Le Vaillant <glv@posteo.net>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@gnu.org>
Subject: Re: branch master updated: gnu: gnuradio: Fix runtime python
 environment for plugins.
In-reply-to: <87v9lfcpiw.fsf@gnu.org>
Date: Sat, 02 May 2020 10:40:44 +0200
Message-ID: <87a72qpw4z.fsf@yamatai>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Received-SPF: pass client-ip=185.67.36.65; envelope-from=glv@posteo.net;
 helo=mout01.posteo.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 04:40:47
X-ACL-Warn: Detected OS   = Linux 3.11 and newer [fuzzy]
X-Received-From: 185.67.36.65
X-BeenThere: guix-devel@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "Development of GNU Guix and the GNU System distribution."
 <guix-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>,
 <mailto:guix-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-devel>
List-Post: <mailto:guix-devel@gnu.org>
List-Help: <mailto:guix-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>,
 <mailto:guix-devel-request@gnu.org?subject=subscribe>
Cc: guix-devel@gnu.org
Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org
Sender: "Guix-devel" <guix-devel-bounces+larch=yhetil.org@gnu.org>
X-Scanner: scn0
X-Spam-Score: -3.31
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=FxXWP8P4;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org
X-Scan-Result: default: False [-3.31 / 13.00];
	 RCVD_VIA_SMTP_AUTH(0.00)[];
	 GENERIC_REPUTATION(0.00)[-0.49485366860804];
	 TO_DN_SOME(0.00)[];
	 R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c];
	 IP_REPUTATION_HAM(0.00)[asn: 22989(0.15), country: US(-0.00), ip: 2001:470:142::17(-0.49)];
	 DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail,posteo.net:server fail];
	 DKIM_TRACE(0.00)[posteo.net:+];
	 RCPT_COUNT_TWO(0.00)[2];
	 DMARC_POLICY_ALLOW(-0.50)[posteo.net,none];
	 MX_GOOD(-0.50)[cached: eggs.gnu.org];
	 MAILLIST(-0.20)[mailman];
	 SIGNED_PGP(-2.00)[];
	 FORGED_RECIPIENTS_MAILLIST(0.00)[];
	 RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail];
	 MIME_TRACE(0.00)[0:+,1:+,2:~];
	 RCVD_TLS_LAST(0.00)[];
	 ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US];
	 TAGGED_FROM(0.00)[larch=yhetil.org];
	 FROM_NEQ_ENVFROM(0.00)[glv@posteo.net,guix-devel-bounces@gnu.org];
	 ARC_NA(0.00)[];
	 R_DKIM_ALLOW(-0.20)[posteo.net:s=2017];
	 URIBL_BLOCKED(0.00)[gnu.org:email,posteo.net:dkim];
	 FROM_HAS_DN(0.00)[];
	 MIME_GOOD(-0.20)[multipart/signed,text/plain];
	 PREVIOUSLY_DELIVERED(0.00)[guix-devel@gnu.org];
	 HAS_LIST_UNSUB(-0.01)[];
	 MID_RHS_NOT_FQDN(0.50)[];
	 RCVD_COUNT_SEVEN(0.00)[7];
	 FORGED_SENDER_MAILLIST(0.00)[]
X-TUID: BTmj2YziZeRr

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Hi,

Ludovic Court=C3=A8s <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=E2=80=99s not OK to have PYTHONPATH in here because that variable =E2=
=80=9Cbelongs=E2=80=9D
> 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=E2=80=99d recommend wrapping the gnuradio executables suc=
h 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=E2=80=99.

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?

=2D Make python a native-input?
=2D Wrap binaries with
  "PYTHONPATH=3D$GUIX_ENVIRONMENT/lib/python/3.7/site-packages:$GUIX_PROFIL=
E/lib/python/3.7/site-packages:$PYTHONPATH"?
=2D Something else?

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQkUwKxurH4Z/3KlryPP4Yfgut6mgUCXq0yDAAKCRCPP4Yfgut6
mqdhAQDsdi/6Ya0wuKEqWizsxiU4Dr1MRIshmx+CK1HrzBxbpAD+JdBep0U5yUYY
UPY5aoY3Br82pCgW1soXmKQoZoiYagA=
=+MPR
-----END PGP SIGNATURE-----
--=-=-=--