From 66a92f35f6ad5340c2737462d082c039551e7a8f Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 4 Oct 2022 13:34:08 +0200 Subject: [PATCH] nginx: enable perl module. --- srcpkgs/nginx-mod-http-perl | 1 + srcpkgs/nginx/files/ngx_auto_config.h.aarch64 | 22 ++++++++++---- srcpkgs/nginx/files/ngx_auto_config.h.armv6l | 22 ++++++++++---- srcpkgs/nginx/template | 30 +++++++++++++++++-- 4 files changed, 61 insertions(+), 14 deletions(-) create mode 120000 srcpkgs/nginx-mod-http-perl diff --git a/srcpkgs/nginx-mod-http-perl b/srcpkgs/nginx-mod-http-perl new file mode 120000 index 00000000000..da70e2081bc --- /dev/null +++ b/srcpkgs/nginx-mod-http-perl @@ -0,0 +1 @@ +nginx \ No newline at end of file diff --git a/srcpkgs/nginx/files/ngx_auto_config.h.aarch64 b/srcpkgs/nginx/files/ngx_auto_config.h.aarch64 index 7dd53d71285..809e031b200 100644 --- a/srcpkgs/nginx/files/ngx_auto_config.h.aarch64 +++ b/srcpkgs/nginx/files/ngx_auto_config.h.aarch64 @@ -1,4 +1,4 @@ -#define NGX_CONFIGURE " --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --pid-path=/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/tmp/nginx/client-body --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-compat --with-file-aio --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-threads --with-http_geoip_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_geoip_module --with-http_slice_module" +#define NGX_CONFIGURE " --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --modules-path=/usr/lib/nginx/modules --pid-path=/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/tmp/client-body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --with-compat --with-file-aio --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_slice_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-threads --add-dynamic-module=../njs-0.7.7/nginx" #ifndef NGX_HAVE_GCC_ATOMIC #define NGX_HAVE_GCC_ATOMIC 1 @@ -528,6 +528,16 @@ #endif +#ifndef NGX_HAVE_EXSLT +#define NGX_HAVE_EXSLT 1 +#endif + + +#ifndef NGX_HAVE_PERL_MULTIPLICITY +#define NGX_HAVE_PERL_MULTIPLICITY 1 +#endif + + #ifndef NGX_HAVE_GEOIP_V6 #define NGX_HAVE_GEOIP_V6 1 #endif @@ -574,27 +584,27 @@ #ifndef NGX_HTTP_CLIENT_TEMP_PATH -#define NGX_HTTP_CLIENT_TEMP_PATH "/var/tmp/nginx/client-body" +#define NGX_HTTP_CLIENT_TEMP_PATH "/var/lib/nginx/tmp/client-body" #endif #ifndef NGX_HTTP_PROXY_TEMP_PATH -#define NGX_HTTP_PROXY_TEMP_PATH "/var/tmp/nginx/proxy" +#define NGX_HTTP_PROXY_TEMP_PATH "/var/lib/nginx/tmp/proxy" #endif #ifndef NGX_HTTP_FASTCGI_TEMP_PATH -#define NGX_HTTP_FASTCGI_TEMP_PATH "/var/tmp/nginx/fastcgi" +#define NGX_HTTP_FASTCGI_TEMP_PATH "/var/lib/nginx/tmp/fastcgi" #endif #ifndef NGX_HTTP_UWSGI_TEMP_PATH -#define NGX_HTTP_UWSGI_TEMP_PATH "/var/tmp/nginx/uwsgi" +#define NGX_HTTP_UWSGI_TEMP_PATH "/var/lib/nginx/tmp/uwsgi" #endif #ifndef NGX_HTTP_SCGI_TEMP_PATH -#define NGX_HTTP_SCGI_TEMP_PATH "/var/tmp/nginx/scgi" +#define NGX_HTTP_SCGI_TEMP_PATH "/var/lib/nginx/tmp/scgi" #endif diff --git a/srcpkgs/nginx/files/ngx_auto_config.h.armv6l b/srcpkgs/nginx/files/ngx_auto_config.h.armv6l index 5b32a6948ce..df88ec2e35a 100644 --- a/srcpkgs/nginx/files/ngx_auto_config.h.armv6l +++ b/srcpkgs/nginx/files/ngx_auto_config.h.armv6l @@ -1,4 +1,4 @@ -#define NGX_CONFIGURE " --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --pid-path=/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/tmp/nginx/client-body --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-compat --with-file-aio --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-threads --with-http_geoip_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_geoip_module --with-http_slice_module" +#define NGX_CONFIGURE " --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --modules-path=/usr/lib/nginx/modules --pid-path=/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/tmp/client-body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --with-compat --with-file-aio --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_slice_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail --with-mail_ssl_module --with-pcre-jit --with-threads --add-dynamic-module=../njs-0.7.7/nginx" #ifndef NGX_HAVE_GCC_ATOMIC #define NGX_HAVE_GCC_ATOMIC 1 @@ -528,6 +528,16 @@ #endif +#ifndef NGX_HAVE_EXSLT +#define NGX_HAVE_EXSLT 1 +#endif + + +#ifndef NGX_HAVE_PERL_MULTIPLICITY +#define NGX_HAVE_PERL_MULTIPLICITY 1 +#endif + + #ifndef NGX_HAVE_GEOIP_V6 #define NGX_HAVE_GEOIP_V6 1 #endif @@ -574,27 +584,27 @@ #ifndef NGX_HTTP_CLIENT_TEMP_PATH -#define NGX_HTTP_CLIENT_TEMP_PATH "/var/tmp/nginx/client-body" +#define NGX_HTTP_CLIENT_TEMP_PATH "/var/lib/nginx/tmp/client-body" #endif #ifndef NGX_HTTP_PROXY_TEMP_PATH -#define NGX_HTTP_PROXY_TEMP_PATH "/var/tmp/nginx/proxy" +#define NGX_HTTP_PROXY_TEMP_PATH "/var/lib/nginx/tmp/proxy" #endif #ifndef NGX_HTTP_FASTCGI_TEMP_PATH -#define NGX_HTTP_FASTCGI_TEMP_PATH "/var/tmp/nginx/fastcgi" +#define NGX_HTTP_FASTCGI_TEMP_PATH "/var/lib/nginx/tmp/fastcgi" #endif #ifndef NGX_HTTP_UWSGI_TEMP_PATH -#define NGX_HTTP_UWSGI_TEMP_PATH "/var/tmp/nginx/uwsgi" +#define NGX_HTTP_UWSGI_TEMP_PATH "/var/lib/nginx/tmp/uwsgi" #endif #ifndef NGX_HTTP_SCGI_TEMP_PATH -#define NGX_HTTP_SCGI_TEMP_PATH "/var/tmp/nginx/scgi" +#define NGX_HTTP_SCGI_TEMP_PATH "/var/lib/nginx/tmp/scgi" #endif diff --git a/srcpkgs/nginx/template b/srcpkgs/nginx/template index 2b1d472d7a8..8508e6c4246 100644 --- a/srcpkgs/nginx/template +++ b/srcpkgs/nginx/template @@ -1,7 +1,7 @@ # Template file for 'nginx' pkgname=nginx version=1.22.0 -revision=2 +revision=3 _tests_commit=18ac4d9e5a2a _njs_version=0.7.7 create_wrksrc=yes @@ -37,6 +37,7 @@ configure_args="--prefix=${_cfgdir} \ --with-http_v2_module \ --with-http_xslt_module=dynamic \ --with-http_geoip_module=dynamic \ + --with-http_perl_module=dynamic \ --with-stream=dynamic \ --with-stream_geoip_module=dynamic \ --with-stream_realip_module \ @@ -47,7 +48,7 @@ configure_args="--prefix=${_cfgdir} \ --with-pcre-jit \ --with-threads --add-dynamic-module=../njs-${_njs_version}/nginx" -hostmakedepends="geoip geoip-devel openssl-devel pcre2-devel libxslt-devel +hostmakedepends="geoip geoip-devel openssl-devel pcre2-devel perl libxslt-devel which" makedepends="${hostmakedepends}" checkdepends="perl perl-IO-Socket-SSL perl-GD perl-FCGI which" @@ -87,6 +88,21 @@ do_configure() { if [ "$CROSS_BUILD" ]; then # fake configure run on host unset CC CPP LD CFLAGS CPPFLAGS LDFLAGS + + local perlprefix=${XBPS_STATEDIR}/perlprefix-${XBPS_TARGET_MACHINE} + mkdir -p $perlprefix + if [ -d "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl" ]; then + cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $perlprefix + cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $perlprefix + sed -i -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \ + ${perlprefix}/Config.pm + sed -i -e "s;^archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \ + ${perlprefix}/Config_heavy.pl + else + cp "/usr/lib/perl5/core_perl/Config"*.p? $perlprefix + cp "/usr/lib/perl5/core_perl/Errno.pm" $perlprefix + fi + export PERL5LIB=$perlprefix fi ./configure ${configure_args} @@ -106,6 +122,8 @@ pre_build() { cp "${FILESDIR}/njs_auto_config.h.aarch64" ../njs-${_njs_version}/build/njs_auto_config.h ;; esac + + sed -i "s:-I/usr:-I${XBPS_CROSS_BASE}/usr:" objs/Makefile fi sed -i 's/-lcrypt/$(LDFLAGS) &/' objs/Makefile @@ -156,6 +174,14 @@ nginx-mod-http-js_package() { } } +nginx-mod-http-perl_package() { + short_desc+=" - Perl module" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/lib/nginx/modules/ngx_http_perl_module.so + } +} + nginx-mod-http-xslt-filter_package() { short_desc+=" - XSLT filter module" depends="${sourcepkg}>=${version}_${revision}"