diff --git a/.gitignore b/.gitignore index 68b179e..64de61f 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,7 @@ Icon .AppleDesktop Network Trash Folder Temporary Items -.apdisk \ No newline at end of file +.apdisk + +venv +mangle.spec diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..1dfc44c --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,52 @@ +# Install Instructions + +For local development / building stand-alone binaries. + +You need [Python 2.7](https://www.python.org/downloads/release/python-2718/). + +If you are using Windows download the +`Windows x86 MSI installer` +because 32 bit Python is needed to create +a Windows executable with `py2exe`. +The performance increase from 64 bit is negligible. + +Be sure to add `python` to `PATH` during installation. + +Install [virtualenv](https://virtualenv.pypa.io/en/stable/) +globally, if you don't already have it. + +``` +> pip install virtualenv +``` + +and install all dependencies in a venv in the mangle directory, e.g. + +``` +...\mangle> virtualenv venv +> venv\Scripts\activate +(venv) > pip install -r requirements.txt +``` + +You can run the app via + +``` +(venv) > python mangle.pyw +``` + +Optionally, you can install all the dependencies globally +so you can simply click on the `mangle.pyw` file to run it. + +# Building an Executable (Windows) + +To actually build a stand-alone `.exe`, install + +[Microsoft Visual C++ Compiler for Python 2.7](https://www.microsoft.com/en-us/download/details.aspx?id=44266) + +A standalone binary can be created in the `dist` folder via + +``` +(venv) > python setup.py install +``` + +You may get an error which can be solved by looking at +https://stackoverflow.com/questions/38444230/error-converting-gui-to-standalone-executable-using-py2exe diff --git a/README.md b/README.md index ad8ee0e..05029ec 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,5 @@ from source. * [mangle\_win.zip](https://foosoft.net/projects/mangle/dl/mangle_win.zip) * [mangle\_osx.zip](https://foosoft.net/projects/mangle/dl/mangle_osx.zip) (quite old) + +Check [INSTALL.md](INSTALL.md) for build instructions. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..decdd52 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Pillow==6.2.2 +py2exe-py2==0.6.9; platform_system=='Windows' +PyQt4 @ https://download.lfd.uci.edu/pythonlibs/w4tscw6k/cp27/PyQt4-4.11.4-cp27-cp27m-win32.whl; platform_system=='Windows' +reportlab==3.5.59 diff --git a/setup.py b/setup.py index 1f774fc..b74142d 100644 --- a/setup.py +++ b/setup.py @@ -43,8 +43,8 @@ setup( options={'py2exe': { 'bundle_files': 1, 'includes': ['sip'], - 'packages': ['reportlab.pdfbase'], - 'dll_excludes': ['w9xpopen.exe'] + 'packages': ['reportlab.pdfbase', 'reportlab.rl_settings'], + 'dll_excludes': ['MSVCP90.dll', 'w9xpopen.exe'] }}, zipfile=None )