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

File patch-nginx-Portfile.upload.diff, 4.0 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}
     
    177194                            rmd160  5734af837be3fe8ec444a7e5e7f6707118594098 \
    178195                            sha256  b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805
    179196    configure.args-append   --add-module=${workpath}/${upload_distname}
     197
     198    # v2.2.0 release references members of ngx_http_request_body_t that were renamed in later nginx versions.
     199    # Patch nginx_upload_module.c with fixed version from https://github.com/TimothyKlim/nginx-upload-module.
     200    patchfiles-append       patch-nginx_upload_module.tmp-ngx_http_upload_module.c.diff
     201
     202
     203    nginx_set_portfile_var   nginx_upload_mod_dirname    "${upload_distname}"
     204
     205    # patch routine balks on file names with "../", but rel-paths in patchfiles start from $worksrcpath
     206    pre-patch {
     207        ln -s   "${workpath}/${nginx_upload_mod_dirname}" "${worksrcpath}/nginx_upload_module.tmp"
     208    }
     209    post-patch {
     210        file delete   "${worksrcpath}/nginx_upload_module.tmp"
     211    }
    180212}
    181213
    182214variant upload_progress description {Enable Brice Figureau's upload progress module (https://github.com/masterzen/nginx-upload-progress-module)} {
    183215    set uploadprg_filename  nginx_uploadprogress_module
    184216    set uploadprg_version   0.9.0
    185217    set uploadprg_distname  ${uploadprg_filename}-${uploadprg_version}
     218
    186219    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     }
    190220    checksums-append        ${uploadprg_distname}.tar.gz \
    191221                            rmd160  10ff91748a06afd81abb9fdb203f164ea369463a \
    192222                            sha256  3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2
    193223    configure.args-append   --add-module=${workpath}/${uploadprg_distname}
     224
     225
     226    nginx_set_portfile_var   nginx_upload_progress_mod_dirname    "${uploadprg_distname}"
     227
     228    post-extract {
     229        move   [glob -directory "${workpath}"   masterzen-nginx-upload-progress-module*]   \
     230               "${workpath}/${nginx_upload_progress_mod_dirname}"
     231    }
    194232}
    195233
    196234variant xslt description {Post-process pages with XSLT} {