Control: tags 750910 + patch Given the difficulties in packaging sitplus 1.1.0, I had a go at patching 1.0.3-4 to work with wxwidgets3.0.
The attached NMU diff results in a package which builds and seems to work to the extent that I can test it without any of the hardware it seems to need. The changes to do with wxGenericCollapsiblePane may look a bit odd - the public class here seems to be wxCollapsiblePane, but where there isn't a native implementation, wx uses: #define wxCollapsiblePane wxGenericCollapsiblePane So that is why I check for both class names in the patch - the reported class name could be either, depending whether there is a native implementation or not. Let me know if you'd like me to upload the NMU. Cheers, Olly
diff -Nru sitplus-1.0.3/debian/changelog sitplus-1.0.3/debian/changelog --- sitplus-1.0.3/debian/changelog 2013-07-01 22:55:55.000000000 +1200 +++ sitplus-1.0.3/debian/changelog 2015-05-22 16:07:33.000000000 +1200 @@ -1,3 +1,10 @@ +sitplus (1.0.3-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Update to use wxWidgets 3.0. (Closes: #750910) + + -- Olly Betts <o...@survex.com> Fri, 22 May 2015 16:07:22 +1200 + sitplus (1.0.3-4) unstable; urgency=low * Team upload. diff -Nru sitplus-1.0.3/debian/control sitplus-1.0.3/debian/control --- sitplus-1.0.3/debian/control 2013-07-01 22:53:33.000000000 +1200 +++ sitplus-1.0.3/debian/control 2014-03-19 16:46:50.000000000 +1300 @@ -7,10 +7,10 @@ Andreas Tille <ti...@debian.org> Build-Depends: debhelper (>= 9), cmake, libpoco-dev, libboost-dev, libboost-program-options-dev, libboost-thread-dev, libboost-system-dev, - wx2.8-headers, libwxbase2.8-dev, libbluetooth-dev, libconfig-dev, libsdl1.2-dev, + libbluetooth-dev, libconfig-dev, libsdl1.2-dev, libopencv-dev, libhighgui-dev, libv4l-dev, libportmidi-dev, libboost-filesystem-dev, asciidoc, libsdl-gfx1.2-dev, libsdl-image1.2-dev, - libwxgtk2.8-dev, doxygen, libxtst-dev + libwxgtk3.0-dev, doxygen, libxtst-dev Standards-Version: 3.9.3 Homepage: http://sitplus.crea-si.com Vcs-Git: git://git.debian.org/debian-med/sitplus.git diff -Nru sitplus-1.0.3/debian/patches/fix-printf-formats-for-size_t.patch sitplus-1.0.3/debian/patches/fix-printf-formats-for-size_t.patch --- sitplus-1.0.3/debian/patches/fix-printf-formats-for-size_t.patch 1970-01-01 12:00:00.000000000 +1200 +++ sitplus-1.0.3/debian/patches/fix-printf-formats-for-size_t.patch 2015-05-22 14:22:39.000000000 +1200 @@ -0,0 +1,72 @@ +Description: Fix printf formats for size_t + Avoids warnings when sizeof(unsigned) != sizeof(size_t), and potential + misbehaviour on some platforms. +Author: Olly Betts <o...@survex.com> +Forwarded: no +Last-Update: 2015-05-22 + +--- sitplus-1.0.3.orig/3rdparty/nvwa/debug_new.cpp ++++ sitplus-1.0.3/3rdparty/nvwa/debug_new.cpp +@@ -464,7 +464,7 @@ static void* alloc_mem(size_t size, cons + #else + fast_mutex_autolock lock(new_output_lock); + fprintf(new_output_fp, +- "Out of memory when allocating %u bytes\n", ++ "Out of memory when allocating %zu bytes\n", + size); + fflush(new_output_fp); + _DEBUG_NEW_ERROR_ACTION; +@@ -499,7 +499,7 @@ static void* alloc_mem(size_t size, cons + { + fast_mutex_autolock lock(new_output_lock); + fprintf(new_output_fp, +- "new%s: allocated %p (size %u, ", ++ "new%s: allocated %p (size %zu, ", + is_array ? "[]" : "", + pointer, size); + if (line != 0) +@@ -548,7 +548,7 @@ static void free_pointer(void* pointer, + msg = "delete after new[]"; + fast_mutex_autolock lock(new_output_lock); + fprintf(new_output_fp, +- "%s: pointer %p (size %u)\n\tat ", ++ "%s: pointer %p (size %zu)\n\tat ", + msg, + (char*)ptr + ALIGNED_LIST_ITEM_SIZE, + ptr->size); +@@ -581,7 +581,7 @@ static void free_pointer(void* pointer, + { + fast_mutex_autolock lock(new_output_lock); + fprintf(new_output_fp, +- "delete%s: freed %p (size %u, %u bytes still allocated)\n", ++ "delete%s: freed %p (size %zu, %zu bytes still allocated)\n", + is_array ? "[]" : "", + (char*)ptr + ALIGNED_LIST_ITEM_SIZE, + ptr->size, total_mem_alloc); +@@ -621,7 +621,7 @@ int check_leaks() + } + #endif + fprintf(new_output_fp, +- "Leaked object at %p (size %u, ", ++ "Leaked object at %p (size %zu, ", + pointer, + ptr->size); + if (ptr->line != 0) +@@ -671,7 +671,7 @@ int check_mem_corruption() + { + #endif + fprintf(new_output_fp, +- "Heap data corrupt near %p (size %u, ", ++ "Heap data corrupt near %p (size %zu, ", + pointer, + ptr->size); + #if _DEBUG_NEW_TAILCHECK +@@ -679,7 +679,7 @@ int check_mem_corruption() + else + { + fprintf(new_output_fp, +- "Overwritten past end of object at %p (size %u, ", ++ "Overwritten past end of object at %p (size %zu, ", + pointer, + ptr->size); + } diff -Nru sitplus-1.0.3/debian/patches/series sitplus-1.0.3/debian/patches/series --- sitplus-1.0.3/debian/patches/series 2013-07-01 22:52:56.000000000 +1200 +++ sitplus-1.0.3/debian/patches/series 2015-05-22 14:23:39.000000000 +1200 @@ -4,3 +4,5 @@ sitplus-opencv2.4.patch libs_underlinkage.patch remove-deprecated-controls.patch +fix-printf-formats-for-size_t.patch +wxwidgets3.0.patch diff -Nru sitplus-1.0.3/debian/patches/wxwidgets3.0.patch sitplus-1.0.3/debian/patches/wxwidgets3.0.patch --- sitplus-1.0.3/debian/patches/wxwidgets3.0.patch 1970-01-01 12:00:00.000000000 +1200 +++ sitplus-1.0.3/debian/patches/wxwidgets3.0.patch 2015-05-22 15:47:49.000000000 +1200 @@ -0,0 +1,170 @@ +Description: Fix to work with wxwidgets3.0 +Author: Olly Betts <o...@survex.com> +Bug-Debian: https://bugs.debian.org/750910 +Forwarded: no +Last-Update: 2015-05-22 + +--- a/src/widgets_base/containerpanel.cpp ++++ b/src/widgets_base/containerpanel.cpp +@@ -171,13 +171,12 @@ + void ContainerPanel::OnSize( wxSizeEvent& event ) + { + if (event.GetSize().GetX() || event.GetSize().GetY()) +- wxPanel::OnSize(event); ++ event.Skip(true); + else { + // wxSize sbef= GetSize(); + Layout(); + Fit(); + +- //wxPanel::OnSize(event); + //InvalidateBestSize(); + // wxSize safter= GetSize(); + +@@ -190,13 +189,4 @@ + } + } + +-/* +-Works on windows, Infinite loop on linux +- +-wxPanel::OnSize(event); +- +- wxPostEvent(GetParent(), event); +- event.Skip(false); +- */ +- +-} +\ No newline at end of file ++} +--- a/src/mod_widgets/collapsible.cpp ++++ b/src/mod_widgets/collapsible.cpp +@@ -139,14 +139,14 @@ + * CollapsiblePanel type definition + */ + +-IMPLEMENT_DYNAMIC_CLASS( CollapsiblePanel, wxGenericCollapsiblePane ) ++IMPLEMENT_DYNAMIC_CLASS( CollapsiblePanel, wxCollapsiblePane ) + + + /*! + * CollapsiblePanel event table definition + */ + +-BEGIN_EVENT_TABLE( CollapsiblePanel, wxGenericCollapsiblePane ) ++BEGIN_EVENT_TABLE( CollapsiblePanel, wxCollapsiblePane ) + + ////@begin CollapsiblePanel event table entries + EVT_COLLAPSIBLEPANE_CHANGED( ID_COLLAPSIBLEPANE_PANEL, CollapsiblePanel::OnCollapsiblepanePanelPaneChanged ) +@@ -179,7 +179,7 @@ + bool CollapsiblePanel::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) + { + ////@begin CollapsiblePanel creation +- wxGenericCollapsiblePane::Create(parent, id, label, pos, size, style, validator); ++ wxCollapsiblePane::Create(parent, id, label, pos, size, style, validator); + CreateControls(); + ////@end CollapsiblePanel creation + return true; +--- a/src/mod_widgets/collapsible.h ++++ b/src/mod_widgets/collapsible.h +@@ -66,7 +66,7 @@ + // TODO: derive from ContainerCollapsible. On Windows there are problems importing + // static data members. See: + // http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6b73c234-46f7-4905-a7ae-9c679544e878 +-class CollapsiblePanel: public wxGenericCollapsiblePane ++class CollapsiblePanel: public wxCollapsiblePane + { + DECLARE_DYNAMIC_CLASS( CollapsiblePanel ) + DECLARE_EVENT_TABLE() +--- a/src/widgets_base/containercollapsible.cpp ++++ b/src/widgets_base/containercollapsible.cpp +@@ -45,14 +45,14 @@ + * ContainerCollapsible type definition + */ + +-IMPLEMENT_DYNAMIC_CLASS( ContainerCollapsible, wxGenericCollapsiblePane ) ++IMPLEMENT_DYNAMIC_CLASS( ContainerCollapsible, wxCollapsiblePane ) + + + /* + * ContainerCollapsible event table definition + */ + +-BEGIN_EVENT_TABLE( ContainerCollapsible, wxGenericCollapsiblePane ) ++BEGIN_EVENT_TABLE( ContainerCollapsible, wxCollapsiblePane ) + + ////@begin ContainerCollapsible event table entries + EVT_COLLAPSIBLEPANE_CHANGED( ID_COLLAPSIBLEPANE, ContainerCollapsible::OnCollapsiblepanePaneChanged ) +@@ -85,7 +85,7 @@ + bool ContainerCollapsible::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) + { + ////@begin ContainerCollapsible creation +- wxGenericCollapsiblePane::Create(parent, id, label, pos, size, style, validator); ++ wxCollapsiblePane::Create(parent, id, label, pos, size, style, validator); + CreateControls(); + ////@end ContainerCollapsible creation + return true; +--- a/src/sphost/componenthelper.cpp ++++ b/src/sphost/componenthelper.cpp +@@ -410,7 +410,7 @@ + + // Is window + if (IsCollapsiblePane()) +- return static_cast<wxGenericCollapsiblePane*>(m_theObj)->GetPane(); ++ return static_cast<wxCollapsiblePane*>(m_theObj)->GetPane(); + else + return static_cast<wxWindow*>(m_theObj); + } +@@ -465,7 +465,8 @@ + + bool IsCollapsiblePane() const { + assert (m_theObj); +- return m_theObj->IsKindOf(wxClassInfo::FindClass(_T("wxGenericCollapsiblePane"))); ++ return m_theObj->IsKindOf(wxClassInfo::FindClass(_T("wxCollapsiblePane"))) || ++ m_theObj->IsKindOf(wxClassInfo::FindClass(_T("wxGenericCollapsiblePane"))); + } + + wxObject* m_theObj; +@@ -616,10 +617,10 @@ + containerStack.push(child); + } + else if (t[1]== "collapsible") { +- wxGenericCollapsiblePane* panel= NULL; ++ wxCollapsiblePane* panel= NULL; + + if (!test) { +- //panel= new wxGenericCollapsiblePane(containerStack.top().GetEffectiveWindow(), wxID_ANY, _("Advanced")); ++ //panel= new wxCollapsiblePane(containerStack.top().GetEffectiveWindow(), wxID_ANY, _("Advanced")); + panel= new widgets_base::ContainerCollapsible(containerStack.top().GetEffectiveWindow(), wxID_ANY, _("Advanced")); + GUIContainer child(panel); + containerStack.top().AddChild (child, &(*it)); +@@ -651,14 +652,15 @@ + ThrowError ("Only widget_collapsible components can be used here", &(*it)); + } + +- wxGenericCollapsiblePane* panel= NULL; ++ wxCollapsiblePane* panel= NULL; + + if (!test) { + //panel= new widgets_base::ContainerCollapsible(containerStack.top().GetEffectiveWindow(), wxID_ANY, _("Advanced")); + wxWindow* w= compo->GetGUI(containerStack.top().GetEffectiveWindow()); + assert (w); +- assert (w->IsKindOf(wxClassInfo::FindClass(_T("wxGenericCollapsiblePane")))); +- panel= static_cast<wxGenericCollapsiblePane*>(w); ++ assert (w->IsKindOf(wxClassInfo::FindClass(_T("wxCollapsiblePane"))) || ++ w->IsKindOf(wxClassInfo::FindClass(_T("wxGenericCollapsiblePane")))); ++ panel= static_cast<wxCollapsiblePane*>(w); + GUIContainer child(panel); + containerStack.top().AddChild (child, &(*it)); + // Set sizer +--- sitplus-1.0.3.orig/include/widgets_base/containercollapsible.h ++++ sitplus-1.0.3/include/widgets_base/containercollapsible.h +@@ -60,7 +60,7 @@ namespace widgets_base { + * ContainerCollapsible class declaration + */ + +-class SPIMPEXP_CLASS_WIDGETSBASE ContainerCollapsible: public wxGenericCollapsiblePane ++class SPIMPEXP_CLASS_WIDGETSBASE ContainerCollapsible: public wxCollapsiblePane + { + DECLARE_DYNAMIC_CLASS( ContainerCollapsible ) + DECLARE_EVENT_TABLE()