Skip to content

Latest commit

 

History

History
102 lines (80 loc) · 4.04 KB

BUILD-Windows-msys2.md

File metadata and controls

102 lines (80 loc) · 4.04 KB

Development guide

This short document will show you how to set up development environment for building LightZone.

Windows

The working directory can't have any spaces in the path to it. For example, don't put it under "My Documents". It is problem for some scripts and command line utilities that do not enclose parameter values in quotes and treat it as multiple parameters.

There is a problem with some files checked out from Git that do not work with Windows-standard CR/LF line endings. There's a .gitattributes file to specify that those files need to have LF line endings.

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/
    2. Install required packages.
    • pacman -S 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, 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 libraw.
    • For 32-bit: pacman -S mingw-w64-i686-libraw
    • For 64-bit: pacman -S mingw-w64-x86_64-libraw
    1. Install lensfun.
    • For 32-bit: pacman -S mingw-w64-i686-lensfun
    • For 64-bit: pacman -S mingw-w64-x86_64-lensfun
    1. Install pkgconf.
    • For 32-bit: pacman -S mingw-w64-i686-pkgconf
    • For 64-bit: pacman -S mingw-w64-x86_64-pkgconf
    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 17 from Bellsoft.
  • Microsoft Windows SDK Pick the right version based on your Windows version. Information and download links are available at http://en.wikipedia.org/wiki/Microsoft_Windows_SDK#Versions Place at end of PATH environment variable.
  • HTML Help Workshop
  • Install4J version 8 (free trial for 90 days, then we'll need to try to get open-source licenses)

Optionally, install following:

  • Java IDE - Eclipse, Netbeans or IntelliJ IDEA Community Edition

Few points for MSYS2 beginners

  • It is POSIX evnironment for Windows (emulates a lot of stuff that is in Linux)
  • It is case-sensitive
  • Computer drives under it are available under / (root) directory, e.g. /c/
  • Home directory is abbreviated with ~

If you haven't changed anything, your default shell is Bash. Open ~/.bashrc with an editor (nano or vim) and enter following environmental variables. (Modify the paths to match your environment.):

export JAVA_HOME="/c/Program Files/AdoptOpenJDK/jdk-11.0.4.11-hotspot"
export ANT_HOME="/c/Program Files/apache-ant-1.9.8"
export MSSDK_HOME="/c/Program Files (x86)/Windows Kits/10/Lib/10.0.22000.0"
export INSTALL4J_HOME="/c/Program Files/install4j5"
export PATH=$PATH:${JAVA_HOME}/bin:${ANT_HOME}/bin:${INSTALL4J_HOME}/bin;

If you close and open your shell again it will automatically set these variables.

Do NOT set C_INCLUDE_PATH=/usr/include for mingw compilers.

Checkout your project with Git. If you have problems with line endings in build (the \r stuff), do following:

git rm --cached -r .
git reset --hard

To start the build:

cd windows
ant build-installer

If you want to build a 32-bit binary on 64-bit machine, specify TARGET_ARCH variable:

TARGET_ARCH=i386 ant build-installer

Known build issues

  • In LightZone there are now no version information. There was a problem with rc.exe from MSSDK failing, windres can be used to compile it. There is a bug in windres that makes it fail on compiling version info. A patch has been submitted to binutils already, so in next version (higher than 2.22.51-2) it should work again. Here also versioning with Git needs to be considered.
  • bundled JRE version in Install4J is updated manually now