1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-11-14 03:29:02 +00:00

Update packaging for windows

- Update package.py to integrate NSIS for windows
- Update makefile to deal with a few additional windows issues
- Add Windows.md to contain specific windows instructions, if we want
this can be merged with README.md
- Minor formatting update to setup.nsi
Ref #393
This commit is contained in:
Andrew Senetar 2017-08-07 21:48:40 -05:00
parent 450770c8f7
commit 29fbc7553d
4 changed files with 56 additions and 4 deletions

View File

@ -1,17 +1,23 @@
PYTHON ?= python3
PYRCC5 ?= pyrcc5
REQ_MINOR_VERSION = 4
PREFIX ?= /usr/local
# Window compatability via Msys2
# - venv creates Scripts instead of bin
# - compile generates .pyd instead of .so
# - venv with --sytem-site-packages has issues on windows as well...
ifeq ($(shell uname -o), Msys)
BIN = Scripts
SO = pyd
VENV_OPTIONS =
PIP_OPTIONS =
else
BIN = bin
SO = so
VENV_OPTIONS = --system-site-packages
PIP_OPTIONS = --user
endif
# Set this variable if all dependencies are already met on the system. We will then avoid the
@ -69,15 +75,15 @@ $(submodules_target) :
env : | $(submodules_target) reqs
ifndef NO_VENV
@echo "Creating our virtualenv"
${PYTHON} -m venv env --system-site-packages
$(VENV_PYTHON) -m pip install --user -r requirements.txt
${PYTHON} -m venv env ${VENV_OPTIONS}
$(VENV_PYTHON) -m pip install ${PIP_OPTIONS} -r requirements.txt
endif
build/help : | env
$(VENV_PYTHON) build.py --doc
qt/dg_rc.py : qt/dg.qrc
pyrcc5 qt/dg.qrc > qt/dg_rc.py
$(PYRCC5) qt/dg.qrc > qt/dg_rc.py
i18n: $(mofiles)

37
Windows.md Normal file
View File

@ -0,0 +1,37 @@
## How to build dupeGuru for Windows
### Prerequisites
- [Python 3.4+][python]
- [nsis](http://nsis.sourceforge.net/Main_Page) (for installer creation)
### With build.py (preferred)
$ cd <dupeGuru directory>
$ git submodule init
$ git submodule update
$ py -3.5 -m venv .\env
$ .\env\Scripts\activate
$ pip install -r requirements.txt -r requirements-windows.txt
$ python build.py
$ python run.py
### With makefile
It is possible to build dupeGuru with the makefile on windows using msys2. There are a few additional considerations:
1. Install PyQt5 globally
2. pass the correct value for PYTHON to the makefile if not on the path as python3
3. Install PyQt5 & cx-Freeze with requirements-windows.txt into the venv
Then the following should work
$ make PYTHON='py -3.5'
$ make run
### Generate Windows Installer Packages
You need to use the respective x86 or x64 version of python to build the 32 bit and 64 bit versions. The build scripts will automatically detect the python architecture for you. When using build.py make sure the resulting python works before continuing to package.py.
$ python package.py
$ python package.py --installer_windows
### Running tests
The complete test suite can be run with tox just like on linux.

View File

@ -12,6 +12,7 @@ import shutil
import json
from argparse import ArgumentParser
import platform
import re
from hscommon.build import (
print_and_do, copy_packages, build_debian_changelog,
@ -168,6 +169,14 @@ def package_windows():
executables=executables,
script_args=['build']
)
# Information to pass to NSIS
version_array = app_version.split('.')
match = re.search('[0-9]+', arch)
bits = match.group(0)
# Call NSIS (TODO update to not use hardcoded path)
cmd = ('"C:\\Program Files (x86)\\NSIS\\Bin\\makensis.exe" '
'/DVERSIONMAJOR={0} /DVERSIONMINOR={1} /DVERSIONPATCH={2} /DBITS={3} setup.nsi')
print_and_do(cmd.format(version_array[0], version_array[1], version_array[2], bits))
def main():
args = parse_args()

View File

@ -85,7 +85,7 @@ var InstallSize
!include MultiUser.nsh
; Modern UI 2
!include "MUI2.nsh"
!include MUI2.nsh
!define MUI_ICON "${APPICON}"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING