diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | kcc.py | 6 | ||||
| -rw-r--r-- | setup.py | 11 |
3 files changed, 15 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore index 0fb638d..fc523ae 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ dist test Output kindlegen* -UnRAR* -7za* +solaio .DS_Store Thumbs.db diff --git a/kcc.py b/kcc.py index 771c42f..baba705 100644 --- a/kcc.py +++ b/kcc.py @@ -40,8 +40,10 @@ except ImportError: from kcc import KCC_gui from multiprocessing import freeze_support if sys.platform.startswith('darwin'): - # Workaround Finder-launched app PATH evaluation - os.environ['PATH'] = '/usr/local/bin:' + os.environ['PATH'] + if 'RESOURCEPATH' in os.environ: + os.environ['PATH'] = os.environ['RESOURCEPATH'] + ':' + os.environ['PATH'] + else: + os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/:' + os.environ['PATH'] from kcc import KCC_ui_osx as KCC_ui elif sys.platform.startswith('linux'): from kcc import KCC_ui_linux as KCC_ui diff --git a/setup.py b/setup.py index 4bee918..4e0eadc 100644 --- a/setup.py +++ b/setup.py @@ -24,10 +24,11 @@ if platform == "darwin": argv_emulation=True, iconfile='icons/comic2ebook.icns', includes=['PIL', 'sip', 'PyQt4', 'PyQt4.QtCore', 'PyQt4.QtGui', 'PyQt4.QtNetwork'], + qt_plugins=[], excludes=['PyQt4.QtDeclarative', 'PyQt4.QtDesigner', 'PyQt4.QtHelp', 'PyQt4.QtMultimedia', 'PyQt4.QtOpenGL', 'PyQt4.QtScript', 'PyQt4.QtScriptTools', 'PyQt4.QtSql', 'PyQt4.QtSvg', 'PyQt4.QtXmlPatterns', 'PyQt4.QtXml', 'PyQt4.QtWebKit', 'PyQt4.QtTest', 'Tkinter'], - resources=['LICENSE.txt', 'other/Additional-LICENSE.txt', 'other/unrar'], + resources=['LICENSE.txt', 'other/Additional-LICENSE.txt', 'other/unrar', 'other/7za'], plist=dict( CFBundleName=NAME, CFBundleShortVersionString=VERSION, @@ -44,6 +45,9 @@ if platform == "darwin": ) ], LSMinimumSystemVersion='10.6.0', + LSEnvironment=dict( + PATH='/usr/local/bin:/usr/bin:/bin' + ), NSHumanReadableCopyright='ISC License (ISCL)' ) ) @@ -84,3 +88,8 @@ setup( packages=['kcc'], requires=['Pillow'], **extra_options ) + +if platform == "darwin": + from os import chmod + chmod('dist/' + NAME + '.app/Contents/Resources/unrar', 0777) + chmod('dist/' + NAME + '.app/Contents/Resources/7za', 0777) \ No newline at end of file |