Compare commits

..

1 Commits

Author SHA1 Message Date
ae6ef16cd1 Add Brotli module, use BoringSSL and zlib-ng 2019-10-02 13:02:46 +03:00
2 changed files with 48 additions and 6 deletions

4
.gitignore vendored
View File

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

View File

@ -10,17 +10,21 @@ _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=9638f8fba961a593c064e3036bb580bdace29e8f
_zlibng_commit=503bdef7a29a7078a50d8149e261c4299a82a9da
_pkgname=nginx _pkgname=nginx
pkgname=nginx-ilves pkgname=nginx-ilves
pkgver=1.17.5 pkgver=1.17.4
pkgrel=1 pkgrel=2
pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release' 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,15 +44,21 @@ 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"
sha256sums=('63ee35e15a75af028ffa1f995e2b9c120b59ef5f1b61a23b8a4c33c262fc10c3' "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=('62854b365e66670ef4f1f8cc79124f914551444da974207cd5fe22d85710e555'
'SKIP' 'SKIP'
'6985a7c271a64b9fce5fb24afc459399643a7abf5e7f1a1cc5043c4941443892' '6985a7c271a64b9fce5fb24afc459399643a7abf5e7f1a1cc5043c4941443892'
'06ebe161af3e761f2e2e35a67c6c0af27bf61aea7cd4ba8b28372ced5e3b3175' '06ebe161af3e761f2e2e35a67c6c0af27bf61aea7cd4ba8b28372ced5e3b3175'
'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="$(realpath ../boringssl-build)" \
--with-zlib="$(realpath ../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
} }