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

File patch-nginx-Portfile.combined.diff, 5.9 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
     
    4545set nginx_pidfile   ${nginx_rundir}/${name}.pid
    4646set nginx_all_confs {fastcgi.conf fastcgi_params mime.types nginx.conf scgi_params uwsgi_params}
    4747
     48# portfile-scoped vars for variant routines to re-def and use in port-stages (post-extract, pre-patch, etc)
     49set nginx_upload_mod_dirname   ""
     50set nginx_upload_progress_mod_dirname   ""
     51
     52
     53# for aforementioned re-defs of portfile-scoped vars in variant routines
     54proc nginx_set_portfile_var {var_name new_value} {
     55    upvar   $var_name   portfile_var
     56    set portfile_var   $new_value
     57}
     58
     59
     60
    4861configure.args-append \
    4962                    --with-cc-opt=\"${configure.cppflags} ${configure.cflags}\" \
    5063                    --with-ld-opt=\"${configure.ldflags}\" \
     
    6073                    --with-ipv6
    6174
    6275# remove --disable-dependency-tracking
    63 configure.universal_args
     76configure.universal_args-delete   --disable-dependency-tracking
    6477
    6578build.target        build
    6679destroot.keepdirs   ${destroot}${nginx_logdir} \
     
    7790    file rename ${destroot}${prefix}/html ${destroot}${prefix}/share/nginx
    7891}
    7992
     93
    8094startupitem.create      yes
    8195startupitem.pidfile     auto ${nginx_pidfile}
    8296startupitem.executable  ${prefix}/sbin/nginx
    8397
     98
    8499notes                   \
    85100    "A sample nginx configuration file has been installed in
    86101    ${nginx_confdir}/nginx.conf.default.\nCopy the configuration to
    87102    ${nginx_confdir}/nginx.conf\nand adjust it to your needs before starting\
    88103    nginx."
    89104
     105
     106
    90107variant addition description {Append text to pages} {
    91108    configure.args-append   --with-http_addition_module
    92109}
     
    109126}
    110127
    111128variant google_perftools description {Enable Google Performance Tools profiling for workers} {
    112     configure.args-append   --with-google_perftools_module
    113129    depends_lib-append      port:google-perftools
     130
     131    # If 'google_perftools' port doesn't find headers needed for the profiler lib, it just quietly skips it.
     132    # Check if "-lprofiler" will fail -- if so, pre-empt configure-stage error with a more useful error msg.
     133    if {    [file exists "${prefix}/lib/libprofiler.dylib"] ||
     134                    [file exists "${prefix}/lib/libprofiler.a"]
     135    } {
     136        configure.args-append   --with-google_perftools_module
     137    } \
     138    else {
     139        ui_warn [ join   [list                                                                       \
     140            "On some OSX versions, the 'google_perftools' port is installed without library files "   \
     141            "needed by the \"google_perftools\" variant ( libprofiler.dylib or libprofiler.a ). \n"   \
     142            "Until the 'google_perftools' port is fixed, this variant is incompatible with these "    \
     143            "OSX versions. \n\n"                                                                      \
     144            "If the 'google_perftools' port HAS BEEN updated, running the command: \n"                \
     145            "    port -f upgrade --enforce-variants nginx +google_perftools \n"                       \
     146            "will indicate if this bug was fixed, based on whether it installs successfully and "     \
     147            "DOES NOT display this message again. \n\n"                                               \
     148            "Aborting 'nginx' port installation... "                                                  \
     149        ] "" ]
     150
     151        return -code error   "Variant \"+google_perftools\" does not support current 'google_perftools' port."
     152    }
    114153}
    115154
    116155variant gzip_static description {Avoids compressing the same file each time it is requested} {
     
    177216                            rmd160  5734af837be3fe8ec444a7e5e7f6707118594098 \
    178217                            sha256  b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805
    179218    configure.args-append   --add-module=${workpath}/${upload_distname}
     219
     220    # v2.2.0 release references members of ngx_http_request_body_t that were renamed in later nginx versions.
     221    # Patch nginx_upload_module.c with fixed version from https://github.com/TimothyKlim/nginx-upload-module.
     222    patchfiles-append       patch-nginx_upload_module.tmp-ngx_http_upload_module.c.diff
     223
     224
     225    nginx_set_portfile_var   nginx_upload_mod_dirname    "${upload_distname}"
     226
     227    # patch routine balks on file names with "../", but rel-paths in patchfiles start from $worksrcpath
     228    pre-patch {
     229        ln -s   "${workpath}/${nginx_upload_mod_dirname}" "${worksrcpath}/nginx_upload_module.tmp"
     230    }
     231    post-patch {
     232        file delete   "${worksrcpath}/nginx_upload_module.tmp"
     233    }
    180234}
    181235
    182236variant upload_progress description {Enable Brice Figureau's upload progress module (https://github.com/masterzen/nginx-upload-progress-module)} {
    183237    set uploadprg_filename  nginx_uploadprogress_module
    184238    set uploadprg_version   0.9.0
    185239    set uploadprg_distname  ${uploadprg_filename}-${uploadprg_version}
     240
    186241    distfiles-append        ${uploadprg_distname}.tar.gz:uploadprogress_module
    187     post-extract {
    188         move [glob ${workpath}/masterzen-nginx-upload-progress-module-a788dea] ${workpath}/nginx_uploadprogress_module-0.9.0
    189     }
    190242    checksums-append        ${uploadprg_distname}.tar.gz \
    191243                            rmd160  10ff91748a06afd81abb9fdb203f164ea369463a \
    192244                            sha256  3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2
    193245    configure.args-append   --add-module=${workpath}/${uploadprg_distname}
     246
     247
     248    nginx_set_portfile_var   nginx_upload_progress_mod_dirname    "${uploadprg_distname}"
     249
     250    post-extract {
     251        move   [glob -directory "${workpath}"   masterzen-nginx-upload-progress-module*]   \
     252               "${workpath}/${nginx_upload_progress_mod_dirname}"
     253    }
    194254}
    195255
    196256variant xslt description {Post-process pages with XSLT} {