view deploy/clean-build-and-package @ 2582:af1a7d76539d

Note if no Makefile found
author Chris Cannam
date Thu, 23 Jul 2020 16:49:42 +0100
parents 32718f05903d
children 4448639b9bb1
line wrap: on
line source
#!/bin/bash

set -eu

current=$(hg id | awk '{ print $1; }')

case "$current" in
    *+) echo "ERROR: Current working copy has been modified - not proceeding";exit 2;;
    *);;
esac

version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`

mkdir -p packages
echo

if [ -d /Applications ]; then

    if [ ! -f Makefile ]; then 
	echo "You must have run a routine normal build at least once before this, so I can see which Qt settings to use"
	exit 1
    fi

    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 -rf "$volume"
    rm -f "$dmg"

    ./repoint install

    rm -rf .qmake.stash
    "$qmake" -set SV_PERSISTENT_DEFINES "WITH_FEEDBACK_REQUEST"
    "$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

echo "Done"