[megaglest] 116/143: Debian release 3.9.1-2
Markus Koschany
apo-guest at moszumanska.debian.org
Sat Jan 31 20:46:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
apo-guest pushed a commit to branch master
in repository megaglest.
commit 1e0b81838b31df38b0f7afade8f3f383550500e7
Author: Markus Koschany <apo at gambaru.de>
Date: Mon Dec 1 19:11:36 2014 +0000
Debian release 3.9.1-2
Fix wxWidgets assertions #768572
---
debian/changelog | 12 +++
debian/control | 1 -
debian/patches/series | 1 +
debian/patches/wxWidgets-assertions.patch | 168 ++++++++++++++++++++++++++++++
debian/rules | 2 +
5 files changed, 183 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index f868732..d209a9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+megaglest (3.9.1-2) unstable; urgency=medium
+
+ * Add wxWidgets-assertions.patch.
+ Fix megaglest_editor and megaglest_g3dviewer assertions with newer versions
+ of wxWidgets that made the tools unusable. (Closes: #768572)
+ Cherry-picked from upstream master branch. Commits c21317a5f, ad0b65272,
+ 6faa3dc72. Thanks to Mark Vejvoda for the patch.
+ * debian/rules: Export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG and disable
+ wxWidgets assertions.
+
+ -- Markus Koschany <apo at gambaru.de> Mon, 01 Dec 2014 19:19:07 +0100
+
megaglest (3.9.1-1) unstable; urgency=low
[ Mark Vejvoda ]
diff --git a/debian/control b/debian/control
index 5915cb3..2f1f246 100644
--- a/debian/control
+++ b/debian/control
@@ -41,7 +41,6 @@ Depends:
famfamfam-flag-png,
fonts-liberation,
fonts-uralic,
- fonts-linuxlibertine,
megaglest-data (<= ${source:Version}),
megaglest-data (>= ${source:Upstream-Version}),
p7zip-full,
diff --git a/debian/patches/series b/debian/patches/series
index b00dbc0..9c34306 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
fix-cmake-build-type-none.patch
+wxWidgets-assertions.patch
diff --git a/debian/patches/wxWidgets-assertions.patch b/debian/patches/wxWidgets-assertions.patch
new file mode 100644
index 0000000..7a7e06c
--- /dev/null
+++ b/debian/patches/wxWidgets-assertions.patch
@@ -0,0 +1,168 @@
+From: Markus Koschany <apo at gambaru.de>
+Date: Mon, 1 Dec 2014 19:12:28 +0100
+Subject: wxWidgets assertions
+
+Fix wxWidgets assertions in megaglest_editor and megaglest_g3dviewer.
+
+Bug: https://bugs.debian.org/768572
+Forwarded: not-needed already fixed
+---
+ source/g3d_viewer/main.cpp | 23 +++++++++++++++--------
+ source/g3d_viewer/main.h | 1 +
+ source/glest_map_editor/main.cpp | 20 +++++++++++++++-----
+ source/shared_lib/sources/graphics/model.cpp | 2 +-
+ 4 files changed, 32 insertions(+), 14 deletions(-)
+
+diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp
+index 1276f73..a6cdb4a 100644
+--- a/source/g3d_viewer/main.cpp
++++ b/source/g3d_viewer/main.cpp
+@@ -480,12 +480,15 @@ void MainWindow::setupTimer() {
+ }
+
+ void MainWindow::setupStartupSettings() {
+- GLuint err = glewInit();
+- if (GLEW_OK != err) {
++
++ glCanvas->setCurrentGLContext();
++
++ GLuint err = glewInit();
++ if (GLEW_OK != err) {
+ fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
+ //return 1;
+ throw std::runtime_error((char *)glewGetErrorString(err));
+- }
++ }
+
+ renderer= Renderer::getInstance();
+
+@@ -567,7 +570,7 @@ MainWindow::~MainWindow(){
+ void MainWindow::init() {
+
+ #if wxCHECK_VERSION(2, 9, 3)
+- glCanvas->setCurrentGLContext();
++ //glCanvas->setCurrentGLContext();
+ //printf("setcurrent #1\n");
+ #elif wxCHECK_VERSION(2, 9, 1)
+
+@@ -585,7 +588,9 @@ void MainWindow::init() {
+ void MainWindow::onPaint(wxPaintEvent &event) {
+ if(!IsShown()) return;
+
+-#if wxCHECK_VERSION(2, 9, 3)
++#if wxCHECK_VERSION(2, 9, 4)
++ //glCanvas->setCurrentGLContext();
++#elif wxCHECK_VERSION(2, 9, 3)
+
+ #elif wxCHECK_VERSION(2, 9, 1)
+ glCanvas->setCurrentGLContext();
+@@ -756,8 +761,8 @@ void MainWindow::onClose(wxCloseEvent &event){
+ delete timer;
+ timer = NULL;
+
+- delete model;
+- model = NULL;
++ //delete model;
++ //model = NULL;
+
+ delete renderer;
+ renderer = NULL;
+@@ -2027,7 +2032,7 @@ GlCanvas::GlCanvas(MainWindow * mainWindow, int *args)
+ }
+
+ GlCanvas::~GlCanvas() {
+- delete this->context;
++ if(this->context) delete this->context;
+ this->context = NULL;
+ }
+
+@@ -2037,11 +2042,13 @@ void GlCanvas::setCurrentGLContext() {
+ #if wxCHECK_VERSION(2, 9, 1)
+ if(this->context == NULL) {
+ this->context = new wxGLContext(this);
++ //printf("Set ctx [%p]\n",this->context);
+ }
+ #endif
+ //printf("Set ctx [%p]\n",this->context);
+ if(this->context) {
+ wxGLCanvas::SetCurrent(*this->context);
++ //printf("Set ctx2 [%p]\n",this->context);
+ }
+ #else
+ this->SetCurrent();
+diff --git a/source/g3d_viewer/main.h b/source/g3d_viewer/main.h
+index d22020d..e8142b8 100644
+--- a/source/g3d_viewer/main.h
++++ b/source/g3d_viewer/main.h
+@@ -201,6 +201,7 @@ public:
+ void onKeyDown(wxKeyEvent &event);
+ void setCurrentGLContext();
+
++ wxGLContext * getCtx() { return context; }
+ private:
+ MainWindow *mainWindow;
+ wxGLContext *context;
+diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp
+index 9b2dc57..e9c9b7c 100644
+--- a/source/glest_map_editor/main.cpp
++++ b/source/glest_map_editor/main.cpp
+@@ -138,12 +138,12 @@ END_EVENT_TABLE()
+
+ void MainWindow::init(string fname) {
+ #if wxCHECK_VERSION(2, 9, 3)
+- glCanvas->setCurrentGLContext();
++ //glCanvas->setCurrentGLContext();
+ //printf("setcurrent #1\n");
+ #elif wxCHECK_VERSION(2, 9, 1)
+
+ #else
+- glCanvas->SetCurrent();
++ //glCanvas->SetCurrent();
+ //printf("setcurrent #2\n");
+ #endif
+
+@@ -638,11 +638,17 @@ void MainWindow::onPaint(wxPaintEvent &event) {
+ return;
+ }
+
+-#if wxCHECK_VERSION(2, 9, 3)
++//#if wxCHECK_VERSION(2, 9, 3)
+
+-#elif wxCHECK_VERSION(2, 9, 1)
++//#elif wxCHECK_VERSION(2, 9, 1)
++// glCanvas->setCurrentGLContext();
++//#endif
++
++ //static bool contextSet = false;
++ //if(contextSet == false) {
++ // contextSet = true;
+ glCanvas->setCurrentGLContext();
+-#endif
++ //}
+
+ if(lastPaintEvent.getMillis() < 30) {
+ sleep(1);
+@@ -1579,6 +1585,10 @@ bool App::OnInit() {
+ SystemFlags::VERBOSE_MODE_ENABLED = false;
+ SystemFlags::ENABLE_THREADED_LOGGING = false;
+
++#if defined(wxMAJOR_VERSION) && defined(wxMINOR_VERSION) && defined(wxRELEASE_NUMBER) && defined(wxSUBRELEASE_NUMBER)
++ printf("Using wxWidgets version [%d.%d.%d.%d]\n",wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxSUBRELEASE_NUMBER);
++#endif
++
+ string fileparam;
+ if(argc==2){
+ if(argv[1][0]=='-') { // any flag gives help and exits program.
+diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp
+index e3bf3cf..84becdb 100644
+--- a/source/shared_lib/sources/graphics/model.cpp
++++ b/source/shared_lib/sources/graphics/model.cpp
+@@ -1099,7 +1099,7 @@ Model::Model() {
+ }
+
+ Model::~Model() {
+- delete [] meshes;
++ if(meshes) delete [] meshes;
+ meshes = NULL;
+ }
+
diff --git a/debian/rules b/debian/rules
index 1c96836..bc516e9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
#!/usr/bin/make -f
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+# Disable wxWidgets assertions
+export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG
%:
dh $@ --parallel
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/megaglest.git
More information about the Pkg-games-commits
mailing list