Skip to content

Commit

Permalink
chore(pkg): Change macOS packging method.
Browse files Browse the repository at this point in the history
Signed-off-by: xm1994 <[email protected]>
  • Loading branch information
summershrimp committed Apr 4, 2021
1 parent 0b93b1b commit 39caa53
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 87 deletions.
4 changes: 3 additions & 1 deletion CI/install-build-obs-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ fi

if [ -z "${OBSTargetVersion}" ]; then
OBSLatestTag=$(git describe --tags --abbrev=0)
echo "[obs-auto-subitile] Checking out ${OBSLatestTag}"
git checkout $OBSLatestTag
else
echo "[obs-auto-subitile] Checking out ${OBSTargetVersion}"
git checkout $OBSTargetVersion
fi
rm -fr build
mkdir -p build && cd build
echo "[obs-auto-subtitle] Building obs-studio.."
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-DDISABLE_PLUGINS=true \
-DENABLE_SCRIPTING=0 \
-DDepsPath=/tmp/obsdeps \
Expand Down
5 changes: 2 additions & 3 deletions CI/package-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if [ "${OSTYPE}" != "Darwin" ]; then
fi

echo "[obs-auto-subtitle] 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)"

GIT_HASH=$(git rev-parse --short HEAD)
GIT_BRANCH_OR_TAG=$(git name-rev --name-only HEAD | awk -F/ '{print $NF}')
Expand All @@ -33,7 +32,7 @@ install_name_tool \
-change /tmp/obsdeps/lib/QtNetwork.framework/Versions/5/QtNetwork \
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork \
-change /tmp/obsdeps/lib/QtWebSockets.framework/Versions/5/QtWebSockets \
@executable_path/../Frameworks/QtWebSockets.framework/Versions/5/QtWebSockets \
@loader_path/../Frameworks/QtWebSockets.framework/Versions/5/QtWebSockets \
./build/obs-auto-subtitle.so

# Check if replacement worked
Expand All @@ -47,7 +46,7 @@ chmod -R +w ./build/QtWebSockets.framework

echo "[obs-auto-subtitle] Modifying QtWebSockets.framework"
install_name_tool \
-id @executable_path/../Frameworks/QtWebSockets.framework/Versions/5/QtWebSockets \
-id QtWebSockets.framework/Versions/5/QtWebSockets \
./build/QtWebSockets.framework/Versions/5/QtWebSockets

install_name_tool \
Expand Down
4 changes: 3 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:

- job: 'Build_macOS'
pool:
vmImage: 'macos-10.14'
vmImage: 'macos-10.15'
variables:
OBSTargetVersion: '26.1.0'
steps:
Expand All @@ -107,6 +107,8 @@ jobs:

- script: ./CI/install-build-obs-macos.sh
displayName: 'Build OBS'
env:
OBSTargetVersion: $(OBSTargetVersion)

- script: ./CI/build-macos.sh
displayName: 'Build obs-auto-subtitle'
Expand Down
147 changes: 65 additions & 82 deletions installer/obs-auto-subtitle.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<key>PACKAGES</key>
<array>
<dict>
<key>MUST-CLOSE-APPLICATION-ITEMS</key>
<array/>
<key>MUST-CLOSE-APPLICATIONS</key>
<false/>
<key>PACKAGE_FILES</key>
<dict>
<key>DEFAULT_INSTALL_LOCATION</key>
Expand All @@ -15,87 +19,7 @@
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>BUNDLE_CAN_DOWNGRADE</key>
<false/>
<key>BUNDLE_POSTINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>BUNDLE_PREINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../build/QtWebSockets.framework</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Frameworks</string>
<key>PATH_TYPE</key>
<integer>2</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Contents</string>
<key>PATH_TYPE</key>
<integer>2</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>OBS.app</string>
<key>PATH_TYPE</key>
<integer>2</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
Expand Down Expand Up @@ -173,6 +97,51 @@
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>BUNDLE_CAN_DOWNGRADE</key>
<false/>
<key>BUNDLE_POSTINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>BUNDLE_PREINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../build/QtWebSockets.framework</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Frameworks</string>
<key>PATH_TYPE</key>
<integer>2</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
Expand Down Expand Up @@ -596,6 +565,8 @@
</dict>
<key>PAYLOAD_TYPE</key>
<integer>0</integer>
<key>PRESERVE_EXTENDED_ATTRIBUTES</key>
<false/>
<key>SHOW_INVISIBLE</key>
<false/>
<key>SPLIT_FORKS</key>
Expand Down Expand Up @@ -638,6 +609,8 @@
<false/>
<key>PAYLOAD_SIZE</key>
<integer>-1</integer>
<key>REFERENCE_PATH</key>
<string></string>
<key>RELOCATABLE</key>
<false/>
<key>USE_HFS+_COMPRESSION</key>
Expand Down Expand Up @@ -673,7 +646,17 @@
<key>PROJECT_PRESENTATION</key>
<dict>
<key>BACKGROUND</key>
<dict/>
<dict>
<key>APPAREANCES</key>
<dict>
<key>DARK_AQUA</key>
<dict/>
<key>LIGHT_AQUA</key>
<dict/>
</dict>
<key>SHARED_SETTINGS_FOR_ALL_APPAREANCES</key>
<true/>
</dict>
<key>INSTALLATION TYPE</key>
<dict>
<key>HIERARCHIES</key>
Expand Down

0 comments on commit 39caa53

Please sign in to comment.