* [gentoo-commits] proj/grs:desktop-amd64-hardened commit in: core/etc/portage/patches/media-gfx/fontforge/
@ 2015-08-08 5:51 Anthony G. Basile
0 siblings, 0 replies; only message in thread
From: Anthony G. Basile @ 2015-08-08 5:51 UTC (permalink / raw
To: gentoo-commits
commit: 075d1fb03605468209629f21f621f1a415a16b85
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 8 05:54:08 2015 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Aug 8 05:54:39 2015 +0000
URL: https://gitweb.gentoo.org/proj/grs.git/commit/?id=075d1fb0
media-gfx/fontforge: add configure.ac patches.
...ure.ac-intelligently-check-for-execinfo.h.patch | 58 ++++++++++++++++++++++
.../0002-configure.ac-check-for-locale_t.patch | 45 +++++++++++++++++
2 files changed, 103 insertions(+)
diff --git a/core/etc/portage/patches/media-gfx/fontforge/0001-configure.ac-intelligently-check-for-execinfo.h.patch b/core/etc/portage/patches/media-gfx/fontforge/0001-configure.ac-intelligently-check-for-execinfo.h.patch
new file mode 100644
index 0000000..1f9ba81
--- /dev/null
+++ b/core/etc/portage/patches/media-gfx/fontforge/0001-configure.ac-intelligently-check-for-execinfo.h.patch
@@ -0,0 +1,58 @@
+From 15f0cb9e59b2fd4112236fc9abbb2bf3a29eca65 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Thu, 6 Aug 2015 04:11:03 -0400
+Subject: [PATCH 1/2] configure.ac: intelligently check for <execinfo.h>
+
+Currently, it is assume that only MINGW32 and CYGWIN on windows do
+not provide backtrace. However, other libc's in the Linux world
+do not provide it either. uClibc only provides it if configured
+to do so, and musl doesn't provide it at all. As a result, the
+build fails on those systems.
+
+This patch checks for <execinfo.h> in configure.ac and skip its
+inclusion in fontforge/cvundoes.c if it is not available.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+---
+ configure.ac | 1 +
+ fontforge/cvundoes.c | 5 +++--
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e998a6f..ebeaf85 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -377,6 +377,7 @@ AC_CHECK_HEADERS([strings.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
+ if test x"${i_do_want_iconv}" = xyes; then
+ AC_CHECK_HEADERS([iconv.h])
+ fi
++AC_CHECK_HEADERS([execinfo.h])
+ gl_INIT
+
+ #--------------------------------------------------------------------------
+diff --git a/fontforge/cvundoes.c b/fontforge/cvundoes.c
+index 5d84830..72a5b96 100644
+--- a/fontforge/cvundoes.c
++++ b/fontforge/cvundoes.c
+@@ -24,6 +24,7 @@
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
++#include "config.h"
+ #include "fontforgevw.h"
+ #include "views.h"
+ #include <math.h>
+@@ -33,8 +34,8 @@
+ #include "inc/gfile.h"
+ #include "psfont.h"
+
+-#if defined(__MINGW32__)||defined(__CYGWIN__)
+-// no backtrace on windows yet
++#ifndef HAVE_EXECINFO_H
++// no backtrace available
+ #else
+ #include <execinfo.h>
+ #endif
+--
+2.4.6
+
diff --git a/core/etc/portage/patches/media-gfx/fontforge/0002-configure.ac-check-for-locale_t.patch b/core/etc/portage/patches/media-gfx/fontforge/0002-configure.ac-check-for-locale_t.patch
new file mode 100644
index 0000000..0aea86a
--- /dev/null
+++ b/core/etc/portage/patches/media-gfx/fontforge/0002-configure.ac-check-for-locale_t.patch
@@ -0,0 +1,45 @@
+From 734217599420766f9927f4d312577911dbf56791 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sat, 8 Aug 2015 01:17:48 -0400
+Subject: [PATCH 2/2] configure.ac: check for locale_t
+
+fontforge/splinefont.h uses a "bad locale hack" for _WIN32 systems
+where locale_t is not provided. However, there are other situations
+where locale_t may not be available. For example, uClibc can be
+configured to not provide locales. A better approach is to check
+for locale_t in configure.ac and enable the hack accordingly.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+---
+ configure.ac | 1 +
+ fontforge/splinefont.h | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index ebeaf85..466214d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -387,6 +387,7 @@ gl_INIT
+ AC_C_BIGENDIAN
+ AC_TYPE_PID_T
+ AX_PTHREAD
++AC_CHECK_TYPES([locale_t], [], [], [[#include <locale.h>]])
+
+ #--------------------------------------------------------------------------
+ # Check to see if "this" compiler can use these flags, errors, or warnings.
+diff --git a/fontforge/splinefont.h b/fontforge/splinefont.h
+index 973f343..4f1de12 100644
+--- a/fontforge/splinefont.h
++++ b/fontforge/splinefont.h
+@@ -3548,7 +3548,7 @@ char * delimit_null(const char * input, char delimiter);
+
+ #include "ustring.h"
+
+-#ifdef _WIN32
++#ifndef HAVE_LOCALE_T
+ #define BAD_LOCALE_HACK
+ typedef char* locale_t;
+ #define LC_GLOBAL_LOCALE ((locale_t)-1)
+--
+2.4.6
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-08 5:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-08 5:51 [gentoo-commits] proj/grs:desktop-amd64-hardened commit in: core/etc/portage/patches/media-gfx/fontforge/ Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox