Allow hard-coded paths to be overridden with $XDG_DATA_DIRS
Necessary for post-installation relocatability. Also ensure that data installed to share/gramps is in mac bundle. svn: r21246
This commit is contained in:
parent
9ea3e520cb
commit
bf9af55a3f
@ -93,12 +93,6 @@ APP_GRAMPS_PKG = "application/x-gramps-package"
|
||||
APP_GENEWEB = "application/x-geneweb"
|
||||
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# system paths
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
LOCALE_DIR = "@LOCALE_DIR@"
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Platforms
|
||||
@ -205,6 +199,19 @@ else:
|
||||
# Paths to data files.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
if "XDG_DATA_DIRS" in os.environ:
|
||||
share = None
|
||||
for path in os.environ["XDG_DATA_DIRS"].split(":"):
|
||||
if os.path.exists(os.path.join(path, "gramps", "tips.xml")):
|
||||
share = path
|
||||
break
|
||||
if not share:
|
||||
share = os.path.split("@DATA_DIR@")[0]
|
||||
LOCALE_DIR = os.path.join(share, "locale")
|
||||
DATA_DIR = os.path.join(share, "gramps")
|
||||
IMAGE_DIR = os.path.join(DATA_DIR, "icons", "hicolor")
|
||||
DOC_DIR = os.path.join(share, "doc", "gramps")
|
||||
else:
|
||||
LOCALE_DIR = "@LOCALE_DIR@"
|
||||
DATA_DIR = "@DATA_DIR@"
|
||||
IMAGE_DIR = "@IMAGE_DIR@"
|
||||
|
@ -183,6 +183,10 @@
|
||||
${prefix}/lib/graphviz/config6
|
||||
</data>
|
||||
|
||||
<data>
|
||||
${prefix}/share/gramps
|
||||
</data>
|
||||
|
||||
<!-- Copy in the themes data. You may want to trim this to save space
|
||||
in your bundle. -->
|
||||
<data>
|
||||
|
Loading…
Reference in New Issue
Block a user