1 |
gienah 15/07/07 13:25:35 |
2 |
|
3 |
Added: octave-4.0.0-imagemagick.patch |
4 |
octave-4.0.0-llvm-3.5.patch |
5 |
octave-4.0.0-imagemagick-configure.patch |
6 |
Log: |
7 |
Bump octave to 4.0.0, fixes Bug 550858 - sci-mathematics/octave-4.0 version bump, thanks to Bohdan Trach for reporting. octave 4.0.0 allows llvm 3.5, fixing Bug 531672 - sci-mathematics/octave-3.8.2 USE=jit depends on <sys-devel/llvm-3.5, thanks to Juergen Rose for reporting and eroen for an upstream bug reference. Fix Bug 539886 - sci-mathematics/octave-3.8.2 should depend on x11-libs/fltk[opengl,xft], thanks to Andreas Fink for reporting and the fix. |
8 |
|
9 |
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 618E971F) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-4.0.0-imagemagick.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: octave-4.0.0-imagemagick.patch |
18 |
=================================================================== |
19 |
--- octave-4.0.0-orig/libinterp/dldfcn/__magick_read__.cc 2015-05-24 00:21:53.000000000 +1000 |
20 |
+++ octave-4.0.0/libinterp/dldfcn/__magick_read__.cc 2015-07-06 18:17:52.263146804 +1000 |
21 |
@@ -38,8 +38,15 @@ |
22 |
#include "gripes.h" |
23 |
|
24 |
#ifdef HAVE_MAGICK |
25 |
- |
26 |
+#define MAGICKCORE_EXCLUDE_DEPRECATED 1 |
27 |
#include <Magick++.h> |
28 |
+#if !defined(QuantumRange) && defined(MaxRGB) |
29 |
+#define QuantumRange MaxRGB |
30 |
+#endif |
31 |
+#if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(QuantumDepth) |
32 |
+#define MAGICKCORE_QUANTUM_DEPTH QuantumDepth |
33 |
+#endif |
34 |
+ |
35 |
#include <clocale> |
36 |
|
37 |
// In theory, it should be enough to check the class: |
38 |
@@ -121,12 +128,18 @@ |
39 |
get_depth (Magick::Image& img) |
40 |
{ |
41 |
octave_idx_type depth = img.depth (); |
42 |
+#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686) |
43 |
+#define Magick MagickCore |
44 |
+#endif |
45 |
if (depth == 8 |
46 |
&& img.channelDepth (Magick::RedChannel) == 1 |
47 |
&& img.channelDepth (Magick::CyanChannel) == 1 |
48 |
&& img.channelDepth (Magick::OpacityChannel) == 1 |
49 |
&& img.channelDepth (Magick::GrayChannel) == 1) |
50 |
depth = 1; |
51 |
+#if defined(MagickLibVersion) && (MagickLibVersion <= 0x686) |
52 |
+#undef Magick |
53 |
+#endif |
54 |
|
55 |
return depth; |
56 |
} |
57 |
@@ -350,7 +363,10 @@ |
58 |
if (imvec[def_elem].depth () == 32) |
59 |
divisor = std::numeric_limits<uint32_t>::max (); |
60 |
else |
61 |
- divisor = MaxRGB / ((uint64_t (1) << imvec[def_elem].depth ()) - 1); |
62 |
+ { |
63 |
+ using namespace Magick; |
64 |
+ divisor = QuantumRange / ((uint64_t (1) << imvec[def_elem].depth ()) - 1); |
65 |
+ } |
66 |
|
67 |
// FIXME: this workaround should probably be fixed in GM by creating a |
68 |
// new ImageType BilevelMatteType |
69 |
@@ -484,7 +500,8 @@ |
70 |
for (octave_idx_type row = 0; row < nRows; row++) |
71 |
{ |
72 |
img_fvec[idx] = pix->red / divisor; |
73 |
- a_fvec[idx] = (MaxRGB - pix->opacity) / divisor; |
74 |
+ using namespace Magick; |
75 |
+ a_fvec[idx] = (QuantumRange - pix->opacity) / divisor; |
76 |
pix += row_shift; |
77 |
idx++; |
78 |
} |
79 |
@@ -563,7 +580,8 @@ |
80 |
rbuf[idx] = pix->red / divisor; |
81 |
gbuf[idx] = pix->green / divisor; |
82 |
bbuf[idx] = pix->blue / divisor; |
83 |
- a_fvec[a_idx++] = (MaxRGB - pix->opacity) / divisor; |
84 |
+ using namespace Magick; |
85 |
+ a_fvec[a_idx++] = (QuantumRange - pix->opacity) / divisor; |
86 |
pix += row_shift; |
87 |
idx++; |
88 |
} |
89 |
@@ -650,7 +668,8 @@ |
90 |
mbuf[idx] = pix->green / divisor; |
91 |
ybuf[idx] = pix->blue / divisor; |
92 |
kbuf[idx] = pix->opacity / divisor; |
93 |
- a_fvec[a_idx++] = (MaxRGB - *apix) / divisor; |
94 |
+ using namespace Magick; |
95 |
+ a_fvec[a_idx++] = (QuantumRange - *apix) / divisor; |
96 |
pix += row_shift; |
97 |
idx++; |
98 |
} |
99 |
@@ -709,10 +728,11 @@ |
100 |
// Restore locale from before GraphicsMagick initialisation |
101 |
setlocale (LC_ALL, locale.c_str ()); |
102 |
|
103 |
- if (QuantumDepth < 32) |
104 |
+ using namespace Magick; |
105 |
+ if (MAGICKCORE_QUANTUM_DEPTH < 32) |
106 |
warning_with_id ("Octave:GraphicsMagic-Quantum-Depth", |
107 |
"your version of %s limits images to %d bits per pixel", |
108 |
- MagickPackageName, QuantumDepth); |
109 |
+ MagickPackageName, MAGICKCORE_QUANTUM_DEPTH); |
110 |
|
111 |
initialized = true; |
112 |
} |
113 |
@@ -1087,8 +1107,9 @@ |
114 |
// From GM documentation: |
115 |
// Color arguments are must be scaled to fit the Quantum size according to |
116 |
// the range of MaxRGB |
117 |
+ using namespace Magick; |
118 |
const double divisor = static_cast<double>((uint64_t (1) << bitdepth) - 1) |
119 |
- / MaxRGB; |
120 |
+ / QuantumRange; |
121 |
|
122 |
const P *img_fvec = img.fortran_vec (); |
123 |
const P *a_fvec = alpha.fortran_vec (); |
124 |
@@ -1140,8 +1161,9 @@ |
125 |
for (octave_idx_type row = 0; row < nRows; row++) |
126 |
{ |
127 |
double grey = double (*img_fvec) / divisor; |
128 |
+ using namespace Magick; |
129 |
Magick::Color c (grey, grey, grey, |
130 |
- MaxRGB - (double (*a_fvec) / divisor)); |
131 |
+ QuantumRange - (double (*a_fvec) / divisor)); |
132 |
pix[GM_idx] = c; |
133 |
img_fvec++; |
134 |
a_fvec++; |
135 |
@@ -1209,10 +1231,11 @@ |
136 |
{ |
137 |
for (octave_idx_type row = 0; row < nRows; row++) |
138 |
{ |
139 |
+ using namespace Magick; |
140 |
Magick::Color c (double (*img_fvec) / divisor, |
141 |
double (img_fvec[G_offset]) / divisor, |
142 |
double (img_fvec[B_offset]) / divisor, |
143 |
- MaxRGB - (double (*a_fvec) / divisor)); |
144 |
+ QuantumRange - (double (*a_fvec) / divisor)); |
145 |
pix[GM_idx] = c; |
146 |
img_fvec++; |
147 |
a_fvec++; |
148 |
@@ -1290,7 +1313,8 @@ |
149 |
double (img_fvec[Y_offset]) / divisor, |
150 |
double (img_fvec[K_offset]) / divisor); |
151 |
pix[GM_idx] = c; |
152 |
- ind[GM_idx] = MaxRGB - (double (*a_fvec) / divisor); |
153 |
+ using namespace Magick; |
154 |
+ ind[GM_idx] = QuantumRange - (double (*a_fvec) / divisor); |
155 |
img_fvec++; |
156 |
a_fvec++; |
157 |
GM_idx += nCols; |
158 |
|
159 |
|
160 |
|
161 |
1.1 sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch |
162 |
|
163 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch?rev=1.1&view=markup |
164 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch?rev=1.1&content-type=text/plain |
165 |
|
166 |
Index: octave-4.0.0-llvm-3.5.patch |
167 |
=================================================================== |
168 |
diff -r 3797df921988 configure.ac |
169 |
--- a/configure.ac Wed Apr 29 17:09:24 2015 -0700 |
170 |
+++ b/configure.ac Sun May 03 22:48:56 2015 +0200 |
171 |
@@ -815,8 +815,13 @@ |
172 |
AC_MSG_NOTICE([using -isystem for LLVM headers])]) |
173 |
|
174 |
dnl Use -isystem so we don't get warnings from llvm headers |
175 |
- LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`" |
176 |
- LLVM_CXXFLAGS= |
177 |
+ AX_CHECK_COMPILE_FLAG([-std=c++11],[ |
178 |
+ LLVM_CPPFLAGS="-std=c++11 $LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`" |
179 |
+ LLVM_CXXFLAGS="-std=c++11" |
180 |
+ ],[ |
181 |
+ LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`" |
182 |
+ LLVM_CXXFLAGS= |
183 |
+ ]) |
184 |
LLVM_LDFLAGS="-L`$LLVM_CONFIG --libdir`" |
185 |
|
186 |
|
187 |
@@ -860,6 +865,8 @@ |
188 |
OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API |
189 |
OCTAVE_LLVM_RAW_FD_OSTREAM_API |
190 |
OCTAVE_LLVM_LEGACY_PASSMANAGER_API |
191 |
+ OCTAVE_LLVM_DATALAYOUTPASS_API |
192 |
+ |
193 |
AC_LANG_POP(C++) |
194 |
CPPFLAGS="$save_CPPFLAGS" |
195 |
CXXFLAGS="$save_CXXFLAGS" |
196 |
diff -r 3797df921988 libinterp/corefcn/jit-typeinfo.cc |
197 |
--- a/libinterp/corefcn/jit-typeinfo.cc Wed Apr 29 17:09:24 2015 -0700 |
198 |
+++ b/libinterp/corefcn/jit-typeinfo.cc Sun May 03 22:48:56 2015 +0200 |
199 |
@@ -1208,7 +1208,7 @@ |
200 |
for (int op = 0; op < octave_value::num_binary_ops; ++op) |
201 |
{ |
202 |
llvm::Twine fn_name ("octave_jit_binary_any_any_"); |
203 |
- fn_name = fn_name + llvm::Twine (op); |
204 |
+ fn_name.concat( llvm::Twine (op) ); |
205 |
|
206 |
fn = create_internal (fn_name, any, any, any); |
207 |
fn.mark_can_error (); |
208 |
diff -r 3797df921988 libinterp/corefcn/pt-jit.cc |
209 |
--- a/libinterp/corefcn/pt-jit.cc Wed Apr 29 17:09:24 2015 -0700 |
210 |
+++ b/libinterp/corefcn/pt-jit.cc Sun May 03 22:48:56 2015 +0200 |
211 |
@@ -59,6 +59,7 @@ |
212 |
|
213 |
#include <llvm/Bitcode/ReaderWriter.h> |
214 |
#include <llvm/ExecutionEngine/ExecutionEngine.h> |
215 |
+#include <llvm/ExecutionEngine/MCJIT.h> |
216 |
#include <llvm/ExecutionEngine/JIT.h> |
217 |
|
218 |
#ifdef LEGACY_PASSMANAGER |
219 |
@@ -83,6 +84,7 @@ |
220 |
#include <llvm/IRBuilder.h> |
221 |
#endif |
222 |
|
223 |
+#include <llvm/Support/FileSystem.h> |
224 |
#include <llvm/Support/raw_os_ostream.h> |
225 |
#include <llvm/Support/TargetSelect.h> |
226 |
|
227 |
@@ -2077,7 +2079,11 @@ |
228 |
module_pass_manager->add (llvm::createAlwaysInlinerPass ()); |
229 |
|
230 |
#ifdef HAVE_LLVM_DATALAYOUT |
231 |
+#ifdef HAVE_LLVM_DATALAYOUTPASS |
232 |
+ pass_manager->add (new llvm::DataLayoutPass (*engine->getDataLayout ())); |
233 |
+#else |
234 |
pass_manager->add (new llvm::DataLayout (*engine->getDataLayout ())); |
235 |
+#endif |
236 |
#else |
237 |
pass_manager->add (new llvm::TargetData (*engine->getTargetData ())); |
238 |
#endif |
239 |
@@ -2192,7 +2198,7 @@ |
240 |
std::string error; |
241 |
#ifdef RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS |
242 |
llvm::raw_fd_ostream fout ("test.bc", error, |
243 |
- llvm::sys::fs::F_Binary); |
244 |
+ llvm::sys::fs::F_Text); |
245 |
#else |
246 |
llvm::raw_fd_ostream fout ("test.bc", error, |
247 |
llvm::raw_fd_ostream::F_Binary); |
248 |
diff -r 3797df921988 m4/acinclude.m4 |
249 |
--- a/m4/acinclude.m4 Wed Apr 29 17:09:24 2015 -0700 |
250 |
+++ b/m4/acinclude.m4 Sun May 03 22:48:56 2015 +0200 |
251 |
@@ -1784,10 +1784,11 @@ |
252 |
[AC_LANG_PUSH(C++) |
253 |
AC_COMPILE_IFELSE( |
254 |
[AC_LANG_PROGRAM([[ |
255 |
+ #include <llvm/Support/FileSystem.h> |
256 |
#include <llvm/Support/raw_os_ostream.h> |
257 |
]], [[ |
258 |
std::string str; |
259 |
- llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Binary); |
260 |
+ llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Text); |
261 |
]])], |
262 |
octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=yes, |
263 |
octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=no) |
264 |
@@ -1828,6 +1829,33 @@ |
265 |
fi |
266 |
]) |
267 |
dnl |
268 |
+dnl Check for llvm::DataLayoutPass API |
269 |
+dnl |
270 |
+AC_DEFUN([OCTAVE_LLVM_DATALAYOUTPASS_API], [ |
271 |
+ AC_CACHE_CHECK([check for LLVM::DataLayoutPass], |
272 |
+ [octave_cv_datalayoutpass], |
273 |
+ [AC_LANG_PUSH(C++) |
274 |
+ save_LIBS="$LIBS" |
275 |
+ LIBS="$LLVM_LIBS $LIBS" |
276 |
+ AC_LINK_IFELSE( |
277 |
+ [AC_LANG_PROGRAM([[ |
278 |
+ #include <llvm/IR/DataLayout.h> |
279 |
+ ]], [[ |
280 |
+ llvm::Module *module; |
281 |
+ llvm::DataLayoutPass *datalayoutpass; |
282 |
+ datalayoutpass = new llvm::DataLayoutPass (module) |
283 |
+ ]])], |
284 |
+ octave_cv_datalayoutpass=yes, |
285 |
+ octave_cv_datalayoutpass=no) |
286 |
+ LIBS="$save_LIBS" |
287 |
+ AC_LANG_POP(C++) |
288 |
+ ]) |
289 |
+ if test $octave_cv_datalayoutpass = yes; then |
290 |
+ AC_DEFINE(HAVE_LLVM_DATALAYOUTPASS, 1, |
291 |
+ [Define to 1 if LLVM::DataLayoutPass exists.]) |
292 |
+ fi |
293 |
+]) |
294 |
+dnl |
295 |
dnl Check for ar. |
296 |
dnl |
297 |
AC_DEFUN([OCTAVE_PROG_AR], [ |
298 |
|
299 |
|
300 |
|
301 |
1.1 sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch |
302 |
|
303 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch?rev=1.1&view=markup |
304 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-4.0.0-imagemagick-configure.patch?rev=1.1&content-type=text/plain |
305 |
|
306 |
Index: octave-4.0.0-imagemagick-configure.patch |
307 |
=================================================================== |
308 |
--- octave-4.0.0-orig/configure.ac 2015-05-27 02:16:39.000000000 +1000 |
309 |
+++ octave-4.0.0/configure.ac 2015-07-06 18:11:43.461136517 +1000 |
310 |
@@ -1086,11 +1086,11 @@ |
311 |
MAGICK_LIBS= |
312 |
|
313 |
PKG_CHECK_EXISTS([$magick++], [ |
314 |
- ## Make sure we only get -I, -L, and -l flags. Some Graphics/ImageMagick++ |
315 |
+ ## Make sure we only get -I, -D, -L, and -l flags. Some Graphics/ImageMagick++ |
316 |
## packages add extra flags that are useful when building |
317 |
## Graphics/ImageMagick++ extentions. These extra flags break the |
318 |
## Octave build. |
319 |
- MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $magick++` |
320 |
+ MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags $magick++ | sed -e 's/\(-@<:@DI@:>@@<:@^ \t@:>@*\)\|\(-@<:@^ \t@:>@*\)/\1/g'` |
321 |
MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L $magick++` |
322 |
MAGICK_LIBS=`$PKG_CONFIG --libs-only-l $magick++` |