From 1fdc150116cad39aae5c5da407c3312b47a59e3a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 17 Dec 2021 07:06:30 -0500 Subject: New upstream version 3.3.3+dfsg1. --- scripts/macosx/compile_build_bundle.sh | 62 ++++++++++++++++++++++++++++++++++ scripts/macosx/create_packages.sh | 16 +++++++++ scripts/macosx/release.sh | 41 ++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100755 scripts/macosx/compile_build_bundle.sh create mode 100755 scripts/macosx/create_packages.sh create mode 100755 scripts/macosx/release.sh (limited to 'scripts/macosx') 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 diff --git a/scripts/macosx/create_packages.sh b/scripts/macosx/create_packages.sh new file mode 100755 index 0000000..5a669b4 --- /dev/null +++ b/scripts/macosx/create_packages.sh @@ -0,0 +1,16 @@ +#!/bin/sh +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + +cdir=`pwd` +absolute_path=`realpath $0` +this_dir=`dirname $absolute_path` +parent_dir=`dirname $this_dir` +parent_dir=`dirname $parent_dir` +cd $parent_dir/output/build +make pkg + +cd .. +mv SQLiteStudio/*.zip SQLiteStudio/*.dmg . +cd $cdir diff --git a/scripts/macosx/release.sh b/scripts/macosx/release.sh new file mode 100755 index 0000000..2fd3293 --- /dev/null +++ b/scripts/macosx/release.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +TARGET_DIR=/tmp/sqls-installer +QMAKE=~/Qt/5.10.0/clang_64/bin/qmake +TMP_DIR=~/tmp/SQLiteStudio.app +CORES=3 +RECOMPILE=1 + +if [ ! -f $QMAKE ]; then + echo "qmake at $QMAKE does not exist." + exit 1 +fi + +OLDDIR=`pwd` + +if [ "$RECOMPILE" != "0" ]; then + rm -rf ../../output + ./compile_build_bundle.sh $QMAKE $CORES +fi +./create_packages.sh $QMAKE +cd ../installer +rm -rf $TARGET_DIR +tclsh assemble.tcl $TARGET_DIR --repo + +rm -rf $TMP_DIR +$TARGET_DIR/InstallSQLiteStudio-*.app/Contents/MacOS/Install* TargetDir=$TMP_DIR + +mv $TMP_DIR $TARGET_DIR/ +cd $TARGET_DIR + +VER=`grep -A 1 ShortVersionString SQLiteStudio.app/Contents/Info.plist | tail -n 1 | egrep -o '([0-9]{1,}\.){1,}[0-9]{1,}'` +ditto -c -k --keepParent SQLiteStudio.app sqlitestudio-$VER.zip +hdiutil create SQLiteStudio-$VER-tmp.dmg -ov -volname "SQLiteStudio 3.2.0" -fs HFS+ -srcfolder "SQLiteStudio.app" +hdiutil convert SQLiteStudio-$VER-tmp.dmg -format UDZO -o SQLiteStudio-$VER.dmg + +rm -rf SQLiteStudio-$VER-tmp.dmg +rm -rf SQLiteStudio.app +rm -rf $TARGET_DIR/InstallSQLiteStudio-*.app +echo "Deleted installed app. System is clean." + +cd $OLDDIR -- cgit v1.2.3