# HG changeset patch # User J. Ali Harlow # Date 1467137138 -3600 # Node ID ea1c42c3a780438a5eb99c5a612bfba02935f1de # Parent a4f43ad0e0c8a93e8d9826ff1685311080977553 Fix mingw64 build diff -r a4f43ad0e0c8 -r ea1c42c3a780 configure.ac --- a/configure.ac Tue Jun 28 15:55:48 2016 +0100 +++ b/configure.ac Tue Jun 28 19:05:38 2016 +0100 @@ -169,10 +169,12 @@ PKG_CHECK_MODULES(SETUP,[whelk razor >= 0.5.4 expat >= 2.1 zlib gio-2.0],[:], [PKG_CHECK_MODULES(SETUP,[whelk razor >= 0.5.4 expat21 zlib gio-2.0])]) if test -n "$host_mingw"; then - # Hack: -liconv is required for mingw. This probably stems from our use of + # Hacks: + # -liconv is required for mingw. This probably stems from our use of # libiconv rather than win-iconv that Fedora uses, but should be addressed # somewhere in the stack below us. - SETUP_LIBS="$SETUP_LIBS -liconv" + # -ldnsapi is required by gio. This probably represents a gio bug. + SETUP_LIBS="$SETUP_LIBS -liconv -ldnsapi" fi PKG_CONFIG="$save_PKG_CONFIG" SETUP_CFLAGS="$SETUP_CFLAGS $LUA_POSIX_CFLAGS" diff -r a4f43ad0e0c8 -r ea1c42c3a780 plover/uri-handler.c --- a/plover/uri-handler.c Tue Jun 28 15:55:48 2016 +0100 +++ b/plover/uri-handler.c Tue Jun 28 19:05:38 2016 +0100 @@ -26,6 +26,16 @@ #include "plover/plover.h" #include "uri-handler.h" +/* + * Avoid g_ascii_ family because of complications with static builds + * of glib2 under Windows. The real problem is probably in how glib2 + * is packaged for cross-compiling in certain distributions, but it's + * easy enough to work around. + */ + +#define ascii_isalpha(c) ((c) >= 'a' && (c) <= 'z' || (c) >= 'A' && (c) <= 'Z') +#define ascii_isalnum(c) (ascii_isalpha(c) || (c) >= '0' && (c) <= '9') + static gboolean has_valid_scheme(const char *uri) { /* @@ -33,12 +43,12 @@ * scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */ const char *s; - if (!g_ascii_isalpha(*uri)) + if (!ascii_isalpha(*uri)) return FALSE; for(s=uri+1;;s++) if (*s==':') return TRUE; - else if (!g_ascii_isalnum(*s) && *s!='+' && *s!='-' && *s!='.') + else if (!ascii_isalnum(*s) && *s!='+' && *s!='-' && *s!='.') return FALSE; } diff -r a4f43ad0e0c8 -r ea1c42c3a780 tests/Makefile.am --- a/tests/Makefile.am Tue Jun 28 15:55:48 2016 +0100 +++ b/tests/Makefile.am Tue Jun 28 19:05:38 2016 +0100 @@ -4,6 +4,12 @@ zappy2.spec unsatisfiable.spec uninstallable.spec badpostun.spec comps.xml \ glib.supp.in README xvfb-run +pkg_V_rpmbuild = $(pkg_v_rpmbuild_$(V)) +pkg_v_rpmbuild_ = $(pkg_v_rpmbuild_$(AM_DEFAULT_VERBOSITY)) +pkg_v_rpmbuild_0 = --quiet + +BUILD_RPM = $(RPMBUILD) $(pkg_V_rpmbuild) --define "_topdir `pwd`/rpmbuild" -bb + if HAVE_CHECK_TOOLS noinst_DATA = glib.supp yum-repo-test-dir/repodata/primary.xml.gz \ @@ -22,21 +28,16 @@ uninstallable.spec badpostun.spec Makefile rm -rf rpmbuild yum-repo-test-dir mkdir -p rpmbuild/BUILD rpmbuild/RPMS - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb $(srcdir)/zap.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" --define "_version 1" \ - -bb $(srcdir)/zip.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb $(srcdir)/zsh.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb $(srcdir)/zsh2.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb \ - $(srcdir)/filesystem.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb $(srcdir)/zappy.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb $(srcdir)/zappy2.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb \ - $(srcdir)/unsatisfiable.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb \ - $(srcdir)/uninstallable.spec - $(RPMBUILD) --define "_topdir `pwd`/rpmbuild" -bb \ - $(srcdir)/badpostun.spec + $(BUILD_RPM) $(srcdir)/zap.spec + $(BUILD_RPM) --define "_version 1" $(srcdir)/zip.spec + $(BUILD_RPM) $(srcdir)/zsh.spec + $(BUILD_RPM) $(srcdir)/zsh2.spec + $(BUILD_RPM) $(srcdir)/filesystem.spec + $(BUILD_RPM) $(srcdir)/zappy.spec + $(BUILD_RPM) $(srcdir)/zappy2.spec + $(BUILD_RPM) $(srcdir)/unsatisfiable.spec + $(BUILD_RPM) $(srcdir)/uninstallable.spec + $(BUILD_RPM) $(srcdir)/badpostun.spec mkdir -p yum-repo-test-dir/rpms mv rpmbuild/RPMS/noarch/*.rpm yum-repo-test-dir/rpms rm -rf rpmbuild