annotate deploy/osx/deploy.sh @ 129:afd72eb2b0aa tip

Added tag v1.0-windows-32bit for changeset 7d5387c63447
author Chris Cannam
date Fri, 12 Jun 2020 17:20:52 +0100
parents efb73feb1061
children
rev   line source
Chris@34 1 #!/bin/bash
Chris@34 2
Chris@34 3 set -e
Chris@34 4
Chris@34 5 # Execute this from the top-level directory of the project (the one
Chris@34 6 # that contains the .app bundle). Supply the name of the application
Chris@34 7 # as argument.
Chris@34 8 #
Chris@34 9 # This now performs *only* the app deployment step - copying in
Chris@34 10 # libraries and setting up paths etc. It does not create a
Chris@34 11 # package. Use deploy-and-package.sh for that.
Chris@34 12
Chris@34 13 app="$1"
Chris@34 14 source="$app.app"
Chris@34 15
Chris@34 16 if [ -z "$app" ] || [ ! -d "$source" ] || [ -n "$2" ]; then
Chris@34 17 echo "Usage: $0 <app>"
Chris@34 18 echo " e.g. $0 MyApplication"
Chris@34 19 echo " The app bundle must exist in ./<app>.app."
Chris@34 20 echo " Version number will be extracted from version.h."
Chris@34 21 exit 2
Chris@34 22 fi
Chris@34 23
Chris@34 24 set -u
Chris@34 25
Chris@34 26 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
Chris@34 27 stem=${version%%-*}
Chris@34 28 stem=${stem%%pre*}
Chris@34 29 case "$stem" in
Chris@34 30 [0-9].[0-9]) bundleVersion="$stem".0 ;;
Chris@34 31 [0-9].[0-9].[0-9]) bundleVersion="$stem" ;;
Chris@34 32 *) echo "Error: Version stem $stem (of version $version) is neither two- nor three-part number" ;;
Chris@34 33 esac
Chris@34 34
Chris@34 35 echo
Chris@34 36 echo "Copying in frameworks and plugins from Qt installation directory."
Chris@34 37
Chris@34 38 deploy/osx/copy-qt.sh "$app" || exit 2
Chris@34 39
Chris@34 40 echo
Chris@34 41 echo "Fixing up paths."
Chris@34 42
Chris@34 43 deploy/osx/paths.sh "$app"
Chris@34 44
Chris@34 45 echo
Chris@34 46 echo "Copying in qt.conf to set local-only plugin paths."
Chris@34 47 echo "Make sure all necessary Qt plugins are in $source/Contents/plugins/*"
Chris@34 48 echo "You probably want platforms/, accessible/ and imageformats/ subdirectories."
Chris@34 49 cp deploy/osx/qt.conf "$source"/Contents/Resources/qt.conf
Chris@34 50
Chris@34 51 echo
Chris@34 52 echo "Writing version $bundleVersion in to bundle."
Chris@34 53 echo "(This should be a three-part number: major.minor.point)"
Chris@34 54
Chris@34 55 perl -p -e "s/PACK_VERSION/$bundleVersion/" deploy/osx/Info.plist \
Chris@34 56 > "$source"/Contents/Info.plist
Chris@34 57
Chris@34 58 echo "Done: check $source/Contents/Info.plist for sanity please"