From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 728BB15808C for ; Tue, 15 Feb 2022 19:51:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 636F3E086D; Tue, 15 Feb 2022 19:51:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 21084E0869 for ; Tue, 15 Feb 2022 19:51:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B808E343152 for ; Tue, 15 Feb 2022 19:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 35B952F5 for ; Tue, 15 Feb 2022 19:51:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1644954623.c1949e9bbaf18f55016c6d8b2853f29675bd8d25.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/freeimage/files/, media-libs/freeimage/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/freeimage/files/freeimage-3.18.0-openexr-3-imath.patch media-libs/freeimage/freeimage-3.18.0-r4.ebuild X-VCS-Directories: media-libs/freeimage/files/ media-libs/freeimage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: c1949e9bbaf18f55016c6d8b2853f29675bd8d25 X-VCS-Branch: master Date: Tue, 15 Feb 2022 19:51:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c9e1e058-c6a9-4381-92c2-08552f898c6a X-Archives-Hash: b6f92fe9b124b92c9f76d640318a7a70 commit: c1949e9bbaf18f55016c6d8b2853f29675bd8d25 Author: Sam James gentoo org> AuthorDate: Sat Feb 12 22:16:26 2022 +0000 Commit: Sam James gentoo org> CommitDate: Tue Feb 15 19:50:23 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1949e9b media-libs/freeimage: support OpenEXR 3 / imath Bug: https://bugs.gentoo.org/833158 Signed-off-by: Sam James gentoo.org> .../files/freeimage-3.18.0-openexr-3-imath.patch | 144 +++++++++++++++++++++ media-libs/freeimage/freeimage-3.18.0-r4.ebuild | 122 +++++++++++++++++ 2 files changed, 266 insertions(+) diff --git a/media-libs/freeimage/files/freeimage-3.18.0-openexr-3-imath.patch b/media-libs/freeimage/files/freeimage-3.18.0-openexr-3-imath.patch new file mode 100644 index 000000000000..693c71fef321 --- /dev/null +++ b/media-libs/freeimage/files/freeimage-3.18.0-openexr-3-imath.patch @@ -0,0 +1,144 @@ +diff --git a/Source/FreeImage/PluginEXR.cpp b/Source/FreeImage/PluginEXR.cpp +index faa8037..e88bd2d 100644 +--- a/Source/FreeImage/PluginEXR.cpp ++++ b/Source/FreeImage/PluginEXR.cpp +@@ -28,16 +28,32 @@ + #pragma warning (disable : 4800) // ImfVersion.h - 'const int' : forcing value to bool 'true' or 'false' (performance warning) + #endif + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++// The version can reliably be found in this header file from OpenEXR, ++// for both 2.x and 3.x: ++#include ++#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \ ++ (100*OPENEXR_VERSION_MINOR) + \ ++ OPENEXR_VERSION_PATCH) ++ ++// There's just no easy way to have an `#include` that works in both ++// cases, so we use the version to switch which set of include files we ++// use. ++#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */ ++# include ++#else ++ // OpenEXR 2.x, use the old locations ++# include ++#endif + + + // ========================================================== +@@ -66,11 +82,11 @@ public: + return ((unsigned)n != _io->read_proc(c, 1, n, _handle)); + } + +- virtual Imath::Int64 tellg() { ++ virtual uint64_t tellg() { + return _io->tell_proc(_handle); + } + +- virtual void seekg(Imath::Int64 pos) { ++ virtual void seekg(uint64_t pos) { + _io->seek_proc(_handle, (unsigned)pos, SEEK_SET); + } + +@@ -100,11 +116,11 @@ public: + } + } + +- virtual Imath::Int64 tellp() { ++ virtual uint64_t tellp() { + return _io->tell_proc(_handle); + } + +- virtual void seekp(Imath::Int64 pos) { ++ virtual void seekp(uint64_t pos) { + _io->seek_proc(_handle, (unsigned)pos, SEEK_SET); + } + }; +diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp +index b9da767..96da4d7 100644 +--- a/Source/FreeImage/PluginTIFF.cpp ++++ b/Source/FreeImage/PluginTIFF.cpp +@@ -39,7 +39,24 @@ + #include "Utilities.h" + #include "tiffiop.h" + #include "../Metadata/FreeImageTag.h" +-#include ++// The version can reliably be found in this header file from OpenEXR, ++// for both 2.x and 3.x: ++#include ++#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \ ++ (100*OPENEXR_VERSION_MINOR) + \ ++ OPENEXR_VERSION_PATCH) ++ ++// There's just no easy way to have an `#include` that works in both ++// cases, so we use the version to switch which set of include files we ++// use. ++#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */ ++# include ++# include ++#else ++ // OpenEXR 2.x, use the old locations ++# include ++# include ++#endif + + #include "FreeImageIO.h" + #include "PSDParser.h" +diff --git a/Makefile.fip b/Makefile.fip +index 60bedbc..193126d 100644 +--- a/Makefile.fip ++++ b/Makefile.fip +@@ -28,7 +28,7 @@ LIBRARIES-$(USE_JPEG) += -ljpeg + LIBRARIES-$(USE_JPEG2K) += $(shell $(PKG_CONFIG) --libs libopenjp2) + LIBRARIES-$(USE_MNG) += -lmng + LIBRARIES-$(USE_PNG) += $(shell $(PKG_CONFIG) --libs libpng) +-LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 IlmBase) ++LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 Imath) + LIBRARIES-$(USE_RAW) += $(shell $(PKG_CONFIG) --libs libraw) + LIBRARIES-$(USE_WEBP) += $(shell $(PKG_CONFIG) --libs libwebp libwebpmux) + +diff --git a/Makefile.gnu b/Makefile.gnu +index b11c554..3de5a1b 100644 +--- a/Makefile.gnu ++++ b/Makefile.gnu +@@ -28,7 +28,7 @@ LIBRARIES-$(USE_JPEG) += -ljpeg + LIBRARIES-$(USE_JPEG2K) += $(shell $(PKG_CONFIG) --libs libopenjp2) + LIBRARIES-$(USE_MNG) += -lmng + LIBRARIES-$(USE_PNG) += $(shell $(PKG_CONFIG) --libs libpng) +-LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 IlmBase) ++LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 Imath) + LIBRARIES-$(USE_RAW) += $(shell $(PKG_CONFIG) --libs libraw) + LIBRARIES-$(USE_WEBP) += $(shell $(PKG_CONFIG) --libs libwebp libwebpmux) + +diff --git a/Makefile.srcs b/Makefile.srcs +index 26e1a6d..d97eacf 100644 +--- a/Makefile.srcs ++++ b/Makefile.srcs +@@ -180,7 +180,7 @@ INCLUDE-$(USE_JPEG) += -DUSE_JPEG + INCLUDE-$(USE_JPEG2K) += -DUSE_JPEG2K $(shell $(PKG_CONFIG) --cflags-only-I libopenjp2) + INCLUDE-$(USE_MNG) += -DUSE_MNG + INCLUDE-$(USE_PNG) += -DUSE_PNG $(shell $(PKG_CONFIG) --cflags-only-I libpng) +-INCLUDE-$(USE_TIFF) += -DUSE_TIFF $(shell $(PKG_CONFIG) --cflags-only-I libtiff-4 IlmBase) ++INCLUDE-$(USE_TIFF) += -DUSE_TIFF $(shell $(PKG_CONFIG) --cflags-only-I libtiff-4 Imath) + INCLUDE-$(USE_RAW) += -DUSE_RAW $(shell $(PKG_CONFIG) --cflags-only-I libraw) + INCLUDE-$(USE_WEBP) += -DUSE_WEBP $(shell $(PKG_CONFIG) --cflags-only-I libwebp libwebpmux) + INCLUDE = $(INCLUDE-yes) diff --git a/media-libs/freeimage/freeimage-3.18.0-r4.ebuild b/media-libs/freeimage/freeimage-3.18.0-r4.ebuild new file mode 100644 index 000000000000..5d9ec9c1f57c --- /dev/null +++ b/media-libs/freeimage/freeimage-3.18.0-r4.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edos2unix toolchain-funcs + +MY_PN=FreeImage +MY_PV=${PV//.} +MY_P=${MY_PN}${MY_PV} + +DESCRIPTION="Image library supporting many formats" +HOMEPAGE="https://freeimage.sourceforge.io/" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip + mirror://sourceforge/${PN}/${MY_P}.pdf + https://dev.gentoo.org/~juippis/distfiles/tmp/freeimage-3.18.0-unbundling.patch" + +LICENSE="|| ( GPL-2 FIPL-1.0 )" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86 ~amd64-linux ~x86-linux" +IUSE="jpeg jpeg2k mng openexr png raw static-libs tiff webp" + +# The tiff/ilmbase isn't a typo. The TIFF plugin cheats and +# uses code from it to handle 16bit<->float conversions. +RDEPEND=" + sys-libs/zlib + jpeg? ( virtual/jpeg:0 ) + jpeg2k? ( media-libs/openjpeg:2= ) + mng? ( media-libs/libmng:= ) + openexr? ( media-libs/openexr:0= ) + png? ( media-libs/libpng:0= ) + raw? ( media-libs/libraw:= ) + tiff? ( + dev-libs/imath:= + media-libs/tiff:0 + ) + webp? ( media-libs/libwebp:= )" +DEPEND="${RDEPEND}" +BDEPEND=" + app-arch/unzip + virtual/pkgconfig" + +S=${WORKDIR}/${MY_PN} + +DOCS=( "${DISTDIR}"/${MY_P}.pdf README.linux Whatsnew.txt ) + +PATCHES=( + "${DISTDIR}"/${PN}-3.18.0-unbundling.patch + "${FILESDIR}"/${PN}-3.18.0-remove-jpeg-transform.patch + "${FILESDIR}"/${PN}-3.18.0-rename-jpeg_read_icc_profile.patch + "${FILESDIR}"/${PN}-3.18.0-disable-plugin-G3.patch + "${FILESDIR}"/${PN}-3.18.0-raw.patch + "${FILESDIR}"/${PN}-3.18.0-libjpeg9.patch + "${FILESDIR}"/${PN}-3.18.0-CVE-2019-12211-CVE-2019-12213.patch + "${FILESDIR}"/${PN}-3.18.0-openexr-3-imath.patch +) + +src_prepare() { + pushd Source >/dev/null || die + cp LibJPEG/{transupp.c,transupp.h,jinclude.h} . || die + cp LibTIFF4/{tiffiop,tif_dir}.h . || die + rm -rf LibPNG LibMNG LibOpenJPEG ZLib OpenEXR LibRawLite LibTIFF4 LibJPEG LibWebP LibJXR || die + popd >/dev/null || die + + edos2unix Makefile.{gnu,fip,srcs} fipMakefile.srcs */*.h */*/*.cpp + sed -i \ + -e "s:/./:/:g" \ + -e "s: ./: :g" \ + -e 's: Source: \\\n\tSource:g' \ + -e 's: Wrapper: \\\n\tWrapper:g' \ + -e 's: Examples: \\\n\tExamples:g' \ + -e 's: TestAPI: \\\n\tTestAPI:g' \ + -e 's: -ISource: \\\n\t-ISource:g' \ + -e 's: -IWrapper: \\\n\t-IWrapper:g' \ + -e 's:INCLS:\nINCLS:g' \ + Makefile.srcs fipMakefile.srcs || die + sed -i \ + -e "/LibJPEG/d" \ + -e "/LibJXR/d" \ + -e "/LibPNG/d" \ + -e "/LibTIFF/d" \ + -e "/Source\/ZLib/d" \ + -e "/LibOpenJPEG/d" \ + -e "/OpenEXR/d" \ + -e "/LibRawLite/d" \ + -e "/LibMNG/d" \ + -e "/LibWebP/d" \ + -e "/LibJXR/d" \ + Makefile.srcs fipMakefile.srcs || die + + default +} + +foreach_make() { + local m + for m in Makefile.{gnu,fip} ; do + emake -f ${m} \ + USE_EXR=$(usex openexr) \ + USE_JPEG=$(usex jpeg) \ + USE_JPEG2K=$(usex jpeg2k) \ + USE_MNG=$(usex mng) \ + USE_PNG=$(usex png) \ + USE_TIFF=$(usex tiff) \ + USE_RAW=$(usex raw) \ + USE_WEBP=$(usex webp) \ + $(usex static-libs '' STATICLIB=) \ + "$@" + done +} + +src_compile() { + tc-export AR PKG_CONFIG + foreach_make \ + CXX="$(tc-getCXX) -fPIC" \ + CC="$(tc-getCC) -fPIC" \ + ${MY_PN} +} + +src_install() { + foreach_make install DESTDIR="${ED}" INSTALLDIR="${ED}"/usr/$(get_libdir) + einstalldocs +}