-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate-natives.sh
executable file
·52 lines (40 loc) · 2.18 KB
/
update-natives.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -e
# version cames in the first argument
VERSION=$1
if [ -z "$VERSION" ]
then
VERSION=`curl -s https://api.github.com/repos/bladecoder/blade-ink-ffi/releases/latest | grep tag_name | cut -d '"' -f 4`
fi
mkdir -p build
cd build
curl -kOL https://github.com/bladecoder/blade-ink-ffi/releases/download/${VERSION}/libbink-${VERSION}-aarch64-apple-darwin.tar.gz
curl -kOL https://github.com/bladecoder/blade-ink-ffi/releases/download/${VERSION}/libbink-${VERSION}-aarch64-unknown-linux-gnu.tar.gz
curl -kOL https://github.com/bladecoder/blade-ink-ffi/releases/download/${VERSION}/libbink-${VERSION}-x86_64-apple-darwin.tar.gz
curl -kOL https://github.com/bladecoder/blade-ink-ffi/releases/download/${VERSION}/libbink-${VERSION}-x86_64-pc-windows-msvc.zip
curl -kOL https://github.com/bladecoder/blade-ink-ffi/releases/download/${VERSION}/libbink-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
echo "Extracting..."
tar -xzf libbink-${VERSION}-aarch64-apple-darwin.tar.gz
tar -xzf libbink-${VERSION}-aarch64-unknown-linux-gnu.tar.gz
tar -xzf libbink-${VERSION}-x86_64-apple-darwin.tar.gz
unzip libbink-${VERSION}-x86_64-pc-windows-msvc.zip
tar -xzf libbink-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
echo "Copying files..."
cp libbink-${VERSION}-aarch64-apple-darwin/libbink.dylib ../bink/native/arm64/libbink.dylib
cp libbink-${VERSION}-aarch64-unknown-linux-gnu/libbink.so ../bink/native/arm64/libbink.so
cp libbink-${VERSION}-x86_64-apple-darwin/libbink.dylib ../bink/native/x86_64/libbink.dylib
cp libbink-${VERSION}-x86_64-pc-windows-msvc/bink.dll ../bink/native/x86_64/bink.dll
cp libbink-${VERSION}-x86_64-unknown-linux-gnu/libbink.so ../bink/native/x86_64/libbink.so
echo "Cleaning up..."
rm -rf libbink-${VERSION}-aarch64-apple-darwin
rm -rf libbink-${VERSION}-aarch64-unknown-linux-gnu
rm -rf libbink-${VERSION}-x86_64-apple-darwin
rm -rf libbink-${VERSION}-x86_64-pc-windows-msvc
rm -rf libbink-${VERSION}-x86_64-unknown-linux-gnu
rm libbink-${VERSION}-aarch64-apple-darwin.tar.gz
rm libbink-${VERSION}-aarch64-unknown-linux-gnu.tar.gz
rm libbink-${VERSION}-x86_64-apple-darwin.tar.gz
rm libbink-${VERSION}-x86_64-pc-windows-msvc.zip
rm libbink-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
cd ..
echo "Done!"