2cb03c4665aa — Chris Cannam 2 years ago
Include kdiff3 executable in bundle on macOS
4 files changed, 46 insertions(+), 5 deletions(-)

A => deploy/osx/copy-kdiff3.sh
M deploy/osx/copy-pyqt.sh
M deploy/osx/copy-qt.sh
M deploy/osx/deploy.sh
A => deploy/osx/copy-kdiff3.sh +37 -0
@@ 0,0 1,37 @@ 
+#!/bin/bash
+
+app="$1"
+if [ -z "$app" ]; then
+	echo "Usage: $0 <appname>"
+	echo "Provide appname without the .app extension, please"
+	exit 2
+fi
+
+set -eu
+
+qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,)
+
+if [ ! -d "$qtdir" ]; then
+    echo "Failed to discover Qt installation directory from Makefile, exiting"
+    exit 2
+fi
+
+kdiff_dir=easyhg-kdiff3
+
+if [ ! -d "$kdiff_dir" ]; then
+    echo
+    echo "Directory $kdiff_dir not found: cloning and building it..."
+    hg clone https://code.soundsoftware.ac.uk/hg/easyhg-kdiff3 "$kdiff_dir"
+    cd "$kdiff_dir"/kdiff3/src-QT4
+    "$qtdir"/bin/qmake -r kdiff3.pro
+    make
+    cd ../../..
+fi
+
+echo
+echo "Copying in kdiff3 executable..."
+
+cp "$kdiff_dir"/kdiff3/src-QT4/kdiff3.app/Contents/MacOS/kdiff3 "$app.app/Contents/MacOS/easyhg-kdiff3"
+
+echo "Done"
+

          
M deploy/osx/copy-pyqt.sh +2 -2
@@ 1,7 1,5 @@ 
 #!/bin/bash
 
-set -eu
-
 app="$1"
 if [ -z "$app" ]; then
 	echo "Usage: $0 <appname>"

          
@@ 9,6 7,8 @@ if [ -z "$app" ]; then
 	exit 2
 fi
 
+set -eu
+
 PYQT_DIR=/Library/Python/2.7/site-packages/PyQt5
 
 if [ ! -d "$PYQT_DIR" ]; then

          
M deploy/osx/copy-qt.sh +2 -3
@@ 1,8 1,5 @@ 
-
 #!/bin/bash
 
-set -eu
-
 app="$1"
 if [ -z "$app" ]; then
 	echo "Usage: $0 <appname>"

          
@@ 10,6 7,8 @@ if [ -z "$app" ]; then
 	exit 2
 fi
 
+set -eu
+
 frameworks="QtCore QtNetwork QtGui QtWidgets QtPrintSupport QtDBus"
 
 plugins="gif icns ico jpeg tga tiff wbmp webp cocoa macstyle minimal offscreen"

          
M deploy/osx/deploy.sh +5 -0
@@ 30,6 30,11 @@ case "$stem" in
 esac
 
 echo
+echo "Copying in kdiff3 program."
+
+deploy/osx/copy-kdiff3.sh "$app" || exit 2
+
+echo
 echo "Copying in frameworks and plugins from Qt installation directory."
 
 deploy/osx/copy-qt.sh "$app" || exit 2