From 8cc7c2f06fd5c3a9422e0e33f1a485df7e43a21a Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Sat, 13 Oct 2018 19:43:10 -0700 Subject: [PATCH] nginx: clarify special handling for cross --- srcpkgs/nginx/files/ngx_auto_config.h.armv6l | 6 ++ .../files/ngx_auto_config.h.armv6l.patch | 86 +++++++++++++++++++ srcpkgs/nginx/template | 41 ++++----- srcpkgs/nginx/update | 2 +- 4 files changed, 109 insertions(+), 26 deletions(-) create mode 100644 srcpkgs/nginx/files/ngx_auto_config.h.armv6l.patch diff --git a/srcpkgs/nginx/files/ngx_auto_config.h.armv6l b/srcpkgs/nginx/files/ngx_auto_config.h.armv6l index 3ae0b191ed1..6ee9d6eb213 100644 --- a/srcpkgs/nginx/files/ngx_auto_config.h.armv6l +++ b/srcpkgs/nginx/files/ngx_auto_config.h.armv6l @@ -1,5 +1,10 @@ #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-mail --with-mail_ssl_module --with-pcre-jit --with-file-aio --with-http_gunzip_module --with-http_v2_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_stub_status_module --with-http_geoip_module" +#ifndef NGX_COMPILER +#define NGX_COMPILER "gcc 8.2.0 (GCC) " +#endif + + #ifndef NGX_HAVE_GCC_ATOMIC #define NGX_HAVE_GCC_ATOMIC 1 #endif @@ -551,3 +556,4 @@ #ifndef NGX_GROUP #define NGX_GROUP "nginx" #endif + diff --git a/srcpkgs/nginx/files/ngx_auto_config.h.armv6l.patch b/srcpkgs/nginx/files/ngx_auto_config.h.armv6l.patch new file mode 100644 index 00000000000..aa35606688c --- /dev/null +++ b/srcpkgs/nginx/files/ngx_auto_config.h.armv6l.patch @@ -0,0 +1,86 @@ +Note: this file is provided as a reference. It is not used when building nginx. + +On ARM targets, certain config variables must be changed to accommodate the +architecture. This typically means translating 64 bit values to 32 bit. When +updating nginx, the difference between objs/ngx_auto_config.h and the vendored +srcpkgs/nginx/files/ngx_auto_config.h.armv6l should match this patch. Additional +definitions may need to be added to the vendored config file. If these +definitions contain architecture specific values like those below, they need to +be translated to their 32 bit equivalents. + +--- objs/ngx_auto_config.h.orig 2019-02-09 22:49:23.758277257 -0800 ++++ objs/ngx_auto_config.h 2019-02-09 23:13:01.326692988 -0800 +@@ -80,13 +80,13 @@ + #endif + + +-#ifndef NGX_HAVE_NONALIGNED +-#define NGX_HAVE_NONALIGNED 1 ++#ifndef NGX_ALIGNMENT ++#define NGX_ALIGNMENT 16 + #endif + + + #ifndef NGX_CPU_CACHE_LINE +-#define NGX_CPU_CACHE_LINE 64 ++#define NGX_CPU_CACHE_LINE 32 + #endif + + +@@ -204,7 +204,7 @@ + + + #ifndef NGX_PTR_SIZE +-#define NGX_PTR_SIZE 8 ++#define NGX_PTR_SIZE 4 + #endif + + +@@ -219,12 +219,12 @@ + + + #ifndef NGX_MAX_SIZE_T_VALUE +-#define NGX_MAX_SIZE_T_VALUE 9223372036854775807LL ++#define NGX_MAX_SIZE_T_VALUE 2147483647 + #endif + + + #ifndef NGX_SIZE_T_LEN +-#define NGX_SIZE_T_LEN (sizeof("-9223372036854775808") - 1) ++#define NGX_SIZE_T_LEN (sizeof("-2147483648") - 1) + #endif + + +@@ -239,17 +239,17 @@ + + + #ifndef NGX_TIME_T_SIZE +-#define NGX_TIME_T_SIZE 8 ++#define NGX_TIME_T_SIZE 4 + #endif + + + #ifndef NGX_TIME_T_LEN +-#define NGX_TIME_T_LEN (sizeof("-9223372036854775808") - 1) ++#define NGX_TIME_T_LEN (sizeof("-2147483648") - 1) + #endif + + + #ifndef NGX_MAX_TIME_T_VALUE +-#define NGX_MAX_TIME_T_VALUE 9223372036854775807LL ++#define NGX_MAX_TIME_T_VALUE 2147483647 + #endif + + +@@ -343,11 +343,6 @@ + #endif + + +-#ifndef NGX_HAVE_LEVEL1_DCACHE_LINESIZE +-#define NGX_HAVE_LEVEL1_DCACHE_LINESIZE 1 +-#endif +- +- + #ifndef NGX_HAVE_OPENAT + #define NGX_HAVE_OPENAT 1 + #endif diff --git a/srcpkgs/nginx/template b/srcpkgs/nginx/template index 93069cfff6f..1994d1bf024 100644 --- a/srcpkgs/nginx/template +++ b/srcpkgs/nginx/template @@ -1,19 +1,25 @@ # Template file for 'nginx' pkgname=nginx version=1.14.2 -revision=1 +revision=2 +build_style=gnu-makefile makedepends="libressl-devel pcre-devel $(vopt_if geoip 'geoip-devel')" -short_desc="A high performance web and reverse proxy server" +short_desc="High performance web and reverse proxy server" maintainer="Juan RP " license="BSD-2-Clause" homepage="https://nginx.org" distfiles="https://nginx.org/download/nginx-${version}.tar.gz" checksum=002d9f6154e331886a2dd4e6065863c9c1cf8291ae97a1255308572c02be9797 +# NOTE: +# On update, the pregenerated header file for ARM may need synchronization. +# See srcpkgs/nginx/files/ngx_auto_config.h.armv6l.patch for more information. + if [ "$CROSS_BUILD" ]; then # fake configure run on host - hostmakedepends=$makedepends + hostmakedepends+=" $makedepends" fi + conf_files="/etc/nginx/fastcgi.conf /etc/nginx/fastcgi_params /etc/nginx/koi-win @@ -29,11 +35,6 @@ make_dirs="/var/log/nginx 0750 root root /var/tmp 1777 root root /var/tmp/nginx 0750 nginx root" -if [ "$CROSS_BUILD" ]; then - # fake configure run on host - hostmakedepends+=" $makedepends" -fi - build_options="geoip" build_options_default="geoip" @@ -69,40 +70,30 @@ do_configure() { --with-http_ssl_module \ --with-http_stub_status_module \ $(vopt_if geoip --with-http_geoip_module) +} +pre_build() { if [ "$CROSS_BUILD" ]; then case "$XBPS_TARGET_MACHINE" in - arm*|aarch64*) cp ${FILESDIR}/ngx_auto_config.h.armv6l objs/ngx_auto_config.h;; + arm*|aarch64*) cp "${FILESDIR}/ngx_auto_config.h.armv6l" objs/ngx_auto_config.h;; esac fi sed -i 's/-lcrypt/$(LDFLAGS) &/' objs/Makefile } -do_build() { - make ${makejobs} CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" -} - -do_install() { - make DESTDIR=$DESTDIR install - +post_install() { sed -e 's|\