From 75c094e1cbcad9685d572ef30a34631a63ac1aba Mon Sep 17 00:00:00 2001 From: crouzet Date: Thu, 14 Nov 2019 10:41:44 +0100 Subject: [PATCH] integration derniers ajustements pour windows --- commands/package.py | 30 +++++++++++++++++--- src/architecture.py | 2 +- src/environment.py | 6 +++- src/internal_config/README_BIN.template | 6 ++-- src/internal_config/README_LAUNCHER.template | 10 +++---- src/internal_config/salomeTools_win.pyconf | 2 +- 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/commands/package.py b/commands/package.py index 03d1055..c28a6a8 100644 --- a/commands/package.py +++ b/commands/package.py @@ -254,8 +254,15 @@ def produce_relative_launcher(config, for_package = binaries_dir_name) # Little hack to put out_dir_Path outside the strings - src.replace_in_file(filepath, 'r"out_dir_Path', 'out_dir_Path + r"' ) - src.replace_in_file(filepath, "r'out_dir_Path + ", "out_dir_Path + r'" ) + if src.architecture.is_windows(): + src.replace_in_file(filepath, '=out_dir_Path', '=%out_dir_Path%' ) + src.replace_in_file(filepath, ';out_dir_Path', ';%out_dir_Path%' ) + src.replace_in_file(filepath, 'out_dir_Path;', '%out_dir_Path%;' ) + src.replace_in_file(filepath, 'r"out_dir_Path', '%out_dir_Path% + r"' ) + src.replace_in_file(filepath, "r'out_dir_Path + ", "%out_dir_Path% + r'" ) + else: + src.replace_in_file(filepath, 'r"out_dir_Path', 'out_dir_Path + r"' ) + src.replace_in_file(filepath, "r'out_dir_Path + ", "out_dir_Path + r'" ) # A hack to put a call to a file for distene licence. # It does nothing to an application that has no distene product @@ -358,6 +365,7 @@ def produce_relative_env_files(config, # Little hack to put out_dir_Path as environment variable if src.architecture.is_windows() : src.replace_in_file(filepath, '"out_dir_Path', '"%out_dir_Path%' ) + src.replace_in_file(filepath, '=out_dir_Path', '=%out_dir_Path%' ) else: src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' ) @@ -613,8 +621,10 @@ WARNING: existing binaries directory from previous detar installation: 1) # construct the name of the directory that will contain the binaries - binaries_dir_name = config.INTERNAL.config.binary_dir + config.VARS.dist - + if src.architecture.is_windows(): + binaries_dir_name = config.INTERNAL.config.binary_dir + else: + binaries_dir_name = config.INTERNAL.config.binary_dir + config.VARS.dist # construct the correlation table between the product names, there # actual install directories and there install directory in archive d_products = {} @@ -1270,6 +1280,8 @@ In the following, $$ROOT represents the directory where you have installed SALOME (the directory where this file is located). """ + if src.architecture.is_windows(): + readme_header = readme_header.replace('$$ROOT','%ROOT%') readme_compilation_with_binaries=""" compilation based on the binaries used as prerequisites @@ -1314,6 +1326,16 @@ The procedure to do it is: if options.binaries or options.sources: d['application'] = config.VARS.application + d['BINARIES'] = config.INTERNAL.config.install_dir + d['SEPARATOR'] = config.VARS.sep + if src.architecture.is_windows(): + d['operatingSystem'] = 'Windows' + d['PYTHON3'] = 'python3' + d['ROOT'] = '%ROOT%' + else: + d['operatingSystem'] = 'Linux' + d['PYTHON3'] = '' + d['ROOT'] = '$ROOT' f.write("# Application: " + d['application'] + "\n") if 'KERNEL' in config.APPLICATION.products: VersionSalome = src.get_salome_version(config) diff --git a/src/architecture.py b/src/architecture.py index 662578e..b6b3688 100644 --- a/src/architecture.py +++ b/src/architecture.py @@ -97,7 +97,7 @@ def get_distrib_version(distrib): ''' if is_windows(): - return "64" + return platform.release() # get version from platform dist_version=platform.dist()[1].split('.') diff --git a/src/environment.py b/src/environment.py index 5c4c11c..e6540b0 100644 --- a/src/environment.py +++ b/src/environment.py @@ -380,7 +380,11 @@ class SalomeEnviron: """ if self.for_package: - self.set("PRODUCT_ROOT_DIR", "out_dir_Path") + if src.architecture.is_windows(): + self.set("PRODUCT_ROOT_DIR", "%out_dir_Path%") + else: + self.set("PRODUCT_ROOT_DIR", "out_dir_Path") + else: self.cfg.APPLICATION.environ.PRODUCT_ROOT_DIR = src.pyconf.Reference(self.cfg, src.pyconf.DOLLAR, "workdir") diff --git a/src/internal_config/README_BIN.template b/src/internal_config/README_BIN.template index 2f0154d..c4bc00c 100644 --- a/src/internal_config/README_BIN.template +++ b/src/internal_config/README_BIN.template @@ -3,10 +3,10 @@ Binaries ======== This package includes a binary installation of the application ¤{application}. -The binaries are stored in BINARIES directory. +The binaries are stored in ¤{BINARIES} directory. -Warning : This binary installation depends upon some native linux packages. +Warning : This binary installation depends upon some native ¤{operatingSystem} packages. If some of these packages are missing on your system, the execution may fail. -If this is the case, please install the missing ones with your linux package manager. +If this is the case, please install the missing ones with your ¤{operatingSystem} package manager. diff --git a/src/internal_config/README_LAUNCHER.template b/src/internal_config/README_LAUNCHER.template index 984c4cd..e9be1c1 100644 --- a/src/internal_config/README_LAUNCHER.template +++ b/src/internal_config/README_LAUNCHER.template @@ -1,12 +1,12 @@ To run the application, launch the following command: -> $ROOT/¤{launcher} +> ¤{PYTHON3} ¤{ROOT}¤{SEPARATOR}¤{launcher} -Note for the use of Salome on a remote computer through ssh: - When salome is used on a remote machine, the use of openGL 3 is not compatible with X11 forwarding (ssh -X). +Note for the use of SALOME on a remote computer through ssh: + When SALOME is used on a remote machine, the use of openGL 3 is not compatible with X11 forwarding (ssh -X). This cause segmentation faults when the 3D viewers are used. - For people who have no other choice and need to use ssh, we provide a mesa laucher called $ROOT/mesa_¤{launcher}. + For people who have no other choice and need to use ssh, we provide a MESA launcher called ¤{ROOT}¤{SEPARATOR}mesa_¤{launcher}. It will avoid the segmentation faults, at the price of poor performance : it should only be used in this case! If performance is required, a solution based on the use of VirtualGL and TurboVNC/x2go would be recommended. - But this requires some configuration of the tools to be done as root. + But this requires some configuration of the tools to be done as system administrator. diff --git a/src/internal_config/salomeTools_win.pyconf b/src/internal_config/salomeTools_win.pyconf index 7d9165f..53eae6c 100644 --- a/src/internal_config/salomeTools_win.pyconf +++ b/src/internal_config/salomeTools_win.pyconf @@ -8,7 +8,7 @@ INTERNAL : { copy_prefix : "LOCAL_" install_dir : "W64" - binary_dir : "" + binary_dir : "W64" single_install_dir : "EXT" } log : -- 2.39.2