From d2f2f22dc1b19488640444dc3383602e589ebb44 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 8 Dec 2023 15:23:53 -0800 Subject: [PATCH] don't build the macOS version twice on GitHub We need some additional options when building the package, so let that script handle the details and use the generic build script mainly for the dependencies. Also let's not mix building for testing and building the DMG - just so I can stay somewhat sane. Signed-off-by: Dirk Hohndel --- .github/workflows/mac.yml | 31 +++++-------------------------- scripts/build.sh | 31 +++++++++++++++++++------------ 2 files changed, 24 insertions(+), 38 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 92f056894..b21f4bc10 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -28,34 +28,13 @@ jobs: export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake DIR=$(pwd) - # now build Subsurface with WebKit, using the generic build script - bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit -release -build-deps -ftdi + # now setup Subsurface with WebKit and build the dependencies, using the generic build script + bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit -release -build-deps -ftdi -prep-only - echo "finished initial build of Subsurface" - - # make sure we have FTDI enabled for the package + echo "finished initial cmake setup of Subsurface - next build the package" cd subsurface/build - FTDI=$(grep FTDISUPPORT:BOOL CMakeCache.txt | grep ON) - if [ "$FTDI" != "FTDISUPPORT:BOOL=ON" ] ; then - cmake -D FTDISUPPORT:BOOL=ON . - fi echo "run the packaging script" - bash -e -x ../packaging/macos/make-package.sh - IMG=$(grep ^created: ../trigger-daily.log | tail -1 | cut -b10-) + bash -e -x ../packaging/macosx/make-package.sh | tee mp.log 2>&1 + IMG=$(grep ^created: mp.log | tail -1 | cut -b10-) echo "Created $IMG" - - name: test desktop build - run: | - # build export-html to make sure that didn't get broken - cd ${GITHUB_WORKSPACE}/build - cmake -DMAKE_TESTS=ON - make -j - make -j export-html - echo "------------------------------------" - echo "run tests for desktop build" - export QT_ROOT=${GITHUB_WORKSPACE}/Qt/5.13.0/clang_64 - export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins - cd tests - # ./TestGitStorage -v2 - make check - diff --git a/scripts/build.sh b/scripts/build.sh index f0f2b729e..4ac362367 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -77,6 +77,11 @@ while [[ $# -gt 0 ]] ; do # call this script with -build-deps BUILD_DEPS="1" ;; + -prep-only) + # use this script to build dependencies and set things up with default values, but don't actually run + # the build + PREP_ONLY="1" + ;; -fat-build) # build a fat binary for macOS # ignored on other platforms @@ -151,7 +156,7 @@ while [[ $# -gt 0 ]] ; do ;; *) echo "Unknown command line argument $arg" - echo "Usage: build.sh [-no-bt] [-quick] [-build-deps] [-fat-build] [-src-dir ] [-build-prefix ] [-build-with-webkit] [-build-with-map] [-mobile] [-desktop] [-downloader] [-both] [-all] [-ftdi] [-create-appdir] [-release]" + echo "Usage: build.sh [-no-bt] [-quick] [-build-deps] [-prep-only] [-fat-build] [-src-dir ] [-build-prefix ] [-build-with-webkit] [-build-with-map] [-mobile] [-desktop] [-downloader] [-both] [-all] [-ftdi] [-create-appdir] [-release]" exit 1 ;; esac @@ -645,17 +650,19 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do rm -rf Subsurface-mobile.app fi - LIBRARY_PATH=$INSTALL_ROOT/lib make -j4 - LIBRARY_PATH=$INSTALL_ROOT/lib make install + if [ ! "$PREP_ONLY" = "1" ] ; then + LIBRARY_PATH=$INSTALL_ROOT/lib make -j4 + LIBRARY_PATH=$INSTALL_ROOT/lib make install - if [ "$CREATE_APPDIR" = "1" ] ; then - # if we create an AppImage this makes gives us a sane starting point - cd "$SRC" - mkdir -p ./appdir - mkdir -p appdir/usr/share/metainfo - mkdir -p appdir/usr/share/icons/hicolor/256x256/apps - cp -r ./install-root/* ./appdir/usr - cp ${SRC_DIR}/appdata/subsurface.appdata.xml appdir/usr/share/metainfo/ - cp ${SRC_DIR}/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/ + if [ "$CREATE_APPDIR" = "1" ] ; then + # if we create an AppImage this makes gives us a sane starting point + cd "$SRC" + mkdir -p ./appdir + mkdir -p appdir/usr/share/metainfo + mkdir -p appdir/usr/share/icons/hicolor/256x256/apps + cp -r ./install-root/* ./appdir/usr + cp ${SRC_DIR}/appdata/subsurface.appdata.xml appdir/usr/share/metainfo/ + cp ${SRC_DIR}/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/ + fi fi done