summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2015-12-15 21:15:39 +0100
committerPacho Ramos <pacho@gentoo.org>2015-12-15 21:16:34 +0100
commitcc701dd19ce61eaa29889b185ca4c55298b75126 (patch)
tree0ee27e9efabf8728a00771a736789635d57ca35e /media-gfx/rawtherapee
parentRevert "media-gfx/rawtherapee: Fix building with latest glibmm/libsigc++ (#56... (diff)
downloadgentoo-cc701dd19ce61eaa29889b185ca4c55298b75126.tar.gz
gentoo-cc701dd19ce61eaa29889b185ca4c55298b75126.tar.bz2
gentoo-cc701dd19ce61eaa29889b185ca4c55298b75126.zip
media-gfx/rawtherapee: Fix building with latest glibmm/libsigc++ (#568136), fix CVE-2015-3885
Package-Manager: portage-2.2.26
Diffstat (limited to 'media-gfx/rawtherapee')
-rw-r--r--media-gfx/rawtherapee/files/rawtherapee-4.2-CVE-2015-3885.patch28
-rw-r--r--media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11-2.patch14
-rw-r--r--media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch20
-rw-r--r--media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch27
-rw-r--r--media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch47
-rw-r--r--media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild62
6 files changed, 198 insertions, 0 deletions
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-CVE-2015-3885.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-CVE-2015-3885.patch
new file mode 100644
index 000000000000..3de7d7e6b123
--- /dev/null
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-CVE-2015-3885.patch
@@ -0,0 +1,28 @@
+Author: Philip Rinn <rinni@inventati.org>
+Description: Fix CVE-2015-3885
+Source: https://github.com/rawstudio/rawstudio/commit/983bda1f0fa5fa86884381208274198a620f006e
+Last-update: 2015-05-14
+--- a/rtengine/dcraw.c
++++ b/rtengine/dcraw.c
+@@ -824,7 +824,8 @@
+
+ int CLASS ljpeg_start (struct jhead *jh, int info_only)
+ {
+- int c, tag, len;
++ int c, tag;
++ ushort len;
+ uchar data[0x10000];
+ const uchar *dp;
+
+--- a/rtengine/dcraw.cc
++++ b/rtengine/dcraw.cc
+@@ -787,7 +787,8 @@
+
+ int CLASS ljpeg_start (struct jhead *jh, int info_only)
+ {
+- int c, tag, len;
++ int c, tag;
++ ushort len;
+ uchar data[0x10000];
+ const uchar *dp;
+
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11-2.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11-2.patch
new file mode 100644
index 000000000000..0d79e25d649c
--- /dev/null
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11-2.patch
@@ -0,0 +1,14 @@
+Author: Philip Rinn <rinni@inventati.org>
+Description: Fix build with C++11 as char is unsigned on some architectures
+Last-update: 2015-11-04
+--- a/rtengine/dcraw.cc
++++ b/rtengine/dcraw.cc
+@@ -2054,7 +2054,7 @@
+
+ void CLASS kodak_radc_load_raw()
+ {
+- static const char src[] = {
++ static const signed char src[] = {
+ 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8,
+ 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8,
+ 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8,
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch
new file mode 100644
index 000000000000..4832dc3f67a2
--- /dev/null
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch
@@ -0,0 +1,20 @@
+Author: Philip Rinn <rinni@inventati.org>
+Description: Fix build with C++11
+Last-update: 2015-11-03
+--- a/rtengine/dcraw.cc
++++ b/rtengine/dcraw.cc
+@@ -136,10 +136,10 @@
+
+ #define SQR(x) rtengine::SQR(x)
+ #define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31))
+-#define MIN(a,b) rtengine::min(a,static_cast<typeof(a)>(b))
+-#define MAX(a,b) rtengine::max(a,static_cast<typeof(a)>(b))
+-#define LIM(x,min,max) rtengine::LIM(x,static_cast<typeof(x)>(min),static_cast<typeof(x)>(max))
+-#define ULIM(x,y,z) rtengine::ULIM(x,static_cast<typeof(x)>(y),static_cast<typeof(x)>(z))
++#define MIN(a,b) rtengine::min(a,static_cast<__typeof__(a)>(b))
++#define MAX(a,b) rtengine::max(a,static_cast<__typeof__(a)>(b))
++#define LIM(x,min,max) rtengine::LIM(x,static_cast<__typeof__(x)>(min),static_cast<__typeof__(x)>(max))
++#define ULIM(x,y,z) rtengine::ULIM(x,static_cast<__typeof__(x)>(y),static_cast<typeof__(x)>(z))
+ #define CLIP(x) rtengine::CLIP(x)
+ #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; }
+
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch
new file mode 100644
index 000000000000..48acb5fc6ffd
--- /dev/null
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch
@@ -0,0 +1,27 @@
+From 39ef59ddeb7679c71274b1da3faadd395b650c73 Mon Sep 17 00:00:00 2001
+From: Adam Reichold <adam.reichold@t-online.de>
+Date: Sun, 29 Nov 2015 11:48:30 +0100
+Subject: [PATCH] Build with '-std=c++11' if libsigc++ version 2.5.1 is used as
+ it does require it.
+
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dd5fcbc..6153484 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -278,10 +278,10 @@ if (OPTION_OMP)
+ endif (OPENMP_FOUND)
+ endif (OPTION_OMP)
+
+-if(USE_EXPERIMENTAL_LANG_VERSIONS)
++if(USE_EXPERIMENTAL_LANG_VERSIONS OR NOT (SIGC_VERSION VERSION_LESS 2.5.1))
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
+-endif (USE_EXPERIMENTAL_LANG_VERSIONS)
++endif ()
+
+ # find out whether we are building out of source
+ get_filename_component(ABS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch
new file mode 100644
index 000000000000..356cee90e393
--- /dev/null
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch
@@ -0,0 +1,47 @@
+Author: Philip Rinn <rinni@inventati.org>
+Description: Fix build with sigc++ >= 2.5.2
+Last-update: 2015-11-03
+--- a/rtgui/adjuster.cc
++++ b/rtgui/adjuster.cc
+@@ -17,7 +17,7 @@
+ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
+ */
+ #include "adjuster.h"
+-#include <sigc++/class_slot.h>
++#include <sigc++/slot.h>
+ #include <cmath>
+ #include "multilangmgr.h"
+ #include "../rtengine/rtengine.h"
+--- a/rtgui/thresholdadjuster.cc
++++ b/rtgui/thresholdadjuster.cc
+@@ -17,7 +17,7 @@
+ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
+ */
+ #include "thresholdadjuster.h"
+-#include <sigc++/class_slot.h>
++#include <sigc++/slot.h>
+ #include <cmath>
+ #include "multilangmgr.h"
+ #include "../rtengine/rtengine.h"
+--- a/rtgui/preferences.cc
++++ b/rtgui/preferences.cc
+@@ -16,7 +16,7 @@
+ * You should have received a copy of the GNU General Public License
+ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
+ */
+-#include <sigc++/class_slot.h>
++#include <sigc++/slot.h>
+ #include "preferences.h"
+ #include "multilangmgr.h"
+ #include "splash.h"
+--- a/rtgui/tonecurve.cc
++++ b/rtgui/tonecurve.cc
+@@ -18,7 +18,7 @@
+ */
+ #include "tonecurve.h"
+ #include "adjuster.h"
+-#include <sigc++/class_slot.h>
++#include <sigc++/slot.h>
+ #include <iomanip>
+ #include "ppversion.h"
+ #include "edit.h"
diff --git a/media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild b/media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild
new file mode 100644
index 000000000000..2723b91e2a28
--- /dev/null
+++ b/media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils toolchain-funcs
+
+DESCRIPTION="A powerful cross-platform raw image processing program"
+HOMEPAGE="http://www.rawtherapee.com/"
+SRC_URI="http://rawtherapee.com/shared/source/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bzip2 openmp"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ >=x11-libs/gtk+-2.24.18:2
+ >=dev-cpp/gtkmm-2.12:2.4
+ >=dev-cpp/glibmm-2.16:2
+ dev-libs/expat
+ dev-libs/libsigc++:2
+ media-libs/libcanberra[gtk]
+ media-libs/tiff
+ media-libs/libpng
+ media-libs/libiptcdata
+ media-libs/lcms:2
+ sci-libs/fftw:3.0
+ sys-libs/zlib
+ virtual/jpeg"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+
+PATCHES=(
+ # Upstream patches for fixing build with current libstdc++
+ # A newer snapshot/version will make this unneeded
+ "${FILESDIR}"/${P}-cxx11.patch
+ "${FILESDIR}"/${P}-CVE-2015-3885.patch
+ "${FILESDIR}"/${P}-build-cxx11.patch
+ "${FILESDIR}"/${P}-build-cxx11-2.patch
+ "${FILESDIR}"/${P}-sigc26.patch
+)
+
+pkg_pretend() {
+ if use openmp ; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use openmp OPTION_OMP)
+ $(cmake-utils_use_with bzip2 BZIP)
+ -DDOCDIR=/usr/share/doc/${PF}
+ -DCREDITSDIR=/usr/share/${PN}
+ -DLICENCEDIR=/usr/share/${PN}
+ -DCACHE_NAME_SUFFIX=""
+ )
+ cmake-utils_src_configure
+}