Files
BMLFS/build-scripts/brotli.build
2023-11-01 18:24:21 -05:00

60 lines
2.2 KiB
Bash

#! /bin/bash
# Brotli
# Source: https://github.com/google/brotli/archive/v1.1.0/brotli-1.1.0.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: Cmake
# Recommended: NONE
# Optional: Python2
# If optimizing, use flags with GCC
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O2 -fno-lto "
#export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
#patch -Np1 -i ../patches/brotli-void/Revert-Add-runtime-linker-path-to-pkg-config-files.patch &&
#sed -i 's@-R..libdir.@@' scripts/*.pc.in &&
mkdir out &&
cd out &&
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
..
read -p "Compile?" && make -j2 &&
pushd .. &&
pip3 wheel -w dist --no-build-isolation --no-deps --no-cache-dir $PWD
popd &&
sudo -S make DESTDIR=$BUILD install &&
cd ..
sudo -S pip3 install --no-index --find-links=dist --no-cache-dir --no-user Brotli --root=$BUILD
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
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 ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
brotli: brotli (Brotli compression format)
brotli:
brotli: Brotli is a general purpose lossless compression algorithm that
brotli: compresses data using a combination of a modern variant of the LZ77
brotli: algorithm, Huffman coding, and second order context modeling, with a
brotli: compression ratio comparable to the best currently available general
brotli: purpose compression methods. It is similar in speed with deflate but
brotli: offers more dense compression.
brotli:
brotli: Homepage: https://github.com/google/brotli/
brotli:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/brotli-1.1.0-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*