Ticket #39773: patch-nginx-Portfile.google_perftools.diff

File patch-nginx-Portfile.google_perftools.diff, 2.5 KB (added by anthropologoi@…, 11 years ago)
  • Portfile

    old new  
    55
    66name                nginx
    77version             1.4.1
    8 revision            1
     8revision            5
    99categories          www mail
    1010platforms           darwin
    1111license             BSD
     
    6060                    --with-ipv6
    6161
    6262# remove --disable-dependency-tracking
    63 configure.universal_args
     63configure.universal_args-delete   --disable-dependency-tracking
    6464
    6565build.target        build
    6666destroot.keepdirs   ${destroot}${nginx_logdir} \
     
    109109}
    110110
    111111variant google_perftools description {Enable Google Performance Tools profiling for workers} {
    112     configure.args-append   --with-google_perftools_module
    113112    depends_lib-append      port:google-perftools
     113
     114    # If 'google_perftools' port doesn't find headers needed for the profiler lib, it just quietly skips it.
     115    # Check if "-lprofiler" will fail -- if so, pre-empt configure-stage error with a more useful error msg.
     116    if {    [file exists "${prefix}/lib/libprofiler.dylib"] ||
     117                    [file exists "${prefix}/lib/libprofiler.a"]
     118    } {
     119        configure.args-append   --with-google_perftools_module
     120    } \
     121    else {
     122        ui_warn [ join   [list                                                                       \
     123            "On some OSX versions, the 'google_perftools' port is installed without library files "   \
     124            "needed by the \"google_perftools\" variant ( libprofiler.dylib or libprofiler.a ). \n"   \
     125            "Until the 'google_perftools' port is fixed, this variant is incompatible with these "    \
     126            "OSX versions. \n\n"                                                                      \
     127            "If the 'google_perftools' port HAS BEEN updated, running the command: \n"                \
     128            "    port -f upgrade --enforce-variants nginx +google_perftools \n"                       \
     129            "will indicate if this bug was fixed, based on whether it installs successfully and "     \
     130            "DOES NOT display this message again. \n\n"                                               \
     131            "Aborting 'nginx' port installation... "                                                  \
     132        ] "" ]
     133
     134        return -code error   "Variant \"+google_perftools\" does not support current 'google_perftools' port."
     135    }
    114136}
    115137
    116138variant gzip_static description {Avoids compressing the same file each time it is requested} {