Ticket #38626: oracle-instantclient.2.diff

File oracle-instantclient.2.diff, 2.1 KB (added by ryandesign (Ryan Carsten Schmidt), 11 years ago)

fixed string match usage; works with v11 on Intel, not with v10 on PowerPC

  • Portfile

     
    1919if {"powerpc" == ${os.arch}} {
    2020    epoch               1
    2121    version             10.1.0.3
     22    revision            1
    2223    set library_version 10.1
    2324    supported_archs     ppc
    2425    universal_variant   no
     
    4041    livecheck.type      none
    4142} else {
    4243    version             11.2.0.3.0
     44    revision            1
    4345    set library_version 11.1
    4446    supported_archs     x86_64 i386
    4547    variant universal {}
     
    135137set lib_dir             ${prefix}/lib/oracle
    136138
    137139build {
    138     # Oracle builds the libraries with strange install_names, which we fix, for
    139     # neatness. Unfortunately users must still set DYLD_LIBRARY_PATH in their
    140     # environment because one of the libraries, libociei, is dynamically loaded
    141     # at runtime rather than being linked to.
    142140    foreach my_arch ${configure.universal_archs} {
     141        # Oracle builds the libraries with strange install_names; fix them.
    143142        # For each dylib, change the directory of its install_name to ${lib_dir}.
    144143        foreach lib [glob -directory ${workpath}/build/${my_arch} *.dylib*] {
    145144            system "install_name_tool -id ${lib_dir}/[strsed ${lib} /^.*\\///] ${lib}"
     
    151150                    system "install_name_tool -change ${dep} ${lib_dir}/[strsed ${dep} /^.*\\///] ${lib}"
    152151                }
    153152            }
     153           
     154            # libociei is special: it's not linked to; it's dynamically loaded at
     155            # runtime by libclntsh. Oracle says you have to set DYLD_LIBRARY_PATH
     156            # to include ${lib_dir}, but adding an rpath works too.
     157            if {[string match "*/libclntsh.dylib*" ${lib}]} {
     158                system "install_name_tool -add_rpath ${lib_dir} ${lib}"
     159            }
    154160        }
    155161    }
    156162}
     
    182188}
    183189
    184190notes "
    185 To use ${name}, add this command to your environment:
    186 
    187 export DYLD_LIBRARY_PATH=${lib_dir}
     191If you previously set DYLD_LIBRARY_PATH=${lib_dir} in your environment, you can remove\
     192it\; it is no longer needed with this version of ${name}.
    188193"