From de6b406e57c15015bda19f749e31c93cfbab4cb9 Mon Sep 17 00:00:00 2001 From: jongough <2803240+jongough@users.noreply.github.com> Date: Thu, 28 Dec 2023 19:40:01 +1100 Subject: [PATCH 1/3] Update to latest FE2, 1.0.288.0 and fix Layer dialog processing in PathAndPoint manager --- .circleci/config.yml | 46 +++++++++++-- CMakeLists.txt | 6 +- build-deps/macos-cache-stamp | 4 ++ build-deps/macos-deps | 7 ++ cmake/MacosWxwidgets.cmake | 90 ++++++++++++++++++++++++++ cmake/PluginConfigure.cmake | 19 +++--- cmake/PluginInstall.cmake | 18 ++++++ cmake/PluginSetup.cmake | 16 ++++- cmake/in-files/cloudsmith-upload.sh.in | 8 +-- src/PathAndPointManagerDialogImpl.cpp | 12 ++-- update_submodule_branch.sh | 11 ++++ 11 files changed, 208 insertions(+), 29 deletions(-) create mode 100644 build-deps/macos-cache-stamp create mode 100644 build-deps/macos-deps create mode 100644 cmake/MacosWxwidgets.cmake create mode 100644 update_submodule_branch.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 0bed518d..a45f3254 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,8 +33,9 @@ workflows: <<: *std-filters - build-android-armhf: <<: *std-filters - - build-macos-wx32: - <<: *std-filters +# Duplicate macos-universal covers this. +# - build-macos-wx32: +# <<: *std-filters - build-flatpak-arm64-2208: <<: *std-filters - build-flatpak-x86-2208: @@ -58,9 +59,13 @@ workflows: ## KEEP needed for Jammy with wx32 - build-ubuntu-x86_64-2204-jammy: <<: *std-filters + - build-macos-universal: + <<: *std-filters + ## ------------------------------------------- ## OpenCPN 5.6.2 Plugins Frozen - 28/05/2023 ## ------------------------------------------ +## Circleci will not build for macos 11 so removed - 18/10/2023 - build-macos: <<: *std-filters ## Appveyor no longer builds for Windows. @@ -74,6 +79,7 @@ workflows: <<: *std-filters - build-debian-x86_64-10-buster: <<: *std-filters + ## ------------------------------------- ## UBUNTU OS Frozen - 28/05/2023 DROP ## ------------------------------------- @@ -109,7 +115,7 @@ commands: condition: <> steps: - run: sudo apt install -y python3-pip - - run: python3.8 -m pip install cloudsmith-cli + - run: python3 -m pip install cloudsmith-cli - when: condition: <> steps: @@ -129,7 +135,7 @@ jobs: ## --------------------- build-android-arm64: docker: - - image: cimg/android:2021.10.2-ndk + - image: cimg/android:2023.12-ndk resource_class: large environment: - OCPN_TARGET: android-arm64 @@ -142,10 +148,11 @@ jobs: install-python: true build-android-armhf: docker: - - image: cimg/android:2021.10.2-ndk + - image: cimg/android:2023.12-ndk resource_class: large environment: - OCPN_TARGET: android-armhf + - DEPLOY_USE_ORB: true steps: - checkout - run: chmod a+x ci/*.sh @@ -165,6 +172,35 @@ jobs: - run: chmod a+x ci/*.sh - run: bash ci/circleci-build-macos.sh - deploy-code + + build-macos-universal: + macos: + xcode: "12.5.1" + environment: + - OCPN_TARGET: macos + - CMAKE_BUILD_PARALLEL_LEVEL: 2 + - WX_VER: 32 + steps: + - checkout + - run: sudo chmod go+w /usr/local + - restore_cache: + key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ + -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ + -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + - run: ci/circleci-build-macos-universal.sh + - save_cache: + key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ + -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ + -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + paths: + - /tmp/local.cache.tar + - /Users/distiller/project/cache + - run: > + sh -c "otool -L build/*.dylib" + - run: > + sh -c "cat build/*.xml" + - deploy-code + build-msvc-wx32-2022: executor: name: win/server-2022 diff --git a/CMakeLists.txt b/CMakeLists.txt index ab75050c..5333b13b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugn(TP) v1.0.283.0 03/11/2023 DD/MM/YYYY format +# Testplugn(TP) v1.0.288.0 28/11/2023 DD/MM/YYYY format # buildCI:yes provideODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -60,9 +60,9 @@ set(PACKAGE "ocpn_draw") set(VERSION_MAJOR "1") set(VERSION_MINOR "8") -set(VERSION_PATCH "44") +set(VERSION_PATCH "45") set(VERSION_TWEAK "0") -set(VERSION_DATE "26/11/2023") # DD/MM/YYYY forma0t +set(VERSION_DATE "28/13/2023") # DD/MM/YYYY forma0t set(OCPN_MIN_VERSION "ov50") set(OCPN_API_VERSION_MAJOR "1") set(OCPN_API_VERSION_MINOR "17") diff --git a/build-deps/macos-cache-stamp b/build-deps/macos-cache-stamp new file mode 100644 index 00000000..612bd695 --- /dev/null +++ b/build-deps/macos-cache-stamp @@ -0,0 +1,4 @@ +# Any change in this file will cause the macos cache to be invalidated +# i. e., that the homebrew dependencies are downloaded and wxwidgets +# rebuilt. For example, change the stock 'v1' to 'v2' +v1 diff --git a/build-deps/macos-deps b/build-deps/macos-deps new file mode 100644 index 00000000..04593c14 --- /dev/null +++ b/build-deps/macos-deps @@ -0,0 +1,7 @@ +# brew packages installed in macos ci build +cmake +gettext +libexif +python +wget +openssl@3 diff --git a/cmake/MacosWxwidgets.cmake b/cmake/MacosWxwidgets.cmake new file mode 100644 index 00000000..cfecf086 --- /dev/null +++ b/cmake/MacosWxwidgets.cmake @@ -0,0 +1,90 @@ +# ~~~ +# Summary: If required, rebuild wxwidgets for macos from source. +# License: GPLv3+ +# Copyright (c) 2022 Alec Leamas +# ~~~ + +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. + +cmake_minimum_required(VERSION 3.20.0) + +set(wx_repo https://github.com/wxWidgets/wxWidgets.git) +set(wx_tag v3.2.2.1) + +option(IGNORE_SYSTEM_WX "Never use system wxWidgets installation" FALSE) + +# Check if we have done the wxWidgets build already +# +if(DEFINED wx_config) + return() +endif() + +# Check if there is a usable wxwidgets anyway +# +set(cache_dir ${PROJECT_SOURCE_DIR}/cache) + +if(IGNORE_SYSTEM_WX) + set(WX_CONFIG_PROG ${cache_dir}/lib/wx/config/osx_cocoa-unicode-3.2) +else() + find_program( + WX_CONFIG_PROG + NAMES wx-config osx_cocoa-unicode-3.2 + HINTS ${PROJECT_SOURCE_DIR}/cache/lib/wx/config /usr/local/lib/wx/config) +endif() +if(WX_CONFIG_PROG) + execute_process( + COMMAND ${WX_CONFIG_PROG} --version + RESULT_VARIABLE wx_status + OUTPUT_VARIABLE wx_version + ERROR_FILE /dev/null COMMAND_ECHO STDOUT + OUTPUT_STRIP_TRAILING_WHITESPACE) +else() + set(wx_status 1) +endif() + +if(${wx_status} EQUAL 0) + set(wx_config + ${WX_CONFIG_PROG} + CACHE FILEPATH "") + set(ENV{WX_CONFIG} ${WX_CONFIG_PROG}) + if(${wx_version} VERSION_GREATER_EQUAL 3.2) + return() + endif() +endif() + +if(NOT EXISTS ${cache_dir}) + file(MAKE_DIRECTORY ${cache_dir}) +endif() + +# Download sources and get the source directory +# +include(FetchContent) +FetchContent_Declare( + wxwidgets + GIT_REPOSITORY ${wx_repo} + GIT_TAG ${wx_tag}) +FetchContent_Populate(wxwidgets) +FetchContent_GetProperties(wxwidgets SOURCE_DIR wxwidgets_src_dir) + +execute_process(COMMAND git submodule update --init 3rdparty/pcre + WORKING_DIRECTORY ${wxwidgets_src_dir}) +execute_process( + COMMAND + ./configure --with-cxx=11 --with-macosx-version-min=10.10 --enable-unicode + --with-osx-cocoa --enable-aui --disable-debug --with-opengl + --enable-macosx_arch=arm64,x86_64 --enable-universal_binary=arm64,x86_64 + --without-subdirs --prefix=${cache_dir} + WORKING_DIRECTORY ${wxwidgets_src_dir}) +math(_nproc ${OCPN_NPROC} * 2) # Assuming two threads/cpu +execute_process(COMMAND make -j${_nproc} WORKING_DIRECTORY ${wxwidgets_src_dir}) +execute_process(COMMAND sudo make install + WORKING_DIRECTORY ${wxwidgets_src_dir}) + +set(wx_config ${cache_dir}/lib/wx/config/osx_cocoa-unicode-3.2) +if(NOT EXISTS ${wx_config}) + message(FATAL_ERROR "Cannot locate wx-config tool at ${wx_config}") +endif() +set(ENV{WX_CONFIG} ${wx_config}) diff --git a/cmake/PluginConfigure.cmake b/cmake/PluginConfigure.cmake index 9a7a930c..d5d7ef98 100644 --- a/cmake/PluginConfigure.cmake +++ b/cmake/PluginConfigure.cmake @@ -233,7 +233,10 @@ if(DEFINED ENV{OCPN_TARGET}) else() set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") - endif() + if(APPLE AND CMAKE_OSX_ARCHITECTURES) + set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${COMPOUND_ARCH_DASH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}") + endif() +endif() else() if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC) set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}") @@ -292,7 +295,7 @@ if(OCPN_FLATPAK_CONFIG) message(STATUS "${CMLOC}FLATPAK_BRANCH: ${FLATPAK_BRANCH}") set(RUNTIME_VERSION ${FLATPAK_BRANCH}) - message(STATUS "${CMLOC}Checking OCPN_FLATPAK_CONFIG: ${OCPN_FLATPAK_CONFIG}, SDK_VER: ${SDK_VER}, WX_VER: ${WX_VER}") + message(STATUS "${CMLOC}Checking OCPN_FLATPAK_CONFIG: ${OCPN_FLATPAK_CONFIG}, SDK_VER: ${SDK_VER}, WX_VER: $ENV{WX_VER}") configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/org.opencpn.OpenCPN.Plugin.yaml.in ${CMAKE_CURRENT_BINARY_DIR}/flatpak/org.opencpn.OpenCPN.Plugin.${PACKAGE}.yaml) message(STATUS "${CMLOC}Done OCPN_FLATPAK CONFIG") @@ -524,14 +527,14 @@ if(NOT QT_ANDROID) set(wxWidgets_USE_STATIC OFF) set(WXWIDGETS_FORCE_VERSION CACHE STRING "Force usage of a specific wxWidgets version.") - if(NOT "${WX_VER}" STREQUAL "") - string(LENGTH ${WX_VER} WX_VER_LEN) - string(SUBSTRING ${WX_VER} 0 1 MAJOR) - string(SUBSTRING ${WX_VER} 1 1 MINOR) + if(NOT "$ENV{WX_VER}" STREQUAL "") + string(LENGTH $ENV{WX_VER} WX_VER_LEN) + string(SUBSTRING $ENV{WX_VER} 0 1 MAJOR) + string(SUBSTRING $ENV{WX_VER} 1 1 MINOR) string(CONCAT WXWIDGETS_FORCE_VERSION ${MAJOR} "." ${MINOR}) if(${WX_VER_LEN} EQUAL 3) - string(SUBSTRING ${WX_VER} 2 1 PATCH) - string(CONCAT WXWIDGETS_FORCE_VERSION ${WXWIDGETS_FORCE_VERSION} "." ${PATCH}) + string(SUBSTRING $ENV{WX_VER} 2 1 PATCH) + #string(CONCAT WXWIDGETS_FORCE_VERSION ${WXWIDGETS_FORCE_VERSION} "." ${PATCH}) endif() endif() message(STATUS "${CMLOC}wxWidgets_Version: ${WXWIDGETS_FORCE_VERSION}") diff --git a/cmake/PluginInstall.cmake b/cmake/PluginInstall.cmake index 842b1271..a8259122 100644 --- a/cmake/PluginInstall.cmake +++ b/cmake/PluginInstall.cmake @@ -54,6 +54,24 @@ endif(UNIX AND NOT APPLE AND NOT QT_ANDROID) set(PARENT opencpn) +if(APPLE) + install( + TARGETS ${PACKAGE_NAME} + RUNTIME + LIBRARY DESTINATION OpenCPN.app/Contents/PlugIns) + if(EXISTS ${PROJECT_SOURCE_DIR}/data) + install(DIRECTORY data DESTINATION OpenCPN.app/Contents/SharedSupport/plugins/${PACKAGE_NAME}) + endif() + + if(EXISTS ${PROJECT_SOURCE_DIR}/UserIcons) + install(DIRECTORY UserIcons DESTINATION OpenCPN.app/Contents/SharedSupport/plugins/${PACKAGE_NAME}) + endif() + + find_package(ZLIB REQUIRED) + target_link_libraries(${PACKAGE_NAME} ${ZLIB_LIBRARIES}) + +endif(APPLE) + # Based on code from nohal if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX ${TENTATIVE_PREFIX}) diff --git a/cmake/PluginSetup.cmake b/cmake/PluginSetup.cmake index b0a553f2..a8502c68 100644 --- a/cmake/PluginSetup.cmake +++ b/cmake/PluginSetup.cmake @@ -65,8 +65,8 @@ if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD) set(PKG_TARGET "flatpak") set(PKG_TARGET_VERSION "${SDK_VER}") # As of flatpak/*yaml message(STATUS "${CMLOC}PKG_TARGET_VERSION: ${PKG_TARGET_VERSION}") - if( NOT "${WX_VER}" STREQUAL "" ) - set(PKG_TARGET_WX_VER "-${WX_VER}") + if( NOT "$ENV{WX_VER}" STREQUAL "" ) + set(PKG_TARGET_WX_VER "-$ENV{WX_VER}") else() unset(PKG_TARGET_WX_VER) endif() @@ -97,7 +97,7 @@ elseif(MSVC) endif() elseif(APPLE) set(PKG_BUILD_TARGET "darwin") - if("$ENV{WX_VER}" STREQUAL "32") + if( NOT "$ENV{WX_VER}" STREQUAL "" ) set(PKG_TARGET "darwin-wx$ENV{WX_VER}") else() set(PKG_TARGET "${PKG_BUILD_TARGET}") @@ -254,7 +254,17 @@ else(NOT WIN32 AND NOT QT_ANDROID) endif(_wx_selected_config MATCHES "androideabi-qt-armhf") endif(NOT WIN32 AND NOT QT_ANDROID) + +if(APPLE AND CMAKE_OSX_ARCHITECTURES) + string(REPLACE ";" "-" _compound_arch "${CMAKE_OSX_ARCHITECTURES}") + set(COMPOUND_ARCH_DASH "${_compound_arch}") + set(ARCH "${CMAKE_OSX_ARCHITECTURES}") +else() + set(COMPOUND_ARCH_DASH "${ARCH}") +endif() + message(STATUS "${CMLOC}ARCH: ${ARCH}") +message(STATUS "${CMLOC}COMPOUND_ARCH_DASH: ${COMPOUND_ARCH_DASH}") if(NOT "${PKG_TARGET}" STREQUAL "") string(STRIP ${PKG_TARGET} PKG_TARGET) diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index c3b4d95e..800d8730 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -122,9 +122,9 @@ echo $tarball_basename source $BUILD_DIR/pkg_version.sh if [ -n "${OCPN_TARGET}" ]; then - tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-${OCPN_TARGET}-tarball + tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-${OCPN_TARGET}-tarball else - tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-tarball + tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-tarball fi if [ "$(ls $BUILD_DIR/*.${PKG_EXT})" ]; then @@ -246,7 +246,7 @@ elif [ $LOCAL_BUILD = false ]; then # Only upload if the owner did the pull request. Non-owners probably don't have security to upload to the cloudsmith repository if [ "$CIRCLE_PROJECT_USERNAME" = "$CIRCLE_USERNAME" ]; then cloudsmith push raw --republish --no-wait-for-sync \ - --name @PACKAGE_NAME@-@PACKAGE_VERSION@-@PKG_TARGET@-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}-metadata \ + --name @PACKAGE_NAME@-@PACKAGE_VERSION@-@PKG_TARGET@-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}-metadata \ --version ${VERSION} \ --summary "@PACKAGE@ opencpn plugin metadata for automatic installation" \ $REPO $xml @@ -259,7 +259,7 @@ elif [ $LOCAL_BUILD = false ]; then if [ "${PKG_EXT}" != "gz" ] && [ "$pkg" != "" ]; then cloudsmith push raw --republish --no-wait-for-sync \ - --name opencpn-package-@PACKAGE@-@PACKAGE_VERSION@-@PKG_TARGET@-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}.${PKG_EXT} \ + --name opencpn-package-@PACKAGE@-@PACKAGE_VERSION@-@PKG_TARGET@-@COMPOUND_ARCH_DASH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}.${PKG_EXT} \ --version ${VERSION} \ --summary "@PACKAGE@ .${PKG_EXT} installation package" \ $REPO $pkg diff --git a/src/PathAndPointManagerDialogImpl.cpp b/src/PathAndPointManagerDialogImpl.cpp index 7ee5f9f1..af1c6436 100644 --- a/src/PathAndPointManagerDialogImpl.cpp +++ b/src/PathAndPointManagerDialogImpl.cpp @@ -1036,8 +1036,7 @@ void PathAndPointManagerDialogImpl::UpdatePathListCtrl( bool b_retain_selection } m_bSizerPathButtons->Layout(); - if( m_szDialogSize == GetSize()) - SetSizerAndFit(m_bSizerDialog); + SetSizerAndFit(m_bSizerDialog); delete [] l_selection; @@ -1721,7 +1720,7 @@ void PathAndPointManagerDialogImpl::OnLayerDeleteClick( wxCommandEvent &event ) item = m_listCtrlLayers->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); while(item != -1) { - ODLayer *layer = g_pLayerList->Item( m_listCtrlLayers->GetItemData( item ) )->GetData(); + ODLayer *layer = reinterpret_cast(m_listCtrlLayers->GetItemData( item )); if( layer ) { if(g_bConfirmObjectDelete) { @@ -1799,7 +1798,7 @@ void PathAndPointManagerDialogImpl::SelectedLayerToggleVisibility( bool visible if ( item == -1 ) break; - ODLayer *player = g_pLayerList->Item( m_listCtrlLayers->GetItemData( item ) )->GetData(); + ODLayer *player = reinterpret_cast(m_listCtrlLayers->GetItemData( item )); if( player ) { player->SetVisible(visible); @@ -1824,7 +1823,7 @@ void PathAndPointManagerDialogImpl::OnLayerShowOnChartClick( wxCommandEvent &eve item = m_listCtrlLayers->GetNextItem( item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); if( item == -1 ) return; - ODLayer *player = g_pLayerList->Item( m_listCtrlLayers->GetItemData( item ) )->GetData(); + ODLayer *player = reinterpret_cast(m_listCtrlLayers->GetItemData( item )); if( !player ) return; @@ -1874,7 +1873,7 @@ void PathAndPointManagerDialogImpl::OnLayerShowPointNamesClick( wxCommandEvent & item = m_listCtrlLayers->GetNextItem( item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); if( item == -1 ) return; - ODLayer *layer = g_pLayerList->Item( m_listCtrlLayers->GetItemData( item ) )->GetData(); + ODLayer *layer = reinterpret_cast(m_listCtrlLayers->GetItemData( item )); if( !layer ) return; @@ -2067,6 +2066,7 @@ void PathAndPointManagerDialogImpl::OnOKClick(wxCommandEvent &event) g_ocpn_draw_pi->OnToolbarToolDownCallback(g_ocpn_draw_pi->m_config_button_id); DeSelectODPoints(); DeSelectPaths(); + m_szDialogSize = GetSize(); } void PathAndPointManagerDialogImpl::OnClose(wxCloseEvent &event) diff --git a/update_submodule_branch.sh b/update_submodule_branch.sh new file mode 100644 index 00000000..1bb37687 --- /dev/null +++ b/update_submodule_branch.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +if [[ "$#" -eq "1" && ( "$1" -eq "-h " || "$1" -eq "-help" ) ]]; then + echo "Will update opencpn-libs current branch to latest version." +fi + +git submodule update --remote --merge opencpn-libs +git add opencpn-libs +git commit -m "Updating current opencpn-libs to latest version" + +echo "This will now need to be pushed to make it available to circleci builds in the cloud" From fa273688bc64ef73f66be844fb0d2f27ded4e244 Mon Sep 17 00:00:00 2001 From: jongough <2803240+jongough@users.noreply.github.com> Date: Thu, 28 Dec 2023 19:45:35 +1100 Subject: [PATCH 2/3] Add missing file --- ci/circleci-build-macos-universal.sh | 82 ++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 ci/circleci-build-macos-universal.sh diff --git a/ci/circleci-build-macos-universal.sh b/ci/circleci-build-macos-universal.sh new file mode 100644 index 00000000..7940f428 --- /dev/null +++ b/ci/circleci-build-macos-universal.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + + +# Build the MacOS artifacts + + +# Copyright (c) 2021 Alec Leamas +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +set -x + +# Load local environment if it exists i. e., this is a local build +if [ -f ~/.config/local-build.rc ]; then source ~/.config/local-build.rc; fi + +git submodule update --init opencpn-libs + +# If applicable, restore /usr/local from cache. +if [[ -n "$CI" && -f /tmp/local.cache.tar ]]; then + sudo rm -rf /usr/local/* + sudo tar -C /usr -xf /tmp/local.cache.tar +fi + +# Set up build directory +rm -rf build && mkdir build + +# Create a log file. +exec > >(tee build/build.log) 2>&1 + +export MACOSX_DEPLOYMENT_TARGET=10.10 + +# Return latest version of $1, optionally using option $2 +pkg_version() { brew list --versions $2 $1 | tail -1 | awk '{print $2}'; } + +# +# Check if the cache is with us. If not, re-install brew. +brew list --versions libexif || brew update-reset + +# Install packaged dependencies +for pkg in cmake gettext libarchive libexif python wget openssl@3; do + brew list --versions $pkg || brew install $pkg || brew install $pkg || : + brew link --overwrite $pkg || brew install $pkg +done + +#Install prebuilt dependencies +wget -q https://dl.cloudsmith.io/public/nohal/opencpn-plugins/raw/files/macos_deps_universal.tar.xz \ + -O /tmp/macos_deps_universal.tar.xz +sudo tar -C /usr/local -xJf /tmp/macos_deps_universal.tar.xz + +export OPENSSL_ROOT_DIR='/usr/local' + +# Build and package +cd build +cmake \ + "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}" \ + -DCMAKE_INSTALL_PREFIX= \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ + -DOCPN_TARGET_TUPLE="darwin-wx32;10;universal" \ + -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ + .. + +if [[ -z "$CI" ]]; then + echo '$CI not found in environment, assuming local setup' + echo "Complete build using 'cd build; make tarball' or so." + exit 0 +fi + +# nor-reproducible error on first invocation, seemingly tarball-conf-stamp +# is not created as required. +#make VERBOSE=1 tarball || make VERBOSE=1 tarball +make +make install +make package +make package + +# Create the cached /usr/local archive +if [ -n "$CI" ]; then + tar -C /usr -cf /tmp/local.cache.tar local +fi From cd39867f3589af6bff36bef97fc3a4c1291114a3 Mon Sep 17 00:00:00 2001 From: jongough <2803240+jongough@users.noreply.github.com> Date: Fri, 29 Dec 2023 07:00:32 +1100 Subject: [PATCH 3/3] Update to ensure ci/circleci-build-macos-universal.sh is executable --- .circleci/config.yml | 1 + CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a45f3254..f65ba8e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -187,6 +187,7 @@ jobs: key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ -{{checksum \"cmake/MacosWxwidgets.cmake\"}}\ -{{checksum \"ci/circleci-build-macos-universal.sh\"}}" + - run: chmod a+x ci/*.sh - run: ci/circleci-build-macos-universal.sh - save_cache: key: "{{checksum \"build-deps/macos-cache-stamp\"}}\ diff --git a/CMakeLists.txt b/CMakeLists.txt index 5333b13b..929d0205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugn(TP) v1.0.288.0 28/11/2023 DD/MM/YYYY format +# Testplugn(TP) v1.0.289.0 29/12/2023 DD/MM/YYYY format # buildCI:yes provideODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -60,9 +60,9 @@ set(PACKAGE "ocpn_draw") set(VERSION_MAJOR "1") set(VERSION_MINOR "8") -set(VERSION_PATCH "45") +set(VERSION_PATCH "46") set(VERSION_TWEAK "0") -set(VERSION_DATE "28/13/2023") # DD/MM/YYYY forma0t +set(VERSION_DATE "29/12/2023") # DD/MM/YYYY forma0t set(OCPN_MIN_VERSION "ov50") set(OCPN_API_VERSION_MAJOR "1") set(OCPN_API_VERSION_MINOR "17")