[GRASS-dev] gis.m patch

Huidae Cho grass4u at gmail.com
Sun Sep 3 13:23:52 EDT 2006


On Sat, Sep 02, 2006 at 01:06:50PM -0700, Michael Barton wrote:
> This is GREAT. Thanks very much. I have a couple questions.
> 
> 1. Is there a binary version of this available for people to try?

No, not yet.  Since the native winGRASS runs on MSys, users need to
install various MSys/GnuWin32 packages as well as GRASS.  I want to
distribute a whole system including MSys/GnuWin32 binaries, but I'm not
sure about license issues related to redistribution.  It looks like most
of packages are under GPL licenses, so can I?  It could be really
annoying for non-techy users to choose right packages from their sites
(it's not like Cygwin).

> 2. Do your changes affect how gism runs on any other platform?

No. It shouldn't because what I've done is to change /dev/null to nul
only if its platform is MSys.

> 3. Could you give me a brief one-liner of what each change to gism is
> intended to do so I can find a way to keep this in the code if it does have
> issues on other platforms?

As mentioned above, the only problem was the null device.  On Windows,
it's called "nul" and that's the only change that I made.

> 4. Does NVIZ work?
> 

No.  The configure message below is misleading because I tried to use
libW11, which WAS part of grass5.

> Great news (even though I don't use Windows)

Me neither except for building winGRASS :-(.

Huidae

> 
> Michael
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution & Social Change
> Center for Social Dynamics & Complexity
> Arizona State University
> 
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
> 
> 
> 
> > From: Huidae Cho <grass4u at gmail.com>
> > Date: Sat, 2 Sep 2006 01:32:19 -0500
> > To: <grass-dev at grass.itc.it>
> > Subject: [GRASS-dev] gis.m patch
> > 
> > Hi,
> > 
> > I've patched gis.m so that it can run on Windows natively with the help
> > of direct rendering.  PDCurses lets the user to start in text mode, but
> > since there are no monitors available, gis.m is the only option for now.
> > 
> > http://geni.ath.cx/grass/native_wingrass.png shows gis.m running on
> > MS-Windows (not Cygwin).
> > 
> > Huidae
> > 
> > GRASS is now configured for:  i686-pc-mingw32
> > 
> >  Source directory:            /home/song/usr/grass/grass6
> >  Build directory:             /home/song/usr/grass/grass6
> >  Installation directory:      /usr/local/grass-6.3.cvs
> >  Startup script in directory: ${exec_prefix}/bin
> >  C compiler:                  gcc -g -O2  -D__W98__
> >  C++ compiler:                c++ -g -O2
> >  FORTRAN compiler:
> >  Building shared libraries:   yes
> >  64bit support:               no
> >  OpenGL platform:             Windows
> > 
> >   NVIZ:                       yes
> > 
> >   BLAS support:               no
> >   C++ support:                yes
> >   DWG support:                no
> >   FFMPEG support:             no
> >   FFTW support:               yes
> >   FreeType support:           yes
> >   GDAL support:               yes
> >   GLw support:                no
> >   JPEG support:               yes
> >   LAPACK support:             no
> >   Large File Support (LFS):   no
> >   Motif support:              no
> >   MySQL support:              no
> >   NLS support:                no
> >   ODBC support:               no
> >   OGR support:                yes
> >   OpenGL support:             yes
> >   PNG support:                yes
> >   PostgreSQL support:         yes
> >   Python support:             no
> >   Readline support:           yes
> >   SQLite support:             yes
> >   Tcl/Tk support:             yes
> >   TIFF support:               yes
> >   X11 support:                yes
> > 
> > 
> > Index: gui/tcltk/gis.m/gm.tcl
> > ===================================================================
> > RCS file: /grassrepository/grass6/gui/tcltk/gis.m/gm.tcl,v
> > retrieving revision 1.25
> > diff -u -r1.25 gm.tcl
> > --- gui/tcltk/gis.m/gm.tcl 24 Aug 2006 18:04:57 -0000 1.25
> > +++ gui/tcltk/gis.m/gm.tcl 2 Sep 2006 06:00:41 -0000
> > @@ -69,6 +69,12 @@
> >      set execom "spawn"
> >  }
> >  
> > +if {[info exists env(MSYSCON)]} {
> > +    set mingw "1"
> > +} {
> > +    set mingw "0"
> > +}
> > +
> >  #fetch GRASS Version number:
> >  set fp [open $env(GISBASE)/etc/VERSIONNUMBER r]
> >  set GRASSVERSION [read -nonewline $fp]
> > @@ -188,7 +194,13 @@
> >  # Determine if an element already exists
> >  
> >  proc Gm::element_exists {elem name} {
> > - set failure [catch {exec [list "|g.findfile" "element=$elem" "file=$name"]
> > >& /dev/null}]
> > + global mingw
> > +
> > + if { $mingw == "1" } {
> > +  set failure [catch {exec [list "|g.findfile" "element=$elem" "file=$name"]
> > >& nul}]
> > + } {
> > +  set failure [catch {exec [list "|g.findfile" "element=$elem" "file=$name"]
> > >& /dev/null}]
> > + }
> >  
> > return [expr {! $failure}]
> >  }
> > Index: gui/tcltk/gis.m/gmmenu.tcl
> > ===================================================================
> > RCS file: /grassrepository/grass6/gui/tcltk/gis.m/gmmenu.tcl,v
> > retrieving revision 1.15
> > diff -u -r1.15 gmmenu.tcl
> > --- gui/tcltk/gis.m/gmmenu.tcl 20 Jul 2006 17:43:19 -0000 1.15
> > +++ gui/tcltk/gis.m/gmmenu.tcl 2 Sep 2006 06:00:41 -0000
> > @@ -19,6 +19,7 @@
> >  global mon
> >  global filename
> >  global env
> > +global mingw
> >  
> >  # Put this at the top of the file menu.
> >  set GuiMenu::Menu_File_Top [subst  {
> > @@ -48,10 +49,20 @@
> >  lappend descmenu all
> >  lappend descmenu options
> >  lappend descmenu $tmenu
> > -lappend descmenu [subst {
> > - {command {[G_msg "GRASS help"]} {} "g.manual" {} -command { exec g.manual -i
> > > /dev/null & } }
> > - {command {[G_msg "GIS Manager &help"]} {} {[G_msg "GIS Manager help"]} {}
> > -command { exec g.manual gis.m > /dev/null & } }
> > - {command {[G_msg "About &GRASS"]} {} {[G_msg "About GRASS"]} {} -command {
> > source $env(GISBASE)/etc/gm/grassabout.tcl} }
> > - {command {[G_msg "About &System"]} {} {[G_msg "About System"]} {} -command {
> > exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}
> > - }]
> >  
> > +# MinGW
> > +if { $mingw == "1" } {
> > + lappend descmenu [subst {
> > +  {command {[G_msg "GRASS help"]} {} "g.manual" {} -command { exec g.manual
> > -i >& nul } }
> > +  {command {[G_msg "GIS Manager &help"]} {} {[G_msg "GIS Manager help"]} {}
> > -command { exec g.manual gis.m >& nul } }
> > +  {command {[G_msg "About &GRASS"]} {} {[G_msg "About GRASS"]} {} -command {
> > source $env(GISBASE)/etc/gm/grassabout.tcl} }
> > +  {command {[G_msg "About &System"]} {} {[G_msg "About System"]} {} -command
> > { exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}
> > +  }]
> > +} {
> > + lappend descmenu [subst {
> > +  {command {[G_msg "GRASS help"]} {} "g.manual" {} -command { exec g.manual
> > -i > /dev/null & } }
> > +  {command {[G_msg "GIS Manager &help"]} {} {[G_msg "GIS Manager help"]} {}
> > -command { exec g.manual gis.m > /dev/null & } }
> > +  {command {[G_msg "About &GRASS"]} {} {[G_msg "About GRASS"]} {} -command {
> > source $env(GISBASE)/etc/gm/grassabout.tcl} }
> > +  {command {[G_msg "About &System"]} {} {[G_msg "About System"]} {} -command
> > { exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}
> > +  }]
> > +}
> > Index: gui/tcltk/gis.m/runandoutput.tcl
> > ===================================================================
> > RCS file: /grassrepository/grass6/gui/tcltk/gis.m/runandoutput.tcl,v
> > retrieving revision 1.12
> > diff -u -r1.12 runandoutput.tcl
> > --- gui/tcltk/gis.m/runandoutput.tcl 27 Aug 2006 21:19:26 -0000 1.12
> > +++ gui/tcltk/gis.m/runandoutput.tcl 2 Sep 2006 06:00:41 -0000
> > @@ -169,11 +169,17 @@
> >  
> >  
> > 
> ##############################################################################>
> #
> >  proc run {cmd args} {
> > + global mingw
> > +
> > # This and runcmd are being used to run command in the background
> > # These used to go to stdout and stderr
> > # but we don't want to pollute that console.
> > # eval exec -- $cmd $args >@ stdout 2>@ stderr
> > - eval [list exec -- $cmd] $args >& /dev/null
> > + if { $mingw == "1" } {
> > +  eval [list exec -- $cmd] $args >& nul
> > + } {
> > +  eval [list exec -- $cmd] $args >& /dev/null
> > + }
> >  }
> >  
> >  
> > 
> ##############################################################################>
> #
> > Index: lib/gtcltk/gronsole.tcl
> > ===================================================================
> > RCS file: /grassrepository/grass6/lib/gtcltk/gronsole.tcl,v
> > retrieving revision 1.6
> > diff -u -r1.6 gronsole.tcl
> > --- lib/gtcltk/gronsole.tcl 27 Aug 2006 21:19:26 -0000 1.6
> > +++ lib/gtcltk/gronsole.tcl 2 Sep 2006 06:00:43 -0000
> > @@ -425,10 +425,16 @@
> >  
> >  proc Gronsole::execout {path cmd ci execcmd} {
> > global env
> > + global mingw
> > +
> > set mark cmdinsert$ci
> >  
> > # Actually run the program
> > - set cmd [concat | $cmd 2>@ stdout]
> > + if { $mingw == "1" } {
> > +  set cmd [concat | $cmd]
> > + } {
> > +  set cmd [concat | $cmd 2>@ stdout]
> > + }
> >  
> > set message_env [exec g.gisenv get=GRASS_MESSAGE_FORMAT]
> >          set env(GRASS_MESSAGE_FORMAT) gui
> > Index: lib/gtcltk/options.tcl
> > ===================================================================
> > RCS file: /grassrepository/grass6/lib/gtcltk/options.tcl,v
> > retrieving revision 1.7
> > diff -u -r1.7 options.tcl
> > --- lib/gtcltk/options.tcl 19 May 2006 21:19:16 -0000 1.7
> > +++ lib/gtcltk/options.tcl 2 Sep 2006 06:00:43 -0000
> > @@ -98,3 +98,9 @@
> >  if { $osxaqua == "1"} {
> >      set keycontrol "Command"
> >  }
> > +
> > +if {[info exists env(MSYSCON)]} {
> > +    set mingw "1"
> > +} else {
> > +    set mingw "0"
> > +}
> > 
> > 
> 




More information about the grass-dev mailing list