<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[149166] trunk/dports/www/nginx</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/149166">149166</a></dd>
<dt>Author</dt> <dd>mps@macports.org</dd>
<dt>Date</dt> <dd>2016-06-03 09:54:15 -0700 (Fri, 03 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>nginx: fix rtmp module build issue.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportswwwnginxPortfile">trunk/dports/www/nginx/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportswwwnginxfilespatchngx_rtmp_core_modulecdiff">trunk/dports/www/nginx/files/patch-ngx_rtmp_core_module.c.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportswwwnginxPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/www/nginx/Portfile (149165 => 149166)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/www/nginx/Portfile        2016-06-03 16:07:00 UTC (rev 149165)
+++ trunk/dports/www/nginx/Portfile        2016-06-03 16:54:15 UTC (rev 149166)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> set auto_activate_confs {nginx.conf mime.types fastcgi.conf}
</span><span class="cx"> 
</span><span class="cx"> # portfile-scoped vars for variant routines to re-def and use in port-stages (post-extract, pre-patch, etc)
</span><ins>+set nginx_rtmp_mod_dirname     &quot;&quot;
</ins><span class="cx"> set nginx_upload_mod_dirname   &quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> # for aforementioned re-defs of portfile-scoped vars in variant routines
</span><span class="lines">@@ -256,7 +257,7 @@
</span><span class="cx">     patchfiles-append       patch-nginx_upload_module.tmp-ngx_http_upload_module.c.diff
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    nginx_set_portfile_var   nginx_upload_mod_dirname    &quot;${upload_distname}&quot;
</del><ins>+    nginx_set_portfile_var  nginx_upload_mod_dirname    &quot;${upload_distname}&quot;
</ins><span class="cx"> 
</span><span class="cx">     pre-fetch {
</span><span class="cx">         ui_error &quot;The +upload variant is currently broken, because the upload module is not compatible with nginx 1.9.0.&quot;
</span><span class="lines">@@ -319,6 +320,17 @@
</span><span class="cx">                             rmd160  3b7510fba6f6e572f0fb0b3676fe1eb4d4caecb1 \
</span><span class="cx">                             sha256  7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3
</span><span class="cx">     configure.args-append   --add-module=${workpath}/${rtmp_distname}
</span><ins>+    patchfiles-append       patch-ngx_rtmp_core_module.c.diff
+
+    nginx_set_portfile_var  nginx_rtmp_mod_dirname    &quot;${rtmp_distname}&quot;
+
+    # patch routine balks on file names with &quot;../&quot;, but rel-paths in patchfiles start from $worksrcpath
+    pre-patch {
+        ln -s   &quot;${workpath}/${nginx_rtmp_mod_dirname}&quot; &quot;${worksrcpath}/nginx_rtmp_module.tmp&quot;
+    }
+    post-patch {
+        file delete   &quot;${worksrcpath}/nginx_rtmp_module.tmp&quot;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> variant http_push description {Enable Ngx HTTP Push module (https://github.com/slact/nchan)} {
</span></span></pre></div>
<a id="trunkdportswwwnginxfilespatchngx_rtmp_core_modulecdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/www/nginx/files/patch-ngx_rtmp_core_module.c.diff (0 => 149166)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/www/nginx/files/patch-ngx_rtmp_core_module.c.diff                                (rev 0)
+++ trunk/dports/www/nginx/files/patch-ngx_rtmp_core_module.c.diff        2016-06-03 16:54:15 UTC (rev 149166)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+--- nginx_rtmp_module.tmp/ngx_rtmp_core_module.c.orig        2015-03-23 14:30:37.000000000 -0500
++++ nginx_rtmp_module.tmp/ngx_rtmp_core_module.c        2016-06-03 11:27:21.000000000 -0500
+@@ -332,6 +332,7 @@
+     void                       *mconf;
+     ngx_uint_t                  m;
+     ngx_conf_t                  pcf;
++    ngx_module_t              **modules;
+     ngx_rtmp_module_t          *module;
+     ngx_rtmp_conf_ctx_t        *ctx, *rtmp_ctx;
+     ngx_rtmp_core_srv_conf_t   *cscf, **cscfp;
+@@ -357,12 +358,17 @@
+         return NGX_CONF_ERROR;
+     }

+-    for (m = 0; ngx_modules[m]; m++) {
+-        if (ngx_modules[m]-&gt;type != NGX_RTMP_MODULE) {
++#if defined(nginx_version) &amp;&amp; nginx_version &gt;= 1009011
++    modules = cf-&gt;cycle-&gt;modules;
++#else
++    modules = ngx_modules;
++#endif
++    for (m = 0; modules[m]; m++) {
++        if (modules[m]-&gt;type != NGX_RTMP_MODULE) {
+             continue;
+         }

+-        module = ngx_modules[m]-&gt;ctx;
++        module = modules[m]-&gt;ctx;

+         if (module-&gt;create_srv_conf) {
+             mconf = module-&gt;create_srv_conf(cf);
+@@ -370,7 +376,7 @@
+                 return NGX_CONF_ERROR;
+             }

+-            ctx-&gt;srv_conf[ngx_modules[m]-&gt;ctx_index] = mconf;
++            ctx-&gt;srv_conf[modules[m]-&gt;ctx_index] = mconf;
+         }

+         if (module-&gt;create_app_conf) {
+@@ -379,7 +385,7 @@
+                 return NGX_CONF_ERROR;
+             }

+-            ctx-&gt;app_conf[ngx_modules[m]-&gt;ctx_index] = mconf;
++            ctx-&gt;app_conf[modules[m]-&gt;ctx_index] = mconf;
+         }
+     }

+@@ -419,6 +425,7 @@
+     ngx_int_t                   i;
+     ngx_str_t                  *value;
+     ngx_conf_t                  save;
++    ngx_module_t              **modules;
+     ngx_rtmp_module_t          *module;
+     ngx_rtmp_conf_ctx_t        *ctx, *pctx;
+     ngx_rtmp_core_srv_conf_t   *cscf;
+@@ -438,17 +445,22 @@
+         return NGX_CONF_ERROR;
+     }

+-    for (i = 0; ngx_modules[i]; i++) {
+-        if (ngx_modules[i]-&gt;type != NGX_RTMP_MODULE) {
++#if defined(nginx_version) &amp;&amp; nginx_version &gt;= 1009011
++    modules = cf-&gt;cycle-&gt;modules;
++#else
++    modules = ngx_modules;
++#endif
++    for (i = 0; modules[i]; i++) {
++        if (modules[i]-&gt;type != NGX_RTMP_MODULE) {
+             continue;
+         }

+-        module = ngx_modules[i]-&gt;ctx;
++        module = modules[i]-&gt;ctx;

+         if (module-&gt;create_app_conf) {
+-            ctx-&gt;app_conf[ngx_modules[i]-&gt;ctx_index] =
++            ctx-&gt;app_conf[modules[i]-&gt;ctx_index] =
+                                 module-&gt;create_app_conf(cf);
+-            if (ctx-&gt;app_conf[ngx_modules[i]-&gt;ctx_index] == NULL) {
++            if (ctx-&gt;app_conf[modules[i]-&gt;ctx_index] == NULL) {
+                 return NGX_CONF_ERROR;
+             }
+         }
+@@ -488,7 +500,7 @@
+     in_port_t                   port;
+     ngx_str_t                  *value;
+     ngx_url_t                   u;
+-    ngx_uint_t                  i, m;
++    ngx_uint_t                  i;
+     struct sockaddr            *sa;
+     ngx_rtmp_listen_t          *ls;
+     struct sockaddr_in         *sin;
+@@ -545,7 +557,11 @@
+             break;
+         }

++#if (nginx_version &gt;= 1011000)
++        if (ngx_memcmp(ls[i].sockaddr + off, &amp;u.sockaddr + off, len) != 0) {
++#else
+         if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
++#endif
+             continue;
+         }

+@@ -565,18 +581,16 @@

+     ngx_memzero(ls, sizeof(ngx_rtmp_listen_t));

++#if (nginx_version &gt;= 1011000)
++    ngx_memcpy(ls-&gt;sockaddr, &amp;u.sockaddr, u.socklen);
++#else
+     ngx_memcpy(ls-&gt;sockaddr, u.sockaddr, u.socklen);
++#endif

+     ls-&gt;socklen = u.socklen;
+     ls-&gt;wildcard = u.wildcard;
+     ls-&gt;ctx = cf-&gt;ctx;

+-    for (m = 0; ngx_modules[m]; m++) {
+-        if (ngx_modules[m]-&gt;type != NGX_RTMP_MODULE) {
+-            continue;
+-        }
+-    }
+-
+     for (i = 2; i &lt; cf-&gt;args-&gt;nelts; i++) {

+         if (ngx_strcmp(value[i].data, &quot;bind&quot;) == 0) {
</ins></span></pre>
</div>
</div>

</body>
</html>