diff --git a/SOURCES/define-ppc64le-endian.patch b/SOURCES/define-ppc64le-endian.patch deleted file mode 100644 index bfbe7ac..0000000 --- a/SOURCES/define-ppc64le-endian.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -up lcms2-2.6/include/lcms2.h.pccle lcms2-2.6/include/lcms2.h ---- lcms2-2.6/include/lcms2.h.pccle 2015-05-08 14:47:23.180315646 -0400 -+++ lcms2-2.6/include/lcms2.h 2015-05-08 14:48:27.071176735 -0400 -@@ -184,6 +184,13 @@ typedef int cmsBool; - # define CMS_USE_BIG_ENDIAN 1 - #endif - -+#if defined (__GNUC__) && defined(__BYTE_ORDER__) && defined(__LITTLE_ENDIAN__) -+# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -+// Don't use big endian for PowerPC little endian mode -+# undef CMS_USE_BIG_ENDIAN -+# endif -+#endif -+ - # ifdef TARGET_CPU_PPC - # if TARGET_CPU_PPC - # define CMS_USE_BIG_ENDIAN 1 diff --git a/SOURCES/endianness.patch b/SOURCES/endianness.patch new file mode 100644 index 0000000..ea1e442 --- /dev/null +++ b/SOURCES/endianness.patch @@ -0,0 +1,99 @@ +commit b32dcedd13b3fc2ea7a8099cc0f67eaa31b8c298 +Author: Chris Liddell +Date: Thu May 21 09:06:01 2015 +0100 + + Simplify/Improve endian decisions in lcms2.h + + Firstly, protect the endian decisions in lcms2.h so that settings given on the + compiler command line are not silently overridden. Thus being set explicitly + gets the highest priority. + + Secondly, use the endianness detected by the configure script, and remove the + complex and error prone stuff for PPC platforms from lcms2.h. Thus the endianess + from configure gets second highest priority. + + Thirdly, if neither of the above are set, fall back to some simple (and long + standing) platform/compiler specific tests. These should rarely, if ever, come + into play in a "normal" build for a "normal" Unix-like system. + +diff --git a/include/lcms2.h b/include/lcms2.h +index a0421d8..f32beec 100644 +--- a/include/lcms2.h ++++ b/include/lcms2.h +@@ -173,46 +173,43 @@ + # define CMS_IS_WINDOWS_ 1 + #endif + +-// Try to detect big endian platforms. This list can be endless, so only some checks are performed over here. +-// you can pass this toggle to the compiler by using -DCMS_USE_BIG_ENDIAN or something similar +- +-#if defined(__sgi__) || defined(__sgi) || defined(sparc) +-# define CMS_USE_BIG_ENDIAN 1 +-#endif ++// Try to detect big endian platforms. This list can be endless, so primarily rely on the configure script ++// on Unix-like systems, and allow it to be set on the compiler command line using ++// -DCMS_USE_BIG_ENDIAN or something similar ++#ifdef CMS_USE_BIG_ENDIAN // set at compiler command line takes overall precedence ++# if CMS_USE_BIG_ENDIAN == 0 ++# undef CMS_USE_BIG_ENDIAN ++# endif ++#else // CMS_USE_BIG_ENDIAN + +-#if defined(__s390__) || defined(__s390x__) +-# define CMS_USE_BIG_ENDIAN 1 +-#endif ++# ifdef WORDS_BIGENDIAN // set by configure (or explicitly on compiler command line) ++# define CMS_USE_BIG_ENDIAN 1 ++# else // WORDS_BIGENDIAN ++// Fall back to platform/compiler specific tests ++# if defined(__sgi__) || defined(__sgi) || defined(sparc) ++# define CMS_USE_BIG_ENDIAN 1 ++# endif + +-# ifdef TARGET_CPU_PPC +-# if TARGET_CPU_PPC ++# if defined(__s390__) || defined(__s390x__) + # define CMS_USE_BIG_ENDIAN 1 + # endif +-# endif + +-#if defined(__powerpc__) || defined(__ppc__) || defined(TARGET_CPU_PPC) +-# define CMS_USE_BIG_ENDIAN 1 +-# if defined (__GNUC__) && defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) +-# if __BYTE_ORDER == __LITTLE_ENDIAN +-// // Don't use big endian for PowerPC little endian mode +-# undef CMS_USE_BIG_ENDIAN +-# endif +-# endif +-#endif ++# ifdef macintosh ++# ifdef __BIG_ENDIAN__ ++# define CMS_USE_BIG_ENDIAN 1 ++# endif ++# ifdef __LITTLE_ENDIAN__ ++# undef CMS_USE_BIG_ENDIAN ++# endif ++# endif ++# endif // WORDS_BIGENDIAN + +-// WORDS_BIGENDIAN takes precedence +-#if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN) +-# define CMS_USE_BIG_ENDIAN 1 +-#endif ++# if defined(_HOST_BIG_ENDIAN) || defined(__BIG_ENDIAN__) ++# define CMS_USE_BIG_ENDIAN 1 ++# endif ++ ++#endif // CMS_USE_BIG_ENDIAN + +-#ifdef macintosh +-# ifdef __BIG_ENDIAN__ +-# define CMS_USE_BIG_ENDIAN 1 +-# endif +-# ifdef __LITTLE_ENDIAN__ +-# undef CMS_USE_BIG_ENDIAN +-# endif +-#endif + + // Calling convention -- this is hardly platform and compiler dependent + #ifdef CMS_IS_WINDOWS_ diff --git a/SOURCES/test_library_path.patch b/SOURCES/test_library_path.patch new file mode 100644 index 0000000..3a0923d --- /dev/null +++ b/SOURCES/test_library_path.patch @@ -0,0 +1,11 @@ +--- testbed/Makefile.in.old 2015-10-16 14:05:13.000000000 -0400 ++++ testbed/Makefile.in 2015-10-16 14:31:17.000000000 -0400 +@@ -539,7 +539,7 @@ + if [ $(top_srcdir) != $(top_builddir) ]; then \ + cp $(top_srcdir)/testbed/*.ic? $(top_builddir)/testbed; \ + fi +- ./testcms ++ LD_LIBRARY_PATH=$(top_builddir)/src/.libs ./.libs/testcms + if [ $(top_srcdir) != $(top_builddir) ]; then \ + rm -f $(top_builddir)/testbed/*.ic?; \ + fi diff --git a/SPECS/lcms2.spec b/SPECS/lcms2.spec index 34ce2b2..3b778a7 100644 --- a/SPECS/lcms2.spec +++ b/SPECS/lcms2.spec @@ -1,11 +1,12 @@ Name: lcms2 Version: 2.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Color Management Engine License: MIT URL: http://www.littlecms.com/ Source0: http://www.littlecms.com/lcms2-2.6.tar.gz -Patch0: define-ppc64le-endian.patch +Patch0: endianness.patch +Patch1: test_library_path.patch BuildRequires: libjpeg-devel BuildRequires: libtiff-devel @@ -36,6 +37,7 @@ Development files for LittleCMS. %prep %setup -q -n lcms2-2.6 %patch0 -p1 +%patch1 %build export CFLAGS='-fno-strict-aliasing %optflags' %configure --disable-static --program-suffix=2 @@ -46,6 +48,9 @@ sed -i.rpath 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} +%check +make check + %install rm -rf ${RPM_BUILD_ROOT} make install DESTDIR=${RPM_BUILD_ROOT} INSTALL="install -p" @@ -83,6 +88,11 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/pkgconfig/%{name}.pc %changelog +* Fri Oct 16 2015 Andrew Hughes - 2.6-3 +- Run tests as part of %%check, fixing Makefile to set LD_LIBRARY_PATH +- Use upstream endianness fix to avoid ppc64le being built big-endian +- Resolves: #1250914 + * Tue May 26 2015 Matthias Clasen 2.6-2 - Build with -fno-strict-aliasing Related: #1174406