[Top][All Lists]

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

Re: [Discuss-gnuradio] gnuradio with alternate python

From: Josh Blum
Subject: Re: [Discuss-gnuradio] gnuradio with alternate python
Date: Sat, 26 Jun 2010 19:29:03 -0700

Somehow distutils solves this problem:
If you figure out what its calling, perhaps we could port that the
gnuradio build system

What would work is an m4 macro (or hook) that takes the list of python
bin scripts and creates new targets and install rules for each python
script. Basically, make would insert/replace the #!/python_exe_path
line into the top of the file as part of this build process. This new
file would be the one installed.


On Sat, Jun 26, 2010 at 6:57 PM, Brett L. Trotter <address@hidden> wrote:
> Thanks for both your replies. Regarding the PATH fix- in the situation
> I'm looking to fix for myself and my users, I've got system python 2.4
> from RHEL 5/CentOS 5 as /usr/bin/python and my python 2.5 as
> /usr/bin/python2.5 (with python25 link). I suppose another choice would
> have been to make it /usr/local/bin/python instead, which if I recall my
> computing roots, was the place to extra software that departs from the
> basic install. In any case, for me the decision to make it side-by-side
> was based on sticking to the redhat standard locations. But due to that,
> creative path ordering doesn't help.
> I suppose I'm open to suggestion on this one- is the case that people
> are compiling gnuradio against a non-default python common enough to
> merit the additional step?
> If so, would doing either a template sort of approach (put @@PYTHON@@ in
> all the gnuradio examples .py files, and use m4 or sed to replace), just
> plain using sed, or some other method I'm not thinking of be the best?
> If not, I'm open to changing my python25 rpm to relocate the python and
> expect users to set the path properly, but I sort of like the "it just
> works".
> P. S.
> Maybe this is a bad idea or demonstrating a lack of knowledge, but it
> seems that its kind of too bad there isn't some kind of handy little
> variant or option of /usr/bin/env that looks at the program name, looks
> for an environment variable with a capitalized spelling of the same
> name, and uses that path/exe if it exists or falls back to doing the
> program name itself. eg setting PYTHON=python2.5 /usr/bin/env -foo
> python would run python2.5 instead. Alternatively if the shebang could
> support a conditional [ ! -z PYTHON ] .. or something.
> P.P.S. I won't reply to the other post about the circbuf message- thanks
> for clearing that up, its been a while since I've seen that message.
> -Brett
> On 06/26/2010 05:10 PM, Eric Blossom wrote:
>> On Sat, Jun 26, 2010 at 12:32:38PM -0500, Brett L. Trotter wrote:
>>> I'm just now getting to a gnuradio project and hadn't had much of a
>>> chance to dogfood my gnuradio RPM from my repo. Now that I'm getting to
>>> it, all of the examples scripts have #!/usr/bin/env python hardcoded at
>>> the top. I was thinking the build process (which already knows the
>>> appropriate python) should populate all the python scripts with the
>>> correct python?
>> Yes, it could.  It would probably be best if the "install" step of
>> "make install" did it while installing them.
>> Feel free to submit a patch for this based off of the "maint" branch.
>>> Otherwise, it looks like I'm going to have to rebuild my RPM and sed all
>>> of the .py files?
>> Or, as a workaround, juggle your PATH such that the python you want
>> comes in front of the python that you don't want.
>> Eric
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

reply via email to

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