Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #794 from henrykironde/pyinst
Use pyinstaller for creating exe for windows and app for mac
- Loading branch information
Showing
5 changed files
with
81 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/ | ||
sudo rm -rf mac | ||
sudo mkdir mac | ||
sudo python setup.py install | ||
sudo python setup.py py2app | ||
sudo mv dist mac | ||
sudo rm mac/*.egg | ||
sudo rm -rf mac/scripts | ||
sudo ditto --rsrc x86_64 mac/retriever.app mac/retriever2.app | ||
sudo rm -rf mac/retriever.app | ||
sudo mv mac/retriever2.app mac/retriever.app | ||
cd mac | ||
sudo zip -r retriever.zip retriever.app | ||
cd .. | ||
sudo pyinstaller pyinstaller.spec --log-level ERROR | ||
sudo mv dist/retriever.app mac/retriever.app | ||
sudo rm -rf build dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# -*- mode: python -*- | ||
import os | ||
import distutils.util | ||
|
||
platform = distutils.util.get_platform() | ||
block_cipher = None | ||
|
||
a = Analysis(['__main__.py'], | ||
pathex=['.', 'lib','engines', 'scripts'], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=['xlrd', 'pymysql', 'psycopg2', 'sqlite3', 'pyodbc'], | ||
hookspath=[], | ||
runtime_hooks=[], | ||
excludes=[ | ||
], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher) | ||
|
||
a.pure += [('retriever.engines.mysql','engines/mysql.py','PYMODULE'), | ||
('retriever.engines.postgres','engines/postgres.py', 'PYMODULE'), | ||
('retriever.engines.sqlite','engines/sqlite.py', 'PYMODULE'), | ||
('retriever.engines.msaccess','engines/msaccess.py', 'PYMODULE'), | ||
('retriever.engines.csvengine','engines/csvengine.py', 'PYMODULE'), | ||
('retriever.engines.download_only','engines/download_only.py', 'PYMODULE'), | ||
('retriever.engines.jsonengine','engines/jsonengine.py', 'PYMODULE'), | ||
('retriever.engines.xmlengine','engines/xmlengine.py', 'PYMODULE'), | ||
('retriever.lib.templates', 'lib/templates.py', 'PYMODULE'), | ||
('retriever.lib.excel', 'lib/excel.py', 'PYMODULE')] | ||
|
||
pyz = PYZ(a.pure, a.zipped_data, | ||
cipher=block_cipher) | ||
|
||
icon_file='icon.ico' | ||
if 'macosx' in platform: | ||
icon_file='osx_icon.icns' | ||
|
||
if 'macosx' or 'linux' in platform: | ||
exe = EXE(pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
name='retriever', | ||
debug=False, | ||
strip=False, | ||
upx=True, | ||
console=False , icon=icon_file) | ||
|
||
if 'macosx' in platform: | ||
app = BUNDLE(exe, | ||
name='retriever.app', | ||
icon='osx_icon.icns', | ||
bundle_identifier=None) | ||
|
||
if 'win' in platform: | ||
exe = EXE(pyz, | ||
a.scripts, | ||
exclude_binaries=True, | ||
name='retriever', | ||
debug=False, | ||
strip=False, | ||
upx=True, | ||
console=True, icon=icon_file ) | ||
coll = COLLECT(exe, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
strip=False, | ||
upx=True, | ||
name='packages') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters