www-servers/nginx: Patch for rtmp module. Fixes bug 585804.
authorThomas Deutschmann <whissi@whissi.de>
Mon, 13 Jun 2016 13:49:57 +0000 (15:49 +0200)
committerPatrice Clement <monsieurp@gentoo.org>
Thu, 16 Jun 2016 06:27:33 +0000 (06:27 +0000)
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@gentoo.org>
www-servers/nginx/files/rtmp-nginx-1.11.0.patch [new file with mode: 0644]
www-servers/nginx/nginx-1.10.1.ebuild
www-servers/nginx/nginx-1.11.1.ebuild

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 (file)
index 0000000..36c9c03
--- /dev/null
@@ -0,0 +1,39 @@
+From 965523f3970e449e3abbaa6c9b0db1ce251f2b68 Mon Sep 17 00:00:00 2001
+From: RocFang <fangpeng1986@gmail.com>
+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;
index 55ec9b2cc49624e1b4ea99e01c88fd8955e47782..630624b67c1db104cf9a9d05ac7f1cd259ef3b3d 100644 (file)
@@ -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
index 5b4e9772b747e3709567c04cd3b4658c7be5c749..451b27185f66e5ba6f49240a7ceb43435df54d10 100644 (file)
@@ -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