Files
BMLFS/build-scripts/libsamplerate.build
2022-01-14 13:18:27 -06:00

66 lines
2.6 KiB
Bash

#! /bin/bash
# libsamplerate
# Source: https://github.com/libsndfile/libsamplerate/releases/download/0.2.2/libsamplerate-0.2.2.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: libsndfile, fftw
# If optimizing, use these flags with GCC
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -Ofast -falign-functions=32 -ffat-lto-objects "
export CFLAGS+="-flto=auto -fno-semantic-interposition -mprefer-vector-width=256 "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
cp -v ../files/config.sub-musl build-aux/config.sub &&
cp -v ../files/config.guess-musl build-aux/config.guess &&
./configure --prefix=/usr --disable-static $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr
sudo -S mv $BUILD/usr/share /BMAN/usr/
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------------------------------------------------------|
libsamplerate: libsamplerate (Sample Rate Converter for audio)
libsamplerate:
libsamplerate: Secret Rabbit Code (aka libsamplerate) is a Sample Rate
libsamplerate: Converter for audio. One example of where such a thing
libsamplerate: would be useful is converting audio from the CD sample rate
libsamplerate: of 44.1kHz to the 48kHz sample rate used by DAT players.
libsamplerate: SRC is capable of arbitrary and time varying conversions.
libsamplerate: SRC provides a small set of converters to allow quality to
libsamplerate: be traded off against computation cost.
libsamplerate:
libsamplerate:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libsamplerate-0.2.2-$(uname -m)-mlfs.txz &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
libsamplerate-doc: Manuals for libsamplerate (Sample Rate Converter for audio)
libsamplerate-doc:
libsamplerate-doc: Secret Rabbit Code (aka libsamplerate) is a Sample Rate
libsamplerate-doc: Converter for audio.
libsamplerate-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libsamplerate-doc-0.2.2-noarch-mlfs.txz
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*