Add 'opus-tools_static_build.sh'
This commit is contained in:
parent
f68a88b6e1
commit
311522de86
|
@ -0,0 +1,117 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ==============================================================
|
||||
#
|
||||
# Bash script to build a statically linked version of opus-tools based on:
|
||||
# https://gist.github.com/guest271314/12a93ff775590867c0862be45fc71161
|
||||
#
|
||||
# Repos:
|
||||
# https://gitlab.xiph.org/xiph/ogg.git
|
||||
# https://gitlab.xiph.org/xiph/flac.git
|
||||
# https://gitlab.xiph.org/xiph/opus.git
|
||||
# https://gitlab.xiph.org/xiph/libopusenc.git
|
||||
# https://gitlab.xiph.org/xiph/opusfile.git
|
||||
# https://gitlab.xiph.org/xiph/opus-tools.git
|
||||
#
|
||||
# Build deps: autoconf automake libtool pkg-config git
|
||||
#
|
||||
# ==============================================================
|
||||
|
||||
export BUILD_DIR="$(pwd)/build"
|
||||
export PKG_CONFIG_PATH="$BUILD_DIR/lib/pkgconfig"
|
||||
#export OPT_FLAGS='-march=x86-64 -mtune=generic -O2'
|
||||
XIPH=https://gitlab.xiph.org/xiph/
|
||||
LIBS=(ogg flac opus libopusenc opusfile opus-tools)
|
||||
|
||||
echo 'Cloning git repositories...'
|
||||
for repo in "${LIBS[@]}"
|
||||
do
|
||||
git clone --depth 1 "$XIPH$repo.git"
|
||||
done
|
||||
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
echo 'Building libogg...'
|
||||
cd "${LIBS[0]}" || exit
|
||||
./autogen.sh
|
||||
./configure --prefix="$BUILD_DIR" \
|
||||
--disable-shared --enable-static \
|
||||
--disable-maintainer-mode
|
||||
make clean
|
||||
make -j "$(nproc)" install
|
||||
cd ..
|
||||
|
||||
echo 'Building FLAC...'
|
||||
cd "${LIBS[1]}" || exit
|
||||
./autogen.sh
|
||||
./configure --prefix="$BUILD_DIR" \
|
||||
--disable-shared --enable-static \
|
||||
--disable-debug \
|
||||
--disable-oggtest \
|
||||
--disable-cpplibs \
|
||||
--disable-xmms-plugin \
|
||||
--disable-doxygen-docs \
|
||||
--disable-examples
|
||||
make clean
|
||||
make -j "$(nproc)" install
|
||||
cd ..
|
||||
|
||||
echo 'Building Opus...'
|
||||
cd "${LIBS[2]}" || exit
|
||||
./autogen.sh
|
||||
./configure --prefix="$BUILD_DIR" \
|
||||
--disable-shared --enable-static \
|
||||
--disable-maintainer-mode \
|
||||
--disable-doc \
|
||||
--disable-extra-programs
|
||||
make clean
|
||||
make -j "$(nproc)" install
|
||||
# Hack
|
||||
sed -i 's/Version: unknown/Version: 1.3.1/' "$PKG_CONFIG_PATH/opus.pc"
|
||||
cd ..
|
||||
|
||||
echo 'Building libopusenc...'
|
||||
cd "${LIBS[3]}" || exit
|
||||
./autogen.sh
|
||||
./configure --prefix="$BUILD_DIR" \
|
||||
--disable-shared --enable-static \
|
||||
--disable-maintainer-mode \
|
||||
--disable-examples \
|
||||
--disable-doc
|
||||
make clean
|
||||
make -j "$(nproc)" install
|
||||
# Hack
|
||||
sed -i 's/Version: unknown/Version: 0.2.1/' "$PKG_CONFIG_PATH/libopusenc.pc"
|
||||
cd ..
|
||||
|
||||
echo 'Building opusfile...'
|
||||
cd "${LIBS[4]}" || exit
|
||||
./autogen.sh
|
||||
./configure --prefix="$BUILD_DIR" \
|
||||
--disable-shared --enable-static \
|
||||
--disable-maintainer-mode \
|
||||
--disable-examples \
|
||||
--disable-doc \
|
||||
--disable-http
|
||||
make clean
|
||||
make -j "$(nproc)" install
|
||||
# Hack
|
||||
sed -i 's/Version: unknown/Version: 0.12/' "$PKG_CONFIG_PATH/opusfile.pc"
|
||||
sed -i 's/Version: unknown/Version: 0.12/' "$PKG_CONFIG_PATH/opusurl.pc"
|
||||
cd ..
|
||||
|
||||
echo 'Building opus-tools...'
|
||||
cd "${LIBS[5]}" || exit
|
||||
./autogen.sh
|
||||
./configure --prefix="$BUILD_DIR" \
|
||||
--disable-shared --enable-static \
|
||||
--disable-maintainer-mode
|
||||
make clean
|
||||
make -j "$(nproc)" install || exit
|
||||
cd ..
|
||||
|
||||
for file in "$BUILD_DIR"/bin/opus*
|
||||
do
|
||||
cp "$file" "$PWD/$(basename "$file")-static"
|
||||
strip -s "$PWD/$(basename "$file")-static"
|
||||
done
|
Loading…
Reference in New Issue