Coder Social home page Coder Social logo

ntd / aur-fedora-mingw Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 3.0 661 KB

ArchLinux PKGBUILDs based on Fedora for cross-buildinging GTK+2 and GTK+3 applications (win32 and win64)

License: MIT License

Shell 95.35% CMake 3.20% Dockerfile 1.45%
archlinux mingw gtk3 gtk cross-compiler-toolchain gobject-introspection lua

aur-fedora-mingw's Introduction

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 yaourt but you are free to adapt them to other solutions (patches welcome).

If you want you can customise afm-mingw-w64-makedepends/makepkg.common.conf to fit your environment and update afm-mingw-w64-makedepends/PKGBUILD accordingly.

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 pkg/ populated with the binary packages.

Helper scripts

  • 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-cairo you 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-all to 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 PKGBUILD files provided as argument.

  • repo-update
    Used by pkg-update to update the package database.

History

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:

  • fedora-mingw-w64-zlib
  • fedora-mingw-w64-bzip2
  • fedora-mingw-w64-termcap
  • fedora-mingw-w64-win-iconv
  • fedora-mingw-w64-gettext
  • fedora-mingw-w64-expat
  • fedora-mingw-w64-libxml2
  • fedora-mingw-w64-libpng
  • fedora-mingw-w64-libjpeg-turbo
  • fedora-mingw-w64-libffi
  • fedora-mingw-w64-glib2
  • fedora-mingw-w64-freetype
  • fedora-mingw-w64-fontconfig
  • fedora-mingw-w64-pixman
  • fedora-mingw-w64-icu
  • fedora-mingw-w64-cairo
  • fedora-mingw-w64-gdk-pixbuf
  • fedora-mingw-w64-atk
  • fedora-mingw-w64-harfbuzz
  • fedora-mingw-w64-pango
  • fedora-mingw-w64-gtk2
  • fedora-mingw-w64-gtk3
  • fedora-mingw-w64-nsis

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:

  • afm-mingw-w64-makedepends
  • afm-mingw-w64-gobject-introspection
  • afm-mingw-w64-lua
  • afm-mingw-w64-lua-lgi

The 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 AUR.

If you intend to build the toolchain in your own way, refer to build-all 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.

External dependencies

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.

License

The code provided by this project is free software released under the MIT license. See 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.

aur-fedora-mingw's People

Contributors

ntd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aur-fedora-mingw's Issues

custom library introspection with last version

With the current version I cannot introspect my custom library. It worked OK with a previous version of the aur-fedora-mingw project. I get this error message:

libtool: compile: x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -mms-bitfields -I/usr/x86_64-w64-mingw32/include/gio-win32-2.0/ -I/usr/x86_64-w64-mingw32/include/glib-2.0 -I/usr/x86_64-w64-mingw32/lib/glib-2.0/include -mms
-bitfields -I/ned/launcher/_inst/usr/local/include -I/usr/x86_64-w64-mingw32/include/glib-2.0 -I/usr/x86_64-w64-mingw32/lib/glib-2.0/include -I../include -I. -I. -I./generated -D_DEBUG -DUNITTEST -mtune=generic -O2 -pipe -fno
-stack-protector -g -std=c99 -Wall -Werror -MT libsfxlog_test_la-helper_file.lo -MD -MP -MF .deps/libsfxlog_test_la-helper_file.Tpo -c helper_file.c -DDLL_EXPORT -DPIC -o .libs/libsfxlog_test_la-helper_file.o
mv -f .deps/libsfxlog_test_la-helper_file.Tpo .deps/libsfxlog_test_la-helper_file.Plo
/bin/sh ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -mtune=generic -O2 -pipe -fno-stack-protector -g -std=c99 -Wall -Werror -o libsfxlog-test.la libsfxlog_test_la-log.lo libsfxlog_test_la-log_conf.lo libsfxl
og_test_la-log_conf_object.lo libsfxlog_test_la-log_test.lo libsfxlog_test_la-helper.lo libsfxlog_test_la-helper_callback.lo libsfxlog_test_la-helper_file.lo -L/usr/x86_64-w64-mingw32/lib -L/usr/lib -L/usr/x86_64-w64-mingw3
2/lib -lgio-2.0 -lgmodule-2.0 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -L/ned/launcher/_inst/usr/local/lib -L/usr/x86_64-w64-mingw32/lib -lsfx -lsfxconf -lglib-2.0 -lintl ./generated/libsfxlog-generated.la
libtool: link: (cd .libs/libsfxlog-test.lax/libsfxlog-generated.a && x86_64-w64-mingw32-ar x "/tmp/tmp.EVi3Cg6nQI/lib/sfxlog/src/./generated/.libs/libsfxlog-generated.a")
libtool: link: x86_64-w64-mingw32-ar cru .libs/libsfxlog-test.a .libs/libsfxlog_test_la-log.o .libs/libsfxlog_test_la-log_conf.o .libs/libsfxlog_test_la-log_conf_object.o .libs/libsfxlog_test_la-log_test.o .libs/libsfxlog_tes
t_la-helper.o .libs/libsfxlog_test_la-helper_callback.o .libs/libsfxlog_test_la-helper_file.o .libs/libsfxlog-test.lax/libsfxlog-generated.a/libsfxlog_generated_la-sfxlog_helper-enum-types.o .libs/libsfxlog-test.lax/libsfxl
og-generated.a/libsfxlog_generated_la-sfxlog_level-enum-types.o
libtool: link: x86_64-w64-mingw32-ranlib .libs/libsfxlog-test.a
libtool: link: rm -fr .libs/libsfxlog-test.lax
libtool: link: ( cd ".libs" && rm -f "libsfxlog-test.la" && ln -s "../libsfxlog-test.la" "libsfxlog-test.la" )
CPPFLAGS="" CFLAGS="-mtune=generic -O2 -pipe -fno-stack-protector -g -std=c99 -Wall -Werror" LDFLAGS="" CC="x86_64-w64-mingw32-gcc" PKG_CONFIG="x86_64-w64-mingw32-pkg-config" GI_HOST_OS="nt" DLLTOOL="x86_64-w64-mingw32-dlltoo
l" /usr/x86_64-w64-mingw32/bin/g-ir-scanner --namespace=SfxLog --nsversion=1.0 --libtool="/bin/sh ../libtool" --pkg=gio-2.0 --include=Gio-2.0 --library=libsfxlog.la --warn-all --warn-error --identifier-prefix=Sfxlog --s
ymbol-prefix=sfxlog --cflags-begin -mms-bitfields -I/usr/x86_64-w64-mingw32/include/gio-win32-2.0/ -I/usr/x86_64-w64-mingw32/include/glib-2.0 -I/usr/x86_64-w64-mingw32/lib/glib-2.0/include -mms-bitfields -I/ned/launcher/_in
st/usr/local/include -I/usr/x86_64-w64-mingw32/include/glib-2.0 -I/usr/x86_64-w64-mingw32/lib/glib-2.0/include -I../include -I. -I. -I./generated -D_DEBUG --cflags-end ../include/sfxlog_test.h ../include/sfxlog_level.h ../i
nclude/sfxlog_conf.h ../include/sfxlog_error.h ../include/sfxlog_helper_type.h ../include/sfxlog.h log_conf.c log_conf_object.c log.c libsfxlog.la --output SfxLog-1.0.gir
g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC x86_64-w64-mingw32-gcc -o /tmp/tmp.EVi3Cg6nQI/lib/sfxlog/src/tmp-introspect1dHRnT/SfxLog-1.0.exe -Wl,--export-all-symbols -mtune=generic -O2 -pipe -fno-stack-protect
or -g -std=c99 -Wall -Werror tmp-introspect1dHRnT/tmp/tmp.EVi3Cg6nQI/lib/sfxlog/src/tmp-introspect1dHRnT/SfxLog-1.0.o -L. libsfxlog.la -L/usr/x86_64-w64-mingw32/lib -L/usr/lib -L/usr/x86_64-w64-mingw32/lib -lgmodule-2.0 -lgio
-2.0 -lgobject-2.0 -lglib-2.0 -lintl
libtool: link: x86_64-w64-mingw32-gcc -o /tmp/tmp.EVi3Cg6nQI/lib/sfxlog/src/tmp-introspect1dHRnT/.libs/SfxLog-1.0.exe -Wl,--export-all-symbols -mtune=generic -O2 -pipe -fno-stack-protector -g -std=c99 -Wall -Werror tmp-intros
pect1dHRnT/tmp/tmp.EVi3Cg6nQI/lib/sfxlog/src/tmp-introspect1dHRnT/SfxLog-1.0.o -L. ./.libs/libsfxlog.dll.a -L/usr/x86_64-w64-mingw32/lib -L/usr/lib -L/ned/launcher/_inst/usr/local/lib /ned/launcher/_inst/usr/local/lib/libsfx
conf.dll.a /ned/launcher/_inst/usr/local/lib/libsfx.dll.a -lgmodule-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -L/ned/launcher/_inst/usr/local/lib
Caught exception: <type 'exceptions.OSError'> OSError(8, 'Exec format error')

/usr/lib/python2.7/subprocess.py(1024)_execute_child()
-> raise child_exception

Do you have an idea what's wrong ?

Cannot build afm-mingw-w64-gobject-introspection : Failed to find symbol 'g_date_get_type'

Thank you for your work, it is a big help for cross compiling for windows !
I cannot compile the afm-mingw-w64-gobject-introspection project.
It fails with this error message :

env PATH=".libs:/usr/i686-w64-mingw32/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /usr/bin/env WINEARCH=win32 WINEPREFIX=/opt/afm-mingw-w64-gobject-introspection/src/win32 DISPLAY= /usr/bin/wine ./g-ir-compiler.exe --includedir=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92 --includedir=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92/gir --includedir=. --includedir=. --includedir=. /opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92/gir/libxml2-2.0.gir -o gir/libxml2-2.0.typelib
Invalid GType function: 'g_date_get_type'
Failed to find symbol 'g_date_get_type'
Command '['/usr/bin/env', 'WINEARCH=win32', 'WINEPREFIX=/opt/afm-mingw-w64-gobject-introspection/src/win32', 'DISPLAY=', '/usr/bin/wine', '/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92-build-i686-w64-mingw32/tmp-introspectZwwq8C/GLib-2.0.exe', '--introspect-dump=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92-build-i686-w64-mingw32/tmp-introspectZwwq8C/functions.txt,/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92-build-i686-w64-mingw32/tmp-introspectZwwq8C/dump.xml']' returned non-zero exit status 1
env PATH=".libs:/usr/i686-w64-mingw32/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /usr/bin/env WINEARCH=win32 WINEPREFIX=/opt/afm-mingw-w64-gobject-introspection/src/win32 DISPLAY= /usr/bin/wine ./g-ir-compiler.exe --includedir=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92 --includedir=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92/gir --includedir=. --includedir=. --includedir=. /opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92/gir/xft-2.0.gir -o gir/xft-2.0.typelib
env PATH=".libs:/usr/i686-w64-mingw32/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /usr/bin/env WINEARCH=win32 WINEPREFIX=/opt/afm-mingw-w64-gobject-introspection/src/win32 DISPLAY= /usr/bin/wine ./g-ir-compiler.exe --includedir=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92 --includedir=/opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92/gir --includedir=. --includedir=. --includedir=. /opt/afm-mingw-w64-gobject-introspection/src/gobject-introspection-1.43.92/gir/xlib-2.0.gir -o gir/xlib-2.0.typelib
Makefile:3430: recipe for target 'GLib-2.0.gir' failed
make[2]: *** [GLib-2.0.gir] Error 1

fedora-mingw-w64-glib2 has been successfully installed before.
Do you have any clue how to fix this issue ?

Thank you very much !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.