-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake_bundle.sh
executable file
·75 lines (59 loc) · 2.29 KB
/
make_bundle.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
if (( $# != 1 )); then
echo "\nERROR: debe especificar el nombre del binario del App Bundle!\n"
exit 1
fi
if [[ "$1" = *[[:space:]]* ]]; then
echo "\nERROR: el nombre del binario del App Bundle no debe tener espacios!\n"
exit 1
fi
echo "\nLimpiando Directorios..."
find . -name ".DS_Store" -depth -exec rm -f {} \;
rm -rf build
rm -rf dist
echo "\nGenerando el binario..."
go clean
go build -tags appbundle -o "$1"
echo "\nCreando App Bundle (py2app)..."
touch dummy.py
python3 setup.py py2app --semi-standalone &> /dev/null
rm -f dummy.py
echo "\nAdaptando el App Bundle..."
rm -rf dist/dummy.app/Contents/MacOS/**
rm -rf dist/dummy.app/Contents/Resources/**
echo "\nNormalizando los Frameworks y dylibs..."
rm -rf dist/dummy.app/Contents/Frameworks/Python.framework
rm -rf dist/dummy.app/Contents/Frameworks/libcrypto.1.0.0.dylib
rm -rf dist/dummy.app/Contents/Frameworks/libssl.1.0.0.dylib
rm -rf dist/dummy.app/Contents/Frameworks/liblzma.5.dylib
echo "\nCorrigiendo estructura..."
cp -v bundle_res/App.icns dist/dummy.app/Contents/Resources/
mv -v "$1" "dist/dummy.app/Contents/MacOS/$1"
sed "s/_APP_EXE_/$1/g" bundle_res/Info.plist \
> dist/dummy.app/Contents/Info.plist
echo "\nCorrigiendo Frameworks y dylibs del binario..."
install_name_tool -change \
/usr/local/opt/csfml/lib/libcsfml-window.2.3.dylib \
@executable_path/../Frameworks/libcsfml-window.2.3.dylib \
"dist/dummy.app/Contents/MacOS/$1"
install_name_tool -change \
/usr/local/opt/csfml/lib/libcsfml-graphics.2.3.dylib \
@executable_path/../Frameworks/libcsfml-graphics.2.3.dylib \
"dist/dummy.app/Contents/MacOS/$1"
install_name_tool -change \
/usr/local/opt/csfml/lib/libcsfml-audio.2.3.dylib \
@executable_path/../Frameworks/libcsfml-audio.2.3.dylib \
"dist/dummy.app/Contents/MacOS/$1"
install_name_tool -change \
/usr/local/opt/csfml/lib/libcsfml-system.2.3.dylib \
@executable_path/../Frameworks/libcsfml-system.2.3.dylib \
"dist/dummy.app/Contents/MacOS/$1"
echo "\nCopiando recursos..."
cp -rv font dist/dummy.app/Contents/Resources/
cp -rv gfx dist/dummy.app/Contents/Resources/
cp -rv sfx dist/dummy.app/Contents/Resources/
echo "\nEstableciendo nombre del App Bundle..."
mv -v dist/dummy.app "dist/$1.app"
echo "\nLimpiando resultados..."
rm -rf build
echo "\n*** App Bundle creado con exito! :) ***\n"