From fe8739a362c3857430c157445d4088f7a42de5b4 Mon Sep 17 00:00:00 2001 From: James Crook Date: Fri, 15 Nov 2019 10:31:23 +0000 Subject: [PATCH] Add modified mac build_dist script. This is for convenience and does some of the manual steps. --- mac/scripts/build_dist2.sh | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 mac/scripts/build_dist2.sh diff --git a/mac/scripts/build_dist2.sh b/mac/scripts/build_dist2.sh new file mode 100644 index 000000000..1dda1cf35 --- /dev/null +++ b/mac/scripts/build_dist2.sh @@ -0,0 +1,105 @@ +set -x + +# Setup +VERSION=`awk '/^#define+ AUDACITY_VERSION / {print $3}' build/Info.plist.h` +RELEASE=`awk '/^#define+ AUDACITY_RELEASE / {print $3}' build/Info.plist.h` +REVISION=`awk '/^#define+ AUDACITY_REVISION / {print $3}' build/Info.plist.h` +VERSION=$VERSION.$RELEASE.$REVISION + +cd "${DSTROOT}" +chmod -RH "${INSTALL_MODE_FLAG}" "${TARGET_BUILD_DIR}" +chown -RH "${INSTALL_OWNER}:${INSTALL_GROUP}" "${TARGET_BUILD_DIR}" + +echo "Audacity has been installed to: ${DSTROOT}" + +cd .. + +VOL="Audacity $VERSION" +DMG="audacity-macos-$VERSION" + +# Preclean +rm -rf "$DMG" "$DMG.dmg" TMP.dmg + +# Create structure +mkdir "$DMG" +cp -pR "${DSTROOT}/" "${DMG}" + +#Add a custom icon for the DMG +#cp -p mac/Resources/Audacity.icns "${DMG}"/.VolumeIcon.icns + +# Make sure it's not already attached +ATTACHED=$(hdiutil info | awk "/\/Volumes\/${VOL}/{print \$1}") +if [ -n "${ATTACHED}" ] +then + hdiutil detach "${ATTACHED}" +fi + +# Create and mount the image +hdiutil create -ov -format UDRW -srcdir "$DMG" -fs HFS+ -volname "$VOL" TMP.dmg +if [ $? -ne 0 ] +then + echo "Create failed" + exit 1 +fi + +#Mount the DMG and store the name it was mounted with +TITLE=$(hdiutil attach TMP.dmg | grep \/Volumes | sed "s/^.*\/Volumes\///") +if [ $? -ne 0 ] +then + echo "Attach failed" + exit 1 +fi + +# And wait for it to show up in Finder +osascript <