+#!/bin/sh -e
+
+opus=opus-1.5.2
+if ! [ -s $opus.tar.gz ] ; then
+ wget --output-document=$opus.tar.gz.tmp \
+ https://downloads.xiph.org/releases/opus/$opus.tar.gz
+ command -v sha512 >/dev/null && SHA512="sha512" || SHA512="sha512sum --binary"
+ hsh=$($SHA512 < $opus.tar.gz.tmp | { read hsh rem ; echo $hsh ; })
+ [ "$hsh" = "78d963cd56d5504611f111e2b3606e236189a3585d65fae1ecdbec9bf4545632b1956f11824328279a2d1ea2ecf441ebc11e455fb598d20a458df15185e95da4" ]
+ mv $opus.tar.gz.tmp $opus.tar.gz
+fi
+rm -fr $opus
+tar xf $opus.tar.gz
+cd $opus
+./configure --prefix=$(realpath ..)/libopus \
+ --enable-deep-plc --enable-osce
+make -j8
+rm -fr ../libopus
+make install
+cd ..
+go_opus_commit=8de5ddafbba227ce1cb46405c69485391c66f9d2
+if ! [ -d go-opus ] ; then
+ git clone --depth 1 git://git.stargrave.org/go-opus.git
+ cd go-opus
+ git fetch origin $go_opus_commit
+ git checkout $go_opus_commit
+ cd ..
+fi
+echo "replace gopkg.in/hraban/opus.v2 => $(realpath go-opus)" >> go.mod
+export PKG_CONFIG_PATH=$(realpath libopus/lib/pkgconfig)
+./mk-bin decodersetcomplexity
+echo Here you go:
+ls bin