diff --git a/gtk3/mingw-w64/0001-Link-explicitely-against-msvcr90-to-prevent-linker-e.patch b/gtk3/mingw-w64/0001-Link-explicitely-against-msvcr90-to-prevent-linker-e.patch new file mode 100644 index 00000000..86f66773 --- /dev/null +++ b/gtk3/mingw-w64/0001-Link-explicitely-against-msvcr90-to-prevent-linker-e.patch @@ -0,0 +1,27 @@ +From 18ff68e7b0151cc10af68ebc144c407078681455 Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Fri, 28 Oct 2016 23:52:45 +0200 +Subject: [PATCH] Link explicitely against msvcr90 to prevent linker error + +Fix undefined reference to `_imp___lock_file' and `_imp___unlock_file' +when building libgtk-3-0.dll with mingw-w64 +--- + gtk/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtk/Makefile.am b/gtk/Makefile.am +index 3b76b82..4ccb973 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -1411,7 +1411,7 @@ libgtk_3_la_LIBADD = $(libadd) + libgtk_3_la_DEPENDENCIES = $(deps) + + if USE_WIN32 +-libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 ++libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 -lmsvcr90 + libgtk_3_la_LDFLAGS += -Wl,-luuid $(gtk_win32_res_ldflag) + libgtk_3_la_DEPENDENCIES += $(gtk_win32_res) + endif +-- +2.10.1 + diff --git a/gtk3/mingw-w64/PKGBUILD b/gtk3/mingw-w64/PKGBUILD new file mode 100644 index 00000000..e149fb5e --- /dev/null +++ b/gtk3/mingw-w64/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: lantw44 at gmail dot com +# Contributor Martchus + +pkgname=mingw-w64-gtk3 +pkgver=3.22.2 +pkgrel=1 +pkgdesc='GObject-based multi-platform GUI toolkit (mingw-w64)' +arch=(any) +url='http://www.gtk.org' +install="${pkgname}.install" +license=('LGPL') +makedepends=( + 'mingw-w64-gcc' + 'mingw-w64-pkg-config' + 'mingw-w64-configure' + 'gtk-update-icon-cache' + 'gobject-introspection') # also pulls python which is required to run gdbus-codegen +depends=( + 'mingw-w64-crt' + 'mingw-w64-adwaita-icon-theme' + 'mingw-w64-atk>=2.15.1' + 'mingw-w64-cairo>=1.14.2-3' + 'mingw-w64-gdk-pixbuf2>=2.30.0' + 'mingw-w64-glib2>=2.49.4' + 'mingw-w64-libepoxy>=1.0' + 'mingw-w64-pango>=1.37.3') +options=(!strip !buildflags staticlibs) +source=("https://download.gnome.org/sources/gtk+/${pkgver%.*}/gtk+-${pkgver}.tar.xz" + '0001-Link-explicitely-against-msvcr90-to-prevent-linker-e.patch') +sha256sums=('2343dcaed2fc237ef718136ff4110fef7eb1ebfe178a9b064aa21cd74ecb6946' + '2527a537b0917844b18b72377dbe3f276c7844473fb61b58d2815c65a5cded75') + +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +prepare() { + cd "${srcdir}/gtk+-${pkgver}" + patch -p1 -i ${srcdir}/0001-Link-explicitely-against-msvcr90-to-prevent-linker-e.patch + autoreconf -fi +} + +build() { + cd "${srcdir}/gtk+-${pkgver}" + for _arch in ${_architectures}; do + export PKG_CONFIG="${_arch}-pkg-config" + export PKG_CONFIG_FOR_BUILD="pkg-config" + mkdir -p "build-${_arch}" + cd "build-${_arch}" + ${_arch}-configure \ + --enable-broadway-backend \ + --enable-win32-backend \ + --disable-cups + make + cd .. + done +} + +package() { + cd "${srcdir}/gtk+-${pkgver}" + for _arch in ${_architectures}; do + cd "build-${_arch}" + make DESTDIR="$pkgdir" install + find "$pkgdir/usr/${_arch}" -name '*.exe' | xargs -rtL1 ${_arch}-strip + find "$pkgdir/usr/${_arch}" -name '*.dll' | xargs -rtL1 ${_arch}-strip --strip-unneeded + find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs -rtL1 ${_arch}-strip -g + rm "$pkgdir/usr/${_arch}/lib/"*.def + rm -r "$pkgdir/usr/${_arch}/etc" + rm -r "$pkgdir/usr/${_arch}/share/man" + cd .. + done +} diff --git a/gtk3/mingw-w64/mingw-w64-gtk3.install b/gtk3/mingw-w64/mingw-w64-gtk3.install new file mode 100644 index 00000000..6936f068 --- /dev/null +++ b/gtk3/mingw-w64/mingw-w64-gtk3.install @@ -0,0 +1,12 @@ +post_install() { + /usr/bin/glib-compile-schemas /usr/i686-w64-mingw32/share/glib-2.0/schemas + /usr/bin/glib-compile-schemas /usr/x86_64-w64-mingw32/share/glib-2.0/schemas +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +}