aports/main/ngtcp2/APKBUILD
2025-03-29 15:23:32 +01:00

71 lines
1.6 KiB
Text

# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ngtcp2
pkgver=1.11.0
pkgrel=1
pkgdesc="Implementation of IETF QUIC protocol"
url="https://nghttp2.org/ngtcp2/"
arch="all"
license="MIT"
makedepends="
cmake
gnutls-dev
samurai
"
checkdepends="cunit-dev"
subpackages="
$pkgname-static
$pkgname-dev
$pkgname-gnutls
"
source="https://github.com/ngtcp2/ngtcp2/releases/download/v$pkgver/ngtcp2-$pkgver.tar.xz"
build() {
# Build static library separately w/o LTO for compatibility with non-gcc
# and minimal size.
_build build-static -DENABLE_SHARED_LIB=OFF
# NOTE: -DINTERPROCEDURAL_OPTIMIZATION=ON doesn't work here.
export CFLAGS="$CFLAGS -flto=auto"
_build build-shared -DENABLE_STATIC_LIB=OFF
}
_build() {
local outdir="$1"; shift
local crossopts=
[ "$CBUILD" != "$CHOST" ] \
&& crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
cmake -B "$outdir" -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_GNUTLS=ON \
-DENABLE_OPENSSL=OFF \
$crossopts \
"$@"
cmake --build "$outdir"
}
check() {
cmake --build build-static -t check
}
package() {
DESTDIR="$pkgdir" cmake --install build-static
DESTDIR="$pkgdir" cmake --install build-shared
rm -rf "$pkgdir"/usr/share/doc
}
gnutls() {
pkgdesc="$pkgdesc - GnuTLS backend"
depends="$pkgname=$pkgver-r$pkgrel"
amove usr/lib/libngtcp2_crypto_gnutls.so*
}
sha512sums="
8c4c8faa24d34e8d6c66df99ba7f3a4dbae689b38bf2bfa68e147af11abc050dc1de790ffc5de1f7379405c91d736f67e58d5661c2d2b72126ba079fadee72d3 ngtcp2-1.11.0.tar.xz
"