From 9a426f25bb44aeede1a524cc6ef84897d9f6254d Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sun, 2 Sep 2018 13:43:37 +0200 Subject: [PATCH] More build notes --- Makefile | 13 +++++++++++-- README.md | 18 ++++++++++++++++++ windows-build.bat | 19 +++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 windows-build.bat diff --git a/Makefile b/Makefile index 464eb14..9d5a65e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,12 @@ PY_FILES = $(wildcard *.py) $(wildcard gui/*.py) UI_COMPILED = $(UI_FILES:.ui=.py) TS_COMPILED = $(TS_FILES:.ts=.qm) +ifeq (, $(shell which python3)) +PY ?= python +else +PY ?= python3 +endif + %.py: %.ui pyuic5 $< > $@ @@ -18,10 +24,13 @@ clean: rm $(TS_COMPILED) run: all - python3 luftdaten-tool.py + $(PY) luftdaten-tool.py dist: all - python3 -m PyInstaller luftdaten-tool.spec + $(PY) -m PyInstaller luftdaten-tool.spec + +deps: + $(PY) -m pip install -U -r requirements.txt i18n-update: @for f in $(TS_FILES) ; do \ diff --git a/README.md b/README.md index 47147eb..33e3c5d 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,35 @@ Binary builds Our main target is having working prebuilt binaries for users to simply download and run, to avoid all the setup below. +### Linux +Currently Linux builds require *Python 3.6* (but 3.7 seems to work fine as +well), GNU make and Qt Linguist tools. Following packages should suffice on +Ubuntu: + + sudo apt install qttools5-dev-tools python3.6 make + +Then, to install python dependencies and build the binary use: + + make deps dist + ### Windows Currently Windows builds require *Python 3.6* installed system-wide and added to `%PATH%`. +To install python and cygwin dependencies and build everything use +`windows-build.bat` batch script. + ### MacOS Currently MacOS builds require *Python 3.6* and Qt SDK installed (just the "Qt > 5... > macOS" part in installer) with following added to $PATH: export PATH="$HOME/Qt/5.11.1/clang_64/bin:$PATH" +Then just install dependencies and build everything using: + + make deps dist + Development ----------- diff --git a/windows-build.bat b/windows-build.bat new file mode 100644 index 0000000..dfae8af --- /dev/null +++ b/windows-build.bat @@ -0,0 +1,19 @@ +if not exist build mkdir build + +rem Download cygwin installer +if not exist build\cygwin-x86.exe powershell -Command "Invoke-WebRequest https://cygwin.com/setup-x86.exe -OutFile build\cygwin-x86.exe" + +rem Install required Cygwin packages +if not exist build\cygwin build\cygwin-x86.exe --site http://cygwin.mirror.constant.com ^ + --no-shortcuts ^ + --no-desktop ^ + --quiet-mode ^ + --root "%cd%\build\cygwin" ^ + --arch x86 ^ + --local-package-dir "%cd%\build\cygwin-packages" ^ + --verbose ^ + --prune-install ^ + --no-admin ^ + --packages qt5-linguist-tools,make + +build\cygwin\bin\bash.exe --login -i -c "ln -s `which lrelease-qt5` /usr/bin/lrelease ; cd \"%cd%\" && make deps dist"