/[thuban]/branches/WIP-pyshapelib-bramz/setup.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/setup.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/thuban/setup.py revision 2651 by bh, Tue Jul 5 20:24:50 2005 UTC branches/WIP-pyshapelib-bramz/setup.py revision 2742 by bramz, Wed Mar 14 16:26:14 2007 UTC
# Line 86  elif os.name == "nt": Line 86  elif os.name == "nt":
86      basedir = os.path.dirname(sys.argv[0])      basedir = os.path.dirname(sys.argv[0])
87    
88      # Directories where Proj4 is installed      # Directories where Proj4 is installed
89      proj4_prefix = os.path.join(basedir, "..", "proj-4.4.7", "src")      proj4_prefix = os.path.join(basedir, "..", "proj-4.4.9", "src")
90      proj4_incdir =  proj4_prefix      proj4_incdir =  proj4_prefix
91      proj4_libdir =  proj4_prefix      proj4_libdir =  proj4_prefix
92      proj4_lib = "proj_i"      proj4_lib = "proj_i"
93    
94      # Define include and lib directories for wxWindows and      # Define include and lib directories for wxWindows and
95      wx_prefix = os.path.join(basedir, "..", "wxPython-2.4.2.4")      wx_prefix = os.path.join(basedir, "..", "wxPython-2.6.3.3")
96      wx_inc = [os.path.join(wx_prefix, 'lib', 'mswdllh'),      wx_inc = [os.path.join(wx_prefix, 'lib', 'vc_dll', 'mswuh'),
97                os.path.join(wx_prefix, "include")]                os.path.join(wx_prefix, "include")]
98      wx_lib = [os.path.join(wx_prefix, "lib")]      wx_lib = [os.path.join(wx_prefix, "lib", "vc_dll")]
99    
100      # Define include and lib directories for GDAL      # Define include and lib directories for GDAL
101      gdal_prefix = os.path.join(basedir, "..", "gdal-1.1.8")      gdal_prefix = os.path.join(basedir, "..", "gdal-1.3.2")
102      gdal_inc = [os.path.join(gdal_prefix, 'alg'),      gdal_inc = [os.path.join(gdal_prefix, 'alg'),
103                  os.path.join(gdal_prefix, 'ogr'),                  os.path.join(gdal_prefix, 'ogr'),
104                  os.path.join(gdal_prefix, 'port'),                  os.path.join(gdal_prefix, 'port'),
105                    os.path.join(gdal_prefix, 'gcore'),
106                  os.path.join(gdal_prefix, 'core')]                  os.path.join(gdal_prefix, 'core')]
107      gdal_lib = [gdal_prefix]      gdal_lib = [gdal_prefix]
108    
# Line 153  elif os.name == "nt": Line 154  elif os.name == "nt":
154            
155      wx_cs_params[CS_INCDIRS] = wx_inc      wx_cs_params[CS_INCDIRS] = wx_inc
156      wx_cs_params[CS_LIBDIRS] = wx_lib      wx_cs_params[CS_LIBDIRS] = wx_lib
157      wx_cs_params[CS_LIBS] = ["wxmsw24h"] \      wx_cs_params[CS_LIBS] = ["wxmsw26uh"] \
158                        + ['kernel32', 'user32', 'gdi32', 'comdlg32',                        + ['kernel32', 'user32', 'gdi32', 'comdlg32',
159                           'winspool', 'winmm', 'shell32', 'oldnames',                           'winspool', 'winmm', 'shell32', 'oldnames',
160                           'comctl32', 'ctl3d32', 'odbc32', 'ole32', 'oleaut32',                           'comctl32', 'odbc32', 'ole32', 'oleaut32',
161                           'uuid', 'rpcrt4', 'advapi32', 'wsock32']                           'uuid', 'rpcrt4', 'advapi32', 'wsock32']
162    
163      gdal_config_script = ""      gdal_config_script = ""
# Line 268  extensions.append(wxproj_extension) Line 269  extensions.append(wxproj_extension)
269  # shapelib wrappers are also distributed with thuban  # shapelib wrappers are also distributed with thuban
270  #  #
271    
272  extensions.append(Extension("Lib.shapelibc",  extensions.append(Extension("Lib.shapelib",
273                              [ext_dir + "/pyshapelib/shapelib_wrap.c",                              [ext_dir + "/pyshapelib/shapelibmodule.c",
274                               shp_dir + "/shpopen.c",                               shp_dir + "/shpopen.c",
275                               shp_dir + "/shptree.c"],                               shp_dir + "/shptree.c"],
276                              include_dirs = [shp_dir]))                              include_dirs = [shp_dir]))
277  extensions.append(Extension("Lib.shptree",  extensions.append(Extension("Lib.shptree",
278                              [ext_dir + "/pyshapelib/shptreemodule.c"],                              [ext_dir + "/pyshapelib/shptreemodule.c"],
279                              include_dirs = [shp_dir]))                              include_dirs = [shp_dir]))
280  extensions.append(Extension("Lib.dbflibc",  extensions.append(Extension("Lib.dbflib",
281                              [ext_dir + "/pyshapelib/dbflib_wrap.c",                              [ext_dir + "/pyshapelib/dbflibmodule.c",
282                               shp_dir + "/dbfopen.c"],                               shp_dir + "/dbfopen.c"],
283                              include_dirs = [shp_dir],                              include_dirs = [shp_dir],
284                              define_macros = [("HAVE_UPDATE_HEADER", "1")]))                              define_macros = [("HAVE_UPDATE_HEADER", "1")]))
285  for name in ("shapelib", "dbflib"):  
     py_modules.append(ext_dir + "/pyshapelib/" + name)  
286    
287  #  #
288  # PROJ4 bindings are also distributed with thuban  # PROJ4 bindings are also distributed with thuban
# Line 319  if os.path.isdir("Resources/Locale"): Line 319  if os.path.isdir("Resources/Locale"):
319          data_files.append(("Resources/Locale/" + d +"/LC_MESSAGES",          data_files.append(("Resources/Locale/" + d +"/LC_MESSAGES",
320                             ["Resources/Locale/"+ d +"/LC_MESSAGES/thuban.mo"]))                             ["Resources/Locale/"+ d +"/LC_MESSAGES/thuban.mo"]))
321    
322    #add the Lib content to the output
323    if os.path.isdir("Lib"):
324            for d in os.listdir("Lib"):
325                    data_files.append(("Lib", ["Lib/"+d]))
326    
327    
328  #  #
329  #       Command definitions  #       Command definitions
330  #  #
# Line 925  class bdist_inno(Command): Line 931  class bdist_inno(Command):
931          if self.output_basename is None:          if self.output_basename is None:
932              self.output_basename = "%s-%s-%d" \              self.output_basename = "%s-%s-%d" \
933                                     % (name, self.distribution.get_version(),                                     % (name, self.distribution.get_version(),
934                                        self.iss_revision)                                        int(self.iss_revision))
935    
936      def run(self, install_options = None):      def run(self, install_options = None):
937          """Execute the command. install_options if given, should be a          """Execute the command. install_options if given, should be a
938          directory of additional options to set in the install step"""          directory of additional options to set in the install step"""
939          # Obviously have to build before we can install          # Obviously have to build before we can install
940    
941            # add gdal to the build
942            for (dirpath, dnames, fnames) in os.walk('gdal'):                      
943                    files_in_dir = []
944                    dp = '/'.join(dirpath.split('\\'))
945                    for f in fnames:
946                            if os.path.isfile(os.path.join(dirpath,f)):                    
947                                    files_in_dir.append( dp + '/' + f)              
948                    if len(files_in_dir) > 0:
949                            data_files.append(( dp , files_in_dir))
950            # add thubaninit to the build
951    
952    
953          if not self.skip_build:          if not self.skip_build:
954              self.run_command('build')              self.run_command('build')
955    
# Line 1050  class thuban_bdist_inno(bdist_inno): Line 1068  class thuban_bdist_inno(bdist_inno):
1068              "warn_dir": 0,              "warn_dir": 0,
1069              "extra_files": ["COPYING", "Lib/proj.dll"],              "extra_files": ["COPYING", "Lib/proj.dll"],
1070              }              }
1071            install_options["extra_files"].extend(self.get_gdal_content())
1072    
1073          # don't make a symlink because we're simulating windows, so          # don't make a symlink because we're simulating windows, so
1074          # that we can generate the iss-file even on Linux          # that we can generate the iss-file even on Linux
1075          install_options["do_symlink"] = 0          install_options["do_symlink"] = 0
1076    
1077          bdist_inno.run(self, install_options)          bdist_inno.run(self, install_options)
1078    
1079        def get_gdal_content(self):
1080            '''
1081            Return the list of files in the gdal directory of the Thuban installation
1082            '''
1083            gdal_files = []
1084            for (dirpath, dnames, fnames) in os.walk('gdal'):                  
1085                if len(fnames) > 0:
1086                    for file in fnames :
1087                        gdal_files.append(dirpath + os.sep + file)
1088            return gdal_files
1089    
1090  class thuban_build_docs(Command):  class thuban_build_docs(Command):
1091    
1092      """Command to generate documentation from source code."""      """Command to generate documentation from source code."""
# Line 1134  Thuban is a viewer for geographic data w Line 1165  Thuban is a viewer for geographic data w
1165  """  """
1166    
1167  setup(name = "Thuban",  setup(name = "Thuban",
1168        version = "1.1.0",        version = "1.2.0",
1169        description = "Geographic data viewer",        description = "Geographic data viewer",
1170        long_description = long_description,        long_description = long_description,
1171        license = "GPL",        license = "GPL",
# Line 1145  setup(name = "Thuban", Line 1176  setup(name = "Thuban",
1176        scripts = ["thuban.py"],        scripts = ["thuban.py"],
1177        packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI",        packages = ["Thuban", "Thuban.Lib", "Thuban.Model", "Thuban.UI",
1178                    "Extensions", "Extensions.gns2shp", "Extensions.wms",                    "Extensions", "Extensions.gns2shp", "Extensions.wms",
1179                    "Extensions.importAPR", "Extensions.profiling"],                    "Extensions.importAPR", "Extensions.profiling",
1180                              "Extensions.svgexport", "Extensions.mouseposition",
1181                              "Extensions.bboxdump", "Extensions.ogr",
1182                      "Extensions.umn_mapserver"],
1183        ext_modules = extensions,        ext_modules = extensions,
1184        py_modules = py_modules,        py_modules = py_modules,
1185        data_files = data_files,        data_files = data_files,
# Line 1159  setup(name = "Thuban", Line 1193  setup(name = "Thuban",
1193                    "install_lib": "$base/lib/thuban",                    "install_lib": "$base/lib/thuban",
1194                    "install_scripts": "$base/lib/thuban",                    "install_scripts": "$base/lib/thuban",
1195                    "install_data": "$base/lib/thuban",                    "install_data": "$base/lib/thuban",
   
1196                    # Don't print warning messages about the lib dir not                    # Don't print warning messages about the lib dir not
1197                    # being on Python's path. The libraries are Thuban                    # being on Python's path. The libraries are Thuban
1198                    # specific and are installed just for Thuban. They'll                    # specific and are installed just for Thuban. They'll

Legend:
Removed from v.2651  
changed lines
  Added in v.2742

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26