diff options
author | jblum | 2009-05-28 21:14:27 +0000 |
---|---|---|
committer | jblum | 2009-05-28 21:14:27 +0000 |
commit | a635c00f360fafb89e64f04638642e716d075760 (patch) | |
tree | 299682a8df27abdf5048888a97cd01798da1fb7e /grc/src | |
parent | 99aeab73da71d2881e67aba558ff204a0fe51944 (diff) | |
download | gnuradio-a635c00f360fafb89e64f04638642e716d075760.tar.gz gnuradio-a635c00f360fafb89e64f04638642e716d075760.tar.bz2 gnuradio-a635c00f360fafb89e64f04638642e716d075760.zip |
Make the hardcoded paths in grc optionally configurable from environment variables: GR_DOCDIR, GR_DATADIR
Allows the grc data files to up-rooted for a package installation (specifically macosx).
Hardcoded path is the default when environment variables are undefined.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11161 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src')
-rw-r--r-- | grc/src/platforms/base/Constants.py.in | 3 | ||||
-rw-r--r-- | grc/src/platforms/base/Makefile.am | 7 | ||||
-rw-r--r-- | grc/src/platforms/python/Constants.py.in | 7 | ||||
-rw-r--r-- | grc/src/platforms/python/Makefile.am | 8 |
4 files changed, 14 insertions, 11 deletions
diff --git a/grc/src/platforms/base/Constants.py.in b/grc/src/platforms/base/Constants.py.in index 6d60f2493..da958a6f4 100644 --- a/grc/src/platforms/base/Constants.py.in +++ b/grc/src/platforms/base/Constants.py.in @@ -24,6 +24,7 @@ PACKAGE = '@PACKAGE@' VERSION = '@VERSION@' #setup paths -DATA_DIR = '@datadir@' +PKG_DIR = os.environ.get('GR_DATADIR', '@pkgdatadir@') +DATA_DIR = os.path.join(PKG_DIR, '@reldatadir@') FLOW_GRAPH_DTD = os.path.join(DATA_DIR, 'flow_graph.dtd') BLOCK_TREE_DTD = os.path.join(DATA_DIR, 'block_tree.dtd') diff --git a/grc/src/platforms/base/Makefile.am b/grc/src/platforms/base/Makefile.am index e39128333..805c7b2b3 100644 --- a/grc/src/platforms/base/Makefile.am +++ b/grc/src/platforms/base/Makefile.am @@ -34,12 +34,13 @@ ourpython_PYTHON = \ Port.py \ __init__.py -Constants.py: Makefile Constants.py.in +Constants.py: $(srcdir)/Constants.py.in Makefile sed \ -e 's|@PACKAGE[@]|$(PACKAGE)|g' \ -e 's|@VERSION[@]|$(VERSION)|g' \ - -e 's|@datadir[@]|$(grc_base_data_dir)|g' \ - $(srcdir)/$@.in > $@ + -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \ + -e 's|@reldatadir[@]|$(grc_base_data_reldir)|g' \ + $< > $@ EXTRA_DIST = $(srcdir)/Constants.py.in BUILT_SOURCES = Constants.py diff --git a/grc/src/platforms/python/Constants.py.in b/grc/src/platforms/python/Constants.py.in index 502f41550..4a43147fa 100644 --- a/grc/src/platforms/python/Constants.py.in +++ b/grc/src/platforms/python/Constants.py.in @@ -20,13 +20,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA import os import sys import stat +from .. base.Constants import PKG_DIR PYEXEC = '@PYTHONW@' #setup paths -DOCS_DIR = os.path.join('@docdir@', 'xml') -DATA_DIR = '@datadir@' -BLOCKS_DIR = '@blocksdir@' +DOCS_DIR = os.path.join(os.environ.get('GR_DOCDIR', '@docdir@'), 'xml') +DATA_DIR = os.path.join(PKG_DIR, '@reldatadir@') +BLOCKS_DIR = os.path.join(PKG_DIR, '@relblocksdir@') HIER_BLOCKS_LIB_DIR = os.path.join(os.path.expanduser('~'), '.grc_gnuradio') #file creation modes diff --git a/grc/src/platforms/python/Makefile.am b/grc/src/platforms/python/Makefile.am index 3790b84f0..c23d14792 100644 --- a/grc/src/platforms/python/Makefile.am +++ b/grc/src/platforms/python/Makefile.am @@ -36,13 +36,13 @@ ourpython_PYTHON = \ Port.py \ __init__.py -Constants.py: Makefile Constants.py.in +Constants.py: $(srcdir)/Constants.py.in Makefile sed \ -e 's|@PYTHONW[@]|$(PYTHONW)|g' \ - -e 's|@datadir[@]|$(grc_python_data_dir)|g' \ - -e 's|@blocksdir[@]|$(grc_python_blocks_dir)|g' \ + -e 's|@reldatadir[@]|$(grc_python_data_reldir)|g' \ + -e 's|@relblocksdir[@]|$(grc_blocks_data_reldir)|g' \ -e 's|@docdir[@]|$(gr_docdir)|g' \ - $(srcdir)/$@.in > $@ + $< > $@ EXTRA_DIST = $(srcdir)/Constants.py.in BUILT_SOURCES = Constants.py |