diff options
| author | Paweł Jastrzębski <[email protected]> | 2014-05-25 10:58:01 +0200 |
|---|---|---|
| committer | Paweł Jastrzębski <[email protected]> | 2014-05-25 11:08:28 +0200 |
| commit | de74318c6984f11fbf76c55d68cd5e4aae5039c7 (patch) | |
| tree | e7b42de23313ca735423a894bc5786e8c4ea61b1 | |
| parent | Dependency tweak (diff) | |
| download | kcc-de74318c6984f11fbf76c55d68cd5e4aae5039c7.tar.gz kcc-de74318c6984f11fbf76c55d68cd5e4aae5039c7.tar.bz2 kcc-de74318c6984f11fbf76c55d68cd5e4aae5039c7.zip | |
Replaced cx_Freeze with py2exe
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | kcc.iss | 18 | ||||
| -rw-r--r-- | other/libEGL32.dll | bin | 47104 -> 0 bytes | |||
| -rw-r--r-- | other/libEGL64.dll | bin | 56320 -> 0 bytes | |||
| -rwxr-xr-x | setup.py | 74 |
5 files changed, 61 insertions, 33 deletions
diff --git a/README.md b/README.md index 4ded835..6375c60 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ sudo pip3 install pillow python-slugify psutil ``` ### For freezing code: -- Windows - [cx_Freeze](https://bitbucket.org/anthony_tuininga/cx_freeze) HEAD version with [this](https://bitbucket.org/anthony_tuininga/cx_freeze/pull-request/29/conversions-to-support-untranslated-wide) patchset. +- Windows - [py2exe](https://pypi.python.org/pypi/py2exe) 0.9.2+ - OS X - [py2app](https://bitbucket.org/ronaldoussoren/py2app) 0.8+ ## USAGE diff --git a/kcc.iss b/kcc.iss index 743f6d7..b27d46d 100644 --- a/kcc.iss +++ b/kcc.iss @@ -42,18 +42,16 @@ Name: "CB7association"; Description: "CB7"; GroupDescription: "File associations [Files] ; x64 files -Source: "build\exe.win-amd64-3.3\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode -Source: "build\exe.win-amd64-3.3\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode -Source: "build\exe.win-amd64-3.3\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode -Source: "build\exe.win-amd64-3.3\*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode -Source: "build\exe.win-amd64-3.3\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode +Source: "dist_64\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode +Source: "dist_64\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode +Source: "dist_64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode +Source: "dist_64\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "other\vcredist_x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode ; x86 files -Source: "build\exe.win32-3.3\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode -Source: "build\exe.win32-3.3\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode -Source: "build\exe.win32-3.3\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode -Source: "build\exe.win32-3.3\*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode -Source: "build\exe.win32-3.3\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode +Source: "dist\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode +Source: "dist\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode +Source: "dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode +Source: "dist\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "other\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode ; Common files Source: "LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion solidbreak diff --git a/other/libEGL32.dll b/other/libEGL32.dll deleted file mode 100644 index 28cc811..0000000 --- a/other/libEGL32.dll +++ /dev/null Binary files differdiff --git a/other/libEGL64.dll b/other/libEGL64.dll deleted file mode 100644 index 8389fa8..0000000 --- a/other/libEGL64.dll +++ /dev/null Binary files differdiff --git a/setup.py b/setup.py index 3041d8f..201ed81 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ Usage (Mac OS X): python setup.py py2app Usage (Windows): - python setup.py build + python setup.py py2exe """ from sys import platform, version_info if version_info[0] != 3: @@ -55,31 +55,61 @@ if platform == "darwin": ) ) elif platform == "win32": + # noinspection PyUnresolvedReferences + import py2exe import platform as arch - from cx_Freeze import setup, Executable + from distutils.core import setup if arch.architecture()[0] == '64bit': - library = 'libEGL64.dll' + suffix = '_64' else: - library = 'libEGL32.dll' - base = "Win32GUI" + suffix = '' + additional_files = [('imageformats', ['C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qgif.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qico.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qjpeg.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qmng.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qsvg.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qtga.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qtiff.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\imageformats\qwbmp.dll']), + ('platforms', ['C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\platforms\qminimal.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\platforms\qoffscreen.dll', + 'C:\Python33' + suffix + + '\Lib\site-packages\PyQt5\plugins\platforms\qwindows.dll']), + ('', ['LICENSE.txt', + 'other\\7za.exe', + 'other\\UnRAR.exe', + 'other\\Additional-LICENSE.txt', + 'other\\7za.exe', + 'C:\Python33' + suffix + '\Lib\site-packages\PyQt5\libEGL.dll'])] extra_options = dict( - options={"build_exe": {"optimize": 2, - "include_files": ['LICENSE.txt', - ['other/UnRAR.exe', 'UnRAR.exe'], - ['other/7za.exe', '7za.exe'], - ['other/Additional-LICENSE.txt', 'Additional-LICENSE.txt'], - ['other/' + library, 'libEGL.dll'] - ], - "copy_dependent_files": True, - "create_shared_zip": False, - "append_script_to_exe": True, - "replace_paths": '*=', - "excludes": ['tkinter']}}, - executables=[Executable(MAIN, - base=base, - targetName="KCC.exe", - icon="icons/comic2ebook.ico", - compress=False)]) + options={'py2exe': {"bundle_files": 2, + "dll_excludes": ["tcl85.dll", "tk85.dll"], + "dist_dir": "dist" + suffix, + "compressed": True, + "includes": ["sip"], + "excludes": ["tkinter"], + "optimize": 2}}, + windows=[{"script": "kcc.py", + "dest_base": "KCC", + "version": VERSION, + "copyright": "Ciro Mattia Gonano, Pawel Jastrzebski © 2014", + "legal_copyright": "ISC License (ISCL)", + "product_version": VERSION, + "product_name": "Kindle Comic Converter", + "file_description": "Kindle Comic Converter", + "icon_resources": [(1, "icons\comic2ebook.ico")]}], + zipfile=None, + data_files=additional_files) else: print('Please use setup.sh to build Linux package.') exit() |