This repository contains Conan support for building GNUstep on Windows and Linux.
It contains:
- Conan recipes for building libobjc2, libdispatch, gnustep-make and gnustep-base
- Conan profiles for building using clang on Windows and Linux
On Windows, this repository takes the approach of building GNUstep using the Windows-native LLVM (clang) compiler. It uses MSYS2 to get a Bash shell, which allows running the scripts required to configure and build GNUstep, and does not use the MSYS2 compiler toolchain.
Prebuilt binary Conan packages containing GNUstep for Windows are available at https://cloudsmith.io/~qmfrederik/repos/gnustep:
Package | Status |
---|---|
gnustep-make | |
gnustep-base | |
gnustep-gui | |
gnustep-headless |
On Windows, you'll need to download the Windows SDK and the LLVM toolchain. Optionally, you can use Visual Studio Code as an editor and Git for source code interations.
To get started, run the following commands:
git clone https://github.com/qmfrederik/conan-gnustep/
cd conan-gnustep
conan config install global.conf
conan create gnustep-helpers --profile:a=profiles/windows-clang
conan create libobjc2 --profile:a=profiles/windows-clang
conan create libdispatch --profile:a=profiles/windows-clang
conan create gnustep-make --profile:a=profiles/windows-clang
conan create gnustep-base --profile:a=profiles/windows-clang
conan create gnustep-gui --profile:a=profiles/windows-clang
conan create gnustep-headless --profile:a=profiles/windows-clang
This will configure GNUstep Base and all of its dependencies.
apt-get install -y clang lld curl zip unzip tar git pkg-config make python3-venv cmake libffi-dev libxml2-dev libxslt-dev gnutls-dev libicu-dev libcurl4-gnutls-dev
git clone https://github.com/qmfrederik/conan-gnustep/
cd conan-gnustep
python3 -m venv .python3/
.python3/bin/pip install conan==2.18.1
. .python3/bin/activate
conan config install global.conf
conan create gnustep-helpers --profile:a=profiles/linux-clang
conan create libobjc2 --profile:a=profiles/linux-clang
conan create libdispatch --profile:a=profiles/linux-clang
conan create gnustep-make --profile:a=profiles/linux-clang
conan create gnustep-base --profile:a=profiles/linux-clang
conan create gnustep-gui --profile:a=profiles/linux-clang
conan create gnustep-headless --profile:a=profiles/linux-clang
There's a couple of tips & tricks which help when you're building GNUstep on a Windows platform:
- libobjc2 works best when used with LLVM/clang on Windows and Linux.
- The GNUstep build system relies on a bash shell. On Windows, you can use MSYS2 to get a bash prompt. There's support for MSYS2 in both Conan and vcpkg.
- The build tools will assume you're targetting an MSYS2 environment when running
./configure
in a MSYS2 environment. To make it target a 'native' Windows environment, specify--host=x86_64-pc-windows
and--target=x86_64-pc-windows
. - You can aquire
pkgconf
as a build tool:self.tool_requires("pkgconf/[>=2.2]")
. Set thePKG_CONFIG
variable to override the path to thepkg-config
tool. - Running the tests for the various GNUstep projects will require you to add the path of the main output (e.g.
gnustep-gui.dll
) to be in the Windows path.
These tips may help when debugging:
- Conan recipes are Python scripts. You can debug them using VS Code.
- Because Conan copies scripts before executing them, breakpoints you've set may not be hit. But you can add a
breakpoint()
call to the script, forcing the debugger to pause. - If a build fails, you can enter an MSYS2 session by running
C:\Users\vagrant\.conan2\p\msys2f33247fcfc934\p\bin\msys64\usr\bin\bash.exe --login -i
. From within that session, you can run./configure
,make
,... --- just make sure to environment variables such asPATH
.