--- Begin Message ---
Package: ctsim
Version: 5.2.0-1.1
Tags: patch sid jessie
User: freewx-ma...@lists.alioth.debian.org
Usertags: wx3.0
Control: block 748169 by -1
We're aiming to migrate the archive to using wxwidgets3.0 instead of
wxwidgets2.8, and intend to drop wxwidgets2.8 before jessie is released.
I've successfully built ctsim with the attached patch, and it starts up
OK and I can exercise the menu options which don't need specialised
knowledge or data. It would be good if you (or someone else) who
actually uses the application could give it a more thorough test though.
I'm happy to NMU this change if you wish me to - just let me know.
Cheers,
Olly
diff -Nru ctsim-5.2.0/debian/changelog ctsim-5.2.0/debian/changelog
--- ctsim-5.2.0/debian/changelog 2011-12-16 07:50:12.000000000 +1300
+++ ctsim-5.2.0/debian/changelog 2014-06-14 19:15:41.000000000 +1200
@@ -1,3 +1,10 @@
+ctsim (5.2.0-1.2) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Update to use wxWidgets 3.0 (new patch: wx3.0-compat.patch)
+
+ -- Olly Betts <o...@survex.com> Sat, 14 Jun 2014 19:15:31 +1200
+
ctsim (5.2.0-1.1) unstable; urgency=low
* Non-maintainer upload.
diff -Nru ctsim-5.2.0/debian/control ctsim-5.2.0/debian/control
--- ctsim-5.2.0/debian/control 2011-12-16 07:42:24.000000000 +1300
+++ ctsim-5.2.0/debian/control 2014-03-20 00:47:36.000000000 +1300
@@ -2,7 +2,7 @@
Section: science
Priority: extra
Maintainer: Kevin M. Rosenberg <k...@debian.org>
-Build-Depends: debhelper (>= 7.0.0), wx2.8-headers, libfftw3-dev, libreadline-dev, libgl1-mesa-dev, libglu1-mesa-dev, libwxgtk2.8-dev, ctn-dev, libpng12-dev, libglib2.0-dev, libgtk2.0-dev, autotools-dev
+Build-Depends: debhelper (>= 7.0.0), libfftw3-dev, libreadline-dev, libgl1-mesa-dev, libglu1-mesa-dev, libwxgtk3.0-dev, ctn-dev, libpng12-dev, libglib2.0-dev, libgtk2.0-dev, autotools-dev
Standards-Version: 3.9.1.0
Homepage: http://www.ctsim.org
Vcs-Git: git://git.b9.com/ctsim.git
diff -Nru ctsim-5.2.0/debian/patches/series ctsim-5.2.0/debian/patches/series
--- ctsim-5.2.0/debian/patches/series 1970-01-01 12:00:00.000000000 +1200
+++ ctsim-5.2.0/debian/patches/series 2014-06-14 18:45:03.000000000 +1200
@@ -0,0 +1 @@
+wx3.0-compat.patch
diff -Nru ctsim-5.2.0/debian/patches/wx3.0-compat.patch ctsim-5.2.0/debian/patches/wx3.0-compat.patch
--- ctsim-5.2.0/debian/patches/wx3.0-compat.patch 1970-01-01 12:00:00.000000000 +1200
+++ ctsim-5.2.0/debian/patches/wx3.0-compat.patch 2014-06-14 19:15:24.000000000 +1200
@@ -0,0 +1,256 @@
+Description: Fix to build with wxwidgets3.0
+Author: Olly Betts <o...@survex.com>
+Last-Update: 2014-06-14
+
+--- a/configure
++++ b/configure
+@@ -5736,13 +5736,13 @@
+ CFLAGS="${CFLAGS} ${g76GTK_CFLAGS} ${GLIB_CFLAGS}"
+ fi
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwx_gtk2u_core-2.8" >&5
+-$as_echo_n "checking for main in -lwx_gtk2u_core-2.8... " >&6; }
+-if test "${ac_cv_lib_wx_gtk2u_core_2_8_main+set}" = set; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwx_gtk2u_core-3.0" >&5
++$as_echo_n "checking for main in -lwx_gtk2u_core-3.0... " >&6; }
++if test "${ac_cv_lib_wx_gtk2u_core_3_0_main+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lwx_gtk2u_core-2.8 -L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} $LIBS"
++LIBS="-lwx_gtk2u_core-3.0 -L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -5756,29 +5756,29 @@
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_wx_gtk2u_core_2_8_main=yes
++ ac_cv_lib_wx_gtk2u_core_3_0_main=yes
+ else
+- ac_cv_lib_wx_gtk2u_core_2_8_main=no
++ ac_cv_lib_wx_gtk2u_core_3_0_main=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wx_gtk2u_core_2_8_main" >&5
+-$as_echo "$ac_cv_lib_wx_gtk2u_core_2_8_main" >&6; }
+-if test "x$ac_cv_lib_wx_gtk2u_core_2_8_main" = x""yes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wx_gtk2u_core_3_0_main" >&5
++$as_echo "$ac_cv_lib_wx_gtk2u_core_3_0_main" >&6; }
++if test "x$ac_cv_lib_wx_gtk2u_core_3_0_main" = x""yes; then :
+ wxwin=true; wx_gtk=true;
+ $as_echo "#define HAVE_WXWINDOWS 1" >>confdefs.h
+
+ fi
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwx_mac_core-2.8" >&5
+-$as_echo_n "checking for main in -lwx_mac_core-2.8... " >&6; }
+-if test "${ac_cv_lib_wx_mac_core_2_8_main+set}" = set; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwx_mac_core-3.0" >&5
++$as_echo_n "checking for main in -lwx_mac_core-3.0... " >&6; }
++if test "${ac_cv_lib_wx_mac_core_3_0_main+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lwx_mac_core-2.8 $LIBS"
++LIBS="-lwx_mac_core-3.0 $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -5792,17 +5792,17 @@
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_wx_mac_core_2_8_main=yes
++ ac_cv_lib_wx_mac_core_3_0_main=yes
+ else
+- ac_cv_lib_wx_mac_core_2_8_main=no
++ ac_cv_lib_wx_mac_core_3_0_main=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wx_mac_core_2_8_main" >&5
+-$as_echo "$ac_cv_lib_wx_mac_core_2_8_main" >&6; }
+-if test "x$ac_cv_lib_wx_mac_core_2_8_main" = x""yes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wx_mac_core_3_0_main" >&5
++$as_echo "$ac_cv_lib_wx_mac_core_3_0_main" >&6; }
++if test "x$ac_cv_lib_wx_mac_core_3_0_main" = x""yes; then :
+ wxwin=true; wx_mac=true;
+ $as_echo "#define HAVE_WXWINDOWS 1" >>confdefs.h
+
+@@ -7359,9 +7359,9 @@
+ wxdebug="--debug"
+ fi
+ if test "x$wx_gtk" != "x" ; then
+- ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}"
++ ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=3.0 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}"
+ elif test "x$wx_mac" != "x" ; then
+- ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl`"
++ ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=3.0 --libs std,gl`"
+ fi
+ fi
+ fi
+@@ -7535,7 +7535,7 @@
+
+ if test "$wxwin" = "true" ; then
+ if test "$wx_gtk" = "true" -o "$wx_mac" = "true" ; then
+- wxcflags=`$wxconfig $wxdebug --cxxflags --version=2.8`
++ wxcflags=`$wxconfig $wxdebug --cxxflags --version=3.0`
+ #wxlibs=`$wxconfig --libs`
+ else
+ wxcflags="-D__WXMSW__ -D__WIN32__ -D__GNUWIN32__"
+--- a/configure.ac
++++ b/configure.ac
+@@ -77,8 +77,8 @@
+ CFLAGS="${CFLAGS} ${g76GTK_CFLAGS} ${GLIB_CFLAGS}"
+ fi
+
+-AC_CHECK_LIB(wx_gtk2u_core-2.8, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])], [], [-L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} ])
+-AC_CHECK_LIB(wx_mac_core-2.8, main, [wxwin=true; wx_mac=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])])
++AC_CHECK_LIB(wx_gtk2u_core-3.0, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])], [], [-L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} ])
++AC_CHECK_LIB(wx_mac_core-3.0, main, [wxwin=true; wx_mac=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])])
+ AC_CHECK_LIB(fftw3, fftw_malloc, [fftw=true; AC_DEFINE(HAVE_FFTW,1,[FFTW library])], [fftw=false], [-L/usr/lib64 -L/usr/lib])
+ AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false], [-L/usr/X11R6/lib -L/usr/X11R6/lib64])
+ AC_CHECK_LIB(pthread, main, [pthread=true], [pthread=false])
+@@ -375,9 +375,9 @@
+ wxdebug="--debug"
+ fi
+ if test "x$wx_gtk" != "x" ; then
+- ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}"
++ ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=3.0 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}"
+ elif test "x$wx_mac" != "x" ; then
+- ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl`"
++ ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=3.0 --libs std,gl`"
+ fi
+ fi
+ fi
+@@ -451,7 +451,7 @@
+
+ if test "$wxwin" = "true" ; then
+ if test "$wx_gtk" = "true" -o "$wx_mac" = "true" ; then
+- wxcflags=`$wxconfig $wxdebug --cxxflags --version=2.8`
++ wxcflags=`$wxconfig $wxdebug --cxxflags --version=3.0`
+ #wxlibs=`$wxconfig --libs`
+ else
+ wxcflags="-D__WXMSW__ -D__WIN32__ -D__GNUWIN32__"
+--- a/libctgraphics/sgp.cpp
++++ b/libctgraphics/sgp.cpp
+@@ -359,7 +359,7 @@
+ {
+ #if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+- int wxFxn = -1;
++ wxRasterOperationMode wxFxn;
+ switch (ro) {
+ case RO_AND:
+ wxFxn = wxAND;
+@@ -409,9 +409,10 @@
+ case RO_XOR:
+ wxFxn = wxXOR;
+ break;
++ default:
++ return;
+ }
+- if (wxFxn >= 0)
+- m_driver.idWX()->SetLogicalFunction (wxFxn);
++ m_driver.idWX()->SetLogicalFunction (wxFxn);
+ }
+ #endif
+ }
+--- a/src/ctsim.cpp
++++ b/src/ctsim.cpp
+@@ -93,15 +93,15 @@
+ void CTSimApp::OnInitCmdLine(wxCmdLineParser& parser)
+ {
+ static const wxCmdLineEntryDesc cmdLineDesc[] = {
+- { wxCMD_LINE_SWITCH, _T("l"), _T("verbose"), _T("verbose logging") },
+- { wxCMD_LINE_SWITCH, _T("v"), _T("version"), _T("print version") },
+- { wxCMD_LINE_SWITCH, _T("p"), _T("print"), _T("print images from command line"),
++ { wxCMD_LINE_SWITCH, wxT_2("l"), wxT_2("verbose"), wxT_2("verbose logging") },
++ { wxCMD_LINE_SWITCH, wxT_2("v"), wxT_2("version"), wxT_2("print version") },
++ { wxCMD_LINE_SWITCH, wxT_2("p"), wxT_2("print"), wxT_2("print images from command line"),
+ wxCMD_LINE_VAL_NONE,
+ wxCMD_LINE_PARAM_OPTIONAL },
+- { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("print this help message"),
++ { wxCMD_LINE_SWITCH, wxT_2("h"), wxT_2("help"), wxT_2("print this help message"),
+ wxCMD_LINE_VAL_NONE,
+ wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_OPTION_HELP },
+- { wxCMD_LINE_PARAM, NULL, NULL, _T("input file"),
++ { wxCMD_LINE_PARAM, NULL, NULL, wxT_2("input file"),
+ wxCMD_LINE_VAL_STRING,
+ wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+ { wxCMD_LINE_NONE }
+@@ -250,7 +250,7 @@
+ if (m_bPrintCmdLineImages) {
+ wxCommandEvent closeEvent;
+ closeEvent.SetInt (MAINMENU_FILE_EXIT);
+- m_pFrame->AddPendingEvent(closeEvent);
++ m_pFrame->GetEventHandler()->ProcessEvent(closeEvent);
+ }
+
+ if (getStartupTips())
+@@ -891,7 +891,7 @@
+ };
+
+ BitmapDialog::BitmapDialog (wxBitmap* pBitmap, char const* pszTitle)
+- : wxDialog(theApp->getMainFrame(), -1, wxString(pszTitle,*wxConvCurrent), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE)
++ : wxDialog(theApp->getMainFrame(), -1, wxString(pszTitle,*wxConvCurrent))
+ {
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+@@ -961,7 +961,7 @@
+ }
+
+ wxString strFilename = wxFileSelector (wxString(wxConvUTF8.cMB2WX("Import Filename")), wxString(wxConvUTF8.cMB2WX("")),
+- wxString(wxConvUTF8.cMB2WX("")), strExt, strWildcard, wxOPEN);
++ wxString(wxConvUTF8.cMB2WX("")), strExt, strWildcard, wxFD_OPEN);
+
+ if (! strFilename.IsEmpty()) {
+ if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PPM || m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PNG) {
+--- a/src/ctsim.h
++++ b/src/ctsim.h
+@@ -126,6 +126,13 @@
+
+ void OnSize (wxSizeEvent& event);
+
++#if wxCHECK_VERSION(2,9,0)
++ // Needed for wx3.0
++ void OnMRUFile(wxCommandEvent& event) {
++ if (m_docManager) m_docManager->OnMRUFile(event);
++ }
++#endif
++
+ #if CTSIM_WINHELP
+ wxCHMHelpController& getWinHelpController()
+ {return m_winHelp; }
+--- a/src/dlgezplot.cpp
++++ b/src/dlgezplot.cpp
+@@ -102,7 +102,7 @@
+
+
+ wxEZPlotDialog::wxEZPlotDialog (wxWindow *parent, bool bCancelButton)
+-: wxDialog((parent ? parent : theApp->getMainFrame()), -1, _T("EZPlot"), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL),
++: wxDialog((parent ? parent : theApp->getMainFrame()), -1, _T("EZPlot")),
+ m_parentTop(0)
+ {
+ if (! parent)
+--- a/src/views.cpp
++++ b/src/views.cpp
+@@ -1315,9 +1315,9 @@
+ _T(""), strExt, strWildcard, wxOVERWRITE_PROMPT | wxHIDE_READONLY | wxSAVE);
+ #else
+ const wxString& strFilename = wxFileSelector (_T("Export Filename"), _T(""),
+- _T(""), strExt, strWildcard, wxOVERWRITE_PROMPT | wxSAVE);
++ _T(""), strExt, strWildcard, wxFD_OVERWRITE_PROMPT | wxFD_SAVE);
+ #endif
+- if (strFilename) {
++ if (!strFilename.empty()) {
+ rIF.exportImage (strFormatName.mb_str(wxConvUTF8), strFilename.mb_str(wxConvUTF8), 1, 1, m_dMinPixel, m_dMaxPixel);
+ *theApp->getLog() << _T("Exported file ") << strFilename << _T("\n");
+ }
--- End Message ---