Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/freeimage freeimage: Force use of unbundled l...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1121e6e5233e
branches:  trunk
changeset: 431536:1121e6e5233e
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu May 14 16:42:13 2020 +0000

description:
freeimage: Force use of unbundled libraries.

Most Linux distributions have been forcing this for a while, because
the reference image libraries are often full of bugs and slow to do
releases, so everyone (including us) is carrying lots of local patches
for security fixes.

Bump PKGREVISION

diffstat:

 graphics/freeimage/Makefile                                                   |   50 ++-
 graphics/freeimage/PLIST                                                      |    9 +-
 graphics/freeimage/distinfo                                                   |   26 +-
 graphics/freeimage/patches/patch-Makefile                                     |   48 ---
 graphics/freeimage/patches/patch-Makefile.fip                                 |   49 ---
 graphics/freeimage/patches/patch-Makefile.gnu                                 |   68 +++++
 graphics/freeimage/patches/patch-Source_FreeImage.h                           |   71 +++++
 graphics/freeimage/patches/patch-Source_FreeImageToolkit_JPEGTransform.cpp    |   21 +
 graphics/freeimage/patches/patch-Source_FreeImage_J2KHelper.cpp               |   15 +
 graphics/freeimage/patches/patch-Source_FreeImage_PSDParser.cpp               |   71 +++++
 graphics/freeimage/patches/patch-Source_FreeImage_Plugin.cpp                  |   29 ++
 graphics/freeimage/patches/patch-Source_FreeImage_PluginEXR.cpp               |   33 ++
 graphics/freeimage/patches/patch-Source_FreeImage_PluginJ2K.cpp               |   15 +
 graphics/freeimage/patches/patch-Source_FreeImage_PluginJP2.cpp               |   15 +
 graphics/freeimage/patches/patch-Source_FreeImage_PluginJPEG.cpp              |   19 +
 graphics/freeimage/patches/patch-Source_FreeImage_PluginPNG.cpp               |   17 +
 graphics/freeimage/patches/patch-Source_FreeImage_PluginRAW.cpp               |   15 +
 graphics/freeimage/patches/patch-Source_FreeImage_PluginTIFF.cpp              |   35 ++
 graphics/freeimage/patches/patch-Source_FreeImage_PluginWebP.cpp              |   19 +
 graphics/freeimage/patches/patch-Source_FreeImage_ZLibInterface.cpp           |   27 ++
 graphics/freeimage/patches/patch-Source_LibOpenJPEG_opj__malloc.h             |   15 -
 graphics/freeimage/patches/patch-Source_LibRawLite_internal_dcraw__common.cpp |   24 -
 graphics/freeimage/patches/patch-Source_Metadata_TagConversion.cpp            |   18 +
 graphics/freeimage/patches/patch-Source_Metadata_XTIFF.cpp                    |  123 ++++++++++
 graphics/freeimage/patches/patch-Source_Utilities.h                           |   21 +
 graphics/freeimage/patches/patch-genfipsrclist.sh                             |   21 +
 graphics/freeimage/patches/patch-gensrclist.sh                                |   14 +
 27 files changed, 719 insertions(+), 169 deletions(-)

diffs (truncated from 1028 to 300 lines):

diff -r 207a15bc0f30 -r 1121e6e5233e graphics/freeimage/Makefile
--- a/graphics/freeimage/Makefile       Thu May 14 16:08:06 2020 +0000
+++ b/graphics/freeimage/Makefile       Thu May 14 16:42:13 2020 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.10 2020/01/18 23:32:11 rillig Exp $
+# $NetBSD: Makefile,v 1.11 2020/05/14 16:42:13 nia Exp $
 
 DISTNAME=      FreeImage3180
 PKGNAME=       freeimage-3.18.0
-CATEGORIES=    devel graphics
+PKGREVISION=   1
+CATEGORIES=    graphics
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=freeimage/}
 EXTRACT_SUFX=  .zip
 
@@ -11,33 +12,42 @@
 COMMENT=       Library for supporting PNG, BMP, JPEG, and TIFF
 LICENSE=       gnu-gpl-v2 OR gnu-gpl-v3 OR mpl-1.0
 
-USE_LANGUAGES+=        c c++03
+USE_LANGUAGES+=        c c++11
 USE_TOOLS+=    gmake
 
 WRKSRC=                ${WRKDIR}/FreeImage
 
+MAKE_FILE=     Makefile.gnu
+
 INSTALLATION_DIRS+=    include lib share/doc/${PKGBASE}
 
-post-install:
-       ${INSTALL_DATA} ${WRKSRC}/Source/LibJXR/LICENCE \
-               ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/LICENSE.LibJXR
-       ${INSTALL_DATA} ${WRKSRC}/Source/LibOpenJPEG/LICENSE \
-               ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/LICENSE.OpenJPEG
-       ${HEAD} -n 31 ${WRKSRC}/Source/LibRawLite/internal/libraw_x3f.cpp \
-               > ${WRKDIR}/LICENSE.x3f
-       ${HEAD} -n 33 ${WRKSRC}/Source/LibRawLite/internal/dcb_demosaicing.c \
-               > ${WRKDIR}/LICENSE.dcb
-       ${HEAD} -n 25 ${WRKSRC}/Source/LibTIFF4/tif_open.c \
-               > ${WRKDIR}/LICENSE.LibTIFF4
-       ${INSTALL_DATA} ${WRKDIR}/LICENSE.* \
-               ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
-       ${INSTALL_DATA} ${WRKSRC}/Source/LibWebP/COPYING \
-               ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/LICENSE.LibWebP
-       ${INSTALL_DATA} ${WRKSRC}/Source/OpenEXR/Copyrights/openexr/LICENSE \
-               ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/LICENSE.OpenEXR
+pre-configure:
+       # G3 and JPEGTransform can't be built,
+       # due to using private headers in bundled libs
+       cd ${WRKSRC} && ${RM} -r Source/Lib* \
+           Source/ZLib \
+           Source/OpenEXR \
+           Source/FreeImage/PluginG3.cpp \
+           Source/FreeImage/PluginJXR.cpp \
+           Source/FreeImageToolkit/JPEGTransform.cpp
+       cd ${WRKSRC} && ${SH} gensrclist.sh
+       cd ${WRKSRC} && ${SH} genfipsrclist.sh
+       ${SED} \
+           -e 's| \./Source/FreeImage/PluginG3\.cpp||g' \
+           -e 's| \./Source/FreeImage/PluginJXR\.cpp||g' \
+           -e 's| \./Source/FreeImageToolkit/JPEGTransform\.cpp||g' \
+           ${WRKSRC}/Makefile.srcs > ${WRKSRC}/Makefile.srcs.new
+       ${MV} ${WRKSRC}/Makefile.srcs.new ${WRKSRC}/Makefile.srcs
 
 PLIST_SUBST+=  PKGVERSION_NOREV=${PKGVERSION_NOREV}
 
 NOT_FOR_PLATFORM=      Darwin-*-*
 
+.include "../../graphics/libraw/buildlink3.mk"
+.include "../../graphics/libwebp/buildlink3.mk"
+.include "../../graphics/openexr/buildlink3.mk"
+.include "../../graphics/openjpeg/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 207a15bc0f30 -r 1121e6e5233e graphics/freeimage/PLIST
--- a/graphics/freeimage/PLIST  Thu May 14 16:08:06 2020 +0000
+++ b/graphics/freeimage/PLIST  Thu May 14 16:42:13 2020 +0000
@@ -1,13 +1,6 @@
-@comment $NetBSD: PLIST,v 1.2 2017/08/11 15:26:20 nros Exp $
+@comment $NetBSD: PLIST,v 1.3 2020/05/14 16:42:13 nia Exp $
 include/FreeImage.h
 lib/libfreeimage-${PKGVERSION_NOREV}.so
 lib/libfreeimage.a
 lib/libfreeimage.so
 lib/libfreeimage.so.3
-share/doc/freeimage/LICENSE.LibJXR
-share/doc/freeimage/LICENSE.LibTIFF4
-share/doc/freeimage/LICENSE.LibWebP
-share/doc/freeimage/LICENSE.OpenEXR
-share/doc/freeimage/LICENSE.OpenJPEG
-share/doc/freeimage/LICENSE.dcb
-share/doc/freeimage/LICENSE.x3f
diff -r 207a15bc0f30 -r 1121e6e5233e graphics/freeimage/distinfo
--- a/graphics/freeimage/distinfo       Thu May 14 16:08:06 2020 +0000
+++ b/graphics/freeimage/distinfo       Thu May 14 16:42:13 2020 +0000
@@ -1,10 +1,26 @@
-$NetBSD: distinfo,v 1.8 2020/03/21 16:41:41 rillig Exp $
+$NetBSD: distinfo,v 1.9 2020/05/14 16:42:13 nia Exp $
 
 SHA1 (FreeImage3180.zip) = 38daa9d8f1bca2330a2eaa42ec66fbe6ede7dce9
 RMD160 (FreeImage3180.zip) = b791715fccf49355a3cb27b6250d8ed809c2454e
 SHA512 (FreeImage3180.zip) = 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818
 Size (FreeImage3180.zip) = 7415716 bytes
-SHA1 (patch-Makefile) = d453337cb2a34f4480d1bd3c2115cb93715170b8
-SHA1 (patch-Makefile.fip) = 466b82e70d06f9552a73d86a742aa1bd3450f881
-SHA1 (patch-Source_LibOpenJPEG_opj__malloc.h) = 7e8b65d17cf1f0ed295964d477b96acac56bd927
-SHA1 (patch-Source_LibRawLite_internal_dcraw__common.cpp) = 3f9a149c7294b3ed3f2c17f4c28fe5b7cc223838
+SHA1 (patch-Makefile.gnu) = 1aa31ec7566565e9e59d06bfa2cd729500a0d2cb
+SHA1 (patch-Source_FreeImage.h) = 9b648a8734a0c3391850e2dd7eaa501d29e99689
+SHA1 (patch-Source_FreeImageToolkit_JPEGTransform.cpp) = 4e7372c8947b4359de4d428bcfcfa2f55210f2e8
+SHA1 (patch-Source_FreeImage_J2KHelper.cpp) = a479a373f5a584978129c00d723251a784210603
+SHA1 (patch-Source_FreeImage_PSDParser.cpp) = ee4f3e1bb2b6644033a93ac58e12b9126d0dd060
+SHA1 (patch-Source_FreeImage_Plugin.cpp) = 58f5d7ca78a66ad7109b0e8dff219c26dfe50a86
+SHA1 (patch-Source_FreeImage_PluginEXR.cpp) = 6c4f6ea9a413d27dee940f24588bdf6f7ae38038
+SHA1 (patch-Source_FreeImage_PluginJ2K.cpp) = bbc44884aba8be3af2aa824da5cf788d91c27fb6
+SHA1 (patch-Source_FreeImage_PluginJP2.cpp) = 9a6d27e039b2050004a2d331389bdfa32dffe681
+SHA1 (patch-Source_FreeImage_PluginJPEG.cpp) = a3998454b11c2f73890828b24c0ea276bff7ee7f
+SHA1 (patch-Source_FreeImage_PluginPNG.cpp) = 0d9c71856a9355f56c3e9a571a414098d8af2e88
+SHA1 (patch-Source_FreeImage_PluginRAW.cpp) = 1d67ad2b634e2a5b1fa82be240a4d6edfad7c05d
+SHA1 (patch-Source_FreeImage_PluginTIFF.cpp) = 5fc6f4a9debf555ba41ff7bd4311ed76ec3f1b51
+SHA1 (patch-Source_FreeImage_PluginWebP.cpp) = d7b57cfcb1379c6a849edb219c8a59edae83ff5c
+SHA1 (patch-Source_FreeImage_ZLibInterface.cpp) = 73211e8ecefb7972f1fcb579dc4a17409c81c480
+SHA1 (patch-Source_Metadata_TagConversion.cpp) = 0785cc5dd395bca538e9a82cadbb7ef450eebe86
+SHA1 (patch-Source_Metadata_XTIFF.cpp) = bfcafc31b8407258c52f30fa0c62d062ce108c00
+SHA1 (patch-Source_Utilities.h) = bb9cdd7d72c46e72cd3a636beb27541783609191
+SHA1 (patch-genfipsrclist.sh) = 9b22593e0ca5ff869ea22ddb91f46785ae45d5cd
+SHA1 (patch-gensrclist.sh) = 2582848736654138b3ebdda9d8469046e992745b
diff -r 207a15bc0f30 -r 1121e6e5233e graphics/freeimage/patches/patch-Makefile
--- a/graphics/freeimage/patches/patch-Makefile Thu May 14 16:08:06 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-$NetBSD: patch-Makefile,v 1.3 2020/01/11 14:40:44 nia Exp $
-
-* use c++ for linking instead of linking with stdc++
-
---- Makefile.gnu.orig  2015-03-08 17:04:00.000000000 +0000
-+++ Makefile.gnu
-@@ -5,8 +5,8 @@ include Makefile.srcs
- 
- # General configuration variables:
- DESTDIR ?= /
--INCDIR ?= $(DESTDIR)/usr/include
--INSTALLDIR ?= $(DESTDIR)/usr/lib
-+INCDIR ?= $(DESTDIR)/$(PREFIX)/include
-+INSTALLDIR ?= $(DESTDIR)/$(PREFIX)/lib
- 
- # Converts cr/lf to just lf
- DOS2UNIX = dos2unix
-@@ -28,10 +28,8 @@ CXXFLAGS ?= -O3 -fPIC -fexceptions -fvis
- CXXFLAGS += -D__ANSI__
- CXXFLAGS += $(INCLUDE)
- 
--ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
--      CFLAGS += -fPIC
--      CXXFLAGS += -fPIC
--endif
-+CFLAGS += -fPIC
-+CXXFLAGS += -fPIC
- 
- TARGET  = freeimage
- STATICLIB = lib$(TARGET).a
-@@ -67,13 +65,12 @@ $(STATICLIB): $(MODULES)
-       $(AR) r $@ $(MODULES)
- 
- $(SHAREDLIB): $(MODULES)
--      $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-+      $(CXX) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES)
- 
- 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)
-+      $(BSD_INSTALL_DATA) $(HEADER) $(INCDIR)
-+      $(BSD_INSTALL_DATA) $(STATICLIB) $(INSTALLDIR)
-+      $(BSD_INSTALL_LIB) $(SHAREDLIB) $(INSTALLDIR)
-       ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
-       ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)   
- #     ldconfig
diff -r 207a15bc0f30 -r 1121e6e5233e graphics/freeimage/patches/patch-Makefile.fip
--- a/graphics/freeimage/patches/patch-Makefile.fip     Thu May 14 16:08:06 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-$NetBSD: patch-Makefile.fip,v 1.3 2020/01/11 14:40:44 nia Exp $
-
-* use c++ for linking instead of linking with stdc++
-
---- Makefile.fip.orig  2015-03-08 17:03:56.000000000 +0000
-+++ Makefile.fip
-@@ -5,8 +5,8 @@ include fipMakefile.srcs
- 
- # General configuration variables:
- DESTDIR ?= /
--INCDIR ?= $(DESTDIR)/usr/include
--INSTALLDIR ?= $(DESTDIR)/usr/lib
-+INCDIR ?= $(DESTDIR)/$(PREFIX)/include
-+INSTALLDIR ?= $(DESTDIR)/$(PREFIX)/lib
- 
- # Converts cr/lf to just lf
- DOS2UNIX = dos2unix
-@@ -28,10 +28,8 @@ CXXFLAGS ?= -O3 -fPIC -fexceptions -fvis
- CXXFLAGS += -D__ANSI__
- CXXFLAGS += $(INCLUDE)
- 
--ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
--      CFLAGS += -fPIC
--      CXXFLAGS += -fPIC
--endif
-+CFLAGS += -fPIC
-+CXXFLAGS += -fPIC
- 
- TARGET  = freeimageplus
- STATICLIB = lib$(TARGET).a
-@@ -68,14 +66,12 @@ $(STATICLIB): $(MODULES)
-       $(AR) r $@ $(MODULES)
- 
- $(SHAREDLIB): $(MODULES)
--      $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-+      $(CXX) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES)
- 
- 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)
-+      $(BSD_INSTALL_DATA) $(HEADERFIP) $(INCDIR)
-+      $(BSD_INSTALL_DATA) $(STATICLIB) $(INSTALLDIR)
-+      $(BSD_INSTALL_LIB) $(SHAREDLIB) $(INSTALLDIR)
-       ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
-       ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)   
- 
diff -r 207a15bc0f30 -r 1121e6e5233e graphics/freeimage/patches/patch-Makefile.gnu
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/freeimage/patches/patch-Makefile.gnu     Thu May 14 16:42:13 2020 +0000
@@ -0,0 +1,68 @@
+$NetBSD: patch-Makefile.gnu,v 1.1 2020/05/14 16:42:14 nia Exp $
+
+- Use pkgsrc directories.
+- Link with CXX for libstdc++.
+- Unbundle image libraries.
+
+--- Makefile.gnu.orig  2015-03-10 09:04:00.000000000 +0000
++++ Makefile.gnu
+@@ -5,14 +5,17 @@ include Makefile.srcs
+ 
+ # General configuration variables:
+ DESTDIR ?= /
+-INCDIR ?= $(DESTDIR)/usr/include
+-INSTALLDIR ?= $(DESTDIR)/usr/lib
++INCDIR ?= $(DESTDIR)/$(PREFIX)/include
++INSTALLDIR ?= $(DESTDIR)/$(PREFIX)/lib
+ 
+ # Converts cr/lf to just lf
+ DOS2UNIX = dos2unix
+ 
+ LIBRARIES = -lstdc++
+ 
++INCLUDE += $(shell pkg-config --cflags libjpeg OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
++LDFLAGS += $(shell pkg-config --libs libjpeg OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
++
+ MODULES = $(SRCS:.c=.o)
+ MODULES := $(MODULES:.cpp=.o)
+ CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
+@@ -28,10 +31,8 @@ CXXFLAGS ?= -O3 -fPIC -fexceptions -fvis
+ CXXFLAGS += -D__ANSI__
+ CXXFLAGS += $(INCLUDE)
+ 
+-ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
+-      CFLAGS += -fPIC
+-      CXXFLAGS += -fPIC
+-endif
++CFLAGS += -fPIC
++CXXFLAGS += -fPIC
+ 
+ TARGET  = freeimage
+ STATICLIB = lib$(TARGET).a
+@@ -40,8 +41,6 @@ LIBNAME      = lib$(TARGET).so
+ VERLIBNAME = $(LIBNAME).$(VER_MAJOR)
+ HEADER = Source/FreeImage.h
+ 
+-
+-
+ default: all
+ 
+ all: dist
+@@ -67,13 +66,12 @@ $(STATICLIB): $(MODULES)
+       $(AR) r $@ $(MODULES)
+ 
+ $(SHAREDLIB): $(MODULES)
+-      $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
++      $(CXX) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES)
+ 
+ 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)



Home | Main Index | Thread Index | Old Index