diff --git a/.circleci/config.yml b/.circleci/config.yml index 6036d65..3c4a8e5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,56 +26,47 @@ std-filters: &std-filters workflows: build_all: jobs: -## -------------------- -## OpenCPN 5.8 Plugins ## ---------------------- - - build-android-arm64: - <<: *std-filters - - build-android-armhf: - <<: *std-filters - - build-flatpak-arm64-2208: - <<: *std-filters - - build-flatpak-x86-2208: - <<: *std-filters - - build-flatpak-arm64-2408: - <<: *std-filters - - build-flatpak-x86-2408: - <<: *std-filters - - build-msvc-wx32-2022: - <<: *std-filters - - build-debian-arm64-12-bookworm: - <<: *std-filters - - build-debian-armhf-12-bookworm: - <<: *std-filters - - build-debian-x86_64-12-bookworm: - <<: *std-filters - - build-debian-armhf-11-bullseye: - <<: *std-filters - - build-debian-arm64-11-bullseye: - <<: *std-filters - - build-debian-x86_64-11-bullseye: - <<: *std-filters -## KEEP needed for Jammy with wx32 - - build-ubuntu-x86_64-2204-jammy: - <<: *std-filters - - build-macos-universal: +## OpenCPN 5.8 Plugins (Also work in 5.10) +## ---------------------- + - build-android-arm64: + <<: *std-filters + - build-android-armhf: + <<: *std-filters + - build-flatpak-aarch64-2208: + <<: *std-filters + - build-flatpak-x86-2208: + <<: *std-filters + - build-flatpak-aarch64-2408: + <<: *std-filters + - build-flatpak-x86-2408: + <<: *std-filters + - build-msvc-wx32-2022: + <<: *std-filters + - build-debian-arm64-12-bookworm: + <<: *std-filters + - build-debian-armhf-12-bookworm: + <<: *std-filters + - build-debian-x86_64-12-bookworm: + <<: *std-filters + - build-debian-armhf-11-bullseye: + <<: *std-filters + - build-debian-arm64-11-bullseye: + <<: *std-filters + - build-debian-x86_64-11-bullseye: + <<: *std-filters +# 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 - - build-msvc-2022: - <<: *std-filters - -## ------------------------------------- -## UBUNTU OS Frozen - 28/05/2023 DROP -## ------------------------------------- -## KEEP needed for Raspbian OpenCPN v5.6 -# - build-ubuntu-armhf-1804-buster: -# <<: *std-filters + - build-msvc-2022: + <<: *std-filters orbs: cloudsmith: cloudsmith/cloudsmith@1.0.4 @@ -144,23 +135,9 @@ jobs: - run: bash ci/circleci-build-android-armhf.sh - deploy-code: install_python: true - build-macos-wx32: - macos: - xcode: "13.4" - environment: - - OCPN_TARGET: macos - - CLOUDSMITH_PKG_EXT: pkg - - WX_VER: "32" - - DEPLOY_USE_ORB: false - steps: - - checkout - - run: chmod a+x ci/*.sh - - run: bash ci/circleci-build-macos.sh - - deploy-code: - deploy_use_orb: false build-macos-universal: macos: - xcode: "13.4" + xcode: "15.2.0" environment: OCPN_TARGET: macos CMAKE_BUILD_PARALLEL_LEVEL: 2 @@ -171,25 +148,26 @@ jobs: - 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\"}}" + 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: chmod a+x cmake/*.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 + 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: deploy_use_orb: false + install_python: false build-msvc-wx32-2022: executor: name: win/server-2022 @@ -207,12 +185,13 @@ jobs: command: ci\circleci-build-msvc.bat - deploy-code: deploy_use_orb: false - build-flatpak-arm64-2208: + build-flatpak-aarch64-2208: machine: image: ubuntu-2204:current resource_class: arm.medium environment: - - OCPN_TARGET: flatpak-arm64 + - OCPN_TARGET: flatpak + - BUILD_ARCH: aarch64 - FLATPAK_BRANCH: stable - CLOUDSMITH_PKG_EXT: gz - SDK_VER: 22.08 @@ -226,9 +205,9 @@ jobs: build-flatpak-x86-2208: machine: image: ubuntu-2204:current - resource_class: arm.medium environment: - OCPN_TARGET: flatpak + - BUILD_ARCH: x86_64 - FLATPAK_BRANCH: stable - CLOUDSMITH_PKG_EXT: gz - SDK_VER: 22.08 @@ -240,12 +219,13 @@ jobs: command: bash ci/circleci-build-flatpak.sh no_output_timeout: 30m - deploy-code - build-flatpak-arm64-2408: + build-flatpak-aarch64-2408: machine: image: ubuntu-2204:current resource_class: arm.medium environment: - - OCPN_TARGET: flatpak-arm64 + - OCPN_TARGET: flatpak + - BUILD_ARCH: aarch64 - FLATPAK_BRANCH: stable - CLOUDSMITH_PKG_EXT: gz - SDK_VER: 24.08 @@ -259,9 +239,9 @@ jobs: build-flatpak-x86-2408: machine: image: ubuntu-2204:current - resource_class: arm.medium environment: - OCPN_TARGET: flatpak + - BUILD_ARCH: x86_64 - FLATPAK_BRANCH: stable - CLOUDSMITH_PKG_EXT: gz - SDK_VER: 24.08 @@ -313,8 +293,7 @@ jobs: - deploy-code build-debian-x86_64-12-bookworm: machine: - image: ubuntu-2204:current - resource_class: arm.medium + image: ubuntu-2404:current environment: - OCPN_TARGET: bookworm - BUILD_GTK3: true @@ -336,7 +315,7 @@ jobs: environment: - OCPN_TARGET=bullseye-armhf - DOCKER_IMAGE=jongough/debian-armhf:bullseye - - BUILD_FLbuild-debian-arm64-12-bookwormAGS=-j3 + - BUILD_FLAGS=-j3 - BUILD_ENV=debian - BUILD_GTK3: true - DEPLOY_USE_ORB: true @@ -410,20 +389,6 @@ jobs: ## --------------------- ## OpenCPN 5.6.2 Plugins ## --------------------- - build-macos: - macos: - xcode: "13.4" - environment: - - OCPN_TARGET: macos - - CLOUDSMITH_PKG_EXT: pkg - - WX_VER: 315 - - DEPLOY_USE_ORB: false - steps: - - checkout - - run: chmod a+x ci/*.sh - - run: bash ci/circleci-build-macos.sh - - deploy-code: - deploy_use_orb: false ## Appveyor doesn't build for Windows now. ## If below is used, WinXT will not work. @@ -445,24 +410,4 @@ jobs: - deploy-code: deploy_use_orb: false -## ------------------------------------------- -## Ubuntu OS - Generally deprecated and not used. -## ------------------------------------------- -## KEEP needed for Raspbian OpenCPN v5.6 - build-ubuntu-armhf-1804-buster: - machine: - image: ubuntu-2204:current - resource_class: arm.medium - environment: - - OCPN_TARGET=buster-armhf - - DOCKER_IMAGE=jongough/ubuntu-armhf:18.04 - - BUILD_FLAGS=-j3 - - BUILD_ENV=ubuntu - - DEPLOY_USE_ORB: true - steps: - - checkout - - run: chmod a+x ./ci/*.sh - - run: - command: ci/circleci-build-ubuntu-docker.sh - no_output_timeout: 30m - - deploy-code + diff --git a/.gitignore b/.gitignore index 2cfb9c4..0ed3992 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ cmake-build* +.BATCH +.build build/* -.idea* .directory po/POTFILES.in.test temp tmp master.zip +OCPNAndroidCommon* diff --git a/CMakeLists.txt b/CMakeLists.txt index ceac237..6fe3463 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, * ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- -# Frontend2 Author: Jon Gough Testplugin(TP) -# v1.0.304.0 20/09/2024 DD/MM/YYYY +# Frontend2 Author: Jon Gough Testplugin(TP) v1.0.326.0 18/01/2025 DD/MM/YYYY # buildCI:yes useODAPI:no validateJSON:no # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -32,7 +31,7 @@ set(CMLOC "CMakeLists: ") # define minimum cmake version cmake_minimum_required(VERSION 3.5.1) -if (COMMAND cmake_policy) +if(COMMAND cmake_policy) if (POLICY CMP0043) cmake_policy(SET CMP0043 NEW) endif (POLICY CMP0043) @@ -62,13 +61,13 @@ set(LONG_DESCRIPTION set(VERSION_MAJOR "0") set(VERSION_MINOR "53") -set(VERSION_PATCH "0") +set(VERSION_PATCH "2") set(VERSION_TWEAK "0") -set(VERSION_DATE "10/12/2024")#DD/MM/YYYY format +set(VERSION_DATE "20/012/2025")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") set(OCPN_API_VERSION_MAJOR "1") -set(OCPN_API_VERSION_MINOR "17") +set(OCPN_API_VERSION_MINOR "18") set(TP_COMMENT " * Release using CI") set(PARENT "opencpn") @@ -77,10 +76,10 @@ set(PARENT "opencpn") #Default is github.com. Now set in pluginconfigure.cmake #set(GIT_REPOSITORY_SERVER "github.com") -# Specifies Cloudsmith upload repository suffix for each catalog -set(PROD "prod") # Standard Repos -set(BETA "beta") # Standard Repos -set(ALPHA "alpha") # Standard Repos +## Specifies Cloudsmith upload repository suffix for each catalog +set(PROD "prod") #Standard Repos +set(BETA "beta") #Standard Repos +set(ALPHA "alpha") #Standard Repos # Set if Cloudsmith Base Repository name does not match your Git Repository name. #set(CLOUDSMITH_BASE_REPOSITORY "${GIT_REPOSITORY_NAME}") @@ -91,7 +90,9 @@ set (CLOUDSMITH_BASE_REPOSITORY "pypilot") #without the pi set(CLOUDSMITH_USER "opencpn") # set(CLOUDSMITH_USER "jon-gough") -set(XML_INFO_URL "https://opencpn-manuals.github.io/main/pypilot/index.html") +set(XML_INFO_URL + "https://opencpn-manuals.github.io/main/pypilot/index.html" +) set(XML_SUMMARY ${SHORT_DESCRIPTION}) set(XML_DESCRIPTION ${LONG_DESCRIPTION}) @@ -122,8 +123,8 @@ set_property( ) message(STATUS "${CMLOC}Build type: ${CMAKE_BUILD_TYPE}") -## ----- Statements below used to setup standard variables required by the CMAKE process --## -## -- Do not remove - ## +# ----- Statements below used to setup standard variables required by the CMAKE -## +# ----- process -- Do not remove -## project(${PACKAGE}) @@ -142,7 +143,8 @@ set(CMAKE_VERBOSE_MAKEFILE "Activate verbose mode for make files" ON) option(Plugin_CXX11 "Use c++11" OFF) -## --Below needed for build process. +## ----- Modify section above if there are special requirements for the plugin --## +## ----- Do not change next section - needed to configure build process ---------## ##=========================================================== include("PluginConfigure") @@ -229,8 +231,8 @@ include_directories( ${PROJECT_SOURCE_DIR}/libs/wxservdisc/src ) ##============================================================== if (NOT OCPN_FLATPAK_CONFIG) - # Build environment not available when flatpak is being configured - # so following statements will not work + # Build environment not available when flatpak is being configured so + # following statements will not work message(STATUS "${CMLOC}Adding target link libraries to ${PACKAGE_NAME}") if (WIN32) @@ -238,7 +240,7 @@ if (NOT OCPN_FLATPAK_CONFIG) target_link_libraries(${PACKAGE_NAME} windows::headers) endif (WIN32) - add_subdirectory(opencpn-libs/api-17) + add_subdirectory(opencpn-libs/api-18) target_link_libraries(${PACKAGE_NAME} ocpn::api) add_subdirectory(opencpn-libs/tinyxml) diff --git a/ci/circleci-build-flatpak.sh b/ci/circleci-build-flatpak.sh index 9ddf64a..0880d0c 100644 --- a/ci/circleci-build-flatpak.sh +++ b/ci/circleci-build-flatpak.sh @@ -97,9 +97,9 @@ else fi if [ "$FLATPAK_BRANCH" = '' ]; then - cmake -DOCPN_TARGET=$OCPN_TARGET -DOCPN_FLATPAK_CONFIG=ON -DSDK_VER=$SDK_VER -DFLATPAK_BRANCH='beta' $SET_WX_VER .. + cmake -DOCPN_TARGET=$OCPN_TARGET -DBUILD_ARCH=$BUILD_ARCH -DOCPN_FLATPAK_CONFIG=ON -DSDK_VER=$SDK_VER -DFLATPAK_BRANCH='beta' $SET_WX_VER .. else - cmake -DOCPN_TARGET=$OCPN_TARGET -DOCPN_FLATPAK_CONFIG=ON -DSDK_VER=$SDK_VER -DFLATPAK_BRANCH=$FLATPAK_BRANCH $SET_WX_VER .. + cmake -DOCPN_TARGET=$OCPN_TARGET -DBUILD_ARCH=$BUILD_ARCH -DOCPN_FLATPAK_CONFIG=ON -DSDK_VER=$SDK_VER -DFLATPAK_BRANCH=$FLATPAK_BRANCH $SET_WX_VER .. fi make flatpak-build diff --git a/ci/circleci-build-macos-universal.sh b/ci/circleci-build-macos-universal.sh index 8854ef7..78057d6 100755 --- a/ci/circleci-build-macos-universal.sh +++ b/ci/circleci-build-macos-universal.sh @@ -16,7 +16,7 @@ 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 +git submodule update --init # If applicable, restore /usr/local from cache. if [[ -n "$CI" && -f /tmp/local.cache.tar ]]; then @@ -40,7 +40,8 @@ pkg_version() { brew list --versions $2 $1 | tail -1 | awk '{print $2}'; } brew list --versions libexif || brew update-reset # Install packaged dependencies -for pkg in cmake gettext libarchive libexif python3 wget openssl@3; do +here=$(cd "$(dirname "$0")"; pwd) +for pkg in $(sed '/#/d' < $here/../build-deps/macos-deps); do brew list --versions $pkg || brew install $pkg || brew install $pkg || : brew link --overwrite $pkg || brew install $pkg done @@ -73,11 +74,7 @@ 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 +make package || make package # Create the cached /usr/local archive if [ -n "$CI" ]; then diff --git a/cmake/PluginConfigure.cmake b/cmake/PluginConfigure.cmake index 2cc5074..2839aa7 100644 --- a/cmake/PluginConfigure.cmake +++ b/cmake/PluginConfigure.cmake @@ -205,6 +205,10 @@ if (NOT SKIP_VERSION_CONFIG) endif (NOT SKIP_VERSION_CONFIG) # configure xml file for circleci +message(STATUS "${CMLOC}ENV BUILD_GTK2: $ENV{BUILD_GTK2}") +string(TOUPPER "$ENV{BUILD_GTK2}" BUILD_GTK2_TEMP) +set(ENV{BUILD_GTK2} ${BUILD_GTK2_TEMP}) +unset(BUILD_GTK2_TEMP) message(STATUS "${CMLOC}ENV BUILD_GTK3: $ENV{BUILD_GTK3}") string(TOUPPER "$ENV{BUILD_GTK3}" BUILD_GTK3_TEMP) @@ -266,7 +270,7 @@ if (NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID ) - if(FE2_FORCE_GTK2) + if(BUILD_GTK2) find_package(GTK2) endif() @@ -333,10 +337,10 @@ if (DEFINED ENV{OCPN_TARGET}) else () if (APPLE AND CMAKE_OSX_ARCHITECTURES) set(PACKAGING_NAME - "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}" + "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}" ) set(PACKAGING_NAME_XML - "${PKG_NVR}-${PKG_TARGET}-${COMPOUND_ARCH_DASH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}" + "${PKG_NVR}-${PKG_TARGET}-${COMPOUND_ARCH_DASH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}-$ENV{OCPN_TARGET}" ) else () set(PACKAGING_NAME diff --git a/cmake/PluginSetup.cmake b/cmake/PluginSetup.cmake index 5488181..ac808e7 100644 --- a/cmake/PluginSetup.cmake +++ b/cmake/PluginSetup.cmake @@ -200,7 +200,11 @@ if (NOT WIN32 AND NOT QT_ANDROID) if (CMAKE_SIZEOF_VOID_P MATCHES "8") if ("$ENV{OCPN_TARGET}" MATCHES "flatpak") message(STATUS "${CMLOC}*** Flatpak detected ***") - set(ARCH "aarch64") + if ("$ENV{BUILD_ARCH}" MATCHES "aarch64") + set(ARCH "aarch64") + else ("$ENV{BUILD_ARCH}" MATCHES "aarch64") + set (ARCH "x86_64") + endif ("$ENV{BUILD_ARCH}" MATCHES "aarch64") else ("$ENV{OCPN_TARGET}" MATCHES "flatpak") set(ARCH "arm64") endif ("$ENV{OCPN_TARGET}" MATCHES "flatpak") @@ -220,8 +224,13 @@ if (NOT WIN32 AND NOT QT_ANDROID) if (NOT DEFINED PACKAGE_FORMAT) if ("$ENV{OCPN_TARGET}" MATCHES "flatpak") message(STATUS "*** Flatpak detected ***") + message(STATUS "** BUILD_ARCH: $ENV{BUILD_ARCH}") set(PACKAGE_FORMAT "TGZ") - set(ARCH "aarch64") + if ("$ENV{BUILD_ARCH}" MATCHES "aarch64") + set(ARCH "aarch64") + else ("$ENV{BUILD_ARCH}" MATCHES "aarch64") + set (ARCH "x86_64") + endif ("$ENV{BUILD_ARCH}" MATCHES "aarch64") set(LIB_INSTALL_DIR "lib") endif ("$ENV{OCPN_TARGET}" MATCHES "flatpak") endif (NOT DEFINED PACKAGE_FORMAT) diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index ec9648a..717bf88 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -64,22 +64,14 @@ if [ "$CIRCLECI" ] || [ "$TRAVIS" ]; then if [ "$DEPLOY_USE_ORB" != "true" ]; then if pyenv versions 2>&1 >/dev/null; then pyenv versions - if ! pyenv global 3.11.3 2>&1 >/dev/null; then - if ! pyenv global 3.9.1 2>&1 >/dev/null; then - if ! pyenv global 3.8.6 2>&1 >/dev/null; then - if ! pyenv global 3.7.1 2>&1 >/dev/null; then - if ! pyenv global 3.7.0 2>&1>/dev/null; then - if ! pyenv global 3.5.2 2>&1>/dev/null; then - sudo apt install software-properties-common - sudo apt update - sudo apt install -y python3.8 python3-pip - sudo rm /usr/bin/python3 - sudo ln -s /usr/bin/python3.8 /usr/bin/python3 - fi - fi - fi - fi - fi + version_1=$(python --version | cut -d '.' -f1 | cut -d ' ' -f2) + version_2=$(python --version | cut -d '.' -f2) + if [ $version_1 -lt 3 ] || [ $version_2 -lt 5 ]; then + sudo apt install software-properties-common + sudo apt update + sudo apt install -y python3.8 python3-pip + sudo rm /usr/bin/python3 + sudo ln -s /usr/bin/python3.8 /usr/bin/python3 fi python3 --version sudo python3 -m pip install cloudsmith-cli diff --git a/opencpn-libs b/opencpn-libs index a001083..c1d8263 160000 --- a/opencpn-libs +++ b/opencpn-libs @@ -1 +1 @@ -Subproject commit a001083af21de2e3faa970b245877a5ee5899aba +Subproject commit c1d82631756056437edc58235d9e1ff68b46ddf3 diff --git a/src/pypilot_pi.cpp b/src/pypilot_pi.cpp index 0f7fdf6..5eb65d6 100644 --- a/src/pypilot_pi.cpp +++ b/src/pypilot_pi.cpp @@ -82,7 +82,7 @@ void pypilotClient_pi::OnConnected() { m_pypilot_pi.OnConnected(); } void pypilotClient_pi::OnDisconnected() { m_pypilot_pi.OnDisconnected(); } pypilot_pi::pypilot_pi(void *ppimgr) - : opencpn_plugin_117(ppimgr), m_client(*this) + : opencpn_plugin_118(ppimgr), m_client(*this) { // Create the PlugIn icons initialize_images(); diff --git a/src/pypilot_pi.h b/src/pypilot_pi.h index cc0a643..0281432 100644 --- a/src/pypilot_pi.h +++ b/src/pypilot_pi.h @@ -91,7 +91,7 @@ class pypilotClient_pi : public pypilotClient }; -class pypilot_pi : public wxEvtHandler, public opencpn_plugin_117 +class pypilot_pi : public wxEvtHandler, public opencpn_plugin_118 { public: