Files
BMLFS/build-scripts/nghttp2.build
2023-10-31 19:09:53 -05:00

82 lines
2.4 KiB
Bash

#! /bin/bash
# nghttp2
# Source: https://github.com/nghttp2/nghttp2/releases/download/v1.57.0/nghttp2-1.57.0.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: libevent, libxml2
# Optional: libev, jansson
# LTO: Tested with LLVM
# If optimizing, use these flags
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -Os -fdata-sections -ffat-lto-objects "
export CFLAGS+="-ffunction-sections -flto=4 -fno-semantic-interposition "
export CXXFLAGS=$CFLAGS
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
./configure --prefix=/usr \
--disable-static \
--enable-lib-only \
--docdir=/usr/share/doc/nghttp2-1.57.0 $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
# If not using any package manager
#sudo -S make install
sudo -S make DESTDIR=${BUILD} install &&
sudo -S mkdir -pv ${BUILD}/install &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr/share
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/
sudo -S mv $BUILD/usr/share/doc /BMAN/usr/share/
cd $BUILD &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
nghttp2: nghttp2
nghttp2:
nghttp2: An implementation of HTTP/2 and its header compression algorithm,
nghttp2: HPACK.
nghttp2:
nghttp2: Homepage: https://github.com/nghttp2
nghttp2:
nghttp2:
nghttp2:
nghttp2:
nghttp2:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/nghttp2-1.57.0-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
nghttp2-doc: Manuals for nghttp2
nghttp2-doc:
nghttp2-doc: An implementation of HTTP/2 and its header compression algorithm,
nghttp2-doc: HPACK
nghttp2-doc:
nghttp2-doc: Homepage: https://github.com/nghttp2
nghttp2-doc:
nghttp2-doc:
nghttp2-doc:
nghttp2-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/
sudo -S makepkg -l y -c n $PKGS/nghttp2-doc-1.53.0-$NOPSUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*