Changeset 831
- Timestamp:
- 08/11/07 11:48:14
- Files:
-
- buildout/pcl.buildout/trunk/dependencies.cfg (modified) (2 diffs)
- buildout/pcl.buildout/trunk/hooks/gdal.py (modified) (2 diffs)
- buildout/pcl.buildout/trunk/hooks/mapserver.py (modified) (1 diff)
- buildout/pcl.buildout/trunk/pcl-core.cfg (modified) (1 diff)
- buildout/pcl.buildout/trunk/pcl-gdal.cfg (modified) (1 diff)
- buildout/pcl.buildout/trunk/pcl-mapserver.cfg (modified) (1 diff)
- buildout/pcl.buildout/trunk/README.txt (modified) (2 diffs)
- buildout/pcl.buildout/trunk/setenv (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
buildout/pcl.buildout/trunk/dependencies.cfg
r828 r831 81 81 include-dirs = ${postgresql:location}/include 82 82 library-dirs = ${postgresql:location}/lib 83 rpath = ${postgresql:location}/lib 83 84 84 85 [proj] … … 101 102 --with-pg=${postgresql:location}/bin/pg_config 102 103 --with-png=${libpng:location} 104 --with-jpeg=${libjpeg:location} 103 105 --with-gif=${libgif:location} 104 106 --with-tiff=${libtiff:location} 107 --with-curl=${curl:location}/bin/curl-config 105 108 PYTHON=${custom-python:executable} 106 109 make-targets = buildout/pcl.buildout/trunk/hooks/gdal.py
r792 r831 1 1 import logging 2 import shutil 2 3 import os 4 import re 3 5 4 6 import zc.buildout … … 6 8 log = logging.getLogger('GDAL hook') 7 9 10 def substitute(filename, search_re, replacement): 11 """Substitutes text within the contents of ``filename`` matching 12 ``search_re`` with ``replacement``. 13 """ 14 search = re.compile(search_re, re.MULTILINE) 15 text = open(filename).read() 16 text = replacement.join(search.split(text)) 17 18 newfilename = '%s%s' % (filename, '.~new') 19 newfile = open(newfilename, 'w') 20 newfile.write(text) 21 newfile.close() 22 shutil.copymode(filename, newfilename) 23 shutil.move(newfilename, filename) 24 25 8 26 def post_make(options, buildout): 9 27 """Custom post-make hook for bulding GDAL python bindings.""" 28 # Generate rpath information.. 29 rpath = ['%s/lib' % buildout[part]['location'] 30 for part 31 in ('geos','proj','postgresql','libpng','libtiff','libgif','libjpeg','curl') 32 ] + ['%s/lib' % options['location']] 33 34 # ..and push it into the setup file 35 substitute('setup.py', 36 'extra_link_args=EXTRA_LINK_ARGS,', 37 'extra_link_args=EXTRA_LINK_ARGS, runtime_library_dirs=%s' % str(rpath)) 38 10 39 cmd = '%s setup.py install' % buildout[buildout['buildout']['python']]['executable'] 11 40 log.info('Installing GDAL python bindings') buildout/pcl.buildout/trunk/hooks/mapserver.py
r792 r831 41 41 here = os.getcwd() 42 42 os.chdir('mapscript/python') 43 43 44 try: 44 45 log.info('Installing python mapscript') 46 47 # Generate rpath information.. 48 rpath = ['%s/lib' % buildout[part]['location'] 49 for part 50 in ('geos','proj','postgresql','libpng','libtiff','libgif', 51 'libjpeg','curl','postgis','libgd','freetype','gdal') 52 ] 53 54 # ..and push it into the setup file 55 substitute('setup.py', 56 'extra_link_args = extras,', 57 'extra_link_args = extras, runtime_library_dirs=%s' % str(rpath)) 58 45 59 run('%s -modern -python -o mapscript_wrap.c ../mapscript.i' % options['swig']) 46 60 run('%s setup.py install' % buildout[buildout['buildout']['python']]['executable']) buildout/pcl.buildout/trunk/pcl-core.cfg
r818 r831 35 35 ${geos:location}/lib 36 36 ${proj:location}/lib 37 rpath = 38 ${geos:location}/lib 39 ${proj:location}/lib 37 40 38 41 [test-pcl-core] buildout/pcl.buildout/trunk/pcl-gdal.cfg
r792 r831 37 37 ${gdal:location}/lib 38 38 ${proj:location}/lib 39 rpath = 40 ${proj:location}/lib 41 ${libpng:location}/lib 42 ${libgif:location}/lib 43 ${libtiff:location}/lib 44 ${gdal:location}/lib 45 ${postgresql:location}/lib 39 46 40 47 [test-pcl-gdal] buildout/pcl.buildout/trunk/pcl-mapserver.cfg
r792 r831 41 41 library-dirs = 42 42 ${geos:location}/lib 43 rpath = 44 ${curl:location}/lib 45 ${geos:location}/lib 46 ${proj:location}/lib 47 ${libgd:location}/lib 48 43 49 swig = ${swig:location}/bin/swig 44 50 swig-opts = -python -modern -keyword buildout/pcl.buildout/trunk/README.txt
r826 r831 30 30 $ python bootstrap.py 31 31 $ ./bin/buildout 32 $ . ./setenv33 32 $ python init_postgresql.py 34 33 $ ./bin/test_core … … 116 115 117 116 118 Setting up the search path for dynamic libraries119 ------------------------------------------------120 121 Because many of the dependencies contain libraries that are installed122 within the buildout sandbox, we need to tell the dynamic linker where123 to find these libraries.124 125 Some of the components are smart enough to use the information126 provided during the make process, but the rest of them must be told127 explicitly. The easiest and non-intrusive way to do this is to use an128 environment variable.129 130 On Linux (and possibly other *nix systems) you must use131 132 LD_LIBRARY_PATH133 134 on Max OS X135 136 DYLD_LIBRARY_PATH137 138 Check your operating system documentation for the correct environment139 variable to use. The contents of the variable should be a colon140 separated list of filesystem location containing the libraries.141 142 There is a helper script ``setenv`` that will set the paths for143 you. You need to check and possibly modify it to make sure it sets the144 correct environment variable variable for your system. The script145 already contains options for some environments so can simply uncomment146 the one suitable for you.147 148 On a Linux system using ``bash`` for a shell you can simply do::149 150 $ . ./setenv151 152 which will set your environment. You can check this by running::153 154 $ env | grep LD_LIBRARY_PATH155 156 157 117 Setting up PostgreSQL 158 118 ---------------------
