Compare commits

...

2 Commits

Author SHA1 Message Date
efbc3c831f Update zlib-ng and BoringSSL 2019-10-30 19:48:30 +02:00
2bb78e08c8 Add Brotli module, use BoringSSL and zlib-ng 2019-10-30 19:47:58 +02:00
2 changed files with 45 additions and 3 deletions

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
*.tar* *.tar*
pkg/ pkg/
src/ src/
boringssl/
zlib-ng/
ngx_brotli/

View File

@ -10,6 +10,9 @@ _davext_ver=3.0.0
_fancyindex_ver=0.4.3 _fancyindex_ver=0.4.3
_headers_more_ver=0.33 _headers_more_ver=0.33
_nchan_ver=1.2.6 _nchan_ver=1.2.6
_brotli_commit=e505dce68acc190cc5a1e780a3b0275e39f160ca
_boringssl_commit=6be491b7bb57c3950d4fbb97fdd4a141e3fa4d63
_zlibng_commit=5bd3c582908503135fd8d6326ca0e2a6a947b44f
_pkgname=nginx _pkgname=nginx
pkgname=nginx-ilves pkgname=nginx-ilves
@ -19,8 +22,9 @@ pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release'
arch=('x86_64') arch=('x86_64')
url='https://nginx.org' url='https://nginx.org'
license=('custom') license=('custom')
depends=('pcre' 'zlib' 'openssl' 'geoip' 'mailcap' depends=('pcre' 'brotli' 'geoip' 'mailcap'
'libxml2') # Extra modules dependencies 'libxml2') # Extra modules dependencies
makedepends=('cmake' 'go')
backup=('etc/nginx/fastcgi.conf' backup=('etc/nginx/fastcgi.conf'
'etc/nginx/fastcgi_params' 'etc/nginx/fastcgi_params'
'etc/nginx/koi-win' 'etc/nginx/koi-win'
@ -40,7 +44,10 @@ source=("${url}/download/${_pkgname}-${pkgver}.tar.gz"{,.asc}
"ngx_davext-${_davext_ver}.tar.gz::https://github.com/arut/nginx-dav-ext-module/archive/v${_davext_ver}.tar.gz" "ngx_davext-${_davext_ver}.tar.gz::https://github.com/arut/nginx-dav-ext-module/archive/v${_davext_ver}.tar.gz"
"ngx_fancyindex-${_fancyindex_ver}.tar.gz::https://github.com/aperezdc/ngx-fancyindex/archive/v${_fancyindex_ver}.tar.gz" "ngx_fancyindex-${_fancyindex_ver}.tar.gz::https://github.com/aperezdc/ngx-fancyindex/archive/v${_fancyindex_ver}.tar.gz"
"ngx_headers_more-${_headers_more_ver}.tar.gz::https://github.com/openresty/headers-more-nginx-module/archive/v${_headers_more_ver}.tar.gz" "ngx_headers_more-${_headers_more_ver}.tar.gz::https://github.com/openresty/headers-more-nginx-module/archive/v${_headers_more_ver}.tar.gz"
"ngx_nchan-${_nchan_ver}.tar.gz::https://github.com/slact/nchan/archive/v${_nchan_ver}.tar.gz") "ngx_nchan-${_nchan_ver}.tar.gz::https://github.com/slact/nchan/archive/v${_nchan_ver}.tar.gz"
"ngx_brotli::git+https://github.com/google/ngx_brotli#commit=${_brotli_commit}"
"boringssl::git+https://boringssl.googlesource.com/boringssl#commit=${_boringssl_commit}"
"zlib-ng::git+https://github.com/zlib-ng/zlib-ng#commit=${_zlibng_commit}")
sha256sums=('63ee35e15a75af028ffa1f995e2b9c120b59ef5f1b61a23b8a4c33c262fc10c3' sha256sums=('63ee35e15a75af028ffa1f995e2b9c120b59ef5f1b61a23b8a4c33c262fc10c3'
'SKIP' 'SKIP'
'6985a7c271a64b9fce5fb24afc459399643a7abf5e7f1a1cc5043c4941443892' '6985a7c271a64b9fce5fb24afc459399643a7abf5e7f1a1cc5043c4941443892'
@ -48,7 +55,10 @@ sha256sums=('63ee35e15a75af028ffa1f995e2b9c120b59ef5f1b61a23b8a4c33c262fc10c3'
'd2499d94d82d4e4eac8425d799e52883131ae86a956524040ff2fd230ef9f859' 'd2499d94d82d4e4eac8425d799e52883131ae86a956524040ff2fd230ef9f859'
'81698fb0c1ec9f906ce308c055d5d248085caf390f4b92516c1ec93f87c886d4' '81698fb0c1ec9f906ce308c055d5d248085caf390f4b92516c1ec93f87c886d4'
'a3dcbab117a9c103bc1ea5200fc00a7b7d2af97ff7fd525f16f8ac2632e30fbf' 'a3dcbab117a9c103bc1ea5200fc00a7b7d2af97ff7fd525f16f8ac2632e30fbf'
'277f35e479f80f04f76b70549d0ec7abdf8f1658cf46538ea9b0adf3e8b1ad50') '277f35e479f80f04f76b70549d0ec7abdf8f1658cf46538ea9b0adf3e8b1ad50'
'SKIP'
'SKIP'
'SKIP')
_common_flags=( _common_flags=(
--with-compat --with-compat
@ -87,6 +97,7 @@ _module_flags=(
--add-module=../ngx-fancyindex-${_fancyindex_ver} --add-module=../ngx-fancyindex-${_fancyindex_ver}
--add-module=../headers-more-nginx-module-${_headers_more_ver} --add-module=../headers-more-nginx-module-${_headers_more_ver}
--add-module=../nchan-${_nchan_ver} --add-module=../nchan-${_nchan_ver}
--add-module=../ngx_brotli
) )
prepare() { prepare() {
@ -104,6 +115,26 @@ prepare() {
} }
build() { build() {
msg2 "Building BoringSSL"
mkdir -p boringssl-build
pushd boringssl-build
cmake "${srcdir}/boringssl" -G "Unix Makefiles" -DBUILD_SHARED_LIBS=0
make
# Move BoringSSL files to proper place
mkdir -p .openssl/lib
cp crypto/libcrypto.a ssl/libssl.a .openssl/lib/
cp -r ../boringssl/include .openssl/
popd
msg2 "Building zlib-ng"
mkdir -p zlib-ng-build
pushd zlib-ng-build
cmake "${srcdir}/zlib-ng" -G "Unix Makefiles" -DZLIB_COMPAT=1
make
popd
msg2 "Building nginx"
cd "${_pkgname}-${pkgver}" cd "${_pkgname}-${pkgver}"
./configure \ ./configure \
--prefix=/etc/nginx \ --prefix=/etc/nginx \
@ -122,10 +153,17 @@ build() {
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-cc-opt="${CFLAGS} ${CPPFLAGS}" \ --with-cc-opt="${CFLAGS} ${CPPFLAGS}" \
--with-ld-opt="${LDFLAGS}" \ --with-ld-opt="${LDFLAGS}" \
--with-openssl="../boringssl-build" \
--with-zlib="../zlib-ng-build" \
${_common_flags[@]} \ ${_common_flags[@]} \
${_mainline_flags[@]} \ ${_mainline_flags[@]} \
${_module_flags[@]} ${_module_flags[@]}
# No idea why this is needed, but nginx build otherwise fails
touch ../boringssl-build/.openssl/include/openssl/ssl.h
touch ../zlib-ng-build/libz.a
make make
} }