Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grass.app: Move ISIS integration to the library #4169

Merged
merged 2 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,20 +1073,6 @@ def load_env(grass_env_file):
# create a new environment variable
os.environ[k] = v

# Allow for mixed ISIS-GRASS Environment
if os.getenv("ISISROOT"):
isis = os.getenv("ISISROOT")
os.environ["ISIS_LIB"] = isis + os.sep + "lib"
os.environ["ISIS_3RDPARTY"] = isis + os.sep + "3rdParty" + os.sep + "lib"
os.environ["QT_PLUGIN_PATH"] = isis + os.sep + "3rdParty" + os.sep + "plugins"
# os.environ['ISIS3DATA'] = isis + "$ISIS3DATA"
libpath = os.getenv("LD_LIBRARY_PATH", "")
isislibpath = os.getenv("ISIS_LIB")
isis3rdparty = os.getenv("ISIS_3RDPARTY")
os.environ["LD_LIBRARY_PATH"] = (
libpath + os.pathsep + isislibpath + os.pathsep + isis3rdparty
)


def install_notranslation():
# If locale is not supported, _ function might be missing
Expand Down
20 changes: 20 additions & 0 deletions python/grass/app/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def set_paths(install_path, grass_config_dir, ld_library_path_variable_name):
# retrieving second time, but now it is always set
addon_base = os.getenv("GRASS_ADDON_BASE")
set_man_path(install_path=install_path, addon_base=addon_base, env=os.environ)
set_isis()


def set_man_path(install_path, addon_base, env):
Expand Down Expand Up @@ -274,6 +275,25 @@ def set_browser(install_path):
os.environ["GRASS_HTML_BROWSER"] = browser


def set_isis():
"""Enable a mixed ISIS-GRASS environment

ISIS is Integrated Software for Imagers and Spectrometers by USGS.
"""
if os.getenv("ISISROOT"):
isis = os.getenv("ISISROOT")
os.environ["ISIS_LIB"] = isis + os.sep + "lib"
os.environ["ISIS_3RDPARTY"] = isis + os.sep + "3rdParty" + os.sep + "lib"
os.environ["QT_PLUGIN_PATH"] = isis + os.sep + "3rdParty" + os.sep + "plugins"
# os.environ['ISIS3DATA'] = isis + "$ISIS3DATA"
libpath = os.getenv("LD_LIBRARY_PATH", "")
isislibpath = os.getenv("ISIS_LIB")
isis3rdparty = os.getenv("ISIS_3RDPARTY")
os.environ["LD_LIBRARY_PATH"] = (
libpath + os.pathsep + isislibpath + os.pathsep + isis3rdparty
)


def ensure_home():
"""Set HOME if not set on MS Windows"""
if WINDOWS and not os.getenv("HOME"):
Expand Down
Loading