forked from simple64/simple64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink-mac.sh
executable file
·87 lines (59 loc) · 3.98 KB
/
link-mac.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
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
contents=mupen64plus/mupen64plus-gui.app/Contents
# Get files in correct directories
mv mupen64plus/font.ttf $contents/MacOS
mv mupen64plus/libmupen64plus.dylib $contents/MacOS
mv mupen64plus/mupen64plus-audio-sdl2.dylib $contents/MacOS
mv mupen64plus/mupen64plus-input-qt.dylib $contents/MacOS
mv mupen64plus/mupen64plus-input-raphnetraw.dylib $contents/MacOS
mv mupen64plus/mupen64plus-rsp-parallel.dylib $contents/MacOS
mv mupen64plus/mupen64plus-video-parallel.dylib $contents/MacOS
mv mupen64plus/mupen64plus.ini $contents/MacOS
mv mupen64plus/mupencheat.txt $contents/MacOS
mv mupen64plus/discord_game_sdk.dylib $contents/MacOS
# SDL
cp /usr/local/opt/sdl2_net/lib/libSDL2-2.0.0.dylib $contents/Frameworks
otool -L $contents/Frameworks/libSDL2_net-2.0.0.dylib
cp /usr/local/opt/sdl2_net/lib/libSDL2_net-2.0.0.dylib $contents/Frameworks
install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib $contents/Frameworks/libSDL2_net-2.0.0.dylib
otool -L $contents/Frameworks/libSDL2_net-2.0.0.dylib
# libpng
cp /usr/local/opt/libpng/lib/libpng16.16.dylib $contents/Frameworks
otool -L $contents/Frameworks/libpng16.16.dylib
# hidapi
cp /usr/local/opt/hidapi/lib/libhidapi.0.dylib $contents/Frameworks
otool -L $contents/Frameworks/libhidapi.0.dylib
# freetype
cp /usr/local/opt/freetype/lib/libfreetype.6.dylib $contents/Frameworks
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libpng16.16.dylib $contents/Frameworks/libfreetype.6.dylib
otool -L $contents/Frameworks/libfreetype.6.dylib
# mupen64plus-gui
# nothing to link
otool -L $contents/MacOS/mupen64plus-gui
# libmupen64plus.dylib
install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib $contents/MacOS/libmupen64plus.dylib
install_name_tool -change /usr/local/opt/sdl2_net/lib/libSDL2_net-2.0.0.dylib @executable_path/../Frameworks/libSDL2_net-2.0.0.dylib $contents/MacOS/libmupen64plus.dylib
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libpng16.16.dylib $contents/MacOS/libmupen64plus.dylib
otool -L $contents/MacOS/libmupen64plus.dylib
# mupen64plus-audio-sdl2.dylib
install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib $contents/MacOS/mupen64plus-audio-sdl2.dylib
otool -L $contents/MacOS/mupen64plus-audio-sdl2.dylib
# mupen64plus-input-qt.dylib
install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib $contents/MacOS/mupen64plus-input-qt.dylib
install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets $contents/MacOS/mupen64plus-input-qt.dylib
install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui $contents/MacOS/mupen64plus-input-qt.dylib
install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore $contents/MacOS/mupen64plus-input-qt.dylib
otool -L $contents/MacOS/mupen64plus-input-qt.dylib
# mupen64plus-input-raphnetraw.dylib
install_name_tool -change /usr/local/opt/hidapi/lib/libhidapi.0.dylib @executable_path/../Frameworks/libhidapi.0.dylib $contents/MacOS/mupen64plus-input-raphnetraw.dylib
otool -L $contents/MacOS/mupen64plus-input-raphnetraw.dylib
# mupen64plus-rsp-parallel.dylib
otool -L $contents/MacOS/mupen64plus-rsp-parallel.dylib
# mupen64plus-video-parallel.dylib
otool -L $contents/MacOS/mupen64plus-video-parallel.dylib
# Time to create the DMG
# 1. Create symlink to Applications folder
ln -s /Applications mupen64plus/Applications
# 2. Create DMG
HASH=$(git rev-parse --short HEAD)
hdiutil create -volname m64p -srcfolder mupen64plus -ov -format UDZO mupen64plus/m64p-osx-$HASH.dmg