|
37 | 37 | import tempfile |
38 | 38 | from distutils.command.build_py import build_py |
39 | 39 | from distutils.dir_util import copy_tree |
| 40 | +from distutils.file_util import copy_file |
40 | 41 |
|
41 | 42 | from setuptools import setup |
42 | 43 |
|
@@ -70,16 +71,16 @@ def fetch_oms(self): |
70 | 71 | # download the zip directory from url |
71 | 72 | if (sysconfig.get_platform() == 'linux-x86_64'): |
72 | 73 | response = requests.get('https://build.openmodelica.org/omsimulator/nightly/linux-amd64/OMSimulator-linux-amd64-@OMS_VERSION_STRING@.tar.gz') |
73 | | - elif (sysconfig.get_platform() == 'linux-i386'): |
74 | | - response = requests.get('https://build.openmodelica.org/omsimulator/nightly/linux-i386/OMSimulator-linux-i386-@OMS_VERSION_STRING@.tar.gz') |
75 | | - elif (sysconfig.get_platform() == 'linux-arm32'): |
76 | | - response = requests.get('https://build.openmodelica.org/omsimulator/nightly/linux-arm32/OMSimulator-linux-arm32-@OMS_VERSION_STRING@.tar.gz') |
77 | | - elif (sysconfig.get_platform() == 'mingw' and platform.architecture()[0] == '64bit'): |
| 74 | + dllpath = "lib/x86_64-linux-gnu/libOMSimulator.so" |
| 75 | + elif (sysconfig.get_platform() == "mingw_x86_64_ucrt" or (sysconfig.get_platform() == 'mingw' and platform.architecture()[0] == '64bit')): |
78 | 76 | response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-mingw-ucrt64/OMSimulator-mingw-ucrt64-@OMS_VERSION_STRING@.zip') |
| 77 | + dllpath = "bin/libOMSimulator.dll" |
79 | 78 | elif (sysconfig.get_platform() == 'win-amd64'): |
80 | 79 | response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-msvc64/OMSimulator-win64-@OMS_VERSION_STRING@.zip') |
| 80 | + dllpath = "bin/OMSimulator.dll" |
81 | 81 | elif (platform.system() == 'Darwin'): |
82 | 82 | response = requests.get('https://build.openmodelica.org/omsimulator/nightly/osx/OMSimulator-osx-@OMS_VERSION_STRING@.zip') |
| 83 | + dllpath = "lib/libOMSimulator.dylib" |
83 | 84 | else: |
84 | 85 | raise Exception("Platform not supported for {} ".format(sysconfig.get_platform())) |
85 | 86 |
|
@@ -112,6 +113,12 @@ def fetch_oms(self): |
112 | 113 | # copy OMSimulator package to root directory |
113 | 114 | copy_tree(os.path.join(zipDir, 'lib/OMSimulator'), target_dir) |
114 | 115 |
|
| 116 | + # copy schema path to OMSimulator/schema |
| 117 | + copy_tree(os.path.join(zipDir, 'share/OMSimulator/schema'), target_dir +"/schema") |
| 118 | + |
| 119 | + # copy dll to root directory |
| 120 | + copy_file(os.path.join(zipDir, dllpath), target_dir) |
| 121 | + |
115 | 122 | # remove the zip directory after copying the files |
116 | 123 | shutil.rmtree(zipDir) |
117 | 124 |
|
|
0 commit comments