0
0
mirror of https://github.com/mumble-voip/mumble.git synced 2024-12-04 12:37:20 +00:00
mumble-voip_mumble/macx/scripts/build-overlay-installer
Davide Beatrici 2ee48b07c0 macx/scripts: allow to specify custom source and binary directories
Our qmake project forcibly put binaries into the "release" folder, inside the repository.

With the CMake project this is not the case: the source and binary directories can even reside on different drives.

Unfortunately the binary directory was hardcoded in both "build-overlay-installer" and "osxdist.py".
As for the source directory, both scripts simply expected to be run from the repository's root.

This commit adds the "--source-dir" and "--binary-dir" options to "osxdist.py". Default values: "." and "build", respectively.

"build-overlay-installer" now expects its working directory to be the binary folder.
No options are added; they are not required because the script is executed by "osxdist.py", which takes care of setting the working directory.

Extra change: "build-overlay-installer" now uses "PlistBuddy" rather than "defaults", because the latter doesn't support reading from a file anymore in macOS Catalina (10.15).
2020-07-11 19:37:18 +02:00

29 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright 2005-2020 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
cp libmumbleoverlay.dylib MumbleOverlay.osax/Contents/MacOS/
productbuild \
--component MumbleOverlay.osax /Library/ScriptingAdditions \
synth.pkg
root=$(mktemp -d -t mumble-overlay-installer)
/usr/bin/xar -f synth.pkg -x -C ${root}
mkdir -p ${root}/Resources
mv bg.png ${root}/Resources/
VERSION=`/usr/libexec/PlistBuddy -c "print MumbleOverlayVersion" MumbleOverlay.osax/Contents/Info.plist`
MINCLIENT=`/usr/libexec/PlistBuddy -c "print MumbleOverlayMinMumbleVersion" MumbleOverlay.osax/Contents/Info.plist`
echo "<upgrade version=\"${VERSION}\" minclient=\"${MINCLIENT}\" />" > ${root}/upgrade.xml
sed -i '' -e 's,<installer-gui-script minSpecVersion="1">,<installer-gui-script minSpecVersion="1"><title>Mumble Overlay</title><background mime-type="image/png" file="bg.png" />,' ${root}/Distribution
pushd ${root}
/usr/bin/xar -f MumbleOverlay.pkg --no-compress "^.*$" -c ./*
popd
cp ${root}/MumbleOverlay.pkg MumbleOverlay.pkg