Skip to content

Commit

Permalink
Appveyor - Support Windows 32-bit build
Browse files Browse the repository at this point in the history
+ 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
  • Loading branch information
ktgw0316 committed Nov 24, 2020
1 parent 4eec443 commit afcc5f1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
25 changes: 15 additions & 10 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 4.2.1.{build}-{branch}

image:
- Visual Studio 2017
- Visual Studio 2019
- macos-mojave
- Ubuntu2004

Expand All @@ -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'
Expand Down
5 changes: 3 additions & 2 deletions lightcrafts/mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,21 @@ 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/
else
# 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)
Expand Down
28 changes: 14 additions & 14 deletions windows/BUILD-Windows-msys2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit afcc5f1

Please sign in to comment.