diff --git a/build_mac.bash b/build_mac.bash index f81b717..8fe282e 100755 --- a/build_mac.bash +++ b/build_mac.bash @@ -1,44 +1,13 @@ -rm -rf freeze - -cxfreeze main.py --target-dir=freeze --include-modules=PySide.QtGui,PySide,PySide.QtNetwork,PySide.QtCore,PIL -chmod 755 freeze/* -cp -rf freeze/* Web2Executable.app/Contents/MacOS/ - -install_name_tool -change /usr/local/Cellar/pyside/1.2.1/lib/libpyside-python2.7.1.2.dylib @executable_path/libpyside-python2.7.1.2.dylib Web2Executable.app/Contents/MacOS/PySide.QtCore.so -install_name_tool -change /usr/local/lib/libshiboken-python2.7.1.2.1.dylib @executable_path/libshiboken-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/PySide.QtCore.so -install_name_tool -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/PySide.QtCore.so - -install_name_tool -change /usr/local/Cellar/pyside/1.2.1/lib/libpyside-python2.7.1.2.dylib @executable_path/libpyside-python2.7.1.2.dylib Web2Executable.app/Contents/MacOS/PySide.QtGui.so -install_name_tool -change /usr/local/lib/libshiboken-python2.7.1.2.1.dylib @executable_path/libshiboken-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/PySide.QtGui.so -install_name_tool -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/PySide.QtGui.so -install_name_tool -change /usr/local/lib/QtGui.framework/Versions/4/QtGui @executable_path/QtGui Web2Executable.app/Contents/MacOS/PySide.QtGui.so - -install_name_tool -change /usr/local/Cellar/pyside/1.2.1/lib/libpyside-python2.7.1.2.dylib @executable_path/libpyside-python2.7.1.2.dylib Web2Executable.app/Contents/MacOS/PySide.QtNetwork.so -install_name_tool -change /usr/local/lib/libshiboken-python2.7.1.2.1.dylib @executable_path/libshiboken-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/PySide.QtNetwork.so -install_name_tool -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/PySide.QtNetwork.so -install_name_tool -change /usr/local/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/QtNetwork Web2Executable.app/Contents/MacOS/PySide.QtNetwork.so - -install_name_tool -change /usr/local/lib/libpyside-python2.7.1.2.1.dylib @executable_path/libpyside-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/libpyside-python2.7.1.2.dylib -install_name_tool -change /usr/local/lib/libshiboken-python2.7.1.2.1.dylib @executable_path/libshiboken-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/libpyside-python2.7.1.2.dylib -install_name_tool -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/libpyside-python2.7.1.2.dylib - -install_name_tool -change /usr/local/lib/libpyside-python2.7.1.2.1.dylib @executable_path/libpyside-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/libpyside-python2.7.1.2.1.dylib -install_name_tool -change /usr/local/lib/libshiboken-python2.7.1.2.1.dylib @executable_path/libshiboken-python2.7.1.2.1.dylib Web2Executable.app/Contents/MacOS/libpyside-python2.7.1.2.1.dylib -install_name_tool -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/libpyside-python2.7.1.2.1.dylib - - -install_name_tool -change /usr/local/lib/QtGui.framework/Versions/4/QtGui @executable_path/QtGui Web2Executable.app/Contents/MacOS/QtGui -install_name_tool -change /usr/local/Cellar/qt/4.8.5/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/QtGui - - -install_name_tool -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/QtCore - - -install_name_tool -change /usr/local/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/QtNetwork Web2Executable.app/Contents/MacOS/QtNetwork -install_name_tool -change /usr/local/Cellar/qt/4.8.5/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore Web2Executable.app/Contents/MacOS/QtNetwork - -install_name_tool -change /usr/local/lib/libjpeg.8.dylib @executable_path/libjpeg.8.dylib Web2Executable.app/Contents/MacOS/PIL._imaging.so - rm -rf command_line_builds/files pyinstaller --hidden-import configobj --distpath command_line_builds --onefile -n web2exe-mac command_line.py cp -rf files command_line_builds/files/ + +rm -rf build dist Web2Executable.app + +sudo python build_mac_setup.py py2app --iconfile icon.icns + +sudo chown -R joey dist/main.app +sudo chown -R joey dist/ build/ +mv dist/main.app Web2Executable.app + +rm -rf build dist diff --git a/build_mac_setup.py b/build_mac_setup.py new file mode 100644 index 0000000..77ca266 --- /dev/null +++ b/build_mac_setup.py @@ -0,0 +1,22 @@ +""" +This is a setup.py script generated by py2applet + +Usage: + python setup.py py2app +""" + +from setuptools import setup + +APP = ['main.py'] +DATA_FILES = ['files'] +OPTIONS = { + 'iconfile': 'icon.icns', + 'includes': ['PySide.QtCore', 'PySide.QtGui', 'PySide.QtNetwork', 'configobj'], + } + +setup( + app=APP, + data_files=DATA_FILES, + options={'py2app': OPTIONS}, + setup_requires=['py2app'], +) diff --git a/command_line.py b/command_line.py index e16dd59..bb284d9 100644 --- a/command_line.py +++ b/command_line.py @@ -32,11 +32,7 @@ from configobj import ConfigObj inside_packed_exe = getattr(sys, 'frozen', '') -if inside_packed_exe: - CWD = os.path.dirname(sys.executable) - os.chdir(CWD) -else: - CWD = os.getcwd() +CWD = os.getcwd() TEMP_DIR = get_temp_dir() DEFAULT_DOWNLOAD_PATH = os.path.join(CWD, diff --git a/icon.icns b/icon.icns new file mode 100644 index 0000000..dea37dc Binary files /dev/null and b/icon.icns differ