Skip to content

Commit

Permalink
fix source path in pip package (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
arun3688 authored Mar 22, 2024
1 parent fea36e3 commit 1eb92ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,20 @@ def fetch_oms(self):
if (sysconfig.get_platform() == 'linux-x86_64'):
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/linux-amd64/OMSimulator-linux-amd64-@[email protected]')
dllpath = "lib/x86_64-linux-gnu/libOMSimulator.so"
sourcePath = "lib/x86_64-linux-gnu/OMSimulator"
elif (sysconfig.get_platform() == "mingw_x86_64_ucrt" or (sysconfig.get_platform() == 'mingw' and platform.architecture()[0] == '64bit')):
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-mingw-ucrt64/OMSimulator-mingw-ucrt64-@[email protected]')
dllpath = "bin/libOMSimulator.dll"
sourcePath = "lib/OMSimulator"
elif (sysconfig.get_platform() == 'win-amd64'):
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/win-msvc64/OMSimulator-win64-@[email protected]')
dllpath = "bin/OMSimulator.dll"
sourcePath = "lib/OMSimulator"
elif (platform.system() == 'Darwin'):
response = requests.get('https://build.openmodelica.org/omsimulator/nightly/osx/OMSimulator-osx-@[email protected]')
dllpath = "lib/libOMSimulator.dylib"
## the path needs to be checked, as of now we are not buiding artifacts for macos
sourcePath = "lib/OMSimulator"
else:
raise Exception("Platform not supported for {} ".format(sysconfig.get_platform()))

Expand Down Expand Up @@ -111,7 +116,7 @@ def fetch_oms(self):
shutil.unpack_archive(zipFilePath, zipDir)

# copy OMSimulator package to root directory
copy_tree(os.path.join(zipDir, 'lib/OMSimulator'), target_dir)
copy_tree(os.path.join(zipDir, sourcePath), target_dir)

# copy schema path to OMSimulator/schema
copy_tree(os.path.join(zipDir, 'share/OMSimulator/schema'), target_dir +"/schema")
Expand Down

0 comments on commit 1eb92ef

Please sign in to comment.