changeset 2392:ab2d0fe8f0b7

Additions to Mac build scripting
author Chris Cannam
date Mon, 21 Oct 2019 13:07:02 +0100
parents d436e75169e3
children 779a70662859
files .hgignore deploy/clean-build-and-package deploy/osx/build-and-package.sh deploy/osx/notarize.sh
diffstat 4 files changed, 66 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Mon Oct 21 10:55:21 2019 +0100
+++ b/.hgignore	Mon Oct 21 13:07:02 2019 +0100
@@ -59,3 +59,5 @@
 *.AppDir
 Dockerfile*.gen
 squashfs-root
+.notarization-uuid
+.notarization-status
--- a/deploy/clean-build-and-package	Mon Oct 21 10:55:21 2019 +0100
+++ b/deploy/clean-build-and-package	Mon Oct 21 13:07:02 2019 +0100
@@ -4,41 +4,62 @@
 
 current=$(hg id | awk '{ print $1; }')
 
-case "$current" in
-    *+) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;;
-    *);;
-esac
+#case "$current" in
+#    *+) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;;
+#    *);;
+#esac
 
 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
 
-echo -n "Proceed to rebuild and package version $version [Yn] ? "
-read yn
+mkdir -p packages
+echo
 
-if [ -z "$yn" ]; then
-    yn=y
-elif [ "$yn" = "Y" ]; then
-    yn=y
+if [ -d /Applications ]; then
+
+    qmake=$(grep '^# Command: ' Makefile | awk '{ print $3; }')
+
+    echo "Proceed to rebuild, package, and sign version $version using"
+    echo -n "qmake path \"$qmake\" [Yn] ? "
+    read yn
+    case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac
+    echo "Proceeding"
+
+    app="Sonic Visualiser"
+    volume="$app"-"$version"
+    dmg="$volume".dmg
+
+    rm -rf "$app.app"
+    rm -f "$dmg"
+
+    ./repoint install
+
+    rm -rf .qmake.stash
+    "$qmake" -r
+    make clean
+    make -j3
+    deploy/osx/deploy-and-package.sh
+
+    mv "$dmg" packages/
+
+else
+
+    echo -n "Proceed to rebuild and package version $version [Yn] ? "
+    read yn
+    case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac
+    echo "Proceeding"
+
+    ./deploy/linux/build-and-test-appimage.sh
+
+    squashedversion=$(echo "$version" | sed 's/_-//g')
+
+    mv deploy/linux/docker/output/SonicVisualiser-"$current"-x86_64.AppImage \
+	packages/SonicVisualiser-"$squashedversion"-x86_64.AppImage
+
+    ./deploy/linux/build-and-test-deb.sh
+
+    mv deploy/linux/docker/output/sonic-visualiser_"$version"_amd64.deb \
+	packages/
 fi
 
-if [ "$yn" != "y" ]; then
-    exit 3
-fi
-
-echo "Proceeding"
-
-mkdir -p packages
-
-./deploy/linux/build-and-test-appimage.sh
-
-squashedversion=$(echo "$version" | sed 's/_-//g')
-
-mv deploy/linux/docker/output/SonicVisualiser-"$current"-x86_64.AppImage \
-   packages/SonicVisualiser-"$squashedversion"-x86_64.AppImage
-
-./deploy/linux/build-and-test-deb.sh
-
-mv deploy/linux/docker/output/sonic-visualiser_"$version"_amd64.deb \
-   packages/
-
 echo "Done"
 
--- a/deploy/osx/build-and-package.sh	Mon Oct 21 10:55:21 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# This script is very specific to certain Xcode and Qt versions -
-# review before running, or do a standard build and a deployment with
-# deploy-and-package.sh instead
-
-set -eu
-
-app="Sonic Visualiser"
-
-version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
-
-volume="$app"-"$version"
-dmg="$volume".dmg
-compatdmg="$volume-osx-10.7.dmg"
-
-./repoint install
-
-echo
-echo "Rebuilding for current macOS..."
-echo
-
-rm -rf .qmake.stash
-$HOME/Qt/5.13.1/clang_64/bin/qmake -r
-make clean
-make -j3
-deploy/osx/deploy-and-package.sh
-
-echo
-echo "Done, images are in $dmg and $compatdmg"
-echo
-
--- a/deploy/osx/notarize.sh	Mon Oct 21 10:55:21 2019 +0100
+++ b/deploy/osx/notarize.sh	Mon Oct 21 13:07:02 2019 +0100
@@ -28,7 +28,8 @@
 echo "Uploading for notarization..."
 
 uuidfile=.notarization-uuid
-rm -f "$uuidfile"
+statfile=.notarization-status
+rm -f "$uuidfile" "$statfile"
 
 xcrun altool --notarize-app \
     -f "$dmg" \
@@ -51,21 +52,26 @@
 
 while true ; do
     sleep 30
-    status=$(xcrun altool --notarization-info "$uuid" -u "$user" -p @keychain:altool 2>&1)
-    if echo "$status" | grep -q 'Package Approved' ; then
+
+    xcrun altool --notarization-info \
+	"$uuid" \
+	-u "$user" \
+	-p @keychain:altool 2>&1 | tee "$statfile"
+
+    if grep -q 'Package Approved' "$statfile"; then
 	echo
 	echo "Approved! Status output is:"
-	echo "$status"
+	cat "$statfile"
 	break
-    elif echo "$status" | grep -q 'in progress' ; then
+    elif grep -q 'in progress' "$statfile" ; then
 	echo
 	echo "Still in progress... Status output is:"
-	echo "$status"
+	cat "$statfile"
 	echo "Waiting..."
     else 
 	echo
 	echo "Failure or unknown status in output:"
-	echo "$status"
+	cat "$statfile"
 	exit 2
     fi
 done