Salome HOME
integration patch pour version windows
authorcrouzet <nicolas.crouzet@cea.fr>
Tue, 12 Nov 2019 09:58:04 +0000 (10:58 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Tue, 12 Nov 2019 09:58:04 +0000 (10:58 +0100)
commands/package.py
src/environment.py
src/fileEnviron.py

index 1e3ca2d35b389fd8cabf5a7e03c69e5b2559a9a3..02a8e7d566cabd82de6d3927a481ddafd5adf1b2 100644 (file)
@@ -42,6 +42,8 @@ PROJECT_DIR = "PROJECT"
 IGNORED_DIRS = [".git", ".svn"]
 IGNORED_EXTENSIONS = []
 
+PACKAGE_EXT=".tar.gz" # the extension we use for the packages
+
 PROJECT_TEMPLATE = """#!/usr/bin/env python
 #-*- coding:utf-8 -*-
 
@@ -354,7 +356,10 @@ def produce_relative_env_files(config,
                           for_package = binaries_dir_name)
 
     # Little hack to put out_dir_Path as environment variable
-    src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' )
+    if src.architecture.is_windows() :
+      src.replace_in_file(filepath, '"out_dir_Path', '"%out_dir_Path%' )
+    else:
+      src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' )
 
     # change the rights in order to make the file executable for everybody
     os.chmod(filepath,
@@ -921,7 +926,7 @@ def make_archive(prod_name, prod_info, where):
     :return: The path of the resulting archive
     :rtype: str
     '''
-    path_targz_prod = os.path.join(where, prod_name + ".tgz")
+    path_targz = os.path.join(dir_name, archive_name + PACKAGE_EXT)
     tar_prod = tarfile.open(path_targz_prod, mode='w:gz')
     local_path = prod_info.source_dir
     tar_prod.add(local_path,
@@ -1329,7 +1334,7 @@ The procedure to do it is:
         if options.sources:
             f.write(src.template.substitute(readme_template_path_src, d))
 
-        if options.binaries and options.sources:
+        if options.binaries and options.sources and not src.architecture.is_windows():
             f.write(readme_compilation_with_binaries)
 
         if options.project:
@@ -1503,7 +1508,7 @@ Please add it in file:
             logger.write("\n", 1)
             return 1
  
-    path_targz = os.path.join(dir_name, archive_name + ".tgz")
+    path_targz = os.path.join(dir_name, archive_name + PACKAGE_EXT)
     
     src.printcolors.print_value(logger, "Package path", path_targz, 2)
 
index d5a98110638b102e2d1b313abe74ec7afaef5b1a..5c4c11cd653dcf03e55c7b4899f8cd6e586b2cd3 100644 (file)
@@ -388,7 +388,8 @@ class SalomeEnviron:
         self.add_line(1)
         self.add_comment("reset these sensitive variables to avoid bad environment interactions")
         self.add_comment("comment these to lines if you wish a different behaviour")
-        self.set("LD_LIBRARY_PATH", "")
+        if not src.architecture.is_windows():
+           self.set("LD_LIBRARY_PATH", "")
         self.set("PYTHONPATH", "")
         self.add_line(1)
 
index b2feabe587904ad54101fb75946388c8a03bd960..d9ba063c014574478b98b77608b496a3e8f1875f 100644 (file)
@@ -476,6 +476,9 @@ class LauncherFileEnviron(FileEnviron):
             launcher_header=launcher_header2
         else:
             launcher_header=launcher_header3
+        # in case of Windows OS, Python scripts are not executable.  PyExe ?
+        if src.architecture.is_windows():
+            launcher_header = launcher_header.replace("#! /usr/bin/env python3",'')
         self.output.write(launcher_header\
                           .replace("BIN_KERNEL_INSTALL_DIR", self.bin_kernel_root_dir))
 
@@ -625,7 +628,7 @@ class LauncherFileEnviron(FileEnviron):
     
 
     def add_comment(self, comment):
-        # Special comment in case of the distène licence
+        # Special comment in case of the DISTENE licence
         if comment=="DISTENE license":
             self.output.write(self.indent+
                               "#"+
@@ -762,7 +765,7 @@ out_dir_Path=os.path.dirname(os.path.realpath(__file__))
 # Preliminary work to initialize path to SALOME Python modules
 def __initialize():
 
-  sys.path[:0] = [ 'BIN_KERNEL_INSTALL_DIR' ]  # to get salomeContext
+  sys.path[:0] = [ r'BIN_KERNEL_INSTALL_DIR' ]  # to get salomeContext
   
   # define folder to store omniorb config (initially in virtual application folder)
   try:
@@ -836,7 +839,7 @@ out_dir_Path=os.path.dirname(os.path.realpath(__file__))
 # Preliminary work to initialize path to SALOME Python modules
 def __initialize():
 
-  sys.path[:0] = [ 'BIN_KERNEL_INSTALL_DIR' ]
+  sys.path[:0] = [ r'BIN_KERNEL_INSTALL_DIR' ]
   
   # define folder to store omniorb config (initially in virtual application folder)
   try: