]> Sergey Matveev's repositories - vors.git/commitdiff
contrib/dl-and-build
authorSergey Matveev <stargrave@stargrave.org>
Sun, 14 Apr 2024 10:13:00 +0000 (13:13 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 14 Apr 2024 10:13:00 +0000 (13:13 +0300)
contrib/dl-and-build [new file with mode: 0755]

diff --git a/contrib/dl-and-build b/contrib/dl-and-build
new file mode 100755 (executable)
index 0000000..e9b7bc4
--- /dev/null
@@ -0,0 +1,33 @@
+#!/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