[GRASS-SVN] r37703 - in grass/trunk/gui/wxpython: . nviz vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 2 07:11:27 EDT 2009
Author: glynn
Date: 2009-06-02 07:11:27 -0400 (Tue, 02 Jun 2009)
New Revision: 37703
Modified:
grass/trunk/gui/wxpython/build_ext.py
grass/trunk/gui/wxpython/nviz/Makefile
grass/trunk/gui/wxpython/nviz/setup.py
grass/trunk/gui/wxpython/vdigit/Makefile
grass/trunk/gui/wxpython/vdigit/setup.py
Log:
Don't try to parse *.make files; use environment variables
Modified: grass/trunk/gui/wxpython/build_ext.py
===================================================================
--- grass/trunk/gui/wxpython/build_ext.py 2009-06-02 10:22:04 UTC (rev 37702)
+++ grass/trunk/gui/wxpython/build_ext.py 2009-06-02 11:11:27 UTC (rev 37703)
@@ -3,28 +3,8 @@
import os
import sys
-def __read_variables(file, dict={}):
- """!Read variables from file (e.g. Platform.make)
-
- @param file file descriptor
- @param dict dictionary to store (variable, value)
- """
- for line in file.readlines():
- if len(line) < 1:
- continue # skip empty lines
- if line[0] == '#':
- continue # skip comments
- try:
- var, val = line.split('=', 1)
- except ValueError:
- continue
-
- dict[var.strip()] = val.strip()
-
-def update_opts(flag, macros, inc_dirs, lib_dirs, libs, extras):
+def update_opts(line, macros, inc_dirs, lib_dirs, libs, extras):
"""!Update Extension options"""
- global variables
- line = variables[flag]
fw_next = False
for val in line.split(' '):
key = val[:2]
@@ -47,16 +27,3 @@
elif val == '-framework':
extras.append(val)
fw_next = True
-
-try:
- Platform_make = open(os.path.join(os.path.normpath(os.getenv('MODULE_TOPDIR')),
- 'include', 'Make', 'Platform.make'))
- Grass_make = open(os.path.join(os.path.normpath(os.getenv('MODULE_TOPDIR')),
- 'include', 'Make', 'Grass.make'))
-except IOError, e:
- print 'Unable to compile wxGUI vdigit extension.\n\n', e
- sys.exit(1)
-
-variables = {}
-__read_variables(Platform_make, variables)
-__read_variables(Grass_make, variables)
Modified: grass/trunk/gui/wxpython/nviz/Makefile
===================================================================
--- grass/trunk/gui/wxpython/nviz/Makefile 2009-06-02 10:22:04 UTC (rev 37702)
+++ grass/trunk/gui/wxpython/nviz/Makefile 2009-06-02 11:11:27 UTC (rev 37703)
@@ -35,7 +35,17 @@
$(LIB_NAME).py: $(SHLIB)
$(SHLIB): $(LIB_NAME).i
- ARCH_DISTDIR=$(ARCH_DISTDIR) GISBASE=$(GISBASE) \
+ GISBASE="$(GISBASE)" \
+ ARCH_DISTDIR="$(ARCH_DISTDIR)" \
+ GDALCFLAGS="$(GDALCFLAGS)" \
+ GDALLIBS="$(GDALLIBS)" \
+ WXWIDGETSCXXFLAGS="$(WXWIDGETSCXXFLAGS)" \
+ OPENGLINC="$(OPENGLINC)" \
+ OPENGLLIB="$(OPENGLLIB)" \
+ OPENGLULIB="$(OPENGLULIB)" \
+ WXWIDGETSLIB="$(WXWIDGETSLIB)" \
+ OPENGL_X11="$(OPENGL_X11)" \
+ XCFLAGS="$(XCFLAGS)" \
python setup.py build_ext --swig=$(SWIG) --swig-opts=-c++ --build-lib=$(OBJDIR) --build-temp=$(OBJDIR)
.NOTPARALLEL: $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
Modified: grass/trunk/gui/wxpython/nviz/setup.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/setup.py 2009-06-02 10:22:04 UTC (rev 37702)
+++ grass/trunk/gui/wxpython/nviz/setup.py 2009-06-02 11:11:27 UTC (rev 37703)
@@ -6,16 +6,15 @@
import sys
sys.path.append('..')
-from build_ext import variables
from build_ext import update_opts
from distutils.core import setup, Extension
macros = [('PACKAGE', '"grasslibs"')]
-inc_dirs = [os.path.join(os.path.normpath(os.environ['ARCH_DISTDIR']), 'include'),
- os.path.join(os.path.normpath(os.environ['GISBASE']), 'include')]
-lib_dirs = [os.path.join(os.path.normpath(os.environ['ARCH_DISTDIR']), 'lib'),
- os.path.join(os.path.normpath(os.environ['GISBASE']), 'lib')]
+inc_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'include'),
+ os.path.join(os.path.normpath(os.getenv('GISBASE')), 'include')]
+lib_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'lib'),
+ os.path.join(os.path.normpath(os.getenv('GISBASE')), 'lib')]
libs = ['grass_gis',
'grass_nviz',
'grass_ogsf',
@@ -28,12 +27,11 @@
'OPENGLINC',
'OPENGLLIB',
'OPENGLULIB']:
- update_opts(flag, macros, inc_dirs, lib_dirs, libs, extras)
+ update_opts(os.getenv(flag), macros, inc_dirs, lib_dirs, libs, extras)
if sys.platform != 'darwin':
- update_opts('WXWIDGETSLIB', macros, inc_dirs, lib_dirs, libs, extras)
-if variables['OPENGL_X11'] == '1':
- for flag in ['XCFLAGS']:
- update_opts(flag, macros, inc_dirs, lib_dirs, libs, extras)
+ update_opts(os.getenv('WXWIDGETSLIB'), macros, inc_dirs, lib_dirs, libs, extras)
+if os.getenv('OPENGL_X11') == '1':
+ update_opts(os.getenv('XCFLAGS'), macros, inc_dirs, lib_dirs, libs, extras)
setup(
ext_modules= [
Modified: grass/trunk/gui/wxpython/vdigit/Makefile
===================================================================
--- grass/trunk/gui/wxpython/vdigit/Makefile 2009-06-02 10:22:04 UTC (rev 37702)
+++ grass/trunk/gui/wxpython/vdigit/Makefile 2009-06-02 11:11:27 UTC (rev 37703)
@@ -33,7 +33,13 @@
$(LIB_NAME).py: $(SHLIB)
$(SHLIB): $(LIB_NAME).i
- ARCH_DISTDIR=$(ARCH_DISTDIR) GISBASE=$(GISBASE) \
+ GISBASE="$(GISBASE)" \
+ ARCH_DISTDIR="$(ARCH_DISTDIR)" \
+ GDALCFLAGS="$(GDALCFLAGS)" \
+ GDALLIBS="$(GDALLIBS)" \
+ GEOSCFLAGS="$(GEOSCFLAGS)" \
+ WXWIDGETSCXXFLAGS="$(WXWIDGETSCXXFLAGS)" \
+ WXWIDGETSLIB="$(WXWIDGETSLIB)" \
python setup.py build_ext --swig=$(SWIG) --swig-opts=-c++ --build-lib=$(OBJDIR) --build-temp=$(OBJDIR)
.NOTPARALLEL: $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
Modified: grass/trunk/gui/wxpython/vdigit/setup.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/setup.py 2009-06-02 10:22:04 UTC (rev 37702)
+++ grass/trunk/gui/wxpython/vdigit/setup.py 2009-06-02 11:11:27 UTC (rev 37703)
@@ -11,10 +11,10 @@
from distutils.core import setup, Extension
macros = [('PACKAGE', '"grasslibs"')]
-inc_dirs = [os.path.join(os.path.normpath(os.environ['ARCH_DISTDIR']), 'include'),
- os.path.join(os.path.normpath(os.environ['GISBASE']), 'include')]
-lib_dirs = [os.path.join(os.path.normpath(os.environ['ARCH_DISTDIR']), 'lib'),
- os.path.join(os.path.normpath(os.environ['GISBASE']), 'lib')]
+inc_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'include'),
+ os.path.join(os.path.normpath(os.getenv('GISBASE')), 'include')]
+lib_dirs = [os.path.join(os.path.normpath(os.getenv('ARCH_DISTDIR')), 'lib'),
+ os.path.join(os.path.normpath(os.getenv('GISBASE')), 'lib')]
libs = ['grass_dbmibase',
'grass_dbmiclient',
'grass_vect',
@@ -22,13 +22,13 @@
'grass_vedit']
extras = []
-for flag in ('GDALCFLAGS',
+for flag in ['GDALCFLAGS',
'GDALLIBS',
'GEOSCFLAGS',
- 'WXWIDGETSCXXFLAGS'):
- update_opts(flag, macros, inc_dirs, lib_dirs, libs, extras)
+ 'WXWIDGETSCXXFLAGS']:
+ update_opts(os.getenv(flag), macros, inc_dirs, lib_dirs, libs, extras)
if sys.platform != 'darwin':
- update_opts('WXWIDGETSLIB', macros, inc_dirs, lib_dirs, libs, extras)
+ update_opts(os.getenv('WXWIDGETSLIB'), macros, inc_dirs, lib_dirs, libs, extras)
setup(
ext_modules= [
@@ -56,3 +56,4 @@
)
]
)
+
More information about the grass-commit
mailing list