Hello community,
here is the log from the commit of package freeimage for openSUSE:Factory checked in at 2016-01-01 19:47:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/freeimage (Old)
and /work/SRC/openSUSE:Factory/.freeimage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "freeimage"
Changes:
--------
--- /work/SRC/openSUSE:Factory/freeimage/freeimage.changes 2015-11-13 23:35:28.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.freeimage.new/freeimage.changes 2016-01-01 19:47:23.000000000 +0100
@@ -1,0 +2,93 @@
+Tue Dec 8 17:02:21 UTC 2015 - p.drouand@gmail.com
+
+- Update to version 3.17.0
+ * FreeImage now uses LibPNG 1.6.16
+ * FreeImage now uses LibWebP 0.4.2 (GIT patch 2015-03-03)
+ * FreeImage now uses LibRaw 0.17-Alpha1
+ * FreeImage now uses LibTIFF 4.0.4 (CVS patch 2015-01-26)
+ * FreeImage now uses OpenEXR 2.2.0
+ * removed VS 2003 project files : this IDE is no longer supported
+ because of its outdated C++ compiler
+ * added FreeImage_ConvertFromRawBitsEx
+ * added RAW_UNPROCESSED load flag to the RAW plugin
+ * added FreeImage_SetMetadataKeyValue
+ * added support for metadata writing to the JPEG-JXR plugin
+ * added VS 2013 project files
+ * added support for PNG tIME metadata (read/write, handle as
+ Exif-TIFF DateTime)
+ * added explicit definition of endianness and color order in
+ compiler options
+ * added FIQ_LFPQUANT quantizer algorithm
+ * added support for input 32-bit dib in Wu quantizer
+ * added FreeImage_ConvertToRGBAF and updated conversions in
+ FreeImage_ConvertToType
+ * added FreeImage_ConvertToRGBA16 and updated conversions in
+ FreeImage_ConvertToType
+ * added FreeImage_CreateView
+ * added FreeImage_RescaleRect
+ * added FreeImage_GetMemorySize
+ * ICO plugin: improved support for Vista icons
+ * fixed a rounding error in RGB to greyscale conversion formula
+ * fixed Makefile.fip so that it installs symlinks
+ * fixed a potential memory access violation in PluginHDR Save function
+ * fixed a bug in FreeImage_LookupSVGColor ("green" color was not found)
+ * fixed TARGA signature validation for TARGA versions < 2.0
+ * fixed FreeImage_GetScanLine not working with very large images on x64
+ platforms
+ * improved PluginTIFF compatibility with LibTIFF 4
+ * fixed a segfault occuring on a corrupted animated GIF
+ * improved memory allocation in PluginRAW
+ * fixed loading/saving of TIFF containing a GPS IFD inside the Exif-TIFF
+ metadata segment (the solution is to ignore the tag)
+ * fixed a bug in FreeImage_JPEGCrop*/_JPEGTransform* functions occuring
+ when using the same source / destination filename
+ * fixed a bug with output image quality in PluginJP2::Save &
+ PluginJ2K::Save functions (regression from FI 3.15.4)
+ * improved RAW file format detection
+ * fixed FreeImage_GetFileType behavior with ANI file formats
+ * improved Exif reader so as to handle Exif IFD with a suspicious offset
+ (can occur with maker notes)
+ * fixed a memory leak in PluginPNG:Save occuring when dealing with invalid
+ PNG files
+ * fixed PNG plugin handling of 16-bit grayscale + 16-bit alpha images
+ * fixed PNG plugin handling of 16-bit grayscale + tRNS chunk images
+ * fixed PNG plugin handling of 24-bit RGB + tRNS chunk images
+ * fixed PNG plugin handling of 1-,4-bit greyscale/palettized + tRNS
+ chunk images
+ * fixed invalid directory delimiter in include statement (mingw-w64)
+ in Source/LibJXR/image/sys/strcodec.h
+ * fixed Invalid condition for defining _byteswap_ulong (mingw-w64)
+ in Source/LibJXR/image/sys/strcodec.c
+ * fixed FreeImage_Get*Mask not returning 0 for greyscale images
+ * fixed loading of external plugins when using UNICODE directory
+ names to store plugins
+ * fixed loading of JXR files when using memory streams
+ * added Dist/ directory creation in Makefiles (in case it is not
+ already present)
+- For changes from previous versions, please read the Whatnew.txt file
+- Remove some obsolete patches
+ * use_system_libs.patch
+ * use_system_libs_openjpeg.patch
+ * use_system_libs_libpng15.patch
+ * use_system_libs_libpng14.patch
+ * libraw_types.patch
+- Update makefiles_fixes.patch
+- Add patches from Fedora
+ * unbundle.patch
+ * CVE-2015-0852.patch
+- Use download Url as source
+- Add dependencies
+ * jxrlib-devel
+ * libjpeg-devel
+ * openjpeg2-devel instead of openjpeg-devel
+ * pkgconfig(libpng)
+ * pkgconfig(libraw) instead of libraw-devel
+ * pkgconfig(libmng)
+ * pkgconfig(libtiff-4)
+ * pkgconfig(libwebp)
+ * pkgconfig(OpenEXR)
+ * pkgconfig(zlib) instead of zlib-devel
+ * unzip
+- Drop support for SLE11; doesn't build anyway
+
+-------------------------------------------------------------------
Old:
----
FreeImage3154.tar.bz2
libraw_types.patch
use_system_libs.patch
use_system_libs_libpng14.patch
use_system_libs_libpng15.patch
use_system_libs_openjpeg.patch
New:
----
CVE-2015-0852.patch
FreeImage3170.zip
unbundle.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ freeimage.spec ++++++
--- /var/tmp/diff_new_pack.UUtaaR/_old 2016-01-01 19:47:24.000000000 +0100
+++ /var/tmp/diff_new_pack.UUtaaR/_new 2016-01-01 19:47:24.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package freeimage
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,45 +17,41 @@
%define so_ver 3
+%define tarver 3170
Name: freeimage
-Version: 3.15.4
+Version: 3.17.0
Release: 0
Summary: Multi-format Image Decoder Library
License: GPL-2.0 or GPL-3.0
Group: System/Libraries
Url: http://freeimage.sourceforge.net/
-# repacked from http://downloads.sourceforge.net/freeimage/FreeImage3154.zip
-Source0: FreeImage3154.tar.bz2
-# PATCH-FIX-OPENSUSE makefiles_fixes.patch asterios.dramis@gmail.com -- Fix CFLAGS and CXXFLAGS, removed -s (strip) option, add missing symlinks for libfreeimageplus, remove root user from install
-Patch0: makefiles_fixes.patch
+Source0: http://downloads.sourceforge.net/freeimage/FreeImage%{tarver}.zip
+# PATCH-FIX-OPENSUSE unbundle.patch p.drouand@gmail.com -- Use system libraries instead of bundled ones
+Patch0: unbundle.patch
# PATCH-FIX-OPENSUSE doxygen.patch asterios.dramis@gmail.com -- Fix documentation building (Based on patch from Fedora)
Patch1: doxygen.patch
-# PATCH-FIX-OPENSUSE use_system_libs.patch asterios.dramis@gmail.com -- Use system libraries, except libjpeg and libtiff (the package uses some internal headers of these).
-Patch2: use_system_libs.patch
-# PATCH-FIX-OPENSUSE use_system_libs_openjpeg.patch asterios.dramis@gmail.com -- Use system libraries (openjpeg)
-Patch3: use_system_libs_openjpeg.patch
-# PATCH-FIX-OPENSUSE use_system_libs_libpng15.patch asterios.dramis@gmail.com -- Use system libraries (libpng15)
-Patch4: use_system_libs_libpng15.patch
-# PATCH-FIX-OPENSUSE use_system_libs_libpng14.patch asterios.dramis@gmail.com -- Use system libraries (libpng14)
-Patch5: use_system_libs_libpng14.patch
-# PATCH-FIX-OPENSUSE don't define conflicting types when libraw is used prusnak@opensuse.org
-Patch6: libraw_types.patch
-BuildRequires: OpenEXR-devel
+# PATCH-FIX-UPSTREAM CVE-2015-0852.patch -- Multiple integer underflows in PluginPCX.cpp in FreeImage 3.17.0 and earlier
+Patch2: CVE-2015-0852.patch
+# PATCH-FIX-OPENSUSE makefiles_fixes.patch asterios.dramis@gmail.com -- Fix CFLAGS and CXXFLAGS, removed -s (strip) option, add missing symlinks for libfreeimageplus, remove root user from install
+Patch3: makefiles_fixes.patch
BuildRequires: doxygen
BuildRequires: gcc-c++
-BuildRequires: libpng-devel
-%if 0%{?suse_version} == 1140
-BuildRequires: libraw-devel
-BuildRequires: libraw-devel-static
+BuildRequires: jxrlib-devel
+BuildRequires: libjpeg-devel
+BuildRequires: openjpeg2-devel
+BuildRequires: pkgconfig(libpng)
+BuildRequires: pkgconfig(libraw)
+%if 0%{?suse_version} >= 1320
+BuildRequires: pkgconfig(libmng)
%else
-BuildRequires: libraw-devel
+BuildRequires: libmng-devel
%endif
-%if 0%{?suse_version} > 1210
-BuildRequires: openjpeg-devel
-%endif
-BuildRequires: zlib-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: unzip
+BuildRequires: pkgconfig(OpenEXR)
+BuildRequires: pkgconfig(libtiff-4)
+BuildRequires: pkgconfig(libwebp)
+BuildRequires: pkgconfig(zlib)
%description
FreeImage is an Open Source library project for developers who would like to
@@ -101,24 +97,23 @@
%patch0 -p1
%patch1
%patch2 -p1
-%if 0%{?suse_version} > 1210
%patch3 -p1
-%endif
-%if 0%{?suse_version} > 1220
-%patch4 -p1
-%else
-%patch5 -p1
-%endif
-%patch6 -p1
-# Remove bundled libs (except of LibJPEG/ and LibTIFF4/) to make sure these don't get used during compile
-rm -rf Source/LibPNG/ Source/LibRawLite/ Source/OpenEXR/ Source/ZLib/
-%if 0%{?suse_version} > 1210
-rm -rf Source/LibOpenJPEG/
-%endif
+# Remove bundled libs to make sure these don't get used during compile
+rm -rf Source/LibPNG/ Source/LibRawLite/ Source/OpenEXR/ Source/ZLib/ Source/LibOpenJPEG/ Source/LibJPEG/
-# Fix "wrong-file-end-of-line-encoding" rpmlint warning
-sed -i 's/\r$//' license-fi.txt license-gplv2.txt license-gplv3.txt Whatsnew.txt
+# clear files which cannot be built due to dependencies on private headers
+# (see also unbundle patch)
+# It disables the G3 Fax Loader and the JPEG lossless transformations plugins
+> Source/FreeImage/PluginG3.cpp
+> Source/FreeImageToolkit/JPEGTransform.cpp
+
+# sanitize encodings / line endings
+for file in `find . -type f -name '*.c' -or -name '*.cpp' -or -name '*.h' -or -name '*.txt' -or -name Makefile`; do
+ iconv --from=ISO-8859-15 --to=UTF-8 $file > $file.new && \
+ sed -i 's|\r||g' $file.new && \
+ touch -r $file $file.new && mv $file.new $file
+done
%build
sh ./gensrclist.sh
++++++ CVE-2015-0852.patch ++++++
diff -rupN FreeImage/Source/FreeImage/PluginPCX.cpp FreeImage-new/Source/FreeImage/PluginPCX.cpp
--- FreeImage/Source/FreeImage/PluginPCX.cpp 2015-03-02 02:07:08.000000000 +0100
+++ FreeImage-new/Source/FreeImage/PluginPCX.cpp 2015-09-05 02:44:55.429436425 +0200
@@ -30,7 +30,7 @@
// Constants + headers
// ----------------------------------------------------------
-#define IO_BUF_SIZE 2048
+#define PCX_IO_BUF_SIZE 2048
// ----------------------------------------------------------
@@ -120,17 +120,17 @@ readline(FreeImageIO &io, fi_handle hand
while (length--) {
if (count == 0) {
- if (*ReadPos >= IO_BUF_SIZE - 1 ) {
- if (*ReadPos == IO_BUF_SIZE - 1) {
+ if (*ReadPos >= PCX_IO_BUF_SIZE - 1 ) {
+ if (*ReadPos == PCX_IO_BUF_SIZE - 1) {
// we still have one BYTE, copy it to the start pos
- *ReadBuf = ReadBuf[IO_BUF_SIZE - 1];
+ *ReadBuf = ReadBuf[PCX_IO_BUF_SIZE - 1];
- io.read_proc(ReadBuf + 1, 1, IO_BUF_SIZE - 1, handle);
+ io.read_proc(ReadBuf + 1, 1, PCX_IO_BUF_SIZE - 1, handle);
} else {
// read the complete buffer
- io.read_proc(ReadBuf, 1, IO_BUF_SIZE, handle);
+ io.read_proc(ReadBuf, 1, PCX_IO_BUF_SIZE, handle);
}
*ReadPos = 0;
@@ -346,19 +346,9 @@ Load(FreeImageIO *io, fi_handle handle,
BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS;
try {
- // check PCX identifier
-
- long start_pos = io->tell_proc(handle);
- BOOL validated = pcx_validate(io, handle);
- io->seek_proc(handle, start_pos, SEEK_SET);
- if(!validated) {
- throw FI_MSG_ERROR_MAGIC_NUMBER;
- }
-
- // process the header
-
PCXHEADER header;
+ // process the header
if(io->read_proc(&header, sizeof(PCXHEADER), 1, handle) != 1) {
throw FI_MSG_ERROR_PARSING;
}
@@ -366,20 +356,38 @@ Load(FreeImageIO *io, fi_handle handle,
SwapHeader(&header);
#endif
- // allocate a new DIB
+ // process the window
+ const WORD *window = header.window; // left, upper, right,lower pixel coord.
+ const int left = window[0];
+ const int top = window[1];
+ const int right = window[2];
+ const int bottom = window[3];
- unsigned width = header.window[2] - header.window[0] + 1;
- unsigned height = header.window[3] - header.window[1] + 1;
- unsigned bitcount = header.bpp * header.planes;
-
- if (bitcount == 24) {
- dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- } else {
- dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
+ // check image size
+ if((left >= right) || (top >= bottom)) {
+ throw FI_MSG_ERROR_PARSING;
}
- // if the dib couldn't be allocated, throw an error
+ const unsigned width = right - left + 1;
+ const unsigned height = bottom - top + 1;
+ const unsigned bitcount = header.bpp * header.planes;
+ // allocate a new dib
+ switch(bitcount) {
+ case 1:
+ case 4:
+ case 8:
+ dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
+ break;
+ case 24:
+ dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
+ break;
+ default:
+ throw FI_MSG_ERROR_DIB_MEMORY;
+ break;
+ }
+
+ // if the dib couldn't be allocated, throw an error
if (!dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
@@ -426,19 +434,23 @@ Load(FreeImageIO *io, fi_handle handle,
if (palette_id == 0x0C) {
BYTE *cmap = (BYTE*)malloc(768 * sizeof(BYTE));
- io->read_proc(cmap, 768, 1, handle);
- pal = FreeImage_GetPalette(dib);
- BYTE *pColormap = &cmap[0];
+ if(cmap) {
+ io->read_proc(cmap, 768, 1, handle);
- for(int i = 0; i < 256; i++) {
- pal[i].rgbRed = pColormap[0];
- pal[i].rgbGreen = pColormap[1];
- pal[i].rgbBlue = pColormap[2];
- pColormap += 3;
+ pal = FreeImage_GetPalette(dib);
+ BYTE *pColormap = &cmap[0];
+
+ for(int i = 0; i < 256; i++) {
+ pal[i].rgbRed = pColormap[0];
+ pal[i].rgbGreen = pColormap[1];
+ pal[i].rgbBlue = pColormap[2];
+ pColormap += 3;
+ }
+
+ free(cmap);
}
- free(cmap);
}
// wrong palette ID, perhaps a gray scale is needed ?
@@ -463,12 +475,12 @@ Load(FreeImageIO *io, fi_handle handle,
return dib;
}
- // calculate the line length for the PCX and the DIB
+ // calculate the line length for the PCX and the dib
// length of raster line in bytes
- unsigned linelength = header.bytes_per_line * header.planes;
- // length of DIB line (rounded to DWORD) in bytes
- unsigned pitch = FreeImage_GetPitch(dib);
+ const unsigned linelength = header.bytes_per_line * header.planes;
+ // length of dib line (rounded to DWORD) in bytes
+ const unsigned pitch = FreeImage_GetPitch(dib);
// run-length encoding ?
@@ -478,14 +490,18 @@ Load(FreeImageIO *io, fi_handle handle,
// ---------------
line = (BYTE*)malloc(linelength * sizeof(BYTE));
- if(!line) throw FI_MSG_ERROR_MEMORY;
+ if(!line) {
+ throw FI_MSG_ERROR_MEMORY;
+ }
- ReadBuf = (BYTE*)malloc(IO_BUF_SIZE * sizeof(BYTE));
- if(!ReadBuf) throw FI_MSG_ERROR_MEMORY;
+ ReadBuf = (BYTE*)malloc(PCX_IO_BUF_SIZE * sizeof(BYTE));
+ if(!ReadBuf) {
+ throw FI_MSG_ERROR_MEMORY;
+ }
bits = FreeImage_GetScanLine(dib, height - 1);
- int ReadPos = IO_BUF_SIZE;
+ int ReadPos = PCX_IO_BUF_SIZE;
if ((header.planes == 1) && ((header.bpp == 1) || (header.bpp == 8))) {
BYTE skip;
@@ -497,7 +513,7 @@ Load(FreeImageIO *io, fi_handle handle,
// skip trailing garbage at the end of the scanline
for (unsigned count = written; count < linelength; count++) {
- if (ReadPos < IO_BUF_SIZE) {
+ if (ReadPos < PCX_IO_BUF_SIZE) {
ReadPos++;
} else {
io->read_proc(&skip, sizeof(BYTE), 1, handle);
@@ -513,7 +529,9 @@ Load(FreeImageIO *io, fi_handle handle,
unsigned x, y, written;
buffer = (BYTE*)malloc(width * sizeof(BYTE));
- if(!buffer) throw FI_MSG_ERROR_MEMORY;
+ if(!buffer) {
+ throw FI_MSG_ERROR_MEMORY;
+ }
for (y = 0; y < height; y++) {
written = readline(*io, handle, line, linelength, bIsRLE, ReadBuf, &ReadPos);
@@ -532,7 +550,7 @@ Load(FreeImageIO *io, fi_handle handle,
}
}
- // then write the DIB row
+ // then write the dib row
for (x = 0; x < width / 2; x++) {
bits[x] = (buffer[2*x] << 4) | buffer[2*x+1];
@@ -541,7 +559,7 @@ Load(FreeImageIO *io, fi_handle handle,
// skip trailing garbage at the end of the scanline
for (unsigned count = written; count < linelength; count++) {
- if (ReadPos < IO_BUF_SIZE) {
+ if (ReadPos < PCX_IO_BUF_SIZE) {
ReadPos++;
} else {
io->read_proc(&skip, sizeof(BYTE), 1, handle);
++++++ doxygen.patch ++++++
--- /var/tmp/diff_new_pack.UUtaaR/_old 2016-01-01 19:47:24.000000000 +0100
+++ /var/tmp/diff_new_pack.UUtaaR/_new 2016-01-01 19:47:24.000000000 +0100
@@ -7,7 +7,7 @@
# if some version control system is used.
-PROJECT_NUMBER = "- FreeImage 3.15.1"
-+PROJECT_NUMBER = "- FreeImage 3.15.3"
++PROJECT_NUMBER = "- FreeImage 3.17.0"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
++++++ makefiles_fixes.patch ++++++
--- /var/tmp/diff_new_pack.UUtaaR/_old 2016-01-01 19:47:24.000000000 +0100
+++ /var/tmp/diff_new_pack.UUtaaR/_new 2016-01-01 19:47:24.000000000 +0100
@@ -2,77 +2,35 @@
===================================================================
--- FreeImage.orig/Makefile.fip
+++ FreeImage/Makefile.fip
-@@ -15,10 +15,10 @@ LIBRARIES = -lstdc++
-
- MODULES = $(SRCS:.c=.o)
- MODULES := $(MODULES:.cpp=.o)
--CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS
--CFLAGS += $(INCLUDE)
--CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
--CXXFLAGS += $(INCLUDE)
-+override CFLAGS += -O3 -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS
-+override CFLAGS += $(INCLUDE)
-+override CXXFLAGS += -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
-+override CXXFLAGS += $(INCLUDE)
-
- ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
- CFLAGS += -fPIC
-@@ -59,14 +59,16 @@ $(STATICLIB): $(MODULES)
- $(AR) r $@ $(MODULES)
-
- $(SHAREDLIB): $(MODULES)
-- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-+ $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-
- install:
- install -d $(INCDIR) $(INSTALLDIR)
-- install -m 644 -o root -g root $(HEADER) $(INCDIR)
-- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
-- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
-- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
-+ install -m 644 $(HEADER) $(INCDIR)
-+ install -m 644 $(HEADERFIP) $(INCDIR)
-+ install -m 644 $(STATICLIB) $(INSTALLDIR)
-+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
-+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
-+ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
-
- clean:
- rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)
+@@ -72,10 +72,10 @@
+
+ install:
+ install -d $(INCDIR) $(INSTALLDIR)
+- install -m 644 -o root -g root $(HEADER) $(INCDIR)
+- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
+- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
++ install -m 644 $(HEADER) $(INCDIR)
++ install -m 644 $(HEADERFIP) $(INCDIR)
++ install -m 644 $(STATICLIB) $(INSTALLDIR)
++ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
+
Index: FreeImage/Makefile.gnu
===================================================================
--- FreeImage.orig/Makefile.gnu
+++ FreeImage/Makefile.gnu
-@@ -15,10 +15,10 @@ LIBRARIES = -lstdc++
-
- MODULES = $(SRCS:.c=.o)
- MODULES := $(MODULES:.cpp=.o)
--CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS
--CFLAGS += $(INCLUDE)
--CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
--CXXFLAGS += $(INCLUDE)
-+override CFLAGS += -O3 -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS
-+override CFLAGS += $(INCLUDE)
-+override CXXFLAGS += -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
-+override CXXFLAGS += $(INCLUDE)
-
- ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
- CFLAGS += -fPIC
-@@ -58,13 +58,13 @@ $(STATICLIB): $(MODULES)
- $(AR) r $@ $(MODULES)
-
- $(SHAREDLIB): $(MODULES)
-- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-+ $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-
- install:
- install -d $(INCDIR) $(INSTALLDIR)
-- install -m 644 -o root -g root $(HEADER) $(INCDIR)
-- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
-- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
-+ install -m 644 $(HEADER) $(INCDIR)
-+ install -m 644 $(STATICLIB) $(INSTALLDIR)
-+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
- ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
- ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
- # ldconfig
+@@ -71,9 +71,9 @@
+
+ install:
+ install -d $(INCDIR) $(INSTALLDIR)
+- install -m 644 -o root -g root $(HEADER) $(INCDIR)
+- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
++ install -m 644 $(HEADER) $(INCDIR)
++ install -m 644 $(STATICLIB) $(INSTALLDIR)
++ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
+ # ldconfig
++++++ unbundle.patch ++++++
diff -rupN FreeImage/genfipsrclist.sh FreeImage-new/genfipsrclist.sh
--- FreeImage/genfipsrclist.sh 2015-02-20 10:52:16.000000000 +0100
+++ FreeImage-new/genfipsrclist.sh 2015-09-05 02:13:52.041353305 +0200
@@ -1,6 +1,6 @@
#!/bin/sh
-DIRLIST=". Source Source/Metadata Source/FreeImageToolkit Source/LibJPEG Source/LibPNG Source/LibTIFF4 Source/ZLib Source/LibOpenJPEG Source/OpenEXR Source/OpenEXR/Half Source/OpenEXR/Iex Source/OpenEXR/IlmImf Source/OpenEXR/IlmThread Source/OpenEXR/Imath Source/OpenEXR/IexMath Source/LibRawLite Source/LibRawLite/dcraw Source/LibRawLite/internal Source/LibRawLite/libraw Source/LibRawLite/src Source/LibWebP Source/LibJXR Source/LibJXR/common/include Source/LibJXR/image/sys Source/LibJXR/jxrgluelib Wrapper/FreeImagePlus"
+DIRLIST="Wrapper/FreeImagePlus"
echo "VER_MAJOR = 3" > fipMakefile.srcs
@@ -19,5 +19,6 @@ echo -n "INCLUDE =" >> fipMakefile.srcs
for DIR in $DIRLIST; do
echo -n " -I$DIR" >> fipMakefile.srcs
done
+echo -n " -IDist" >> fipMakefile.srcs
echo >> fipMakefile.srcs
diff -rupN FreeImage/gensrclist.sh FreeImage-new/gensrclist.sh
--- FreeImage/gensrclist.sh 2015-02-20 10:51:50.000000000 +0100
+++ FreeImage-new/gensrclist.sh 2015-09-05 02:13:52.041353305 +0200
@@ -1,6 +1,6 @@
#!/bin/sh
-DIRLIST=". Source Source/Metadata Source/FreeImageToolkit Source/LibJPEG Source/LibPNG Source/LibTIFF4 Source/ZLib Source/LibOpenJPEG Source/OpenEXR Source/OpenEXR/Half Source/OpenEXR/Iex Source/OpenEXR/IlmImf Source/OpenEXR/IlmThread Source/OpenEXR/Imath Source/OpenEXR/IexMath Source/LibRawLite Source/LibRawLite/dcraw Source/LibRawLite/internal Source/LibRawLite/libraw Source/LibRawLite/src Source/LibWebP Source/LibJXR Source/LibJXR/common/include Source/LibJXR/image/sys Source/LibJXR/jxrgluelib"
+DIRLIST=". Source Source/Metadata Source/FreeImageToolkit"
echo "VER_MAJOR = 3" > Makefile.srcs
echo "VER_MINOR = 17.0" >> Makefile.srcs
diff -rupN FreeImage/Makefile.fip FreeImage-new/Makefile.fip
--- FreeImage/Makefile.fip 2015-03-08 18:03:56.000000000 +0100
+++ FreeImage-new/Makefile.fip 2015-09-05 02:14:09.212684028 +0200
@@ -17,20 +17,22 @@ MODULES = $(SRCS:.c=.o)
MODULES := $(MODULES:.cpp=.o)
CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
# OpenJPEG
-CFLAGS += -DOPJ_STATIC
+override CFLAGS += -DOPJ_STATIC
# LibRaw
-CFLAGS += -DNO_LCMS
+override CFLAGS += -DNO_LCMS
# LibJXR
-CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
-CFLAGS += $(INCLUDE)
+override CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
+override CFLAGS += $(INCLUDE)
CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
# LibJXR
-CXXFLAGS += -D__ANSI__
-CXXFLAGS += $(INCLUDE)
+override CXXFLAGS += -D__ANSI__
+override CXXFLAGS += $(INCLUDE)
+LDFLAGS ?=
+override LDFLAGS += -LDist -lfreeimage-$(VER_MAJOR).$(VER_MINOR)
ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
- CFLAGS += -fPIC
- CXXFLAGS += -fPIC
+ override CFLAGS += -fPIC
+ override CXXFLAGS += -fPIC
endif
TARGET = freeimageplus
@@ -68,7 +70,7 @@ $(STATICLIB): $(MODULES)
$(AR) r $@ $(MODULES)
$(SHAREDLIB): $(MODULES)
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
+ $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
install:
install -d $(INCDIR) $(INSTALLDIR)
diff -rupN FreeImage/Makefile.gnu FreeImage-new/Makefile.gnu
--- FreeImage/Makefile.gnu 2015-03-08 18:04:00.000000000 +0100
+++ FreeImage-new/Makefile.gnu 2015-09-05 02:14:04.810599259 +0200
@@ -16,21 +16,11 @@ LIBRARIES = -lstdc++
MODULES = $(SRCS:.c=.o)
MODULES := $(MODULES:.cpp=.o)
CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
-# OpenJPEG
-CFLAGS += -DOPJ_STATIC
-# LibRaw
-CFLAGS += -DNO_LCMS
-# LibJXR
-CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
-CFLAGS += $(INCLUDE)
-CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
-# LibJXR
-CXXFLAGS += -D__ANSI__
-CXXFLAGS += $(INCLUDE)
+override CFLAGS += $(INCLUDE) -D__ANSI__ -I/usr/include/jxrlib $(shell pkg-config --cflags OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
+override LDFLAGS += -ljpeg -ljpegxr -ljxrglue $(shell pkg-config --libs OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
- CFLAGS += -fPIC
- CXXFLAGS += -fPIC
+ override CFLAGS += -fPIC
endif
TARGET = freeimage
@@ -61,13 +51,13 @@ FreeImage: $(STATICLIB) $(SHAREDLIB)
$(CC) $(CFLAGS) -c $< -o $@
.cpp.o:
- $(CXX) $(CXXFLAGS) -c $< -o $@
+ $(CXX) $(CFLAGS) -c $< -o $@
$(STATICLIB): $(MODULES)
$(AR) r $@ $(MODULES)
$(SHAREDLIB): $(MODULES)
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
+ $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
install:
install -d $(INCDIR) $(INSTALLDIR)
diff -rupN FreeImage/Source/FreeImage/J2KHelper.cpp FreeImage-new/Source/FreeImage/J2KHelper.cpp
--- FreeImage/Source/FreeImage/J2KHelper.cpp 2015-03-02 02:07:08.000000000 +0100
+++ FreeImage-new/Source/FreeImage/J2KHelper.cpp 2015-09-05 02:13:52.042353324 +0200
@@ -21,7 +21,7 @@
#include "FreeImage.h"
#include "Utilities.h"
-#include "../LibOpenJPEG/openjpeg.h"
+#include