commit:     6241ba18ca4a5e043a97ad11cf450c8d27b3079f
Author:     Thomas Deutschmann <whissi <AT> whissi <DOT> de>
AuthorDate: Mon Jun 13 13:49:57 2016 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 06:27:33 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6241ba18

www-servers/nginx: Patch for rtmp module. Fixes bug 585804.

Proposed patch for upstream bug 820 added to fix building of
nginx's 3rd party module "rtmp" against nginx-1.11.0+.

Bug: https://github.com/arut/nginx-rtmp-module/issues/820
Gentoo-Bug: https://bugs.gentoo.org/585804

Package-Manager: portage-2.3.0_rc1
Closes: https://github.com/gentoo/gentoo/pull/1669

Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 www-servers/nginx/files/rtmp-nginx-1.11.0.patch | 39 +++++++++++++++++++++++++
 www-servers/nginx/nginx-1.10.1.ebuild           |  7 +++--
 www-servers/nginx/nginx-1.11.1.ebuild           | 13 +++++++--
 3 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/www-servers/nginx/files/rtmp-nginx-1.11.0.patch 
b/www-servers/nginx/files/rtmp-nginx-1.11.0.patch
new file mode 100644
index 0000000..36c9c03
--- /dev/null
+++ b/www-servers/nginx/files/rtmp-nginx-1.11.0.patch
@@ -0,0 +1,39 @@
+From 965523f3970e449e3abbaa6c9b0db1ce251f2b68 Mon Sep 17 00:00:00 2001
+From: RocFang <[email protected]>
+Date: Mon, 30 May 2016 22:56:16 +0800
+Subject: [PATCH] compile with nginx-1.11.0
+
+From https://github.com/arut/nginx-rtmp-module/issues/820
+
+---
+ ngx_rtmp_core_module.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/ngx_rtmp_core_module.c b/ngx_rtmp_core_module.c
+index 643702f..567f011 100644
+--- a/ngx_rtmp_core_module.c
++++ b/ngx_rtmp_core_module.c
+@@ -557,7 +557,11 @@ ngx_rtmp_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, 
void *conf)
+             break;
+         }
+ 
++#if (nginx_version >= 1011000)
++        if (ngx_memcmp(ls[i].sockaddr + off, &u.sockaddr + off, len) != 0) {
++#else
+         if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
++#endif
+             continue;
+         }
+ 
+@@ -577,7 +581,11 @@ ngx_rtmp_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, 
void *conf)
+ 
+     ngx_memzero(ls, sizeof(ngx_rtmp_listen_t));
+ 
++#if (nginx_version >= 1011000)
++    ngx_memcpy(ls->sockaddr, &u.sockaddr, u.socklen);
++#else
+     ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);
++#endif
+ 
+     ls->socklen = u.socklen;
+     ls->wildcard = u.wildcard;

diff --git a/www-servers/nginx/nginx-1.10.1.ebuild 
b/www-servers/nginx/nginx-1.10.1.ebuild
index 55ec9b2..630624b 100644
--- a/www-servers/nginx/nginx-1.10.1.ebuild
+++ b/www-servers/nginx/nginx-1.10.1.ebuild
@@ -348,7 +348,7 @@ src_prepare() {
 src_configure() {
        # mod_security needs to generate nginx/modsecurity/config before 
including it
        if use nginx_modules_http_security; then
-               cd "${HTTP_SECURITY_MODULE_WD}"
+               cd "${HTTP_SECURITY_MODULE_WD}" || die
                if use luajit ; then
                        sed -i \
                                -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
@@ -360,7 +360,7 @@ src_configure() {
                        $(use_with nginx_modules_http_lua lua) || die 
"configure failed for mod_security"
        fi
 
-       cd "${S}"
+       cd "${S}" || die
 
        local myconf=() http_enabled= mail_enabled= stream_enabled=
 
@@ -624,9 +624,10 @@ src_install() {
        newins "${FILESDIR}"/nginx.logrotate-r1 nginx
 
        if use nginx_modules_http_perl; then
-               cd "${S}"/objs/src/http/modules/perl/
+               cd "${S}"/objs/src/http/modules/perl/ || die
                emake DESTDIR="${D}" INSTALLDIRS=vendor
                perl_delete_localpod
+               cd "${S}" || die
        fi
 
        if use nginx_modules_http_cache_purge; then

diff --git a/www-servers/nginx/nginx-1.11.1.ebuild 
b/www-servers/nginx/nginx-1.11.1.ebuild
index 5b4e977..451b271 100644
--- a/www-servers/nginx/nginx-1.11.1.ebuild
+++ b/www-servers/nginx/nginx-1.11.1.ebuild
@@ -320,6 +320,12 @@ pkg_setup() {
 src_prepare() {
        eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
 
+       if use rtmp; then
+               cd "${RTMP_MODULE_WD}" || die
+               eapply "${FILESDIR}"/rtmp-nginx-1.11.0.patch
+               cd "${S}" || die
+       fi
+
        if use nginx_modules_http_upstream_check; then
                eapply -p0 "${HTTP_UPSTREAM_CHECK_MODULE_WD}/check_1.9.2+".patch
        fi
@@ -348,7 +354,7 @@ src_prepare() {
 src_configure() {
        # mod_security needs to generate nginx/modsecurity/config before 
including it
        if use nginx_modules_http_security; then
-               cd "${HTTP_SECURITY_MODULE_WD}"
+               cd "${HTTP_SECURITY_MODULE_WD}" || die
                if use luajit ; then
                        sed -i \
                                -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
@@ -360,7 +366,7 @@ src_configure() {
                        $(use_with nginx_modules_http_lua lua) || die 
"configure failed for mod_security"
        fi
 
-       cd "${S}"
+       cd "${S}" || die
 
        local myconf=() http_enabled= mail_enabled= stream_enabled=
 
@@ -624,9 +630,10 @@ src_install() {
        newins "${FILESDIR}"/nginx.logrotate-r1 nginx
 
        if use nginx_modules_http_perl; then
-               cd "${S}"/objs/src/http/modules/perl/
+               cd "${S}"/objs/src/http/modules/perl/ || die
                emake DESTDIR="${D}" INSTALLDIRS=vendor
                perl_delete_localpod
+               cd "${S}" || die
        fi
 
        if use nginx_modules_http_cache_purge; then

Reply via email to