mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Merge pull request #246 from PatTheMav/4.4-macOS-build-update
4.4 macOS build system update
This commit is contained in:
commit
feaeef5a70
@ -34,12 +34,12 @@ matrix:
|
|||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
env: _macos_build
|
env: _macos_build
|
||||||
osx_image: xcode8.3
|
osx_image: xcode9.4
|
||||||
before_install:
|
before_install:
|
||||||
- "./CI/install-dependencies-macos.sh"
|
- "./CI/install-dependencies-macos.sh"
|
||||||
- "./CI/install-build-obs-macos.sh"
|
- "./CI/install-build-obs-macos.sh"
|
||||||
script: "./CI/build-macos.sh"
|
script: "./CI/build-macos.sh"
|
||||||
after_success:
|
after_success:
|
||||||
- ./CI/package-macos.sh
|
- ./CI/package-macos.sh
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
@ -53,7 +53,7 @@ deploy:
|
|||||||
acl: public_read
|
acl: public_read
|
||||||
on:
|
on:
|
||||||
repo: Palakis/obs-websocket
|
repo: Palakis/obs-websocket
|
||||||
condition:
|
condition:
|
||||||
- "$TRAVIS_OS_NAME = linux"
|
- "$TRAVIS_OS_NAME = linux"
|
||||||
- "-d /home/travis/package"
|
- "-d /home/travis/package"
|
||||||
all_branches: true
|
all_branches: true
|
||||||
|
@ -1,8 +1,22 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ex
|
|
||||||
|
OSTYPE=$(uname)
|
||||||
|
|
||||||
|
if [ "${OSTYPE}" != "Darwin" ]; then
|
||||||
|
echo "[obs-websocket - Error] macOS build script can be run on Darwin-type OS only."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
HAS_CMAKE=$(type cmake 2>/dev/null)
|
||||||
|
|
||||||
|
if [ "${HAS_CMAKE}" = "" ]; then
|
||||||
|
echo "[obs-websocket - Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
#export QT_PREFIX="$(find /usr/local/Cellar/qt5 -d 1 | tail -n 1)"
|
#export QT_PREFIX="$(find /usr/local/Cellar/qt5 -d 1 | tail -n 1)"
|
||||||
|
|
||||||
|
echo "[obs-websocket] Building 'obs-websocket' for macOS."
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DQTDIR=/usr/local/opt/qt \
|
-DQTDIR=/usr/local/opt/qt \
|
||||||
|
@ -1,13 +1,34 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ex
|
|
||||||
|
OSTYPE=$(uname)
|
||||||
|
|
||||||
|
if [ "${OSTYPE}" != "Darwin" ]; then
|
||||||
|
echo "[obs-websocket - Error] macOS obs-studio build script can be run on Darwin-type OS only."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
HAS_CMAKE=$(type cmake 2>/dev/null)
|
||||||
|
HAS_GIT=$(type git 2>/dev/null)
|
||||||
|
|
||||||
|
if [ "${HAS_CMAKE}" = "" ]; then
|
||||||
|
echo "[obs-websocket - Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${HAS_GIT}" = "" ]; then
|
||||||
|
echo "[obs-websocket - Error] Git not installed - please install Xcode developer tools or via Homebrew."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Build obs-studio
|
# Build obs-studio
|
||||||
cd ..
|
cd ..
|
||||||
|
echo "[obs-websocket] Cloning obs-studio from GitHub.."
|
||||||
git clone https://github.com/obsproject/obs-studio
|
git clone https://github.com/obsproject/obs-studio
|
||||||
cd obs-studio
|
cd obs-studio
|
||||||
OBSLatestTag=$(git describe --tags --abbrev=0)
|
OBSLatestTag=$(git describe --tags --abbrev=0)
|
||||||
git checkout $OBSLatestTag
|
git checkout $OBSLatestTag
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
|
echo "[obs-websocket] Building obs-studio.."
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DDISABLE_PLUGINS=true \
|
-DDISABLE_PLUGINS=true \
|
||||||
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
|
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
|
||||||
|
@ -1,16 +1,55 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ex
|
|
||||||
|
OSTYPE=$(uname)
|
||||||
|
|
||||||
|
if [ "${OSTYPE}" != "Darwin" ]; then
|
||||||
|
echo "[obs-websocket - Error] macOS install dependencies script can be run on Darwin-type OS only."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
HAS_BREW=$(type brew 2>/dev/null)
|
||||||
|
|
||||||
|
if [ "${HAS_BREW}" = "" ]; then
|
||||||
|
echo "[obs-websocket - Error] Please install Homebrew (https://www.brew.sh/) to build obs-websocket on macOS."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# OBS Studio deps
|
# OBS Studio deps
|
||||||
brew update
|
echo "[obs-websocket] Updating Homebrew.."
|
||||||
brew install ffmpeg
|
brew update >/dev/null
|
||||||
brew install libav
|
echo "[obs-websocket] Checking installed Homebrew formulas.."
|
||||||
|
BREW_PACKAGES=$(brew list)
|
||||||
|
BREW_DEPENDENCIES="ffmpeg libav cmake"
|
||||||
|
|
||||||
|
for DEPENDENCY in ${BREW_DEPENDENCIES}; do
|
||||||
|
if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then
|
||||||
|
echo "[obs-websocket] Upgrading OBS-Studio dependency '${DEPENDENCY}'.."
|
||||||
|
brew upgrade ${DEPENDENCY} 2>/dev/null
|
||||||
|
else
|
||||||
|
echo "[obs-websocket] Installing OBS-Studio dependency '${DEPENDENCY}'.."
|
||||||
|
brew install ${DEPENDENCY} 2>/dev/null
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# qtwebsockets deps
|
# qtwebsockets deps
|
||||||
# qt latest
|
echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.."
|
||||||
brew install ./CI/macos/qt.rb
|
# =!= NOTICE =!=
|
||||||
|
# When building QT5 from sources on macOS 10.13+, use local qt5 formula:
|
||||||
|
# brew install ./CI/macos/qt.rb
|
||||||
|
# Pouring from the bottle is much quicker though, so use bottle for now.
|
||||||
|
# =!= NOTICE =!=
|
||||||
|
|
||||||
# Packages app
|
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9a70413d137839de0054571e5f85fd07ee400955/Formula/qt.rb
|
||||||
brew install wget || brew upgrade wget
|
|
||||||
wget --quiet --retry-connrefused --waitretry=1 https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg
|
# Pin this version of QT5 to avoid `brew upgrade`
|
||||||
|
# upgrading it to incompatible version
|
||||||
|
brew pin qt
|
||||||
|
|
||||||
|
# Fetch and install Packages app
|
||||||
|
# =!= NOTICE =!=
|
||||||
|
# Installs a LaunchDaemon under /Library/LaunchDaemons/fr.whitebox.packages.build.dispatcher.plist
|
||||||
|
# =!= NOTICE =!=
|
||||||
|
|
||||||
|
echo "[obs-websocket] Installing Packaging app (might require password due to 'sudo').."
|
||||||
|
curl -o './Packages.pkg' --retry-connrefused -s --retry-delay 1 'https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg'
|
||||||
sudo installer -pkg ./Packages.pkg -target /
|
sudo installer -pkg ./Packages.pkg -target /
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
class Qt < Formula
|
class Qt < Formula
|
||||||
desc "Cross-platform application and UI framework"
|
desc "Cross-platform application and UI framework"
|
||||||
homepage "https://www.qt.io/"
|
homepage "https://www.qt.io/"
|
||||||
url "https://download.qt.io/official_releases/qt/5.10/5.10.0/single/qt-everywhere-src-5.10.0.tar.xz"
|
url "https://download.qt.io/archive/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
|
||||||
mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.0/single/qt-everywhere-opensource-src-5.10.0.tar.xz"
|
mirror "https://mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
|
||||||
sha256 "936d4cf5d577298f4f9fdb220e85b008ae321554a5fcd38072dc327a7296230e"
|
sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a"
|
||||||
head "https://code.qt.io/qt/qt5.git", :branch => "5.10", :shallow => false
|
head "https://code.qt.io/qt/qt5.git", :branch => "5.10.1", :shallow => false
|
||||||
|
|
||||||
bottle do
|
bottle do
|
||||||
sha256 "332ab2f3eb7c13510f460c13d28a562db03297149a3615feb9e3d467fafde56c" => :high_sierra
|
sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra
|
||||||
sha256 "c93cf6ead1774cfa7a369c92c7d6a69154bc0dd5b48a0e7ddf3a78202c4a3dc5" => :sierra
|
sha256 "9c488554935fb573554a4e36d36d3c81e47245b7fefc4b61edef894e67ba1740" => :sierra
|
||||||
sha256 "44425e23d8b9c2b8b2f50d850ca94dcd411cd89e20e057c8d6505c9056d06328" => :el_capitan
|
sha256 "c0407afba5951df6cc4c6f6c1c315972bd41c99cecb4e029919c4c15ab6f7bdc" => :el_capitan
|
||||||
end
|
end
|
||||||
|
|
||||||
keg_only "Qt 5 has CMake issues when linked"
|
keg_only "Qt 5 has CMake issues when linked"
|
||||||
@ -61,18 +61,6 @@ class Qt < Formula
|
|||||||
sha256 "8ee0bf71df1043f08ebae3aa35036be29c4d9ebff8a27e3b0411a6bd635e9382"
|
sha256 "8ee0bf71df1043f08ebae3aa35036be29c4d9ebff8a27e3b0411a6bd635e9382"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Remove for > 5.10.0
|
|
||||||
# Fix "error: 'loadFileURL:allowingReadAccessToURL:' is only available on
|
|
||||||
# macOS 10.11 or newer [-Werror,-Wunguarded-availability]"
|
|
||||||
# Reported 8 Dec 2017 https://bugreports.qt.io/browse/QTBUG-65075
|
|
||||||
# Equivalent to upstream fix from 8 Dec 2017 https://codereview.qt-project.org/#/c/213993/
|
|
||||||
if MacOS::Xcode.version >= "9.0"
|
|
||||||
patch do
|
|
||||||
url "https://raw.githubusercontent.com/Homebrew/formula-patches/9c97726e2b153099049326ade23fe24b52b778fe/qt/QTBUG-65075.diff"
|
|
||||||
sha256 "a51595868c6173ab53463107e0ee3355576002c32ab80897587c3607589cfd22"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def install
|
def install
|
||||||
args = %W[
|
args = %W[
|
||||||
-verbose
|
-verbose
|
||||||
|
@ -2,8 +2,15 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "-- Preparing package build"
|
OSTYPE=$(uname)
|
||||||
export QT_CELLAR_PREFIX="$(find /usr/local/Cellar/qt -d 1 | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1)"
|
|
||||||
|
if [ "${OSTYPE}" != "Darwin" ]; then
|
||||||
|
echo "[obs-websocket - Error] macOS package script can be run on Darwin-type OS only."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[obs-websocket] Preparing package build"
|
||||||
|
export QT_CELLAR_PREFIX="$(/usr/bin/find /usr/local/Cellar/qt -d 1 | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1)"
|
||||||
|
|
||||||
export WS_LIB="/usr/local/opt/qt/lib/QtWebSockets.framework/QtWebSockets"
|
export WS_LIB="/usr/local/opt/qt/lib/QtWebSockets.framework/QtWebSockets"
|
||||||
export NET_LIB="/usr/local/opt/qt/lib/QtNetwork.framework/QtNetwork"
|
export NET_LIB="/usr/local/opt/qt/lib/QtNetwork.framework/QtNetwork"
|
||||||
@ -20,20 +27,20 @@ fi
|
|||||||
export FILENAME="obs-websocket-$VERSION.pkg"
|
export FILENAME="obs-websocket-$VERSION.pkg"
|
||||||
export LATEST_FILENAME="obs-websocket-latest-$LATEST_VERSION.pkg"
|
export LATEST_FILENAME="obs-websocket-latest-$LATEST_VERSION.pkg"
|
||||||
|
|
||||||
echo "-- Copying Qt dependencies"
|
echo "[obs-websocket] Copying Qt dependencies"
|
||||||
if [ ! -f ./build/$(basename $WS_LIB) ]; then cp $WS_LIB ./build; fi
|
if [ ! -f ./build/$(basename $WS_LIB) ]; then cp $WS_LIB ./build; fi
|
||||||
if [ ! -f ./build/$(basename $NET_LIB) ]; then cp $NET_LIB ./build; fi
|
if [ ! -f ./build/$(basename $NET_LIB) ]; then cp $NET_LIB ./build; fi
|
||||||
|
|
||||||
chmod +rw ./build/QtWebSockets ./build/QtNetwork
|
chmod +rw ./build/QtWebSockets ./build/QtNetwork
|
||||||
|
|
||||||
echo "-- Modifying QtNetwork"
|
echo "[obs-websocket] Modifying QtNetwork"
|
||||||
install_name_tool \
|
install_name_tool \
|
||||||
-id @rpath/QtNetwork \
|
-id @rpath/QtNetwork \
|
||||||
-change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork \
|
-change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork \
|
||||||
-change $QT_CELLAR_PREFIX/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
|
-change $QT_CELLAR_PREFIX/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
|
||||||
./build/QtNetwork
|
./build/QtNetwork
|
||||||
|
|
||||||
echo "-- Modifying QtWebSockets"
|
echo "[obs-websocket] Modifying QtWebSockets"
|
||||||
install_name_tool \
|
install_name_tool \
|
||||||
-id @rpath/QtWebSockets \
|
-id @rpath/QtWebSockets \
|
||||||
-change /usr/local/opt/qt/lib/QtWebSockets.framework/Versions/5/QtWebSockets @rpath/QtWebSockets \
|
-change /usr/local/opt/qt/lib/QtWebSockets.framework/Versions/5/QtWebSockets @rpath/QtWebSockets \
|
||||||
@ -41,7 +48,7 @@ install_name_tool \
|
|||||||
-change $QT_CELLAR_PREFIX/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
|
-change $QT_CELLAR_PREFIX/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
|
||||||
./build/QtWebSockets
|
./build/QtWebSockets
|
||||||
|
|
||||||
echo "-- Modifying obs-websocket.so"
|
echo "[obs-websocket] Modifying obs-websocket.so"
|
||||||
install_name_tool \
|
install_name_tool \
|
||||||
-change /usr/local/opt/qt/lib/QtWebSockets.framework/Versions/5/QtWebSockets @rpath/QtWebSockets \
|
-change /usr/local/opt/qt/lib/QtWebSockets.framework/Versions/5/QtWebSockets @rpath/QtWebSockets \
|
||||||
-change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @rpath/QtWidgets \
|
-change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @rpath/QtWidgets \
|
||||||
@ -51,18 +58,18 @@ install_name_tool \
|
|||||||
./build/obs-websocket.so
|
./build/obs-websocket.so
|
||||||
|
|
||||||
# Check if replacement worked
|
# Check if replacement worked
|
||||||
echo "-- Dependencies for QtNetwork"
|
echo "[obs-websocket] Dependencies for QtNetwork"
|
||||||
otool -L ./build/QtNetwork
|
otool -L ./build/QtNetwork
|
||||||
echo "-- Dependencies for QtWebSockets"
|
echo "[obs-websocket] Dependencies for QtWebSockets"
|
||||||
otool -L ./build/QtWebSockets
|
otool -L ./build/QtWebSockets
|
||||||
echo "-- Dependencies for obs-websocket"
|
echo "[obs-websocket] Dependencies for obs-websocket"
|
||||||
otool -L ./build/obs-websocket.so
|
otool -L ./build/obs-websocket.so
|
||||||
|
|
||||||
chmod -w ./build/QtWebSockets ./build/QtNetwork
|
chmod -w ./build/QtWebSockets ./build/QtNetwork
|
||||||
|
|
||||||
echo "-- Actual package build"
|
echo "[obs-websocket] Actual package build"
|
||||||
packagesbuild ./CI/macos/obs-websocket.pkgproj
|
packagesbuild ./CI/macos/obs-websocket.pkgproj
|
||||||
|
|
||||||
echo "-- Renaming obs-websocket.pkg to $FILENAME"
|
echo "[obs-websocket] Renaming obs-websocket.pkg to $FILENAME"
|
||||||
mv ./release/obs-websocket.pkg ./release/$FILENAME
|
mv ./release/obs-websocket.pkg ./release/$FILENAME
|
||||||
cp ./release/$FILENAME ./release/$LATEST_FILENAME
|
cp ./release/$FILENAME ./release/$LATEST_FILENAME
|
||||||
|
Loading…
x
Reference in New Issue
Block a user