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 | |
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
-rw-r--r-- | grc/Makefile.inc | 7 | ||||
-rw-r--r-- | grc/data/platforms/base/Makefile.am | 2 | ||||
-rw-r--r-- | grc/data/platforms/python/Makefile.am | 2 | ||||
-rw-r--r-- | grc/data/platforms/python/blocks/Makefile.am | 2 | ||||
-rw-r--r-- | grc/freedesktop/Makefile.am | 6 | ||||
-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 |
9 files changed, 23 insertions, 21 deletions
diff --git a/grc/Makefile.inc b/grc/Makefile.inc index 4d78070da..c400e532f 100644 --- a/grc/Makefile.inc +++ b/grc/Makefile.inc @@ -22,7 +22,6 @@ include $(top_srcdir)/Makefile.common grc_gnuradio_prefix = $(pythondir)/grc_gnuradio grc_src_prefix = $(pythondir)/gnuradio/grc -grc_data_prefix = $(datadir)/$(PACKAGE)/grc -grc_base_data_dir = $(grc_data_prefix)/platforms/base -grc_python_data_dir = $(grc_data_prefix)/platforms/python -grc_python_blocks_dir = $(grc_data_prefix)/platforms/python/blocks +grc_base_data_reldir = grc/base +grc_python_data_reldir = grc/python +grc_blocks_data_reldir = grc/blocks diff --git a/grc/data/platforms/base/Makefile.am b/grc/data/platforms/base/Makefile.am index aaf53b4fc..d323a1441 100644 --- a/grc/data/platforms/base/Makefile.am +++ b/grc/data/platforms/base/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/grc/Makefile.inc -ourdatadir = $(grc_base_data_dir) +ourdatadir = $(pkgdatadir)/$(grc_base_data_reldir) dist_ourdata_DATA = \ block_tree.dtd \ diff --git a/grc/data/platforms/python/Makefile.am b/grc/data/platforms/python/Makefile.am index 45783dfba..3b056b3f2 100644 --- a/grc/data/platforms/python/Makefile.am +++ b/grc/data/platforms/python/Makefile.am @@ -23,7 +23,7 @@ include $(top_srcdir)/grc/Makefile.inc SUBDIRS = blocks -ourdatadir = $(grc_python_data_dir) +ourdatadir = $(pkgdatadir)/$(grc_python_data_reldir) dist_ourdata_DATA = \ block.dtd \ diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/data/platforms/python/blocks/Makefile.am index a5ae57a73..d3b3564cd 100644 --- a/grc/data/platforms/python/blocks/Makefile.am +++ b/grc/data/platforms/python/blocks/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/grc/Makefile.inc -ourdatadir = $(grc_python_blocks_dir) +ourdatadir = $(pkgdatadir)/$(grc_blocks_data_reldir) dist_ourdata_DATA = \ audio_sink.xml \ diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am index b167a0c66..79388ba3a 100644 --- a/grc/freedesktop/Makefile.am +++ b/grc/freedesktop/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/grc/Makefile.inc -ourdatadir = $(grc_data_prefix)/freedesktop +ourdatadir = $(pkgdatadir)/grc/freedesktop dist_ourdata_DATA = \ grc-icon-256.png \ @@ -36,8 +36,8 @@ dist_ourdata_DATA = \ dist_bin_SCRIPTS = grc_setup_freedesktop -grc_setup_freedesktop: Makefile grc_setup_freedesktop.in - sed -e 's|@SRCDIR[@]|$(ourdatadir)|g' $(srcdir)/$@.in > $@ +grc_setup_freedesktop: $(srcdir)/grc_setup_freedesktop.in Makefile + sed -e 's|@SRCDIR[@]|$(ourdatadir)|g' $< > $@ EXTRA_DIST = $(srcdir)/grc_setup_freedesktop.in BUILT_SOURCES = grc_setup_freedesktop 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 |