[110824] trunk/dports/print/lcdf-typetools

larryv at macports.org larryv at macports.org
Fri Sep 6 19:15:15 PDT 2013


Revision: 110824
          https://trac.macports.org/changeset/110824
Author:   larryv at macports.org
Date:     2013-09-06 19:15:15 -0700 (Fri, 06 Sep 2013)
Log Message:
-----------
lcdf-typetools: Fix universal build on Intel, at least (#40401).

Modified Paths:
--------------
    trunk/dports/print/lcdf-typetools/Portfile

Added Paths:
-----------
    trunk/dports/print/lcdf-typetools/files/detect-endianness-universal.patch

Modified: trunk/dports/print/lcdf-typetools/Portfile
===================================================================
--- trunk/dports/print/lcdf-typetools/Portfile	2013-09-06 23:39:43 UTC (rev 110823)
+++ trunk/dports/print/lcdf-typetools/Portfile	2013-09-07 02:15:15 UTC (rev 110824)
@@ -21,12 +21,14 @@
 checksums           rmd160  87b9b49ac74f0f5bfdef15a9bb32d79c31032fbe \
                     sha256  cbb0ed8c42d078fb216b8f4b8ca7a29e0ad3c1969f580a6f2558c829a472adff
 
+patch.pre_args      -p1
+patchfiles          detect-endianness-universal.patch
+
 if {[info exists configure.cxx_stdlib] &&
     ${configure.cxx_stdlib} eq {libc++} &&
     [string match *clang* ${configure.cxx}]
 } then {
-    patch.pre_args              -p1
-    patchfiles                  0001-Avoid-implicit-initializer-narrowing.patch
+    patchfiles-append           0001-Avoid-implicit-initializer-narrowing.patch
     configure.cxxflags-append   -std=c++11
 }
 configure.args      --without-kpathsea

Added: trunk/dports/print/lcdf-typetools/files/detect-endianness-universal.patch
===================================================================
--- trunk/dports/print/lcdf-typetools/files/detect-endianness-universal.patch	                        (rev 0)
+++ trunk/dports/print/lcdf-typetools/files/detect-endianness-universal.patch	2013-09-07 02:15:15 UTC (rev 110824)
@@ -0,0 +1,51 @@
+diff --git a/liblcdf/md5.c b/liblcdf/md5.c
+index 557a39b..5b12d64 100644
+--- a/liblcdf/md5.c
++++ b/liblcdf/md5.c
+@@ -98,7 +98,7 @@ transform(MD5_CONTEXT *ctx, const unsigned char *data)
+ 	uint32_t D = ctx->D;
+ 	uint32_t *cwp = correct_words;
+ 
+-#if WORDS_BIGENDIAN
++#if WORDS_BIGENDIAN || defined(__APPLE__) && defined(__BIG_ENDIAN__)
+ 	{
+ 		int i;
+ 		unsigned char *p2, *p1;
+@@ -111,7 +111,7 @@ transform(MD5_CONTEXT *ctx, const unsigned char *data)
+ 			p2[0] = *p1++;
+ 		}
+ 	}
+-#elif WORDS_LITTLEENDIAN
++#elif WORDS_LITTLEENDIAN || defined(__APPLE__) && defined(__LITTLE_ENDIAN__)
+ 	memcpy(correct_words, data, 64);
+ #else
+ # error "Neither WORDS_BIGENDIAN nor WORDS_LITTLEENDIAN is defined!"
+@@ -307,10 +307,10 @@ do_final(MD5_CONTEXT *hd)
+ 	transform(hd, hd->buf);
+ 
+ 	p = hd->buf;
+-#if WORDS_BIGENDIAN
++#if WORDS_BIGENDIAN || defined(__APPLE__) && defined(__BIG_ENDIAN__)
+ #define X(a) do { *p++ = hd->a      ; *p++ = hd->a >> 8;      \
+ 		  *p++ = hd->a >> 16; *p++ = hd->a >> 24; } while(0)
+-#elif WORDS_LITTLEENDIAN
++#elif WORDS_LITTLEENDIAN || defined(__APPLE__) && defined(__LITTLE_ENDIAN__)
+ 	/*#define X(a) do { *(uint32_t*)p = hd->##a ; p += 4; } while(0)*/
+ 	/* Unixware's cpp doesn't like the above construct so we do it his way:
+ 	 * (reported by Allan Clark) */
+diff --git a/liblcdf/string.cc b/liblcdf/string.cc
+index ec14c37..1b97665 100644
+--- a/liblcdf/string.cc
++++ b/liblcdf/string.cc
+@@ -641,9 +641,9 @@ String::hashcode(const char *begin, const char *end)
+ #undef get16
+ #if !HAVE_INDIFFERENT_ALIGNMENT
+     } else {
+-# if WORDS_BIGENDIAN
++# if WORDS_BIGENDIAN || defined(__APPLE__) && defined(__BIG_ENDIAN__)
+ #  define get16(p) (((unsigned char) (p)[0] << 8) + (unsigned char) (p)[1])
+-# elif WORDS_LITTLEENDIAN
++# elif WORDS_LITTLEENDIAN || defined(__APPLE__) && defined(__LITTLE_ENDIAN__)
+ #  define get16(p) ((unsigned char) (p)[0] + ((unsigned char) (p)[1] << 8))
+ # else
+ #  error "unknown byte order"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130906/a38e2052/attachment-0001.html>


More information about the macports-changes mailing list