nginx: clarify special handling for cross

This commit is contained in:
Cameron Nemo 2018-10-13 19:43:10 -07:00 committed by maxice8
parent e313a4767d
commit 8cc7c2f06f
4 changed files with 109 additions and 26 deletions

View file

@ -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" #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 #ifndef NGX_HAVE_GCC_ATOMIC
#define NGX_HAVE_GCC_ATOMIC 1 #define NGX_HAVE_GCC_ATOMIC 1
#endif #endif
@ -551,3 +556,4 @@
#ifndef NGX_GROUP #ifndef NGX_GROUP
#define NGX_GROUP "nginx" #define NGX_GROUP "nginx"
#endif #endif

View file

@ -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

View file

@ -1,19 +1,25 @@
# Template file for 'nginx' # Template file for 'nginx'
pkgname=nginx pkgname=nginx
version=1.14.2 version=1.14.2
revision=1 revision=2
build_style=gnu-makefile
makedepends="libressl-devel pcre-devel $(vopt_if geoip 'geoip-devel')" 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 <xtraeme@voidlinux.org>" maintainer="Juan RP <xtraeme@voidlinux.org>"
license="BSD-2-Clause" license="BSD-2-Clause"
homepage="https://nginx.org" homepage="https://nginx.org"
distfiles="https://nginx.org/download/nginx-${version}.tar.gz" distfiles="https://nginx.org/download/nginx-${version}.tar.gz"
checksum=002d9f6154e331886a2dd4e6065863c9c1cf8291ae97a1255308572c02be9797 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 if [ "$CROSS_BUILD" ]; then
# fake configure run on host # fake configure run on host
hostmakedepends=$makedepends hostmakedepends+=" $makedepends"
fi fi
conf_files="/etc/nginx/fastcgi.conf conf_files="/etc/nginx/fastcgi.conf
/etc/nginx/fastcgi_params /etc/nginx/fastcgi_params
/etc/nginx/koi-win /etc/nginx/koi-win
@ -29,11 +35,6 @@ make_dirs="/var/log/nginx 0750 root root
/var/tmp 1777 root root /var/tmp 1777 root root
/var/tmp/nginx 0750 nginx root" /var/tmp/nginx 0750 nginx root"
if [ "$CROSS_BUILD" ]; then
# fake configure run on host
hostmakedepends+=" $makedepends"
fi
build_options="geoip" build_options="geoip"
build_options_default="geoip" build_options_default="geoip"
@ -69,40 +70,30 @@ do_configure() {
--with-http_ssl_module \ --with-http_ssl_module \
--with-http_stub_status_module \ --with-http_stub_status_module \
$(vopt_if geoip --with-http_geoip_module) $(vopt_if geoip --with-http_geoip_module)
}
pre_build() {
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
case "$XBPS_TARGET_MACHINE" in 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 esac
fi fi
sed -i 's/-lcrypt/$(LDFLAGS) &/' objs/Makefile sed -i 's/-lcrypt/$(LDFLAGS) &/' objs/Makefile
} }
do_build() { post_install() {
make ${makejobs} CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
}
do_install() {
make DESTDIR=$DESTDIR install
sed -e 's|\<user\s\+\w\+;|user html;|g' \ sed -e 's|\<user\s\+\w\+;|user html;|g' \
-e '44s|html|/usr/share/nginx/html|' \ -e '44s|html|/usr/share/nginx/html|' \
-e '54s|html|/usr/share/nginx/html|' \ -e '54s|html|/usr/share/nginx/html|' \
-i $DESTDIR/etc/nginx/nginx.conf -i "$DESTDIR/etc/nginx/nginx.conf"
rm $DESTDIR/etc/nginx/*.default rm -- "$DESTDIR"/etc/nginx/*.default
vmkdir usr/share/nginx vmkdir usr/share/nginx
mv $DESTDIR/etc/nginx/html/ $DESTDIR/usr/share/nginx mv "$DESTDIR/etc/nginx/html" "$DESTDIR/usr/share/nginx"
vman man/nginx.8 vman man/nginx.8
vlicense LICENSE vlicense LICENSE
vsv nginx vsv nginx
} }
# REMARKS:
# The pregnerated header file for ARM must be syncrhonized on update. After the
# configure step, the diff between srcpkgs/nginx/files/ngx_auto_config.h.armv6l
# and masterdir/builddir/nginx-$version/objs/ngx_auto_config.h must be checked
# for changes that must be made.

View file

@ -1 +1 @@
ignore="*.[13579].*" ignore="*\.*[13579]\.*"