name=nghttp2
version=1.68.0
release=3
desc="HTTP/2 library"
url="https://nghttp2.org/"
license="MIT"
depend="glibc"
makedepend=""
source="https://github.com/nghttp2/nghttp2/releases/download/v1.68.0/nghttp2-1.68.0.tar.xz"
sha256="SKIP"

build() {
	cd "nghttp2-1.68.0"
	_opts="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib"
	_help=$(./configure --help 2>/dev/null)
	case "$_help" in *--disable-static*)  _opts="$_opts --disable-static" ;; esac
	case "$_help" in *--disable-nls*)     _opts="$_opts --disable-nls" ;; esac
	case "$_help" in *--enable-examples*) _opts="$_opts --disable-examples" ;; esac
	case "$_help" in *--enable-app*)      _opts="$_opts --disable-app" ;; esac
	case "$_help" in *--enable-hpack-tools*) _opts="$_opts --disable-hpack-tools" ;; esac
	./configure $_opts
	make -j"$JOBS"
}

package() {
	cd "nghttp2-1.68.0"
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir/usr/bin/inflatehd" "$pkgdir/usr/bin/deflatehd"
}
