#! /bin/bash # FLAC # Source: https://downloads.xiph.org/releases/flac/flac-1.4.3.tar.xz # # $BUILD = Directory to temporarily install # $PKGS = Directory to store built packages # # DEPS # Required: NONE # Recommended: NONE # Optional: libogg, NASM, DocBook-Utils, Doxygen, Valgrind # if optimizing, use these flags with GCC export CFLAGS="-march=native -pipe " export CFLAGS+="-O3 -Ofast -falign-functions=32 -ffast-math " export CFLAGS+="-ffat-lto-objects -flto=4 -fno-semantic-interposition " export CFLAGS+="-fstack-protector-strong -ftree-loop-vectorize " export CFLAGS+="-fzero-call-used-regs=used -mprefer-vector-width=256 " export CXXFLAGS="$CFLAGS" export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed " # Security fixes per LFS #patch -Np1 -i ../patches/flac-lfs/flac-1.3.3-security_fixes-1.patch case $(uname -m) in x86_64) export ECONF="--enable-sse" ;; i686) export ECONF="--disable-sse" ;; esac ./configure --prefix=/usr \ --disable-thorough-tests \ --docdir=/usr/share/doc/flac-1.4.3 $BUILDTRUPLE ${ECONF} && read -p "Compile?" && make -j2 && sudo -S make DESTDIR=$BUILD install && sudo -S mkdir -pv /BMAN/install sudo -S mkdir -pv /BMAN/usr/share sudo -S mv $BUILD/usr/share/doc /BMAN/usr/share/ sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/ 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------------------------------------------------------| flac: flac (Free Lossless Audio Codec) flac: flac: FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, flac: FLAC is similar to MP3, but lossless. "Free" means that the flac: specification of the stream format is in the public domain, and that flac: neither the FLAC format nor any of the implemented encoding/decoding flac: methods are covered by any patent. It also means that the sources for flac: libFLAC and libFLAC++ are available under the LGPL and the sources for flac: flac, metaflac, and the plugins are available under the GPL. flac: flac: FLAC was developed by Josh Coalson. EOF sudo -S mv -v /tmp/slack-desc install/ && sudo -S makepkg -l y -c n $PKGS/flac-1.4.3-$PSUFFIX && cd /BMAN cat > /tmp/slack-desc << "EOF" flac-doc: Manuals for flac (Free Lossless Audio Codec) flac-doc: flac-doc: FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, flac-doc: FLAC is similar to MP3, but lossless. "Free" means that the flac-doc: specification of the stream format is in the public domain, and that flac-doc: neither the FLAC format nor any of the implemented encoding/decoding flac-doc: methods are covered by any patent. flac-doc: flac-doc: FLAC was developed by Josh Coalson. flac-doc: EOF sudo -S mv -v /tmp/slack-desc install/ && sudo -S makepkg -l y -c n $PKGS/flac-doc-1.4.3-$NOPSUFFIX sudo -S rm -f /BMAN/* sudo -S rm -rf ${BUILD}/*