[digikam] fix build with gcc-4.7.0 (kde#290642) and boost-1.48 (kde#287772)

nucleo nucleo at fedoraproject.org
Thu Jan 5 02:40:33 UTC 2012


commit 58c193ffc694d85422fbc1916315652cc0376662
Author: nucleo <nucleo at fedoraproject.org>
Date:   Thu Jan 5 04:40:27 2012 +0200

    fix build with gcc-4.7.0 (kde#290642) and boost-1.48 (kde#287772)

 digikam-2.5.0-boost-1.48.patch |   95 ++++++++++++++++++++++++++++++++++++++++
 digikam-2.5.0-gcc-4.7.0.patch  |   63 ++++++++++++++++++++++++++
 digikam.spec                   |   18 +++++++-
 3 files changed, 175 insertions(+), 1 deletions(-)
---
diff --git a/digikam-2.5.0-boost-1.48.patch b/digikam-2.5.0-boost-1.48.patch
new file mode 100644
index 0000000..1d0afd0
--- /dev/null
+++ b/digikam-2.5.0-boost-1.48.patch
@@ -0,0 +1,95 @@
+diff --git a/libs/database/imagehistory/imagehistorygraph_boost.h b/libs/database/imagehistory/imagehistorygraph_boost.h
+index 6ffccce..52162e9 100644
+--- a/libs/database/imagehistory/imagehistorygraph_boost.h
++++ b/libs/database/imagehistory/imagehistorygraph_boost.h
+@@ -34,6 +34,7 @@
+ 
+ #include <utility>
+ #include <algorithm>
++#include <boost/version.hpp>
+ #include <boost/graph/transitive_closure.hpp>
+ #include <boost/graph/adjacency_list.hpp>
+ #include <boost/graph/topological_sort.hpp>
+@@ -188,6 +189,9 @@ public:
+ 
+         Edge() : null(true) {}
+         Edge(const edge_t& e) : e(e), null(false) {}
++#if BOOST_VERSION >= 104700
++        Edge(const boost::detail::reverse_graph_edge_descriptor<edge_t>& e) : e(e.underlying_desc), null(false) {}
++#endif
+ 
+         Edge& operator=(const edge_t& other)
+         {
+@@ -1049,6 +1053,15 @@ protected:
+         return toList<Edge, range_t>(range);
+     }
+ 
++    template <class GraphType>
++    class edge_desc_maker {
++        public:
++        template <typename range_t> static QList<typename boost::graph_traits<GraphType>::edge_descriptor> toEdgeDescList(const range_t& range)
++        {
++            return toList<typename boost::graph_traits<GraphType>::edge_descriptor, range_t>(range);
++        }
++    };
++
+     template <typename range_t>
+     static bool isEmptyRange(const range_t& range)
+     {
+@@ -1198,7 +1211,7 @@ protected:
+             {
+                 boost::dag_shortest_paths(graph, v,
+                                           // we provide a constant weight of 1
+-                                          weight_map(boost::ref_property_map<edge_t,int>(weight)).
++                                          weight_map(boost::ref_property_map<typename boost::graph_traits<GraphType>::edge_descriptor,int>(weight)).
+                                           // Store distance and predecessors in QMaps, wrapped to serve as property maps
+                                           distance_map(VertexIntMapAdaptor(distances)).
+                                           predecessor_map(VertexVertexMapAdaptor(predecessors))
+@@ -1218,7 +1231,7 @@ protected:
+             {
+                 boost::dag_shortest_paths(graph, v,
+                                           // we provide a constant weight of 1
+-                                          weight_map(boost::ref_property_map<edge_t,int>(weight)).
++                                          weight_map(boost::ref_property_map<typename boost::graph_traits<GraphType>::edge_descriptor,int>(weight)).
+                                           // Invert the default compare method: With greater, we get the longest path
+                                           distance_compare(std::greater<int>()).
+                                           // will be returned if a node is unreachable
+@@ -1389,9 +1402,10 @@ protected:
+                 : g(g), vertexLessThan(vertexLessThan) {}
+             const GraphType& g;
+             VertexLessThan vertexLessThan;
+-            bool operator()(const Edge& a, const Edge& b)
++            bool operator()(const typename boost::graph_traits<GraphType>::edge_descriptor& a,
++                            const typename boost::graph_traits<GraphType>::edge_descriptor& b)
+             {
+-                return vertexLessThan(boost::target(a.toEdge(), g), boost::target(b.toEdge(), g));
++                return vertexLessThan(boost::target(a, g), boost::target(b, g));
+             }
+         };
+ 
+@@ -1402,20 +1416,21 @@ protected:
+         {
+             typedef std::pair<Vertex, QList<Edge> > VertexInfo;
+ 
+-            QList<Edge>             outEdges;
++            QList<typename boost::graph_traits<IncidenceGraph>::edge_descriptor> outEdges;
+             std::vector<VertexInfo> stack;
+ 
+             boost::put(color, u, boost::gray_color);
+             vis.discover_vertex(u, g);
+ 
+-            outEdges = toEdgeList(boost::out_edges(u, g));
++            outEdges = edge_desc_maker<IncidenceGraph>::toEdgeDescList(boost::out_edges(u, g));
+             // Sort edges. The lessThan we have takes vertices, so we use a lessThan which
+             // maps the given edges to their targets, and calls our vertex lessThan.
+             qSort(outEdges.begin(), outEdges.end(), lessThanMapEdgeToTarget<IncidenceGraph, LessThan>(g, lessThan));
+ 
+-            foreach(const Edge& e, outEdges)
++            foreach(const typename boost::graph_traits<IncidenceGraph>::edge_descriptor& ed, outEdges)
+             {
+-                Vertex v = boost::target(e.toEdge(), g);
++                Edge e = ed;
++                Vertex v = boost::target(ed, g);
+                 vis.examine_edge(e, g);
+                 boost::default_color_type v_color = boost::get(color, v);
+                 if (v_color == boost::white_color)
diff --git a/digikam-2.5.0-gcc-4.7.0.patch b/digikam-2.5.0-gcc-4.7.0.patch
new file mode 100644
index 0000000..535387b
--- /dev/null
+++ b/digikam-2.5.0-gcc-4.7.0.patch
@@ -0,0 +1,63 @@
+--- digikam-2.5.0/core/digikam/album/albummanager.h	2012-01-03 02:32:41.000000000 +0200
++++ digikam-2.5.0/core/digikam/album/albummanager.h	2012-01-05 03:18:16.291639995 +0200
+@@ -831,7 +831,7 @@
+     {
+         foreach(T* t, list)
+         {
+-            append(AlbumPointer<T>(t));
++            this->append(AlbumPointer<T>(t));
+         }
+         return *this;
+     }
+--- digikam-2.5.0/core/libs/database/imagehistory/imagehistorygraph_boost.h	2012-01-03 02:32:26.000000000 +0200
++++ digikam-2.5.0/core/libs/database/imagehistory/imagehistorygraph_boost.h	2012-01-05 03:01:56.965609602 +0200
+@@ -1362,7 +1362,7 @@
+             template <typename VertexType, typename GraphType>
+             void discover_vertex(VertexType u, const GraphType&) const
+             {
+-                record(u);
++                this->record(u);
+             }
+         };
+ 
+@@ -1373,7 +1373,7 @@
+             template <typename VertexType, typename GraphType>
+             void discover_vertex(VertexType u, const GraphType&) const
+             {
+-                record(u);
++                this->record(u);
+             }
+         };
+ 
+--- digikam-2.5.0/core/utilities/cameragui/devices/gpcamera.cpp	2012-01-03 02:32:04.000000000 +0200
++++ digikam-2.5.0/core/utilities/cameragui/devices/gpcamera.cpp	2012-01-05 01:22:34.009352997 +0200
+@@ -30,6 +30,7 @@
+ extern "C"
+ {
+ #include <utime.h>
++#include <unistd.h>
+ }
+ 
+ // C++ includes
+--- digikam-2.5.0/extra/kipi-plugins/htmlexport/wizard.cpp	2012-01-03 02:31:42.000000000 +0200
++++ digikam-2.5.0/extra/kipi-plugins/htmlexport/wizard.cpp	2012-01-05 02:35:01.061054821 +0200
+@@ -78,7 +78,7 @@
+ public:
+     WizardPage(KAssistantDialog* dialog, const QString& title)
+     : QWidget(dialog) {
+-        setupUi(this);
++        this->setupUi(this);
+         layout()->setMargin(0);
+         mPage = dialog->addPage(this, title);
+     }
+--- digikam-2.5.0/extra/kipi-plugins/printimages/wizard/wizard.cpp	2012-01-03 02:31:34.000000000 +0200
++++ digikam-2.5.0/extra/kipi-plugins/printimages/wizard/wizard.cpp	2012-01-05 02:17:15.249914790 +0200
+@@ -88,7 +88,7 @@
+     WizardPage ( KAssistantDialog* dialog, const QString& title )
+         : QWidget ( dialog )
+     {
+-        setupUi ( this );
++        this->setupUi ( this );
+         layout()->setMargin ( 0 );
+         mPage = dialog->addPage ( this, title );
+     }
diff --git a/digikam.spec b/digikam.spec
index 54bce3b..0d67344 100644
--- a/digikam.spec
+++ b/digikam.spec
@@ -1,7 +1,7 @@
 
 Name:	 digikam
 Version: 2.5.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: A digital camera accessing & photo management application
 
 License: GPLv2+
@@ -19,6 +19,12 @@ Source1: digikam-import.desktop
 # isn't helpful.
 Patch0: digikam-2.5.0-clapack-atlas.patch
 
+# fix gcc-4.7.0 build https://bugs.kde.org/show_bug.cgi?id=290642#c3
+Patch1: digikam-2.5.0-gcc-4.7.0.patch
+
+# fix build against boost-1.48 https://bugs.kde.org/show_bug.cgi?id=287772#c22
+Patch2: digikam-2.5.0-boost-1.48.patch
+
 ## upstreamable patches
 # move dngconverter icons oxygen->hicolor so visible outside of kde
 Patch50: digikam-2.4.1-dngconverter_hicolor_icons.patch
@@ -199,6 +205,13 @@ Requires: kipi-plugins = %{version}-%{release}
 %setup -q -n %{name}-%{version}%{?pre:-%{pre}}
 
 %patch0 -p1 -b .clapack-atlas
+%patch1 -p1 -b .gcc-4.7.0
+
+%if 0%{?fedora} > 16
+pushd core
+%patch2 -p1 -b .boost-1.48
+popd
+%endif
 
 mv extra/kipi-plugins/dngconverter/icons/oxygen \
    extra/kipi-plugins/dngconverter/icons/hicolor
@@ -482,6 +495,9 @@ update-desktop-database -q &> /dev/null
 
 
 %changelog
+* Thu Jan  5 2012 Alexey Kurov <nucleo at fedoraproject.org> - 2.5.0-2
+- fix build with gcc-4.7.0 (kde#290642) and boost-1.48 (kde#287772)
+
 * Tue Jan  3 2012 Alexey Kurov <nucleo at fedoraproject.org> - 2.5.0-1
 - digikam-2.5.0
 


More information about the scm-commits mailing list