Package: calligra / 1:2.8.5+dfsg-1

eigen3.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
Description: mirgate from eigen2 to eigen3
Author: Anton Gladky <gladk@debian.org>
Bug-Debian: http://bugs.debian.org/726643
Last-Update: 2013-10-17

Index: calligra/CMakeLists.txt
===================================================================
--- calligra.orig/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
+++ calligra/CMakeLists.txt	2014-05-15 17:22:23.131474312 +0200
@@ -423,10 +423,10 @@
 macro_log_feature(KDEPIMLIBS_FOUND "KDE PIMLibs" "KDE Personal Information Management Libraries" "http://www.kde.org/" FALSE "" "Required by Plan and the KDE address book integration (available as a module in KDE)")
 
 ##
-## Test for eigen2
+## Test for eigen3
 ##
-macro_optional_find_package(Eigen2)
-macro_log_feature(EIGEN2_FOUND "Eigen" "C++ template library for linear algebra" "http://eigen.tuxfamily.org" FALSE "2.0" "Required by Calligra Sheets and Krita")
+macro_optional_find_package(Eigen3)
+macro_log_feature(EIGEN3_FOUND "Eigen" "C++ template library for linear algebra" "http://eigen.tuxfamily.org" FALSE "3.0" "Required by Calligra Sheets and Krita")
 
 ##
 ## Test for QCA2
@@ -933,13 +933,13 @@
     calligra_disable_product(RDF "Soprano not found")
 endif(NOT Soprano_FOUND)
 
-if(NOT EIGEN2_FOUND)
+if(NOT EIGEN3_FOUND)
     calligra_disable_product(SHEETS_PART "Eigen devel not found")
-endif(NOT EIGEN2_FOUND)
+endif(NOT EIGEN3_FOUND)
 
-if(NOT EIGEN2_FOUND OR NOT EXIV2_FOUND OR NOT HAVE_REQUIRED_LCMS_VERSION OR NOT SHARED_MIME_INFO_FOUND)
-    calligra_disable_product(KRITA_APP "SharedMimeInfo|libeigen2|libexiv2|lcms devel not found ")
-endif(NOT EIGEN2_FOUND OR NOT EXIV2_FOUND OR NOT HAVE_REQUIRED_LCMS_VERSION OR NOT SHARED_MIME_INFO_FOUND)
+if(NOT EIGEN3_FOUND OR NOT EXIV2_FOUND OR NOT HAVE_REQUIRED_LCMS_VERSION OR NOT SHARED_MIME_INFO_FOUND)
+    calligra_disable_product(KRITA_APP "SharedMimeInfo|libeigen3|libexiv2|lcms devel not found ")
+endif(NOT EIGEN3_FOUND OR NOT EXIV2_FOUND OR NOT HAVE_REQUIRED_LCMS_VERSION OR NOT SHARED_MIME_INFO_FOUND)
 
 if(NOT APPLE AND NOT REQUIRED_Xinput_FOUND)
     calligra_disable_product(KRITA_APP "Xinput devel not found ")
Index: calligra/cmake/modules/FindEigen3.cmake
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ calligra/cmake/modules/FindEigen3.cmake	2014-05-15 17:22:23.131474312 +0200
@@ -0,0 +1,81 @@
+# - Try to find Eigen3 lib
+#
+# This module supports requiring a minimum version, e.g. you can do
+#   find_package(Eigen3 3.1.2)
+# to require version 3.1.2 or newer of Eigen3.
+#
+# Once done this will define
+#
+#  EIGEN3_FOUND - system has eigen lib with correct version
+#  EIGEN3_INCLUDE_DIR - the eigen include directory
+#  EIGEN3_VERSION - eigen version
+
+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
+# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
+# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
+# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
+
+if(NOT Eigen3_FIND_VERSION)
+  if(NOT Eigen3_FIND_VERSION_MAJOR)
+    set(Eigen3_FIND_VERSION_MAJOR 2)
+  endif(NOT Eigen3_FIND_VERSION_MAJOR)
+  if(NOT Eigen3_FIND_VERSION_MINOR)
+    set(Eigen3_FIND_VERSION_MINOR 91)
+  endif(NOT Eigen3_FIND_VERSION_MINOR)
+  if(NOT Eigen3_FIND_VERSION_PATCH)
+    set(Eigen3_FIND_VERSION_PATCH 0)
+  endif(NOT Eigen3_FIND_VERSION_PATCH)
+
+  set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
+endif(NOT Eigen3_FIND_VERSION)
+
+macro(_eigen3_check_version)
+  file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
+
+  string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
+  set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
+  string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
+  set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
+  string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
+  set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
+
+  set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
+  if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+    set(EIGEN3_VERSION_OK FALSE)
+  else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+    set(EIGEN3_VERSION_OK TRUE)
+  endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+
+  if(NOT EIGEN3_VERSION_OK)
+
+    message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
+                   "but at least version ${Eigen3_FIND_VERSION} is required")
+  endif(NOT EIGEN3_VERSION_OK)
+endmacro(_eigen3_check_version)
+
+if (EIGEN3_INCLUDE_DIR)
+
+  # in cache already
+  _eigen3_check_version()
+  set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
+
+else (EIGEN3_INCLUDE_DIR)
+
+  find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
+      PATHS
+      ${CMAKE_INSTALL_PREFIX}/include
+      ${KDE4_INCLUDE_DIR}
+      PATH_SUFFIXES eigen3 eigen
+    )
+
+  if(EIGEN3_INCLUDE_DIR)
+    _eigen3_check_version()
+  endif(EIGEN3_INCLUDE_DIR)
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
+
+  mark_as_advanced(EIGEN3_INCLUDE_DIR)
+
+endif(EIGEN3_INCLUDE_DIR)
+
Index: calligra/krita/image/kis_perspective_math.cpp
===================================================================
--- calligra.orig/krita/image/kis_perspective_math.cpp	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/image/kis_perspective_math.cpp	2014-05-15 17:22:23.131474312 +0200
@@ -86,7 +86,7 @@
     b.coeffRef(8) = 1;
 //     dbgImage <<" a := { {" << a(0,0) <<" ," << a(0,1) <<" ," << a(0,2) <<" ," << a(0,3) <<" ," << a(0,4) <<" ," << a(0,5) <<" ," << a(0,6) <<" ," << a(0,7) <<" ," << a(0,8) <<" } , {" << a(1,0) <<" ," << a(1,1) <<" ," << a(1,2) <<" ," << a(1,3) <<" ," << a(1,4) <<" ," << a(1,5) <<" ," << a(1,6) <<" ," << a(1,7) <<" ," << a(1,8) <<" } , {" << a(2,0) <<" ," << a(2,1) <<" ," << a(2,2) <<" ," << a(2,3) <<" ," << a(2,4) <<" ," << a(2,5) <<" ," << a(2,6) <<" ," << a(2,7) <<" ," << a(2,8) <<" } , {" << a(3,0) <<" ," << a(3,1) <<" ," << a(3,2) <<" ," << a(3,3) <<" ," << a(3,4) <<" ," << a(3,5) <<" ," << a(3,6) <<" ," << a(3,7) <<" ," << a(3,8) <<" } , {" << a(4,0) <<" ," << a(4,1) <<" ," << a(4,2) <<" ," << a(4,3) <<" ," << a(4,4) <<" ," << a(4,5) <<" ," << a(4,6) <<" ," << a(4,7) <<" ," << a(4,8) <<" } , {" << a(5,0) <<" ," << a(5,1) <<" ," << a(5,2) <<" ," << a(5,3) <<" ," << a(5,4) <<" ," << a(5,5) <<" ," << a(5,6) <<" ," << a(5,7) <<" ," << a(5,8) <<" } , {" << a(6,0) <<" ," << a(6,1) <<" ," << a(6,2) <<" ," << a(6,3) <<" ," << a(6,4) <<" ," << a(6,5) <<" ," << a(6,6) <<" ," << a(6,7) <<" ," << a(6,8) <<" } , {"<< a(7,0) <<" ," << a(7,1) <<" ," << a(7,2) <<" ," << a(7,3) <<" ," << a(7,4) <<" ," << a(7,5) <<" ," << a(7,6) <<" ," << a(7,7) <<" ," << a(7,8) <<" } , {"<< a(8,0) <<" ," << a(8,1) <<" ," << a(8,2) <<" ," << a(8,3) <<" ," << a(8,4) <<" ," << a(8,5) <<" ," << a(8,6) <<" ," << a(8,7) <<" ," << a(8,8) <<" } };";
     Vector9qreal v;
-    a.lu().solve(b, &v);
+    v = a.lu().solve(b);
     Matrix3qreal matrix;
     for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) matrix.coeffRef(r, c) = v.coeff(3 * r + c);
     return matrix;
Index: calligra/krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_ring.cpp
===================================================================
--- calligra.orig/krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_ring.cpp	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_ring.cpp	2014-05-15 17:22:23.131474312 +0200
@@ -21,7 +21,7 @@
 #include <QMouseEvent>
 
 #include <Eigen/Core>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
 #include <cmath>
 
 #include "KoColor.h"
Index: calligra/krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_triangle.cpp
===================================================================
--- calligra.orig/krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_triangle.cpp	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_triangle.cpp	2014-05-15 17:22:23.131474312 +0200
@@ -21,7 +21,7 @@
 #include <QMouseEvent>
 
 #include <Eigen/Core>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
 #include <cmath>
         
 #include "KoColor.h"
Index: calligra/krita/plugins/paintops/libbrush/CMakeLists.txt
===================================================================
--- calligra.orig/krita/plugins/paintops/libbrush/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/plugins/paintops/libbrush/CMakeLists.txt	2014-05-15 17:22:23.131474312 +0200
@@ -1,5 +1,6 @@
 add_subdirectory( tests )
 
+add_definitions( -DEIGEN3_SUPPORT )
 set(kritalibbrush_LIB_SRCS
     kis_predefined_brush_factory.cpp
     kis_auto_brush.cpp
Index: calligra/krita/plugins/tools/selectiontools/kis_tool_select_brush.cc
===================================================================
--- calligra.orig/krita/plugins/tools/selectiontools/kis_tool_select_brush.cc	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/plugins/tools/selectiontools/kis_tool_select_brush.cc	2014-05-15 17:22:23.131474312 +0200
@@ -35,7 +35,7 @@
 #include <KoCompositeOp.h>
 
 #include <Eigen/Core>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
 
 #include "kis_cursor.h"
 #include "kis_canvas2.h"
Index: calligra/krita/plugins/tools/selectiontools/kis_tool_select_magnetic.h
===================================================================
--- calligra.orig/krita/plugins/tools/selectiontools/kis_tool_select_magnetic.h	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/plugins/tools/selectiontools/kis_tool_select_magnetic.h	2014-05-15 17:22:23.131474312 +0200
@@ -42,7 +42,7 @@
 }
 
 #include <Eigen/Core>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
 
 typedef Eigen::Matrix3d FilterMatrix;
 
Index: calligra/sheets/CMakeLists.txt
===================================================================
--- calligra.orig/sheets/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
+++ calligra/sheets/CMakeLists.txt	2014-05-15 17:22:23.131474312 +0200
@@ -5,7 +5,7 @@
                     ${KOTEXT_INCLUDES}
                     ${TEXTLAYOUT_INCLUDES}
                     ${Boost_INCLUDE_DIR}
-                    ${EIGEN2_INCLUDE_DIR} )
+                    ${EIGEN3_INCLUDE_DIR} )
 
 if (SHOULD_BUILD_SHEETS_PART)
 
Index: calligra/sheets/functions/CMakeLists.txt
===================================================================
--- calligra.orig/sheets/functions/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
+++ calligra/sheets/functions/CMakeLists.txt	2014-05-15 17:22:23.131474312 +0200
@@ -1,4 +1,4 @@
-include_directories(${CMAKE_SOURCE_DIR}/sheets ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${EIGEN2_INCLUDE_DIR})
+include_directories(${CMAKE_SOURCE_DIR}/sheets ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${EIGEN3_INCLUDE_DIR})
 
 
 ########### next target ###############
Index: calligra/sheets/functions/math.cpp
===================================================================
--- calligra.orig/sheets/functions/math.cpp	2014-05-15 17:22:23.135474153 +0200
+++ calligra/sheets/functions/math.cpp	2014-05-15 17:22:23.135474153 +0200
@@ -1228,9 +1228,9 @@
 
     Eigen::MatrixXd eMatrix = convert(matrix, calc),
                               eMatrixInverse(eMatrix.rows(), eMatrix.cols());
-    Eigen::LU<Eigen::MatrixXd> lu(eMatrix);
+    Eigen::FullPivLU<Eigen::MatrixXd> lu(eMatrix);
     if (lu.isInvertible()) {
-        lu.computeInverse(&eMatrixInverse);
+        eMatrixInverse.inverse();
         return convert(eMatrixInverse);
     } else
         return Value::errorDIV0();
Index: calligra/sheets/tests/CMakeLists.txt
===================================================================
--- calligra.orig/sheets/tests/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
+++ calligra/sheets/tests/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
@@ -1,6 +1,6 @@
 include(MacroAddCompileFlags)
 set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
-include_directories( ${CMAKE_SOURCE_DIR}/sheets  ${EIGEN2_INCLUDE_DIR} ${KOMAIN_INCLUDES} ${KDE4_INCLUDES} )
+include_directories( ${CMAKE_SOURCE_DIR}/sheets  ${EIGEN3_INCLUDE_DIR} ${KOMAIN_INCLUDES} ${KDE4_INCLUDES} )
 
 ########### Core Functionality ###############
 
Index: calligra/krita/CMakeLists.txt
===================================================================
--- calligra.orig/krita/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
+++ calligra/krita/CMakeLists.txt	2014-05-15 17:22:23.135474153 +0200
@@ -108,7 +108,7 @@
     ${CMAKE_SOURCE_DIR}/libs/widgets/colorwidgets
     ${CMAKE_SOURCE_DIR}/libs/widgetutils
 
-    ${EIGEN2_INCLUDE_DIR}
+    ${EIGEN3_INCLUDE_DIR}
     ${Vc_INCLUDE_DIR}
 
     # 'Export' this for use by filters