Skip to content

Commit 05903c8

Browse files
authored
Update Pyinstaller spec (#202)
* Updated pyinstaller spec file for OCP * Put OCP path in the correct place * Removed extra Library part of path for MacOS
1 parent 162132e commit 05903c8

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

Diff for: pyinstaller.spec

+11-6
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ spyder_data = Path(site.getsitepackages()[-1]) / 'spyder'
99
parso_grammar = (Path(site.getsitepackages()[-1]) / 'parso/python').glob('grammar*')
1010

1111
if sys.platform == 'linux':
12-
oce_dir = Path(sys.prefix) / 'share' / 'oce-0.18'
13-
else:
14-
oce_dir = Path(sys.prefix) / 'Library' / 'share' / 'oce'
12+
occt_dir = os.path.join(Path(sys.prefix), 'share', 'opencascade')
13+
ocp_path = (os.path.join(HOMEPATH, 'OCP.cpython-38-x86_64-linux-gnu.so'), '.')
14+
elif sys.platform == 'darwin':
15+
occt_dir = os.path.join(Path(sys.prefix), 'share', 'opencascade')
16+
ocp_path = (os.path.join(HOMEPATH, 'OCP.cpython-38-darwin.so'), '.')
17+
elif sys.platform == 'win32':
18+
occt_dir = os.path.join(Path(sys.prefix), 'Library', 'share', 'opencascade')
19+
ocp_path = (os.path.join(HOMEPATH, 'OCP.cp38-win_amd64.pyd'), '.')
1520

1621
a = Analysis(['run.py'],
17-
pathex=['/home/adam/cq/CQ-editor'],
18-
binaries=[],
22+
pathex=['.'],
23+
binaries=[ocp_path],
1924
datas=[(spyder_data, 'spyder'),
20-
(oce_dir, 'oce')] +
25+
(occt_dir, 'opencascade')] +
2126
[(p, 'parso/python') for p in parso_grammar],
2227
hiddenimports=['ipykernel.datapub'],
2328
hookspath=[],

Diff for: pyinstaller/pyi_rth_occ.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from os import environ as env
22

3-
env['CASROOT'] = 'oce'
3+
env['CASROOT'] = 'opencascade'
44

5-
env['CSF_ShadersDirectory'] = 'oce/src/Shaders'
6-
env['CSF_UnitsLexicon'] = 'oce/src/UnitsAPI/Lexi_Expr.dat'
7-
env['CSF_UnitsDefinition'] = 'oce/src/UnitsAPI/Units.dat'
5+
env['CSF_ShadersDirectory'] = 'opencascade/src/Shaders'
6+
env['CSF_UnitsLexicon'] = 'opencascade/src/UnitsAPI/Lexi_Expr.dat'
7+
env['CSF_UnitsDefinition'] = 'opencascade/src/UnitsAPI/Units.dat'

0 commit comments

Comments
 (0)