Changeset 831

Show
Ignore:
Timestamp:
08/11/07 11:48:14
Author:
dokai
Message:

Added rpath configuration for all relevant components. It is no longer necessary to set LD_LIBRARY_PATH.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • buildout/pcl.buildout/trunk/dependencies.cfg

    r828 r831  
    8181include-dirs = ${postgresql:location}/include 
    8282library-dirs = ${postgresql:location}/lib 
     83rpath = ${postgresql:location}/lib 
    8384 
    8485[proj] 
     
    101102    --with-pg=${postgresql:location}/bin/pg_config 
    102103    --with-png=${libpng:location} 
     104    --with-jpeg=${libjpeg:location} 
    103105    --with-gif=${libgif:location} 
    104106    --with-tiff=${libtiff:location} 
     107    --with-curl=${curl:location}/bin/curl-config 
    105108    PYTHON=${custom-python:executable} 
    106109make-targets = 
  • buildout/pcl.buildout/trunk/hooks/gdal.py

    r792 r831  
    11import logging 
     2import shutil 
    23import os 
     4import re 
    35 
    46import zc.buildout 
     
    68log = logging.getLogger('GDAL hook') 
    79 
     10def 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 
    826def post_make(options, buildout): 
    927    """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     
    1039    cmd = '%s setup.py install' % buildout[buildout['buildout']['python']]['executable'] 
    1140    log.info('Installing GDAL python bindings') 
  • buildout/pcl.buildout/trunk/hooks/mapserver.py

    r792 r831  
    4141    here = os.getcwd() 
    4242    os.chdir('mapscript/python') 
     43 
    4344    try: 
    4445        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 
    4559        run('%s -modern -python -o mapscript_wrap.c ../mapscript.i' % options['swig']) 
    4660        run('%s setup.py install' % buildout[buildout['buildout']['python']]['executable']) 
  • buildout/pcl.buildout/trunk/pcl-core.cfg

    r818 r831  
    3535    ${geos:location}/lib 
    3636    ${proj:location}/lib 
     37rpath =  
     38    ${geos:location}/lib 
     39    ${proj:location}/lib 
    3740 
    3841[test-pcl-core] 
  • buildout/pcl.buildout/trunk/pcl-gdal.cfg

    r792 r831  
    3737    ${gdal:location}/lib 
    3838    ${proj:location}/lib 
     39rpath =  
     40    ${proj:location}/lib 
     41    ${libpng:location}/lib 
     42    ${libgif:location}/lib 
     43    ${libtiff:location}/lib 
     44    ${gdal:location}/lib 
     45    ${postgresql:location}/lib 
    3946 
    4047[test-pcl-gdal] 
  • buildout/pcl.buildout/trunk/pcl-mapserver.cfg

    r792 r831  
    4141library-dirs = 
    4242    ${geos:location}/lib 
     43rpath = 
     44    ${curl:location}/lib 
     45    ${geos:location}/lib 
     46    ${proj:location}/lib 
     47    ${libgd:location}/lib 
     48 
    4349swig = ${swig:location}/bin/swig 
    4450swig-opts = -python -modern -keyword 
  • buildout/pcl.buildout/trunk/README.txt

    r826 r831  
    3030 $ python bootstrap.py 
    3131 $ ./bin/buildout 
    32  $ . ./setenv 
    3332 $ python init_postgresql.py 
    3433 $ ./bin/test_core 
     
    116115 
    117116 
    118 Setting up the search path for dynamic libraries 
    119 ------------------------------------------------ 
    120  
    121 Because many of the dependencies contain libraries that are installed 
    122 within the buildout sandbox, we need to tell the dynamic linker where 
    123 to find these libraries. 
    124  
    125 Some of the components are smart enough to use the information 
    126 provided during the make process, but the rest of them must be told 
    127 explicitly. The easiest and non-intrusive way to do this is to use an 
    128 environment variable. 
    129  
    130 On Linux (and possibly other *nix systems) you must use 
    131  
    132   LD_LIBRARY_PATH 
    133  
    134 on Max OS X 
    135  
    136   DYLD_LIBRARY_PATH 
    137  
    138 Check your operating system documentation for the correct environment 
    139 variable to use. The contents of the variable should be a colon 
    140 separated list of filesystem location containing the libraries. 
    141  
    142 There is a helper script ``setenv`` that will set the paths for 
    143 you. You need to check and possibly modify it to make sure it sets the 
    144 correct environment variable variable for your system. The script 
    145 already contains options for some environments so can simply uncomment 
    146 the one suitable for you. 
    147  
    148 On a Linux system using ``bash`` for a shell you can simply do:: 
    149  
    150   $ . ./setenv 
    151  
    152 which will set your environment. You can check this by running:: 
    153  
    154   $ env | grep LD_LIBRARY_PATH 
    155  
    156  
    157117Setting up PostgreSQL 
    158118---------------------