annotate deploy/osx/deploy.sh @ 670:8f3075eeaac2 qt5

Attempt to fix library paths for PyQt libraries. Doesn't seem to be sufficient.
author Chris Cannam
date Fri, 27 May 2016 11:02:53 +0100
parents 0f3e086066fc
children 8121a6f9abca
rev   line source
Chris@232 1 #!/bin/bash
Chris@232 2
Chris@667 3 set -e
Chris@667 4
Chris@232 5 # Execute this from the top-level directory of the project (the one
Chris@366 6 # that contains the .app bundle). Supply the name of the .app bundle
Chris@366 7 # as argument (the target will use $app.app regardless, but we need
Chris@366 8 # to know the source)
Chris@232 9
Chris@366 10 source="$1"
Chris@366 11 dmg="$2"
Chris@366 12 if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then
Chris@366 13 echo "Usage: $0 <source.app> <target-dmg-basename>"
Chris@366 14 exit 2
Chris@366 15 fi
Chris@232 16 app=EasyMercurial
Chris@232 17
Chris@667 18 set -u
Chris@667 19
Chris@372 20 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h`
Chris@260 21 case "$version" in
Chris@260 22 [0-9].[0-9]) bundleVersion="$version".0 ;;
Chris@260 23 [0-9].[0-9].[0-9]) bundleVersion="$version" ;;
Chris@260 24 *) echo "Error: Version $version is neither two- nor three-part number" ;;
Chris@260 25 esac
Chris@232 26
Chris@232 27 echo
Chris@667 28 echo "Copying in frameworks and plugins from Qt installation directory."
Chris@667 29
Chris@667 30 deploy/osx/copy-qt.sh "$app" || exit 2
Chris@667 31
Chris@667 32 echo
Chris@667 33 echo "Fixing up paths."
Chris@667 34
Chris@667 35 deploy/osx/paths.sh "$app"
Chris@667 36
Chris@667 37 echo
Chris@667 38 echo "Copying in qt.conf to set local-only plugin paths."
Chris@667 39 echo "Make sure all necessary Qt plugins are in $source/Contents/plugins/*"
Chris@667 40 echo "You probably want platforms/, accessible/ and imageformats/ subdirectories."
Chris@667 41 cp deploy/osx/qt.conf "$source"/Contents/Resources/qt.conf
Chris@667 42
Chris@667 43 echo "Writing version $bundleVersion in to bundle."
Chris@667 44 echo "(This should be a three-part number: major.minor.point)"
Chris@667 45
Chris@667 46 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \
Chris@667 47 > "$source"/Contents/Info.plist
Chris@667 48
Chris@667 49 echo "Done: check $source/Contents/Info.plist for sanity please"
Chris@667 50
Chris@667 51 echo
Chris@670 52 echo "Copying in helper scripts"
Chris@670 53 cp easyhg-extdiff.sh "$source"/Contents/MacOS/
Chris@670 54 cp easyhg-merge.sh "$source"/Contents/MacOS/
Chris@670 55 chmod +x "$source"/Contents/MacOS/easyhg-extdiff.sh "$source"/Contents/MacOS/easyhg-merge.sh
Chris@670 56
Chris@670 57 echo
Chris@366 58 echo "Making target tree."
Chris@366 59
Chris@366 60 volume="$app"-"$version"
Chris@366 61 target="$volume"/"$app".app
Chris@366 62 dmg="$dmg"-"$version".dmg
Chris@366 63
Chris@366 64 mkdir "$volume" || exit 1
Chris@366 65
Chris@366 66 ln -s /Applications "$volume"/Applications
Chris@577 67 cp COPYING "$volume/COPYING.txt"
Chris@667 68 cp -rp "$source" "$target"
Chris@366 69
Chris@366 70 echo "Done"
Chris@366 71
Chris@667 72 deploy/osx/sign.sh "$volume" || exit 1
Chris@256 73
Chris@256 74 echo
Chris@232 75 echo "Making dmg..."
Chris@232 76
Chris@366 77 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" &&
Chris@366 78 rm -r "$volume"
Chris@232 79
Chris@232 80 echo "Done"