From cf43513d52c9dbb5c1be9077c85fb6f681d27b88 Mon Sep 17 00:00:00 2001 From: davide-romanini Date: Wed, 17 Jan 2018 13:35:10 -0800 Subject: [PATCH] feat: add appveyor configuration --- Makefile | 32 +++++++++++++++++++++++++------- appveyor.yml | 6 ++++++ comictaggerlib/ctversion.py | 2 +- unrar/makefile | 8 +------- windows/fullbuild.ps1 | 9 +++++++++ 5 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 appveyor.yml create mode 100644 windows/fullbuild.ps1 diff --git a/Makefile b/Makefile index f48019d..a5e25ee 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,19 @@ -TAGGER_BASE ?= . -TAGGER_SRC := $(TAGGER_BASE)/comictaggerlib -VERSION_STR := $(shell grep version $(TAGGER_SRC)/ctversion.py| cut -d= -f2 | sed 's/\"//g') -all: clean +VERSION_STR := $(shell python -c 'import comictaggerlib.ctversion; print comictaggerlib.ctversion.version') + +ifeq ($(OS),Windows_NT) + APP_NAME=comictagger.exe + FINAL_NAME=ComicTagger-$(VERSION_STR).exe +else ifeq ($(shell uname -s),Darwin) + APP_NAME=ComicTagger.app + FINAL_NAME=ComicTagger-$(VERSION_STR).app +else + APP_NAME=comictagger + FINAL_NAME=ComicTagger-$(VERSION_STR) +endif + +.PHONY: all clean pydist upload unrar dist + +all: clean dist clean: rm -rf *~ *.pyc *.pyo @@ -24,9 +36,15 @@ upload: python setup.py register python setup.py sdist --formats=zip upload -.PHONY: unrar dist unrar: - $(MAKE) -C unrar lib +ifeq ($(OS),Windows_NT) + # statically compile mingw dependencies + # https://stackoverflow.com/questions/18138635/mingw-exe-requires-a-few-gcc-dlls-regardless-of-the-code + $(MAKE) -C unrar LDFLAGS='-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive -pthread -static-libgcc -static-libstdc++' lib +else + $(MAKE) -C unrar lib +endif dist: unrar - pyinstaller comictagger.spec \ No newline at end of file + pyinstaller -y comictagger.spec + mv dist/$(APP_NAME) dist/$(FINAL_NAME) \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..824af47 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,6 @@ +version: 1.0.{build} +build_script: +- cmd: powershell -exec bypass -File windows\fullbuild.ps1 +artifacts: +- path: dist\*.exe + name: ComicTagger \ No newline at end of file diff --git a/comictaggerlib/ctversion.py b/comictaggerlib/ctversion.py index e63ebc7..2d513cb 100644 --- a/comictaggerlib/ctversion.py +++ b/comictaggerlib/ctversion.py @@ -1,3 +1,3 @@ # This file should contain only these comments, and the line below. # Used by packaging makefiles and app -version = "1.1.16-beta-rc2" +version = "1.1.20-SNAPSHOT" diff --git a/unrar/makefile b/unrar/makefile index b8103a6..4f46c2a 100644 --- a/unrar/makefile +++ b/unrar/makefile @@ -8,13 +8,7 @@ LIBFLAGS=-fPIC DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP STRIP=strip AR=ar -ifeq ($(OS),Windows_NT) - # statically compile mingw dependencies - # https://stackoverflow.com/questions/18138635/mingw-exe-requires-a-few-gcc-dlls-regardless-of-the-code - LDFLAGS=-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive -pthread -static-libgcc -static-libstdc++ -else - LDFLAGS=-pthread -endif +LDFLAGS=-pthread DESTDIR=/usr # Linux using LCC diff --git a/windows/fullbuild.ps1 b/windows/fullbuild.ps1 new file mode 100644 index 0000000..d559a43 --- /dev/null +++ b/windows/fullbuild.ps1 @@ -0,0 +1,9 @@ +# Script to be run inside appveyor for a full build +$env:PATH="C:\tools\mingw64\bin;C:\Miniconda-x64;C:\Miniconda-x64\Scripts;$env:path" +choco install -y mingw +C:\Miniconda-x64\Scripts\conda create -y --name comictagger python=2 +C:\Miniconda-x64\Scripts\activate comictagger +C:\Miniconda-x64\Scripts\conda install -y pyqt=4 +C:\Miniconda-x64\Scripts\pip install -r .\requirements.txt +mingw32-make dist +objdump -af unrar/libunrar.so