1 |
commit: cc701dd19ce61eaa29889b185ca4c55298b75126 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 15 20:15:39 2015 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 15 20:16:34 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc701dd1 |
7 |
|
8 |
media-gfx/rawtherapee: Fix building with latest glibmm/libsigc++ (#568136), fix CVE-2015-3885 |
9 |
|
10 |
Package-Manager: portage-2.2.26 |
11 |
|
12 |
.../files/rawtherapee-4.2-CVE-2015-3885.patch | 28 ++++++++++ |
13 |
.../files/rawtherapee-4.2-build-cxx11-2.patch | 14 +++++ |
14 |
.../files/rawtherapee-4.2-build-cxx11.patch | 20 +++++++ |
15 |
.../rawtherapee/files/rawtherapee-4.2-cxx11.patch | 27 ++++++++++ |
16 |
.../rawtherapee/files/rawtherapee-4.2-sigc26.patch | 47 ++++++++++++++++ |
17 |
media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild | 62 ++++++++++++++++++++++ |
18 |
6 files changed, 198 insertions(+) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 0000000..3de7d7e |
23 |
--- /dev/null |
24 |
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-CVE-2015-3885.patch |
25 |
@@ -0,0 +1,28 @@ |
26 |
+Author: Philip Rinn <rinni@×××××××××.org> |
27 |
+Description: Fix CVE-2015-3885 |
28 |
+Source: https://github.com/rawstudio/rawstudio/commit/983bda1f0fa5fa86884381208274198a620f006e |
29 |
+Last-update: 2015-05-14 |
30 |
+--- a/rtengine/dcraw.c |
31 |
++++ b/rtengine/dcraw.c |
32 |
+@@ -824,7 +824,8 @@ |
33 |
+ |
34 |
+ int CLASS ljpeg_start (struct jhead *jh, int info_only) |
35 |
+ { |
36 |
+- int c, tag, len; |
37 |
++ int c, tag; |
38 |
++ ushort len; |
39 |
+ uchar data[0x10000]; |
40 |
+ const uchar *dp; |
41 |
+ |
42 |
+--- a/rtengine/dcraw.cc |
43 |
++++ b/rtengine/dcraw.cc |
44 |
+@@ -787,7 +787,8 @@ |
45 |
+ |
46 |
+ int CLASS ljpeg_start (struct jhead *jh, int info_only) |
47 |
+ { |
48 |
+- int c, tag, len; |
49 |
++ int c, tag; |
50 |
++ ushort len; |
51 |
+ uchar data[0x10000]; |
52 |
+ const uchar *dp; |
53 |
+ |
54 |
|
55 |
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 |
56 |
new file mode 100644 |
57 |
index 0000000..0d79e25 |
58 |
--- /dev/null |
59 |
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11-2.patch |
60 |
@@ -0,0 +1,14 @@ |
61 |
+Author: Philip Rinn <rinni@×××××××××.org> |
62 |
+Description: Fix build with C++11 as char is unsigned on some architectures |
63 |
+Last-update: 2015-11-04 |
64 |
+--- a/rtengine/dcraw.cc |
65 |
++++ b/rtengine/dcraw.cc |
66 |
+@@ -2054,7 +2054,7 @@ |
67 |
+ |
68 |
+ void CLASS kodak_radc_load_raw() |
69 |
+ { |
70 |
+- static const char src[] = { |
71 |
++ static const signed char src[] = { |
72 |
+ 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, |
73 |
+ 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, |
74 |
+ 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, |
75 |
|
76 |
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch |
77 |
new file mode 100644 |
78 |
index 0000000..4832dc3 |
79 |
--- /dev/null |
80 |
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-build-cxx11.patch |
81 |
@@ -0,0 +1,20 @@ |
82 |
+Author: Philip Rinn <rinni@×××××××××.org> |
83 |
+Description: Fix build with C++11 |
84 |
+Last-update: 2015-11-03 |
85 |
+--- a/rtengine/dcraw.cc |
86 |
++++ b/rtengine/dcraw.cc |
87 |
+@@ -136,10 +136,10 @@ |
88 |
+ |
89 |
+ #define SQR(x) rtengine::SQR(x) |
90 |
+ #define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31)) |
91 |
+-#define MIN(a,b) rtengine::min(a,static_cast<typeof(a)>(b)) |
92 |
+-#define MAX(a,b) rtengine::max(a,static_cast<typeof(a)>(b)) |
93 |
+-#define LIM(x,min,max) rtengine::LIM(x,static_cast<typeof(x)>(min),static_cast<typeof(x)>(max)) |
94 |
+-#define ULIM(x,y,z) rtengine::ULIM(x,static_cast<typeof(x)>(y),static_cast<typeof(x)>(z)) |
95 |
++#define MIN(a,b) rtengine::min(a,static_cast<__typeof__(a)>(b)) |
96 |
++#define MAX(a,b) rtengine::max(a,static_cast<__typeof__(a)>(b)) |
97 |
++#define LIM(x,min,max) rtengine::LIM(x,static_cast<__typeof__(x)>(min),static_cast<__typeof__(x)>(max)) |
98 |
++#define ULIM(x,y,z) rtengine::ULIM(x,static_cast<__typeof__(x)>(y),static_cast<typeof__(x)>(z)) |
99 |
+ #define CLIP(x) rtengine::CLIP(x) |
100 |
+ #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; } |
101 |
+ |
102 |
|
103 |
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch |
104 |
new file mode 100644 |
105 |
index 0000000..48acb5f |
106 |
--- /dev/null |
107 |
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-cxx11.patch |
108 |
@@ -0,0 +1,27 @@ |
109 |
+From 39ef59ddeb7679c71274b1da3faadd395b650c73 Mon Sep 17 00:00:00 2001 |
110 |
+From: Adam Reichold <adam.reichold@××××××××.de> |
111 |
+Date: Sun, 29 Nov 2015 11:48:30 +0100 |
112 |
+Subject: [PATCH] Build with '-std=c++11' if libsigc++ version 2.5.1 is used as |
113 |
+ it does require it. |
114 |
+ |
115 |
+--- |
116 |
+ CMakeLists.txt | 4 ++-- |
117 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
118 |
+ |
119 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
120 |
+index dd5fcbc..6153484 100644 |
121 |
+--- a/CMakeLists.txt |
122 |
++++ b/CMakeLists.txt |
123 |
+@@ -278,10 +278,10 @@ if (OPTION_OMP) |
124 |
+ endif (OPENMP_FOUND) |
125 |
+ endif (OPTION_OMP) |
126 |
+ |
127 |
+-if(USE_EXPERIMENTAL_LANG_VERSIONS) |
128 |
++if(USE_EXPERIMENTAL_LANG_VERSIONS OR NOT (SIGC_VERSION VERSION_LESS 2.5.1)) |
129 |
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x") |
130 |
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") |
131 |
+-endif (USE_EXPERIMENTAL_LANG_VERSIONS) |
132 |
++endif () |
133 |
+ |
134 |
+ # find out whether we are building out of source |
135 |
+ get_filename_component(ABS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) |
136 |
|
137 |
diff --git a/media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch b/media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch |
138 |
new file mode 100644 |
139 |
index 0000000..356cee9 |
140 |
--- /dev/null |
141 |
+++ b/media-gfx/rawtherapee/files/rawtherapee-4.2-sigc26.patch |
142 |
@@ -0,0 +1,47 @@ |
143 |
+Author: Philip Rinn <rinni@×××××××××.org> |
144 |
+Description: Fix build with sigc++ >= 2.5.2 |
145 |
+Last-update: 2015-11-03 |
146 |
+--- a/rtgui/adjuster.cc |
147 |
++++ b/rtgui/adjuster.cc |
148 |
+@@ -17,7 +17,7 @@ |
149 |
+ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. |
150 |
+ */ |
151 |
+ #include "adjuster.h" |
152 |
+-#include <sigc++/class_slot.h> |
153 |
++#include <sigc++/slot.h> |
154 |
+ #include <cmath> |
155 |
+ #include "multilangmgr.h" |
156 |
+ #include "../rtengine/rtengine.h" |
157 |
+--- a/rtgui/thresholdadjuster.cc |
158 |
++++ b/rtgui/thresholdadjuster.cc |
159 |
+@@ -17,7 +17,7 @@ |
160 |
+ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. |
161 |
+ */ |
162 |
+ #include "thresholdadjuster.h" |
163 |
+-#include <sigc++/class_slot.h> |
164 |
++#include <sigc++/slot.h> |
165 |
+ #include <cmath> |
166 |
+ #include "multilangmgr.h" |
167 |
+ #include "../rtengine/rtengine.h" |
168 |
+--- a/rtgui/preferences.cc |
169 |
++++ b/rtgui/preferences.cc |
170 |
+@@ -16,7 +16,7 @@ |
171 |
+ * You should have received a copy of the GNU General Public License |
172 |
+ * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. |
173 |
+ */ |
174 |
+-#include <sigc++/class_slot.h> |
175 |
++#include <sigc++/slot.h> |
176 |
+ #include "preferences.h" |
177 |
+ #include "multilangmgr.h" |
178 |
+ #include "splash.h" |
179 |
+--- a/rtgui/tonecurve.cc |
180 |
++++ b/rtgui/tonecurve.cc |
181 |
+@@ -18,7 +18,7 @@ |
182 |
+ */ |
183 |
+ #include "tonecurve.h" |
184 |
+ #include "adjuster.h" |
185 |
+-#include <sigc++/class_slot.h> |
186 |
++#include <sigc++/slot.h> |
187 |
+ #include <iomanip> |
188 |
+ #include "ppversion.h" |
189 |
+ #include "edit.h" |
190 |
|
191 |
diff --git a/media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild b/media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild |
192 |
new file mode 100644 |
193 |
index 0000000..2723b91 |
194 |
--- /dev/null |
195 |
+++ b/media-gfx/rawtherapee/rawtherapee-4.2-r1.ebuild |
196 |
@@ -0,0 +1,62 @@ |
197 |
+# Copyright 1999-2014 Gentoo Foundation |
198 |
+# Distributed under the terms of the GNU General Public License v2 |
199 |
+# $Id$ |
200 |
+ |
201 |
+EAPI=5 |
202 |
+ |
203 |
+inherit cmake-utils toolchain-funcs |
204 |
+ |
205 |
+DESCRIPTION="A powerful cross-platform raw image processing program" |
206 |
+HOMEPAGE="http://www.rawtherapee.com/" |
207 |
+SRC_URI="http://rawtherapee.com/shared/source/${P}.tar.xz" |
208 |
+ |
209 |
+LICENSE="GPL-3" |
210 |
+SLOT="0" |
211 |
+KEYWORDS="~amd64 ~x86" |
212 |
+IUSE="bzip2 openmp" |
213 |
+ |
214 |
+RDEPEND="bzip2? ( app-arch/bzip2 ) |
215 |
+ >=x11-libs/gtk+-2.24.18:2 |
216 |
+ >=dev-cpp/gtkmm-2.12:2.4 |
217 |
+ >=dev-cpp/glibmm-2.16:2 |
218 |
+ dev-libs/expat |
219 |
+ dev-libs/libsigc++:2 |
220 |
+ media-libs/libcanberra[gtk] |
221 |
+ media-libs/tiff |
222 |
+ media-libs/libpng |
223 |
+ media-libs/libiptcdata |
224 |
+ media-libs/lcms:2 |
225 |
+ sci-libs/fftw:3.0 |
226 |
+ sys-libs/zlib |
227 |
+ virtual/jpeg" |
228 |
+DEPEND="${RDEPEND} |
229 |
+ app-arch/xz-utils |
230 |
+ virtual/pkgconfig" |
231 |
+ |
232 |
+PATCHES=( |
233 |
+ # Upstream patches for fixing build with current libstdc++ |
234 |
+ # A newer snapshot/version will make this unneeded |
235 |
+ "${FILESDIR}"/${P}-cxx11.patch |
236 |
+ "${FILESDIR}"/${P}-CVE-2015-3885.patch |
237 |
+ "${FILESDIR}"/${P}-build-cxx11.patch |
238 |
+ "${FILESDIR}"/${P}-build-cxx11-2.patch |
239 |
+ "${FILESDIR}"/${P}-sigc26.patch |
240 |
+) |
241 |
+ |
242 |
+pkg_pretend() { |
243 |
+ if use openmp ; then |
244 |
+ tc-has-openmp || die "Please switch to an openmp compatible compiler" |
245 |
+ fi |
246 |
+} |
247 |
+ |
248 |
+src_configure() { |
249 |
+ local mycmakeargs=( |
250 |
+ $(cmake-utils_use openmp OPTION_OMP) |
251 |
+ $(cmake-utils_use_with bzip2 BZIP) |
252 |
+ -DDOCDIR=/usr/share/doc/${PF} |
253 |
+ -DCREDITSDIR=/usr/share/${PN} |
254 |
+ -DLICENCEDIR=/usr/share/${PN} |
255 |
+ -DCACHE_NAME_SUFFIX="" |
256 |
+ ) |
257 |
+ cmake-utils_src_configure |
258 |
+} |