Package: mesademos
Version: 6.2.1-1
Severity: normal

Attached is a patch (relative to the root of the extracted source package) that:
* adds/moves calls to glutInit so the affected programs work with freeglut3
(those programs exit at runtime with an error).
* Adds a missing include to rain.cxx so it compiles.
* Patches the Makefile installed by the package (i.e. Makefile.standalone) so
the clean rule removes any object files in the directory.
* Patches that Makefile so the "rain" program is compiled

The alternative way to patch the Makefile for building rain:
TARGETS += $(filter-out particles, $(patsubst %.cxx,%,$(wildcard *.cxx)))
(and keeping the rule for rain) does not work, but changing .cxx to .cpp (and
renaming the files) works.

Thanks,

Euan.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-k7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)

-- no debconf information
diff -ur oldprogsdemos/cubemap.c progs/demos/cubemap.c
--- oldprogsdemos/cubemap.c     2006-04-14 16:00:32.000000000 +0100
+++ progs/demos/cubemap.c       2006-04-14 16:02:41.740810185 +0100
@@ -454,6 +454,7 @@
 
 int main( int argc, char *argv[] )
 {
+   glutInit(&argc, argv);
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(600, 500);
    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
diff -ur oldprogsdemos/geartrain.c progs/demos/geartrain.c
--- oldprogsdemos/geartrain.c   2006-04-14 16:00:32.000000000 +0100
+++ progs/demos/geartrain.c     2006-04-14 16:02:41.740810185 +0100
@@ -1058,6 +1058,7 @@
     else
        file = argv[1];
 
+    glutInit(&argc, argv);
     glutInitWindowPosition (0, 0);
     glutInitWindowSize(640,480);
     glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
diff -ur oldprogsdemos/gltestperf.c progs/demos/gltestperf.c
--- oldprogsdemos/gltestperf.c  2003-04-21 15:50:13.000000000 +0100
+++ progs/demos/gltestperf.c    2006-04-14 16:02:41.740810185 +0100
@@ -569,6 +569,7 @@
    if (ac == 2)
       frontbuffer = 0;
 
+   glutInit(&ac, av);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(640, 480);
diff -ur oldprogsdemos/isosurf.c progs/demos/isosurf.c
--- oldprogsdemos/isosurf.c     2003-09-08 15:57:02.000000000 +0100
+++ progs/demos/isosurf.c       2006-04-14 16:02:41.739810356 +0100
@@ -1042,6 +1042,7 @@
 
    read_surface( "isosurf.dat" );
 
+   glutInit(&argc, argv);
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(400, 400);
 
diff -ur oldprogsdemos/Makefile.standalone progs/demos/Makefile.standalone
--- oldprogsdemos/Makefile.standalone   2006-04-14 16:00:32.000000000 +0100
+++ progs/demos/Makefile.standalone     2006-04-14 16:02:41.737810697 +0100
@@ -1,9 +1,18 @@
 TARGETS = $(filter-out osdemo% readtex showbuffer,$(patsubst %.c,%,$(wildcard 
*.c)))
+TARGETS += rain
 
 LDLIBS = -lglut
 
 all : $(TARGETS)
 
+rain.o: rain.cxx
+       $(CXX) -c rain.cxx
+
+particles.o: particles.cxx
+       $(CXX) -c particles.cxx
+
+rain: readtex.o rain.o particles.o
+
 cubemap: cubemap.o readtex.o
 
 readpix: readpix.o readtex.o
@@ -19,4 +28,4 @@
 tunnel2: tunnel2.o readtex.o
 
 clean:
-       $(RM) $(TARGETS)
+       $(RM) $(TARGETS) *.o
diff -ur oldprogsdemos/morph3d.c progs/demos/morph3d.c
--- oldprogsdemos/morph3d.c     2006-04-14 16:00:32.000000000 +0100
+++ progs/demos/morph3d.c       2006-04-14 16:02:41.739810356 +0100
@@ -887,6 +887,7 @@
 
 int main(int argc, char **argv)
 {
+  glutInit(&argc, argv);
   INIT();
   return(0);
 }
diff -ur oldprogsdemos/rain.cxx progs/demos/rain.cxx
--- oldprogsdemos/rain.cxx      2002-01-16 00:48:43.000000000 +0000
+++ progs/demos/rain.cxx        2006-04-14 16:02:41.738810526 +0100
@@ -8,6 +8,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <math.h>
 #include <time.h>
 #include <GL/glut.h>
@@ -353,9 +354,9 @@
   WIDTH=640;
   HEIGHT=480;
 
+  glutInit(&ac,av);
   glutInitWindowPosition(0,0);
   glutInitWindowSize(WIDTH,HEIGHT);
-  glutInit(&ac,av);
 
   glutInitDisplayMode(GLUT_RGB|GLUT_DEPTH|GLUT_DOUBLE);
 
diff -ur oldprogsdemos/winpos.c progs/demos/winpos.c
--- oldprogsdemos/winpos.c      2003-06-05 01:50:23.000000000 +0100
+++ progs/demos/winpos.c        2006-04-14 16:02:41.739810356 +0100
@@ -100,6 +100,7 @@
 
 int main( int argc, char *argv[] )
 {
+   glutInit(&argc, argv);
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(500, 500);
    glutInitDisplayMode( GLUT_RGB );

Reply via email to