From afcc5f1e962e55622cc3786c102af766b29d20bd Mon Sep 17 00:00:00 2001 From: Masahiro Kitagawa Date: Tue, 24 Nov 2020 12:55:33 +0900 Subject: [PATCH] Appveyor - Support Windows 32-bit build + Use pacboy to install both migw-w64-{i686,x86_64} packages + Replace pkg-config with pkgconf + Avoid reinstallation of autoconf, git, make and tar + Downgrade Windows Kit to avoid "undefined reference to `__guard_dispatch_icall_fptr`" error --- .appveyor.yml | 25 +++++++++++++++---------- lightcrafts/mk/platform.mk | 5 +++-- windows/BUILD-Windows-msys2.md | 28 ++++++++++++++-------------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d994a850..17f02b03 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,7 @@ version: 4.2.1.{build}-{branch} image: -- Visual Studio 2017 +- Visual Studio 2019 - macos-mojave - Ubuntu2004 @@ -14,32 +14,37 @@ for: - matrix: only: - - image: Visual Studio 2017 + - image: Visual Studio 2019 init: - - cmd: SET MINGW_PATH=mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64 - - cmd: SET MINGW_DIR=/c/%MINGW_PATH%/ - - cmd: SET MINGW_ARCH=mingw-w64-x86_64 - - cmd: SET PATH=C:/%MINGW_PATH%/bin/;C:/msys64/mingw64/bin/;C:/msys64/usr/bin/;%PATH% + - cmd: SET MINGW64_PATH=mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64 + - cmd: SET MINGW32_PATH=mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32 + - cmd: SET PATH=C:/%MINGW64_PATH%/bin/;C:/%MINGW32_PATH%/bin/;C:/msys64/usr/bin/;%PATH% - cmd: SET MSSDK_HOME=/c/Program Files (x86)/Windows Kits/10 - cmd: SET JAVA_HOME=/c/Program Files/Java/jdk11 + - cmd: SET PROJECT_DIR=/c/projects/lightzone install: - cmd: cinst ant html-help-workshop + - cmd: bash -lc 'cp "$MSSDK_HOME/../8.1/Lib/winv6.3/um/x64/Htmlhelp.Lib" /c/$MINGW64_PATH/lib/libhtmlhelp.a' + - cmd: bash -lc 'cp "$MSSDK_HOME/../8.1/Lib/winv6.3/um/x86/Htmlhelp.Lib" /c/$MINGW32_PATH/lib/libhtmlhelp.a' - ps: (new-object net.webclient).DownloadFile('https://download-gcdn.ej-technologies.com/install4j/install4j_windows-x64_8_0_8.exe', 'install4j-installer.exe') - ps: install4j-installer.exe -q - - cmd: bash -lc 'cp "/c/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/Htmlhelp.Lib" /c/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/lib/libhtmlhelp.a' - cmd: bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" - cmd: bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig" - cmd: bash -lc "pacman-key --verify msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig" - cmd: bash -lc "pacman --noconfirm -U msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" - cmd: bash -lc "pacman --needed --noconfirm -Sy pacman" - cmd: bash -lc "pacman --needed --noconfirm -Su" - - cmd: bash -lc "pacman --noconfirm -S autoconf git make tar" - - cmd: bash -lc "pacman --noconfirm -S ${MINGW_ARCH}-lcms2 ${MINGW_ARCH}-lensfun ${MINGW_ARCH}-ntldd-git ${MINGW_ARCH}-pkg-config" + - cmd: bash -lc "pacboy --noconfirm --disable-download-timeout -S lcms2:m lensfun:m ntldd-git:m" build_script: - - cmd: bash -lc "ant -f /c/projects/lightzone/windows/build.xml build-installer" + - cmd: bash -lc "MINGW_DIR=/c/$MINGW64_PATH ant -f $PROJECT_DIR/windows/build.xml build-installer" + - cmd: bash -lc "make -C $PROJECT_DIR/lightcrafts/coprocesses/ clean" + - cmd: bash -lc "make -C $PROJECT_DIR/lightcrafts/jnisrc/ clean" + - cmd: bash -lc "make -C $PROJECT_DIR/windows/jnisrc/ clean" + - cmd: bash -lc "make -C $PROJECT_DIR/windows/products/ clean" + - cmd: bash -lc "TARGET=i686 MINGW_DIR=/c/$MINGW32_PATH ant -f $PROJECT_DIR/windows/build.xml -Doffline=true build-installer" artifacts: - path: 'windows/LightZone_Installer_*.exe' diff --git a/lightcrafts/mk/platform.mk b/lightcrafts/mk/platform.mk index 52683be2..9be53a46 100644 --- a/lightcrafts/mk/platform.mk +++ b/lightcrafts/mk/platform.mk @@ -215,7 +215,7 @@ ifeq ($(PLATFORM),Windows) endif CC:= $(MINGW)-gcc CXX:= $(MINGW)-g++ - PKGCFG:= $(MINGW)-pkg-config + PKGCFG:= pkgconf ifeq ($(CYGWIN),1) MINGW_DIR?= /usr/$(MINGW)/sys-root/mingw/ @@ -223,12 +223,13 @@ ifeq ($(PLATFORM),Windows) # MSYS2 ifeq ($(PROCESSOR),x86_64) MINGW_DIR?= /mingw64/ + PKG_CONFIG_PATH:= /mingw64/lib/pkgconfig/ else MINGW_DIR?= /mingw32/ + PKG_CONFIG_PATH:= /mingw32/lib/pkgconfig/ endif endif - PKG_CONFIG_PATH:= $(MINGW_DIR)lib/pkgconfig/ DLL_DIR:= $(MINGW_DIR)bin/ PLATFORM_CFLAGS+= $(SSE_FLAGS) diff --git a/windows/BUILD-Windows-msys2.md b/windows/BUILD-Windows-msys2.md index f2f81086..634683f0 100644 --- a/windows/BUILD-Windows-msys2.md +++ b/windows/BUILD-Windows-msys2.md @@ -12,20 +12,20 @@ line endings. There's a .gitattributes file to specify that those files need to Download and install (or unpack) following: - __Apache Ant__ version 1.9.8 or later to support nativeheaderdir parameter -- __MSYS2__ - 1. Install MSYS2 and update packages as described in https://msys2.github.io/ - 1. Install required packages. - - `pacman -S autoconf diffutils git make tar` - 1. Install target-specific toolchain. - - For 32-bit: `pacman -S mingw-w64-i686-toolchain` - - For 64-bit: `pacman -S mingw-w64-x86_64-toolchain` - then select (at least) __binutils__, __gcc__, __gcc-libs__, and __pkg_config__. - 1. Install __lcms2__. This will also install __libtiff__ and __libjpeg-turbo__. - - For 32-bit: `pacman -S mingw-w64-i686-lcms2` - - For 64-bit: `pacman -S mingw-w64-x86_64-lcms2` - 1. Install __ntldd__. - - For 32-bit: `pacman -S mingw-w64-i686-ntldd-git` - - For 64-bit: `pacman -S mingw-w64-x86_64-ntldd-git` +- __MSYS2__ + 1. Install MSYS2 and update packages as described in https://msys2.github.io/ + 1. Install required packages. + - `pacman -S autoconf diffutils git make pkgconf tar` + 1. Install target-specific toolchain. + - For 32-bit: `pacman -S mingw-w64-i686-toolchain` + - For 64-bit: `pacman -S mingw-w64-x86_64-toolchain` + then select (at least) __binutils__, __gcc__, and __gcc-libs__. + 1. Install __lcms2__. This will also install __libtiff__ and __libjpeg-turbo__. + - For 32-bit: `pacman -S mingw-w64-i686-lcms2` + - For 64-bit: `pacman -S mingw-w64-x86_64-lcms2` + 1. Install __ntldd__. + - For 32-bit: `pacman -S mingw-w64-i686-ntldd-git` + - For 64-bit: `pacman -S mingw-w64-x86_64-ntldd-git` - __Java Development Kit__ (JDK) version 11 from [AdoptOpenJDK](https://adoptopenjdk.net/). - __Microsoft Windows SDK__ Pick the right version based on your Windows version. Information and download links are