From 2558ce7675de5e0800fdc87580039ac0717f6e88 Mon Sep 17 00:00:00 2001 From: DominikDeak Date: Thu, 23 Jul 2020 15:22:51 +1000 Subject: [PATCH] Work on scripts. --- Scripts/Build/BuildDarwin.sh | 44 ++++++++++++ Scripts/Build/BuildLinux.sh | 0 Scripts/Build/BuildMacOS.sh | 133 ----------------------------------- Scripts/build.py | 2 +- 4 files changed, 45 insertions(+), 134 deletions(-) create mode 100755 Scripts/Build/BuildDarwin.sh mode change 100644 => 100755 Scripts/Build/BuildLinux.sh delete mode 100644 Scripts/Build/BuildMacOS.sh diff --git a/Scripts/Build/BuildDarwin.sh b/Scripts/Build/BuildDarwin.sh new file mode 100755 index 0000000..b338420 --- /dev/null +++ b/Scripts/Build/BuildDarwin.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +configureCMake() { + + cmake -S "${productRepoPath}" -B "${productBuildPath}" \ + -D CMAKE_PREFIX_PATH="${libQtPath}" \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_OSX_DEPLOYMENT_TARGET=10.12 \ + -D CMAKE_OSX_ARCHITECTURES=x86_64 \ + -D SYNERGY_ENTERPRISE=ON \ + || exit 1 + +} + +buildApplication() { + + pushd "${productBuildPath}" || exit 1 + + make -j || exit 1 + make install/strip || exit 1 + + macdeployqt "${productBuildPath}/bundle/Synergy.app" || exit 1 + + rsync -a --delete "${productBuildPath}/bundle/Synergy.app" "${binariesPath}/${productName}.app" || exit 1 + + popd + +} + +buildDMG() { + + ln -s /Applications "${productBuildPath}/bundle/Applications" + + hdiutil create -volname "${productName} ${productVersion}" -srcfolder "${productBuildPath}/bundle" -ov -format UDZO "${binariesPath}/${productPackageName}.dmg" || exit 1 + +} + +set -o nounset + +configureCMake +buildApplication +buildDMG + +exit 0 diff --git a/Scripts/Build/BuildLinux.sh b/Scripts/Build/BuildLinux.sh old mode 100644 new mode 100755 diff --git a/Scripts/Build/BuildMacOS.sh b/Scripts/Build/BuildMacOS.sh deleted file mode 100644 index 3f4e2af..0000000 --- a/Scripts/Build/BuildMacOS.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash - -# Path to the Qt library, clang, 64-bit build. -libQtPath="~/Qt5.12.9/5.12.9/clang_64" - -upstreamURL="https://github.com/DEAKSoftware/Synergy-Binaries.git" -queriedURL="$( git config --get remote.origin.url )" -toplevelPath="$( git rev-parse --show-toplevel )" - -if [ "${upstreamURL}" != "${queriedURL}" ] || [ "${toplevelPath}" == "" ]; then - - echo "error: Unrecognised Git upstream URL, or top-level directory. This script must run within the top-level directory of the Synergy-Binaries repository." - exit 1 - -fi - -synergyCorePath="${toplevelPath}/Synergy-Core" -buildPath="${synergyCorePath}/build" -binariesPath="${toplevelPath}/Binaries" -toolsPath="${toplevelPath}/Tools" - - - -configureSubmodules() { - - git submodule update --init --remote --recursive - -} - -configureQt() { - - export PATH="${libQtPath}:$PATH" - -} - -configureCMake() { - - cmake -S "${synergyCorePath}" -B "${buildPath}" \ - -D CMAKE_OSX_DEPLOYMENT_TARGET=10.12 \ - -D CMAKE_OSX_ARCHITECTURES=x86_64 \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_CONFIGURATION_TYPES=Release \ - -D SYNERGY_ENTERPRISE=ON || exit 1 - -} - -configureVersion() { - - source "${buildPath}/version" - synergyVersion="${SYNERGY_VERSION_MAJOR}.${SYNERGY_VERSION_MINOR}.${SYNERGY_VERSION_PATCH}" - synergyReleaseName="synergy-${synergyVersion}-macos-x64" - -} - -configure() { - - configureSubmodules - configureQt - configureCMake - configureVersion -} - -buildApp() { - - pushd "${buildPath}" || exit 1 - - make -j || exit 1 - make install/strip || exit 1 - - macdeployqt "${buildPath}/bundle/Synergy.app" - - cp -R "${buildPath}/bundle/Synergy.app" "${binariesPath}" - - popd - -} - -buildDMG() { - - ln -s /Applications "${buildPath}/bundle/Applications" - - hdiutil create -volname "Synergy ${synergyVersion}" -srcfolder "${buildPath}/bundle" -ov -format UDZO "${binariesPath}/${synergyReleaseName}.dmg" || exit 1 - -} - -buildClean() { - - pushd "${synergyCorePath}" || exit 1 - - git clean -fdx - - popd - - pushd "${toplevelPath}" || exit 1 - - git clean -fdx - - popd - -} - -if [ "${1}" = "--help" ] || [ "${1}" = "-h" ]; then - - cat "${toplevelPath}/Documentation/HelpMacOS.txt" - -elif [ "${1}" = "--app" ]; then - - configure - buildApp - -elif [ "${1}" = "--dmg" ]; then - - configure - buildDMG - -elif [ "${1}" = "--all" ]; then - - configure - buildApp - buildDMG - -elif [ "${1}" = "--clean" ]; then - - buildClean - -else - - echo "error: Bad or unknown option. Run with '--help' option for details." - exit 1 - -fi - -exit 0 diff --git a/Scripts/build.py b/Scripts/build.py index deef813..ec5c8e5 100755 --- a/Scripts/build.py +++ b/Scripts/build.py @@ -59,4 +59,4 @@ configureSubmodules() configureEnvironment() -# buildProducts() +buildProducts()