Ticket #38626: oracle-instantclient.diff

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

the change I tried, which did not work

  • 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:
     191With this version of ${name}, it should no longer be necessary to add this command to your environment:
    186192
    187193export DYLD_LIBRARY_PATH=${lib_dir}
    188194"