diff --git a/CI/before-deploy-osx.sh b/CI/before-deploy-osx.sh index 4bb61885d..2074af497 100755 --- a/CI/before-deploy-osx.sh +++ b/CI/before-deploy-osx.sh @@ -8,9 +8,12 @@ hr() { set -e # Generate file name variables +export GIT_TAG=$(git describe --abbrev=0) export GIT_HASH=$(git rev-parse --short HEAD) export FILE_DATE=$(date +%Y-%m-%d.%H-%M-%S) -export FILENAME=$FILE_DATE-$GIT_HASH-$TRAVIS_BRANCH-osx.pkg +export FILENAME=$FILE_DATE-$GIT_HASH-$TRAVIS_BRANCH-osx.dmg + +echo "git tag: $GIT_TAG" cd ./build @@ -30,32 +33,57 @@ if [ -n "${TRAVIS_TAG}" ]; then STABLE=true fi -sudo python ../CI/install/osx/build_app.py --public-key ../CI/install/osx/OBSPublicDSAKey.pem --sparkle-framework ../../sparkle/Sparkle.framework --stable=$STABLE +#sudo python ../CI/install/osx/build_app.py --public-key ../CI/install/osx/OBSPublicDSAKey.pem --sparkle-framework ../../sparkle/Sparkle.framework --stable=$STABLE + +../CI/install/osx/packageApp + +# curl +cp /usr/local/opt/curl/lib/libcurl.4.dylib ./OBS.app/Contents/Frameworks/ +install_name_tool -change /usr/local/opt/curl/lib/libcurl.4.dylib @executable_path/../Frameworks/libcurl.4.dylib ./OBS.app/Contents/Plugins/rtmp-services.so + +# luajit +install_name_tool -change /tmp/obsdeps/lib/libluajit-5.1.2.dylib @executable_path/../Frameworks/libluajit-5.1.2.dylib ./OBS.app/Contents/Plugins/frontend-tools.so + +# jack +cp /usr/local/opt/jack/lib/libjack.0.dylib ./OBS.app/Contents/Frameworks/ +cp /usr/local/opt/berkeley-db/lib/libdb-18.1.dylib ./OBS.app/Contents/Frameworks/ +install_name_tool -change /usr/local/opt/jack/lib/libjack.0.dylib @executable_path/../Frameworks/libjack.0.dylib ./OBS.app/Contents/Plugins/linux-jack.so +install_name_tool -change /usr/local/opt/berkeley-db/lib/libdb-18.1.dylib @executable_path/../Frameworks/libdb-18.1.dylib ./OBS.app/Contents/Frameworks/libjack.0.dylib + +# speexdsp +cp /usr/local/opt/speexdsp/lib/libspeexdsp.1.dylib ./OBS.app/Contents/Frameworks/ +install_name_tool -change /usr/local/opt/speexdsp/lib/libspeexdsp.1.dylib @executable_path/../Frameworks/libspeexdsp.1.dylib ./OBS.app/Contents/Plugins/obs-filters.so + +# libmbedtls +cp /usr/local/opt/mbedtls/lib/libmbedtls.12.dylib ./OBS.app/Contents/Frameworks/ +cp /usr/local/opt/mbedtls/lib/libmbedcrypto.3.dylib ./OBS.app/Contents/Frameworks/ +cp /usr/local/opt/mbedtls/lib/libmbedx509.0.dylib ./OBS.app/Contents/Frameworks/ +install_name_tool -change /usr/local/opt/mbedtls/lib/libmbedtls.12.dylib @executable_path/../Frameworks/libmbedtls.12.dylib ./OBS.app/Contents/Plugins/obs-outputs.so +install_name_tool -change /usr/local/opt/mbedtls/lib/libmbedcrypto.3.dylib @executable_path/../Frameworks/libmbedcrypto.3.dylib ./OBS.app/Contents/Plugins/obs-outputs.so +install_name_tool -change /usr/local/opt/mbedtls/lib/libmbedx509.0.dylib @executable_path/../Frameworks/libmbedx509.0.dylib ./OBS.app/Contents/Plugins/obs-outputs.so + +# copy sparkle into the app +hr "Copying Sparkle.framework" +cp -r ../../sparkle/Sparkle.framework ./OBS.app/Contents/Frameworks/ +install_name_tool -change @rpath/Sparkle.framework/Versions/A/Sparkle @executable_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle ./OBS.app/Contents/MacOS/obs # Copy Chromium embedded framework to app Frameworks directory hr "Copying Chromium Embedded Framework.framework" sudo mkdir -p OBS.app/Contents/Frameworks sudo cp -r ../../cef_binary_${CEF_BUILD_VERSION}_macosx64/Release/Chromium\ Embedded\ Framework.framework OBS.app/Contents/Frameworks/ -sudo install_name_tool -change \ - @rpath/Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - ../../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - OBS.app/Contents/Resources/obs-plugins/obs-browser.so -sudo install_name_tool -change \ - @executable_path/../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - ../../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - OBS.app/Contents/Resources/obs-plugins/obs-browser.so -sudo install_name_tool -change \ - @rpath/Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - ../../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - OBS.app/Contents/Resources/obs-plugins/obs-browser-page -sudo install_name_tool -change \ - @executable_path/../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - ../../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework \ - OBS.app/Contents/Resources/obs-plugins/obs-browser-page -# Package app -hr "Generating .pkg" -packagesbuild ../CI/install/osx/CMakeLists.pkgproj +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-browser.so +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-browser.so +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-browser.so + +# edit plist +plutil -insert CFBundleVersion -string $GIT_TAG-$GIT_HASH ./OBS.app/Contents/Info.plist +plutil -insert CFBundleShortVersionString -string $GIT_TAG-$GIT_HASH ./OBS.app/Contents/Info.plist +plutil -insert OBSFeedsURL -string https://obsproject.com/osx_update/feeds.xml ./OBS.app/Contents/Info.plist +plutil -insert SUFeedURL -string https://obsproject.com/osx_update/stable/updates.xml ./OBS.app/Contents/Info.plist +plutil -insert SUPublicDSAKeyFile -string OBSPublicDSAKey.pem ./OBS.app/Contents/Info.plist + +dmgbuild -s ../CI/install/osx/settings.json "OBS" obs.dmg if [ -v "$TRAVIS" ]; then # Signing stuff @@ -70,12 +98,10 @@ if [ -v "$TRAVIS" ]; then security import ./Certificates.p12 -k build.keychain -T /usr/bin/productsign -P "" # macOS 10.12+ security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword build.keychain - hr "Signing Package" - productsign --sign 2MMRE5MTB8 ./OBS.pkg ./$FILENAME -else - cp ./OBS.pkg ./$FILENAME fi +cp ./OBS.dmg ./$FILENAME + # Move to the folder that travis uses to upload artifacts from hr "Moving package to nightly folder for distribution" mkdir ../nightly diff --git a/CI/install-dependencies-osx.sh b/CI/install-dependencies-osx.sh index c37d58843..425ef3cfb 100755 --- a/CI/install-dependencies-osx.sh +++ b/CI/install-dependencies-osx.sh @@ -16,6 +16,8 @@ else /bin/bash -c "sudo xcode-select -s /Applications/Xcode_9.4.1.app/Contents/Developer" fi +git fetch origin --tags + # Leave obs-studio folder cd ../ @@ -32,6 +34,8 @@ brew install jack speexdsp ccache mbedtls clang-format brew install https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb brew install https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb +pip install dmgbuild + export PATH=/usr/local/opt/ccache/libexec:$PATH ccache -s || echo "CCache is not available." diff --git a/CI/install/osx/Info.plist b/CI/install/osx/Info.plist new file mode 100644 index 000000000..7eed962ad --- /dev/null +++ b/CI/install/osx/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleIconFile + obs.icns + CFBundleName + OBS + CFBundleGetInfoString + OBS - Free and Open Source Streaming/Recording Software + CFBundleExecutable + OBS + CFBundleIdentifier + com.obsproject.obs-studio + CFBundlePackageType + APPL + CFBundleSignature + ???? + LSMinimumSystemVersion + 10.8.5 + NSHighResolutionCapable + + LSAppNapIsDisabled + + NSCameraUsageDescription + OBS needs to access the camera to enable camera sources to work. + NSMicrophoneUsageDescription + OBS needs to access the microphone to enable audio input. + + diff --git a/CI/install/osx/background.png b/CI/install/osx/background.png new file mode 100644 index 000000000..02c4d5501 Binary files /dev/null and b/CI/install/osx/background.png differ diff --git a/CI/install/osx/background.pxd/QuickLook/Icon.tiff b/CI/install/osx/background.pxd/QuickLook/Icon.tiff new file mode 100644 index 000000000..4ef96a409 Binary files /dev/null and b/CI/install/osx/background.pxd/QuickLook/Icon.tiff differ diff --git a/CI/install/osx/background.pxd/QuickLook/Preview.tiff b/CI/install/osx/background.pxd/QuickLook/Preview.tiff new file mode 100644 index 000000000..b28ab1ec4 Binary files /dev/null and b/CI/install/osx/background.pxd/QuickLook/Preview.tiff differ diff --git a/CI/install/osx/background.pxd/QuickLook/Thumbnail.tiff b/CI/install/osx/background.pxd/QuickLook/Thumbnail.tiff new file mode 100644 index 000000000..1bd46a7ea Binary files /dev/null and b/CI/install/osx/background.pxd/QuickLook/Thumbnail.tiff differ diff --git a/CI/install/osx/background.pxd/data/556CF265-5721-4F18-BE83-8CF39483B4C2 b/CI/install/osx/background.pxd/data/556CF265-5721-4F18-BE83-8CF39483B4C2 new file mode 100644 index 000000000..3036891ae Binary files /dev/null and b/CI/install/osx/background.pxd/data/556CF265-5721-4F18-BE83-8CF39483B4C2 differ diff --git a/CI/install/osx/background.pxd/data/8CA689C3-ED2A-459E-952C-E08026CFCD07 b/CI/install/osx/background.pxd/data/8CA689C3-ED2A-459E-952C-E08026CFCD07 new file mode 100644 index 000000000..52d94b97c Binary files /dev/null and b/CI/install/osx/background.pxd/data/8CA689C3-ED2A-459E-952C-E08026CFCD07 differ diff --git a/CI/install/osx/background.pxd/metadata.info b/CI/install/osx/background.pxd/metadata.info new file mode 100644 index 000000000..6054a580b Binary files /dev/null and b/CI/install/osx/background.pxd/metadata.info differ diff --git a/CI/install/osx/background.tiff b/CI/install/osx/background.tiff new file mode 100644 index 000000000..454874005 Binary files /dev/null and b/CI/install/osx/background.tiff differ diff --git a/CI/install/osx/background@2x.png b/CI/install/osx/background@2x.png new file mode 100644 index 000000000..a001edf36 Binary files /dev/null and b/CI/install/osx/background@2x.png differ diff --git a/CI/install/osx/buildDMG b/CI/install/osx/buildDMG new file mode 100755 index 000000000..af2c798e4 --- /dev/null +++ b/CI/install/osx/buildDMG @@ -0,0 +1 @@ +dmgbuild -s ./settings.json "OBS" obs.dmg diff --git a/CI/install/osx/makeRetinaBG b/CI/install/osx/makeRetinaBG new file mode 100755 index 000000000..5d7f309b5 --- /dev/null +++ b/CI/install/osx/makeRetinaBG @@ -0,0 +1 @@ +tiffutil -cathidpicheck background.png background@2x.png -out background.tiff diff --git a/CI/install/osx/obs.icns b/CI/install/osx/obs.icns new file mode 100644 index 000000000..6f878d6a3 Binary files /dev/null and b/CI/install/osx/obs.icns differ diff --git a/CI/install/osx/packageApp b/CI/install/osx/packageApp new file mode 100755 index 000000000..133decc2e --- /dev/null +++ b/CI/install/osx/packageApp @@ -0,0 +1,25 @@ +mkdir OBS.app +mkdir OBS.app/Contents +mkdir OBS.app/Contents/MacOS +mkdir OBS.app/Contents/Plugins +mkdir OBS.app/Contents/Resources + +cp -r rundir/RelWithDebInfo/bin/ ./OBS.app/Contents/MacOS +cp -r rundir/RelWithDebInfo/data ./OBS.app/Contents/Resources +cp ../CI/install/osx/obs.icns ./OBS.app/Contents/Resources +cp -r rundir/RelWithDebInfo/obs-plugins/ ./OBS.app/Contents/Plugins +cp ../CI/install/osx/Info.plist ./OBS.app/Contents + +/usr/local/Cellar/qt/5.10.1/bin/macdeployqt ./OBS.app + +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 + +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 + +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 + +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 + +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 + +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 \ No newline at end of file diff --git a/CI/install/osx/settings.json b/CI/install/osx/settings.json new file mode 100644 index 000000000..34fbc2ff4 --- /dev/null +++ b/CI/install/osx/settings.json @@ -0,0 +1,13 @@ +{ + "title": "OBS", + "background": "../CI/install/osx/background.tiff", + "format": "UDZO", + "compression-level": 9, + "window": { "position": { "x": 100, "y": 100 }, + "size": { "width": 540, "height": 380 } }, + "contents": [ + { "x": 120, "y": 180, "type": "file", + "path": "./OBS.app" }, + { "x": 420, "y": 180, "type": "link", "path": "/Applications" } + ] +}