discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] GRC request


From: Michael Dickens
Subject: [Discuss-gnuradio] GRC request
Date: Wed, 27 May 2009 12:37:27 -0400

I would like to be able to execute GRC from a directory structure moved elsewhere from ${prefix} ... meaning, I compile and install into ${prefix}, but then 'cp -r' or 'mv' or 'tar - | tar -' the whole directory structure elsewhere outside of the usual execution location. I then create / modify the environment variables such that they point to the new location (PATH, PYTHONPATH, and DYLD_LIBRARY_PATH are the 3 primary ones for OSX). From my initial testing, the rest of GNU Radio can do this with just those 3 variables (on OSX; Y-Variables-MV on other platforms)

This doesn't work because GRC hard-wires the install path (or something like it) in a few files (I do not know if all of these files need to be modified to get what I'd like to do working; nor do I know if these are all of the files that need to be tweaked):

grc/freedesktop/grc_setup_freedesktop.in
grc/src/platforms/base/Constants.py.in
grc/src/platforms/python/Constants.py.in

I can think of two possible solutions:

1) Put a switch at the top of each of these files along the lines of:

import os
DATA_DIR = os.getenv ("GRC_DATADIR")
if not DATA_DIR:
  DATA_DIR = @datadir@

or the equivalent functionality that would work for the @variables@ used in that file (I don't know if the above would work; it is for descriptive purposes only): first check the user's shell environment for the appropriate variables, and if they don't exist, then revert to the default from compiling. This way, users who wish to change the location can do so easily via their shell environment, and those who do not set the shell environment variables get the default -- same as current usage.

2) Even better would be the use of relative paths (it does work for me, directly modifying the installed files). This solution would require knowing the path to $sharedir and the $pythondir and then figuring out how to get from one to the other (the relative path), but IMHO is the more elegant solution.

Thanks in advance! - MLD




reply via email to

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