diff --git a/lcms2-ocloexec.patch b/lcms2-ocloexec.patch new file mode 100644 index 0000000..98ddfe4 --- /dev/null +++ b/lcms2-ocloexec.patch @@ -0,0 +1,38 @@ +--- src/cmscgats.c.orig ++++ src/cmscgats.c +@@ -835,7 +835,7 @@ void InSymbol(cmsIT8* it8) + return; + } + +- FileNest->Stream = fopen(FileNest->FileName, "rt"); ++ FileNest->Stream = fopen(FileNest->FileName, "rte"); + if (FileNest->Stream == NULL) { + + SynError(it8, "File %s not found", FileNest->FileName); +@@ -1669,7 +1669,7 @@ cmsBool CMSEXPORT cmsIT8SaveToFile(cmsHA + + memset(&sd, 0, sizeof(sd)); + +- sd.stream = fopen(cFileName, "wt"); ++ sd.stream = fopen(cFileName, "wte"); + if (!sd.stream) return FALSE; + + WriteStr(&sd, it8->SheetType); +@@ -2142,7 +2142,7 @@ cmsBool IsMyFile(const char* FileName) + cmsUInt32Number Size; + cmsUInt8Number Ptr[133]; + +- fp = fopen(FileName, "rt"); ++ fp = fopen(FileName, "rte"); + if (!fp) { + cmsSignalError(0, cmsERROR_FILE, "File '%s' not found", FileName); + return FALSE; +@@ -2220,7 +2220,7 @@ cmsHANDLE CMSEXPORT cmsIT8LoadFromFile( + if (!hIT8) return NULL; + + +- it8 ->FileStack[0]->Stream = fopen(cFileName, "rt"); ++ it8 ->FileStack[0]->Stream = fopen(cFileName, "rte"); + + if (!it8 ->FileStack[0]->Stream) { + cmsIT8Free(hIT8); diff --git a/lcms2-visibility.patch b/lcms2-visibility.patch new file mode 100644 index 0000000..e498600 --- /dev/null +++ b/lcms2-visibility.patch @@ -0,0 +1,16 @@ +--- src/lcms2_internal.h.orig ++++ src/lcms2_internal.h +@@ -37,6 +37,7 @@ + // assert macro is part of C99 as per 7.2 + #include + ++#pragma GCC visibility push(hidden) + // Some needed constants + #ifndef M_PI + # define M_PI 3.14159265358979323846 +@@ -625,4 +626,5 @@ cmsBool _cmsBuildRGB2XYZtransferMatrix + + + #define _lcms_internal_H ++#pragma GCC visibility pop + #endif diff --git a/lcms2.changes b/lcms2.changes index 23e6c55..69d2454 100644 --- a/lcms2.changes +++ b/lcms2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 24 02:12:00 UTC 2011 - crrodriguez@opensuse.org + +- Open all fds with O_CLOEXEC +- Use gcc visibility, symbol table shrinks around 50% ... + ------------------------------------------------------------------- Fri Jun 10 23:36:41 UTC 2011 - mrdocs@opensuse.org diff --git a/lcms2.spec b/lcms2.spec index 5d8024b..1a80865 100644 --- a/lcms2.spec +++ b/lcms2.spec @@ -42,6 +42,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: http://sourceforge.net/projects/lcms/files/lcms/%{version}/%{name}-%{version}.tar.gz Source1: baselibs.conf Patch: lcms-endian.patch +Patch1: lcms2-ocloexec.patch +Patch2: lcms2-visibility.patch %description Littlecms is a small speed optimized color management engine. @@ -84,11 +86,13 @@ This package contains user and developer documentation for lcms2. %prep %setup -q %patch +%patch1 +%patch2 chmod a-x doc/* COPYING AUTHORS %build -export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" -export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +#export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +#export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --disable-static