From 50ba42cce4f27263d90832a83563d39a983171bd Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 1 Mar 2018 15:54:57 +1100 Subject: [PATCH] bison flex: update and build on darwin --- docs/index.html | 2 -- plugins/native/bison-1-fixes.patch | 30 +++++++++++++++++++++++ plugins/native/bison.mk | 15 ++++++------ plugins/native/darwin/bison-1-fixes.patch | 1 + plugins/native/darwin/bison.mk | 1 + plugins/native/darwin/flex.mk | 1 + plugins/native/flex.mk | 14 +++++------ 7 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 plugins/native/bison-1-fixes.patch create mode 120000 plugins/native/darwin/bison-1-fixes.patch create mode 120000 plugins/native/darwin/bison.mk create mode 120000 plugins/native/darwin/flex.mk diff --git a/docs/index.html b/docs/index.html index f5b61c8b..75c93c6b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -918,9 +918,7 @@ USE_OSGPLUGIN(<plugin2>)
sudo port install \
     autoconf \
     automake \
-    bison \
     coreutils \
-    flex \
     gdk-pixbuf2 \
     gettext \
     gnutar \
diff --git a/plugins/native/bison-1-fixes.patch b/plugins/native/bison-1-fixes.patch
new file mode 100644
index 00000000..e8bb66e4
--- /dev/null
+++ b/plugins/native/bison-1-fixes.patch
@@ -0,0 +1,30 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tony Theodore 
+Date: Thu, 1 Mar 2018 15:42:14 +1100
+Subject: [PATCH 1/1] fix for crash on High Sierra due to usage of %n in
+ dynamic format strings
+
+taken from:
+https://github.com/macports/macports-ports/commit/14451f57e899ba3bd8672830944209cf0bbb87a7
+
+With format string strictness, High Sierra also enforces that %n isn't used
+in dynamic format strings, but we should just disable its use on darwin in
+general.
+
+diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
+index 1111111..2222222 100644
+--- a/lib/vasnprintf.c
++++ b/lib/vasnprintf.c
+@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ #endif
+                   *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+                 fbp[1] = '%';
+                 fbp[2] = 'n';
+                 fbp[3] = '\0';
diff --git a/plugins/native/bison.mk b/plugins/native/bison.mk
index 50d2bfb2..498c102f 100644
--- a/plugins/native/bison.mk
+++ b/plugins/native/bison.mk
@@ -1,9 +1,9 @@
 # This file is part of MXE. See LICENSE.md for licensing information.
 
 PKG             := bison
-$(PKG)_IGNORE   := 3%
-$(PKG)_VERSION  := 2.7.1
-$(PKG)_CHECKSUM := b409adcbf245baadb68d2f66accf6fdca5e282cafec1b865f4b5e963ba8ea7fb
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.0.4
+$(PKG)_CHECKSUM := a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1
 $(PKG)_SUBDIR   := bison-$($(PKG)_VERSION)
 $(PKG)_FILE     := bison-$($(PKG)_VERSION).tar.xz
 $(PKG)_URL      := https://ftp.gnu.org/gnu/bison/$($(PKG)_FILE)
@@ -13,6 +13,9 @@ $(PKG)_OWNER    := https://github.com/tonytheodore
 $(PKG)_TARGETS  := $(BUILD)
 $(PKG)_DEPS     := flex
 
+# recursive variable so always use literal instead of $(PKG)
+MXE_REQS_PKGS   += $(BUILD)~bison
+
 define $(PKG)_UPDATE
     $(WGET) -q -O- 'https://ftp.gnu.org/gnu/bison/?C=M;O=D' | \
     $(SED) -n 's,.*