]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Fix EDF launcher and salome test issues
authoresy <emmanuel.streby@opencascade.com>
Thu, 23 Jan 2020 14:38:49 +0000 (15:38 +0100)
committeresy <emmanuel.streby@opencascade.com>
Thu, 23 Jan 2020 14:38:49 +0000 (15:38 +0100)
bin/appli_gen.py

index ba05883ed909bfdb8173794788f75b08bcdd3553..f33e00f1d4823bd087023e34d9ad1888de8fa6bf 100755 (executable)
@@ -224,6 +224,14 @@ def install(prefix, config_file, verbose=0):
             options.module_name = module
             options.module_path = _config[module]
             virtual_salome.link_module(options)
+            # To fix GEOM_TestXAO issue https://codev-tuleap.cea.fr/plugins/tracker/?aid=16599
+            if module == "GEOM":
+                # link <appli_path>/bin/salome/test/<module> to <module_path>/bin/salome/test
+                test_dir=os.path.join(home_dir,'bin','salome', 'test')
+                module_dir=os.path.abspath(options.module_path)
+                xao_link=os.path.join(module_dir,'bin','salome', 'test', "xao")
+                print("link %s --> %s"%(os.path.join(test_dir, "xao"), xao_link))
+                virtual_salome.symlink(xao_link, os.path.join(test_dir, "xao"))
             pass
         pass
 
@@ -327,6 +335,17 @@ def install(prefix, config_file, verbose=0):
         if "resources_path" in _config and os.path.isfile(_config["resources_path"]):
             command = 'export USER_CATALOG_RESOURCES_FILE=' + os.path.abspath(_config["resources_path"]) +'\n'
             f.write(command)
+        command ="""export PATH=${HOME}/${APPLI}/bin/salome:$PATH
+export PYTHONPATH=${HOME}/${APPLI}/lib/python3.6/site-packages/salome:$PYTHONPATH
+export PYTHONPATH=${HOME}/${APPLI}/lib/salome:$PYTHONPATH
+export LD_LIBRARY_PATH=${HOME}/${APPLI}/lib/salome:$LD_LIBRARY_PATH
+"""
+        f.write(command)
+        # Create environment variable for the salome test
+        for module in _config.get("modules", []):
+            command = "export LD_LIBRARY_PATH=  ${HOME}/${APPLI}/bin/salome/test/" + module + "/lib:$LD_LIBRARY_PATH\n"
+            f.write(command)
+            pass
 
     # Create configuration file: configSalome.cfg
     with open(os.path.join(home_dir, 'env.d', 'configSalome.cfg'),'w') as f:
@@ -343,12 +362,33 @@ def install(prefix, config_file, verbose=0):
         if "resources_path" in _config and os.path.isfile(_config["resources_path"]):
             command = 'USER_CATALOG_RESOURCES_FILE=' + os.path.abspath(_config["resources_path"]) +'\n'
             f.write(command)
+        command ="""ADD_TO_PATH: ${HOME}/${APPLI}/bin/salome
+ADD_TO_PYTHONPATH: ${HOME}/${APPLI}/lib/python3.6/site-packages/salome
+ADD_TO_PYTHONPATH: ${HOME}/${APPLI}/lib/salome
+ADD_TO_LD_LIBRARY_PATH: ${HOME}/${APPLI}/lib/salome
+"""
+        f.write(command)
+        for module in _config.get("modules", []):
+            command = "ADD_TO_LD_LIBRARY_PATH: ${HOME}/${APPLI}/bin/salome/test/" + module + "/lib\n"
+            f.write(command)
+            pass
 
 
     # Create environment file: configGUI.sh
+    dirs_ress_icon = []
+    salomeappname  = "SalomeApp"
     with open(os.path.join(home_dir, 'env.d', 'configGUI.sh'),'w') as f:
-        command = """export SalomeAppConfig=${HOME}/${APPLI}
-export SUITRoot=${HOME}/${APPLI}/share/salome
+        for module in _config.get("modules", []):
+            if module not in ["KERNEL", "GUI", ""]:
+                d = os.path.join(_config[module],"share","salome","resources",module.lower())
+                d_appli = os.path.join("${HOME}","${APPLI}","share","salome","resources",module.lower())
+                if os.path.exists( os.path.join(d,"{0}.xml".format(salomeappname)) ):
+                   dirs_ress_icon.append( d_appli )
+        AppConfig="export SalomeAppConfig=${HOME}/${APPLI}:${HOME}/${APPLI}/share/salome/resources/gui/"
+        for dir_module in dirs_ress_icon:
+             AppConfig=AppConfig+":"+dir_module
+        f.write(AppConfig+"\n")
+        command = """export SUITRoot=${HOME}/${APPLI}/share/salome
 export DISABLE_FPE=1
 export MMGT_REENTRANT=1
 """
@@ -356,9 +396,19 @@ export MMGT_REENTRANT=1
 
     # Create configuration file: configGUI.cfg
     with open(os.path.join(home_dir, 'env.d', 'configGUI.cfg'),'w') as f:
-        command = """[SALOME GUI Configuration]
-SalomeAppConfig=${HOME}/${APPLI}
-SUITRoot=${HOME}/${APPLI}/share/salome
+        command = """[SALOME GUI Configuration]\n"""
+        f.write(command)
+        for module in _config.get("modules", []):
+            if module not in ["KERNEL", "GUI", ""]:
+                d = os.path.join(_config[module],"share","salome","resources",module.lower())
+                d_appli = os.path.join("${HOME}","${APPLI}","share","salome","resources",module.lower())
+                if os.path.exists( os.path.join(d,"{0}.xml".format(salomeappname)) ):
+                   dirs_ress_icon.append( d_appli )
+        AppConfig="SalomeAppConfig=${HOME}/${APPLI}:${HOME}/${APPLI}/share/salome/resources/gui/"
+        for dir_module in dirs_ress_icon:
+             AppConfig=AppConfig+":"+dir_module
+        f.write(AppConfig+"\n")
+        command = """SUITRoot=${HOME}/${APPLI}/share/salome
 DISABLE_FPE=1
 MMGT_REENTRANT=1
 """