-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·49 lines (35 loc) · 2.22 KB
/
package.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
#!/usr/bin/env sh
# couldnt figure out undocumented 'output template' mode for pkg so wrote this
# also need to include .node files until pkg supports including them in binary
NODE_ABI="node-64"
VERSION=$(node -pe "require('./package.json').version")
echo $NODE_ABI
echo $VERSION
rm -rf dist
mkdir dist
mkdir builds/supr-$VERSION-linux-x64
mkdir builds/supr-$VERSION-macos-x64
mkdir builds/supr-$VERSION-win-x64
mv builds/supr-linux builds/supr-$VERSION-linux-x64/supr
mv builds/supr-macos builds/supr-$VERSION-macos-x64/supr
mv builds/supr-win.exe builds/supr-$VERSION-win-x64/supr.exe
cp node_modules/utp-native/prebuilds/linux-x64/node-napi.node builds/supr-$VERSION-linux-x64/
cp node_modules/utp-native/prebuilds/darwin-x64/node-napi.node builds/supr-$VERSION-macos-x64/
cp node_modules/utp-native/prebuilds/win32-x64/node-napi.node builds/supr-$VERSION-win-x64/
cp node_modules/sodium-native/prebuilds/linux-x64/node-64.node builds/supr-$VERSION-linux-x64/
cp node_modules/sodium-native/prebuilds/darwin-x64/node-64.node builds/supr-$VERSION-macos-x64/
cp node_modules/sodium-native/prebuilds/win32-x64/node-64.node builds/supr-$VERSION-win-x64/
cp node_modules/sodium-native/prebuilds/linux-x64/libsodium.so.23 builds/supr-$VERSION-linux-x64/
cp node_modules/sodium-native/prebuilds/darwin-x64/libsodium.dylib builds/supr-$VERSION-macos-x64/
cp node_modules/sodium-native/prebuilds/win32-x64/libsodium.dll builds/supr-$VERSION-win-x64/
#cp -rv ffmpeg/ builds/supr-$VERSION-win-x64/
cp LICENSE builds/supr-$VERSION-linux-x64/
cp LICENSE builds/supr-$VERSION-macos-x64/
cp LICENSE builds/supr-$VERSION-win-x64/
cp README.md builds/supr-$VERSION-linux-x64/README
cp README.md builds/supr-$VERSION-macos-x64/README
cp README.md builds/supr-$VERSION-win-x64/README
cd builds
7z a ../dist/supr-$VERSION-linux-x64.7z supr-$VERSION-linux-x64 || echo "Trying 7zr bin instead" && 7zr a ../dist/supr-$VERSION-linux-x64.7z supr-$VERSION-linux-x64
7z a ../dist/supr-$VERSION-macos-x64.7z supr-$VERSION-macos-x64 || echo "Trying 7zr bin instead" && 7zr a ../dist/supr-$VERSION-macos-x64.7z supr-$VERSION-macos-x64
7z a ../dist/supr-$VERSION-win-x64.7z supr-$VERSION-win-x64 || echo "Trying 7zr bin instead" && 7zr a ../dist/supr-$VERSION-win-x64.7z supr-$VERSION-win-x64