Collection of PKGBUILDs for cross-building GTK+2 and GTK+3 applications on ArchLinux using a mingw-w64 system. Think of it as a spur of AUR.
The repository is available for cloning on github.
This is how the project is structured:
aur-fedora-mingw, the repository root
aur, containing the PKGBUILDs the helper scripts
src, where the source packages will be downloaded
pkg, where the built packages will be created
docker, support files needed by docker
How to use
These are common PKGBUILD files so you can build them in the way you like, e.g.
by using makepkg. Some helper
scripts are provided though, just for convenience. They are based on
but you are free to adapt them to other solutions (patches welcome).
If you want you can customise
to fit your environment and update
The following commands should build and install both the 32 and 64 bits toolchains:
cd path/to/aur-fedora-mingw/aur rm */*.pkg.tar.xz # Just to be sure to rebuild everything env - TERM=$TERM PATH=/usr/bin ./build-all i686 env - TERM=$TERM PATH=/usr/bin ./build-all x86_64
Alternatively you can leverage docker for running the building inside an isolated container. This will only create the packages without installing them. Here is how to do it:
cd path/to/aur-fedora-mingw docker build -t afm . docker run -v $(pwd)/src:/home/user/src -v $(pwd)/pkg:/home/user/pkg afm
In both cases, and if everything goes smoothly, at the end you will have
populated with the binary packages.
build-all ARCH [PACKAGE]...
The main script for building the whole toolchain. To minimize potential problems raised by unattended environment variables, you could call the script by providing only a minimal environment, e.g.:
env - TERM=$TERM PATH=/usr/bin ./build-all i686
You can optionally specify on the command line the name of one or more packages to skip, e.g. by passing
fedora-mingw-w64-cairoyou will build everything but cairo.
This script does not automatically create the package database! If you want to, you need to create it by yourself with:
repo-add PACKAGE-DATABASE */*.pkg.tar.xz
pkg-update ARCH PACKAGE
It is intended to be used after
build-allto upgrade only one package. Just call it with the proper package name, e.g.:
./pkg-update i686 fedora-mingw-w64-glib2
This script automatically updates the package database. Actually the name of that database is hardcoded in the sources: fire up an editor for details.
inc-pkgrel PKGBUILD [...]
Increase the release number by one on the
PKGBUILDfiles provided as argument.
pkg-updateto update the package database.
I badly needed a MinGW environment for cross-compiling my GTK+ applications on Windows platforms but the PKGBUILDs found in AUR at that time were a mess, i.e. the toolchain was not working out of the box and required a lot of manual work to be put on the road. It was clear nobody was really using it.
Submitting patches and waiting them to be accepted was feasible but really slow and time consuming, so I decided to develop my own PKGBUILDs basing the code on the Fedora MinGW environment as it seems to be the best maintained MinGW toolchain available. As far as I know, also OpenSUSE based its toolchain on the Fedora one.
I am trying to keep these packages in sync with Fedora and, although not mapped exactly 1:1, they are quite close.
Features and limits
Here is the list of (potential) packages provided by this project:
Some additional package are not based on the Fedora ones. They are developed internally and prefixed with afm (AUR Fedora MinGW) to differentiate them from the others:
build-all helper script can be used as a one-line solution to build all
from scratch. It uses yaourt for
pulling it the required dependencies either from Archlinux community or from
If you intend to build the toolchain in your own way, refer to
know the exact order of build, so check it out to see the most up to date
list and order of packages.
To keep the dependecies as low as possible, this toolchain does not contain some image format I do not use, most notably SVG and tiff.
Check the source of
build-all for knowing the exact dependencies needed. They
are pulled in from core, extra, multilib and community. One dependency
mingw-w64-tools) must be compiled from AUR.
The code provided by this project is free software released under the MIT
COPYING for details.
This license is not extended to the sources of the packages. Every package fetched by this project is free software but you need to hunt inside the source tree to know the exact license.