diff --git a/mingw-w64-libpeas/0001-allow-shared-libs.patch b/mingw-w64-libpeas/0001-allow-shared-libs.patch new file mode 100644 index 0000000000..127b0346c1 --- /dev/null +++ b/mingw-w64-libpeas/0001-allow-shared-libs.patch @@ -0,0 +1,221 @@ +From e00dbf43d739cbd327034cc5044de4eb4c0e4e78 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= + =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= +Date: Wed, 2 Apr 2014 15:47:28 +0000 +Subject: [PATCH] W32: Allow shared libs to be built + +This requires -no-undefined flag and resolving all dependencies at link-time by +linking plugins to libpeas and libpeas-gtk as needed. + +https://bugzilla.gnome.org/show_bug.cgi?id=727499 +--- + configure.ac | 4 ++-- + loaders/python/Makefile.am | 5 +++-- + loaders/python3/Makefile.am | 5 +++-- + loaders/seed/Makefile.am | 5 ++++- + peas-demo/plugins/helloworld/Makefile.am | 6 +++++- + peas-demo/plugins/secondtime/Makefile.am | 5 ++++- + tests/libpeas-gtk/plugins/builtin-configurable/Makefile.am | 6 +++++- + tests/libpeas-gtk/plugins/configurable/Makefile.am | 6 +++++- + tests/plugins/builtin/Makefile.am | 4 +++- + tests/plugins/has-dep/Makefile.am | 4 +++- + tests/plugins/loadable/Makefile.am | 4 +++- + tests/plugins/self-dep/Makefile.am | 4 +++- + 12 files changed, 43 insertions(+), 15 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 89e46df..e6e5fa3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -395,12 +395,12 @@ AC_SUBST(LT_AGE) + # The reasons for -rpath /nowhere can be found at: + # http://www.mail-archive.com/automake@gnu.org/msg10725.htm + +-PLUGIN_LIBTOOL_FLAGS="-module -avoid-version" ++PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined" + TEST_PLUGIN_LIBTOOL_FLAGS="$PLUGIN_LIBTOOL_FLAGS -rpath /nowhere" + TEST_INTROSPECTION_LIBTOOL_FLAGS="-rpath /nowhere -export-dynamic -no-undefined" + # Cannot use "-export-symbols-regex peas_register_types" + # because it might make the python plugin loader not work! +-LOADER_LIBTOOL_FLAGS="-module -avoid-version" ++LOADER_LIBTOOL_FLAGS="-module -avoid-version -no-undefined" + AC_SUBST(PLUGIN_LIBTOOL_FLAGS) + AC_SUBST(TEST_PLUGIN_LIBTOOL_FLAGS) + AC_SUBST(TEST_INTROSPECTION_LIBTOOL_FLAGS) +diff --git a/loaders/python/Makefile.am b/loaders/python/Makefile.am +index a33d0af..38cc98c 100644 +--- a/loaders/python/Makefile.am ++++ b/loaders/python/Makefile.am +@@ -25,8 +25,9 @@ libpythonloader_la_LDFLAGS = \ + $(PYTHON2_LDFLAGS) + + libpythonloader_la_LIBADD = \ +- $(PEAS_LIBS) \ +- $(PYGOBJECT_LIBS) \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(PYGOBJECT_LIBS) \ + $(PYTHON2_LIBS) + + gcov_sources = $(libpythonloader_la_SOURCES) +diff --git a/loaders/python3/Makefile.am b/loaders/python3/Makefile.am +index 884d710..19e085e 100644 +--- a/loaders/python3/Makefile.am ++++ b/loaders/python3/Makefile.am +@@ -25,8 +25,9 @@ libpython3loader_la_LDFLAGS = \ + $(PYTHON3_LDFLAGS) + + libpython3loader_la_LIBADD = \ +- $(PEAS_LIBS) \ +- $(PYGOBJECT_LIBS) \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(PYGOBJECT_LIBS) \ + $(PYTHON3_LIBS) + + gcov_sources = $(libpython3loader_la_SOURCES) +diff --git a/loaders/seed/Makefile.am b/loaders/seed/Makefile.am +index 75566c0..12ae3b9 100644 +--- a/loaders/seed/Makefile.am ++++ b/loaders/seed/Makefile.am +@@ -19,7 +19,10 @@ libseedloader_la_SOURCES = \ + peas-plugin-loader-seed.h + + libseedloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS) $(GCOV_LDFLAGS) +-libseedloader_la_LIBADD = $(PEAS_LIBS) $(SEED_LIBS) ++libseedloader_la_LIBADD = \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(SEED_LIBS) + + gcov_sources = $(libseedloader_la_SOURCES) + include $(top_srcdir)/Makefile.gcov +diff --git a/peas-demo/plugins/helloworld/Makefile.am b/peas-demo/plugins/helloworld/Makefile.am +index a7b151c..7519d26 100644 +--- a/peas-demo/plugins/helloworld/Makefile.am ++++ b/peas-demo/plugins/helloworld/Makefile.am +@@ -14,7 +14,11 @@ libhelloworld_la_SOURCES = \ + peasdemo-hello-world-configurable.c + + libhelloworld_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +-libhelloworld_la_LIBADD = $(PEAS_LIBS) $(PEAS_GTK_LIBS) ++libhelloworld_la_LIBADD = \ ++ $(top_builddir)/libpeas-gtk/libpeas-gtk-1.0.la \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(PEAS_GTK_LIBS) + + plugin_DATA = helloworld.plugin + +diff --git a/peas-demo/plugins/secondtime/Makefile.am b/peas-demo/plugins/secondtime/Makefile.am +index a20e76c..e54e5d3 100644 +--- a/peas-demo/plugins/secondtime/Makefile.am ++++ b/peas-demo/plugins/secondtime/Makefile.am +@@ -12,7 +12,10 @@ libsecondtime_la_SOURCES = \ + second-time.c + + libsecondtime_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) +-libsecondtime_la_LIBADD = $(PEAS_LIBS) $(PEAS_GTK_LIBS) ++libsecondtime_la_LIBADD = \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(PEAS_GTK_LIBS) + + plugin_DATA = secondtime.plugin + +diff --git a/tests/libpeas-gtk/plugins/builtin-configurable/Makefile.am b/tests/libpeas-gtk/plugins/builtin-configurable/Makefile.am +index 78d9529..53577d6 100644 +--- a/tests/libpeas-gtk/plugins/builtin-configurable/Makefile.am ++++ b/tests/libpeas-gtk/plugins/builtin-configurable/Makefile.am +@@ -16,7 +16,11 @@ libbuiltin_configurable_la_SOURCES = \ + builtin-configurable.h + + libbuiltin_configurable_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) +-libbuiltin_configurable_la_LIBADD = $(PEAS_LIBS) $(PEAS_GTK_LIBS) ++libbuiltin_configurable_la_LIBADD = \ ++ $(top_builddir)/libpeas-gtk/libpeas-gtk-1.0.la \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(PEAS_GTK_LIBS) + + noinst_PLUGIN = builtin-configurable.plugin + +diff --git a/tests/libpeas-gtk/plugins/configurable/Makefile.am b/tests/libpeas-gtk/plugins/configurable/Makefile.am +index 7588069..77536cc 100644 +--- a/tests/libpeas-gtk/plugins/configurable/Makefile.am ++++ b/tests/libpeas-gtk/plugins/configurable/Makefile.am +@@ -14,7 +14,11 @@ libconfigurable_la_SOURCES = \ + configurable-plugin.h + + libconfigurable_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) +-libconfigurable_la_LIBADD = $(PEAS_LIBS) $(PEAS_GTK_LIBS) ++libconfigurable_la_LIBADD = \ ++ $(top_builddir)/libpeas-gtk/libpeas-gtk-1.0.la \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) \ ++ $(PEAS_GTK_LIBS) + + noinst_PLUGIN = configurable.plugin + +diff --git a/tests/plugins/builtin/Makefile.am b/tests/plugins/builtin/Makefile.am +index b909ef3..8d01fa8 100644 +--- a/tests/plugins/builtin/Makefile.am ++++ b/tests/plugins/builtin/Makefile.am +@@ -13,7 +13,9 @@ libbuiltin_la_SOURCES = \ + builtin-plugin.h + + libbuiltin_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) +-libbuiltin_la_LIBADD = $(PEAS_LIBS) ++libbuiltin_la_LIBADD = \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) + + noinst_PLUGIN = builtin.plugin + +diff --git a/tests/plugins/has-dep/Makefile.am b/tests/plugins/has-dep/Makefile.am +index facb48d..3c6dfd4 100644 +--- a/tests/plugins/has-dep/Makefile.am ++++ b/tests/plugins/has-dep/Makefile.am +@@ -13,7 +13,9 @@ libhas_dep_la_SOURCES = \ + has-dep-plugin.h + + libhas_dep_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) +-libhas_dep_la_LIBADD = $(PEAS_LIBS) ++libhas_dep_la_LIBADD = \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) + + noinst_PLUGIN = has-dep.plugin + +diff --git a/tests/plugins/loadable/Makefile.am b/tests/plugins/loadable/Makefile.am +index c387e5e..46bb90c 100644 +--- a/tests/plugins/loadable/Makefile.am ++++ b/tests/plugins/loadable/Makefile.am +@@ -13,7 +13,9 @@ libloadable_la_SOURCES = \ + loadable-plugin.h + + libloadable_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) +-libloadable_la_LIBADD = $(PEAS_LIBS) ++libloadable_la_LIBADD = \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) + + noinst_PLUGIN = loadable.plugin + +diff --git a/tests/plugins/self-dep/Makefile.am b/tests/plugins/self-dep/Makefile.am +index f20079c..ff5ce90 100644 +--- a/tests/plugins/self-dep/Makefile.am ++++ b/tests/plugins/self-dep/Makefile.am +@@ -13,7 +13,9 @@ libself_dep_la_SOURCES = \ + self-dep-plugin.h + + libself_dep_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) +-libself_dep_la_LIBADD = $(PEAS_LIBS) ++libself_dep_la_LIBADD = \ ++ $(top_builddir)/libpeas/libpeas-1.0.la \ ++ $(PEAS_LIBS) + + noinst_PLUGIN = self-dep.plugin + +-- +1.8.5.3 diff --git a/mingw-w64-libpeas/0002-give-cc-to-gir-scanner.all.patch b/mingw-w64-libpeas/0002-give-cc-to-gir-scanner.all.patch new file mode 100644 index 0000000000..c85f5bc99b --- /dev/null +++ b/mingw-w64-libpeas/0002-give-cc-to-gir-scanner.all.patch @@ -0,0 +1,30 @@ +--- libpeas-1.10.0/libpeas/Makefile.am.orig 2014-02-09 23:55:50.000000000 +0400 ++++ libpeas-1.10.0/libpeas/Makefile.am 2014-05-18 21:09:07.722800000 +0400 +@@ -88,6 +88,7 @@ + if HAVE_INTROSPECTION + -include $(INTROSPECTION_MAKEFILE) + INTROSPECTION_GIRS = Peas-1.0.gir ++ INTROSPECTION_SCANNER_ENV = CC="$(CC)" + INTROSPECTION_SCANNER_ARGS = \ + -I$(top_srcdir) \ + --c-include=libpeas/peas.h \ +--- libpeas-1.10.0/libpeas-gtk/Makefile.am.orig 1970-01-01 03:00:00.000000000 +0300 ++++ libpeas-1.10.0/libpeas-gtk/Makefile.am 2014-05-18 21:09:34.204800000 +0400 +@@ -47,6 +47,7 @@ + if HAVE_INTROSPECTION + -include $(INTROSPECTION_MAKEFILE) + INTROSPECTION_GIRS = PeasGtk-1.0.gir ++ INTROSPECTION_SCANNER_ENV = CC="$(CC)" + INTROSPECTION_SCANNER_ARGS = \ + --add-include-path=$(top_builddir)/libpeas \ + --c-include=libpeas-gtk/peas-gtk.h \ +--- libpeas-1.10.0/tests/libpeas/introspection/Makefile.am.orig 1970-01-01 03:00:00.000000000 +0300 ++++ libpeas-1.10.0/tests/libpeas/introspection/Makefile.am 2014-05-18 21:09:34.204800000 +0400 +@@ -31,6 +31,7 @@ + -include $(INTROSPECTION_MAKEFILE) + INTROSPECTION_GIRS = Introspection-1.0.gir + INTROSPECTION_TYPELIBS = $(INTROSPECTION_GIRS:.gir=.typelib) ++ INTROSPECTION_SCANNER_ENV = CC="$(CC)" + INTROSPECTION_SCANNER_ARGS = \ + --add-include-path=$(top_builddir)/libpeas \ + --warn-all diff --git a/mingw-w64-libpeas/PKGBUILD b/mingw-w64-libpeas/PKGBUILD new file mode 100644 index 0000000000..99e055bb5f --- /dev/null +++ b/mingw-w64-libpeas/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: Alexey Pavlov + +_realname=libpeas +_mingw_suff=mingw-w64-${CARCH} +pkgname="${_mingw_suff}-${_realname}" +pkgver=1.10.0 +pkgrel=1 +pkgdesc="A GObject-based plugins engine (mingw-w64)" +arch=('any') +url="http://www.gtk.org" +license=("GPL2") +makedepends=("${_mingw_suff}-gcc" + "${_mingw_suff}-pkg-config" + "${_mingw_suff}-gobject-introspection" + "${_mingw_suff}-gtk-doc" + "intltool" + "${_mingw_suff}-python3-gobject" + "${_mingw_suff}-python2-gobject" + "${_mingw_suff}-glade") +depends=("${_mingw_suff}-gcc-libs" + "${_mingw_suff}-gtk3" + "${_mingw_suff}-hicolor-icon-theme" + ) +options=('strip' 'staticlibs') +install=${_realname}-${CARCH}.install +source=(http://download.gnome.org/sources/${_realname}/${pkgver:0:4}/${_realname}-${pkgver}.tar.xz + 0001-allow-shared-libs.patch + 0002-give-cc-to-gir-scanner.all.patch) +md5sums=('b388cdb1c38ac8701f85c8278df0de0a' + '8b0ca87de555d4519de0ab856a825d84' + 'b79cae8a6794dc2511f6fcceaa809111') + +prepare() { + cd ${srcdir}/${_realname}-${pkgver} + patch -p1 -i ${srcdir}/0001-allow-shared-libs.patch + patch -p1 -i ${srcdir}/0002-give-cc-to-gir-scanner.all.patch + + autoreconf -fi +} + +build() { + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + ${srcdir}/${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --sysconfdir=${MINGW_PREFIX}/etc \ + --localstatedir=${MINGW_PREFIX}/var \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --enable-static \ + --enable-shared \ + --enable-python2 \ + --enable-python3 \ + --enable-glade-catalog \ + --enable-gtk \ + DATADIRNAME=share + + # https://bugzilla.gnome.org/show_bug.cgi?id=655517 + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make -j1 V=1 +} + +package() { + cd "${srcdir}/build-${MINGW_CHOST}" + make DESTDIR="$pkgdir" install +} diff --git a/mingw-w64-libpeas/libpeas-i686.install b/mingw-w64-libpeas/libpeas-i686.install new file mode 100644 index 0000000000..da50a72875 --- /dev/null +++ b/mingw-w64-libpeas/libpeas-i686.install @@ -0,0 +1,11 @@ +post_install() { + mingw32/bin/gtk-update-icon-cache -q -t -f mingw32/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/mingw-w64-libpeas/libpeas-x86_64.install b/mingw-w64-libpeas/libpeas-x86_64.install new file mode 100644 index 0000000000..4a2bb1bb75 --- /dev/null +++ b/mingw-w64-libpeas/libpeas-x86_64.install @@ -0,0 +1,11 @@ +post_install() { + mingw64/bin/gtk-update-icon-cache -q -t -f mingw64/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +}