aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/macosx/compile_build_bundle.sh
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
commit1fdc150116cad39aae5c5da407c3312b47a59e3a (patch)
tree123c79a4d7ad2d45781ba03ce939f7539fb428d8 /scripts/macosx/compile_build_bundle.sh
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'scripts/macosx/compile_build_bundle.sh')
-rwxr-xr-xscripts/macosx/compile_build_bundle.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/scripts/macosx/compile_build_bundle.sh b/scripts/macosx/compile_build_bundle.sh
new file mode 100755
index 0000000..0165ebb
--- /dev/null
+++ b/scripts/macosx/compile_build_bundle.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+if [ "$1" == "" ]; then
+ QMAKE=`which qmake`
+ if [ "$QMAKE" == "" ]; then
+ echo "Cannot find qmake"
+ exit 1
+ else
+ read -p "Is this correct qmake (y/N) $QMAKE : " yn
+ case $yn in
+ [Yy]* ) break;;
+ * ) echo "Please pass path to correct qmake as argument to this script."; exit;;
+ esac
+ fi
+else
+ QMAKE=$1
+fi
+
+realpath() {
+ [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
+}
+
+cdir=`pwd`
+cpu_cores=`sysctl -n hw.logicalcpu`
+absolute_path=`realpath $0`
+this_dir=`dirname $absolute_path`
+parent_dir=`dirname $this_dir`
+parent_dir=`dirname $parent_dir`
+
+if [ "$2" == "" ]; then
+ read -p "Number of CPU cores to use for compiling (hit enter to use $cpu_cores): " new_cpu_cores
+ case $new_cpu_cores in
+ "" ) break;;
+ * ) cpu_cores=$new_cpu_cores; break;;
+ esac
+else
+ cpu_cores=$2
+fi
+
+if [ -d $parent_dir/output ]; then
+ read -p "Directory $parent_dir/output already exists. The script will delete and recreate it. Is that okay? (y/N) : " yn
+ case $yn in
+ [Yy]* ) rm -rf $parent_dir/output; break;;
+ * ) echo "Aborted."; exit;;
+ esac
+fi
+
+cd $parent_dir
+mkdir output output/build output/build/Plugins
+
+cd output/build
+$QMAKE CONFIG+=portable ../../SQLiteStudio3
+make -j $cpu_cores
+
+cd Plugins
+$QMAKE CONFIG+=portable ../../../Plugins
+make -j $cpu_cores
+
+cd ..
+make bundle
+
+cd $cdir