compatibility with MacOS : site-packages and DYLD_LIBRARY_PATH

This commit is contained in:
Roselyne Chotin 2013-04-26 15:32:59 +00:00
parent 7e036ab036
commit 77f71e68f8
1 changed files with 12 additions and 5 deletions

View File

@ -124,18 +124,16 @@ if __name__ == "__main__":
"""echo "%(MESSAGE)s";\n""" \ """echo "%(MESSAGE)s";\n""" \
"""echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \ """echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \
"""PATH="%(PATH)s";\n""" \ """PATH="%(PATH)s";\n""" \
"""LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \
"""BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n""" \ """BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n""" \
"""CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n""" \ """CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n""" \
"""STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \ """STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \
"""export PATH LD_LIBRARY_PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n""" \ """export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n""" \
"""hash -r;\n""" """hash -r;\n"""
shellScriptCsh = \ shellScriptCsh = \
"""echo "%(MESSAGE)s";\n""" \ """echo "%(MESSAGE)s";\n""" \
"""echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \ """echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \
"""setenv PATH "%(PATH)s";\n""" \ """setenv PATH "%(PATH)s";\n""" \
"""setenv LD_LIBRARY_PATH "%(LD_LIBRARY_PATH)s";\n""" \
"""setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n""" \ """setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n""" \
"""setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n""" \ """setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n""" \
"""setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \ """setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \
@ -167,7 +165,7 @@ if __name__ == "__main__":
if not options.nopython: if not options.nopython:
pyVersion = sys.version_info pyVersion = sys.version_info
version = "%d.%d" % (pyVersion[0],pyVersion[1]) version = "%d.%d" % (pyVersion[0],pyVersion[1])
if osType.startswith("Linux.SL") or osType.startswith("Linux.sl"): if osType.startswith("Linux.SL") or osType.startswith("Linux.sl") or osType.startswith("Darwin"):
sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version)
else: else:
sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version)
@ -178,9 +176,18 @@ if __name__ == "__main__":
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
shellScriptSh += """PYTHONPATH="%(PYTHONPATH)s";\n""" \ shellScriptSh += """PYTHONPATH="%(PYTHONPATH)s";\n""" \
"""export PYTHONPATH""" """export PYTHONPATH;\n"""
shellScriptCsh += """setenv PYTHONPATH "%(PYTHONPATH)s";""" shellScriptCsh += """setenv PYTHONPATH "%(PYTHONPATH)s";"""
if osType == "Darwin":
shellScriptSh += """DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \
"""export DYLD_LIBRARY_PATH;\n"""
shellScriptCsh += """setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n"""
else:
shellScriptSh += """LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \
"""export LD_LIBRARY_PATH;\n"""
shellScriptCsh += """setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n"""
if options.csh: shellScript = shellScriptCsh if options.csh: shellScript = shellScriptCsh
else: shellScript = shellScriptSh else: shellScript = shellScriptSh