packageApp.sh 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/usr/bin/env bash
  2. # Exit if something fails
  3. set -e
  4. rm -rf ./OBS.app
  5. mkdir OBS.app
  6. mkdir OBS.app/Contents
  7. mkdir OBS.app/Contents/MacOS
  8. mkdir OBS.app/Contents/PlugIns
  9. mkdir OBS.app/Contents/Resources
  10. cp -R rundir/RelWithDebInfo/bin/ ./OBS.app/Contents/MacOS
  11. cp -R rundir/RelWithDebInfo/data ./OBS.app/Contents/Resources
  12. cp ../CI/scripts/macos/app/obs.icns ./OBS.app/Contents/Resources
  13. cp -R rundir/RelWithDebInfo/obs-plugins/ ./OBS.app/Contents/PlugIns
  14. cp ../CI/scripts/macos/app/Info.plist ./OBS.app/Contents
  15. ../CI/scripts/macos/package/dylibBundler -b -cd -d ./OBS.app/Contents/Frameworks -p @executable_path/../Frameworks/ \
  16. -s ./OBS.app/Contents/MacOS \
  17. -x ./OBS.app/Contents/PlugIns/coreaudio-encoder.so \
  18. -x ./OBS.app/Contents/PlugIns/decklink-ouput-ui.so \
  19. -x ./OBS.app/Contents/PlugIns/frontend-tools.so \
  20. -x ./OBS.app/Contents/PlugIns/image-source.so \
  21. -x ./OBS.app/Contents/PlugIns/linux-jack.so \
  22. -x ./OBS.app/Contents/PlugIns/mac-avcapture.so \
  23. -x ./OBS.app/Contents/PlugIns/mac-capture.so \
  24. -x ./OBS.app/Contents/PlugIns/mac-decklink.so \
  25. -x ./OBS.app/Contents/PlugIns/mac-syphon.so \
  26. -x ./OBS.app/Contents/PlugIns/mac-vth264.so \
  27. -x ./OBS.app/Contents/PlugIns/obs-browser.so \
  28. -x ./OBS.app/Contents/PlugIns/obs-browser-page \
  29. -x ./OBS.app/Contents/PlugIns/obs-ffmpeg.so \
  30. -x ./OBS.app/Contents/PlugIns/obs-filters.so \
  31. -x ./OBS.app/Contents/PlugIns/obs-transitions.so \
  32. -x ./OBS.app/Contents/PlugIns/obs-vst.so \
  33. -x ./OBS.app/Contents/PlugIns/rtmp-services.so \
  34. -x ./OBS.app/Contents/MacOS/obs \
  35. -x ./OBS.app/Contents/MacOS/obs-ffmpeg-mux \
  36. -x ./OBS.app/Contents/MacOS/obslua.so \
  37. -x ./OBS.app/Contents/PlugIns/obs-x264.so \
  38. -x ./OBS.app/Contents/PlugIns/text-freetype2.so \
  39. -x ./OBS.app/Contents/PlugIns/obs-libfdk.so
  40. # -x ./OBS.app/Contents/MacOS/_obspython.so \
  41. # -x ./OBS.app/Contents/PlugIns/obs-outputs.so \
  42. /usr/local/Cellar/qt/${QT_VERSION}/bin/macdeployqt ./OBS.app
  43. mv ./OBS.app/Contents/MacOS/libobs-opengl.so ./OBS.app/Contents/Frameworks
  44. rm -f -r ./OBS.app/Contents/Frameworks/QtNetwork.framework
  45. # put qt network in here becasuse streamdeck uses it
  46. cp -R /usr/local/opt/qt/lib/QtNetwork.framework ./OBS.app/Contents/Frameworks
  47. chmod -R +w ./OBS.app/Contents/Frameworks/QtNetwork.framework
  48. rm -r ./OBS.app/Contents/Frameworks/QtNetwork.framework/Headers
  49. rm -r ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/Headers/
  50. chmod 644 ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/Resources/Info.plist
  51. install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork
  52. install_name_tool -change /usr/local/Cellar/qt/${QT_VERSION}/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./OBS.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork
  53. # decklink ui qt
  54. install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./OBS.app/Contents/PlugIns/decklink-ouput-ui.so
  55. install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./OBS.app/Contents/PlugIns/decklink-ouput-ui.so
  56. install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./OBS.app/Contents/PlugIns/decklink-ouput-ui.so
  57. # frontend tools qt
  58. install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./OBS.app/Contents/PlugIns/frontend-tools.so
  59. install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./OBS.app/Contents/PlugIns/frontend-tools.so
  60. install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./OBS.app/Contents/PlugIns/frontend-tools.so
  61. # vst qt
  62. install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./OBS.app/Contents/PlugIns/obs-vst.so
  63. install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./OBS.app/Contents/PlugIns/obs-vst.so
  64. install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./OBS.app/Contents/PlugIns/obs-vst.so
  65. install_name_tool -change /usr/local/opt/qt/lib/QtMacExtras.framework/Versions/5/QtMacExtras @executable_path/../Frameworks/QtMacExtras.framework/Versions/5/QtMacExtras ./OBS.app/Contents/PlugIns/obs-vst.so