Skip to content

Commit

Permalink
grass.app: Move ISIS integration to the library (OSGeo#4169)
Browse files Browse the repository at this point in the history
Path setup for ISIS was lost in GIS variable setup. This moves it to the library, where other paths and integrations are initialized.

The variables are left as is, without further testing.
  • Loading branch information
wenzeslaus authored Sep 7, 2024
1 parent 39e1e11 commit 83ee146
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
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

0 comments on commit 83ee146

Please sign in to comment.