forked from Inochi2D/inochi-creator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
osxbundle.sh
executable file
·50 lines (37 loc) · 1.42 KB
/
osxbundle.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
echo "Creating directory structure..."
LASTPWD=$PWD
# Handle copying all the dylibs to their respective directories
# As well handle creating our directory structure
cd out/Inochi\ Creator.app/Contents
# Remove old files
if [ -d "Frameworks" ]; then
echo "Removing files from prior bundle..."
rm -r Frameworks SharedSupport Resources
rm Info.plist
fi
# Create new directories and move dylibs
mkdir -p Frameworks SharedSupport Resources Resources/i18n
mv MacOS/libSDL2*.dylib Frameworks/libSDL2.dylib
mv -n MacOS/*.dylib Frameworks
# Move back to where we were
cd $LASTPWD
echo "Setting up file structure..."
# Copy info plist and icon
cp res/Info.plist out/Inochi\ Creator.app/Contents/
# Move any translation files in if any.
mv -n out/*.mo out/Inochi\ Creator.app/Contents/Resources/i18n/
# Copy license info to SharedSupport
cp res/*-LICENSE out/Inochi\ Creator.app/Contents/SharedSupport/
cp LICENSE out/Inochi\ Creator.app/Contents/SharedSupport/LICENSE
# Create icons dir
# TODO: check if dir exists, skip this step if it does
if [ ! -d "out/InochiCreator.icns" ]; then
iconutil -c icns -o out/InochiCreator.icns res/Inochi-Creator.iconset
else
echo "Icons already exist, skipping..."
fi
echo "Applying Icon..."
cp out/InochiCreator.icns out/Inochi\ Creator.app/Contents/Resources/InochiCreator.icns
echo "Cleaning up..."
find out/Inochi\ Creator.app/Contents/MacOS -type f ! -name "inochi-creator" -delete
echo "Done!"