From d469eaec64745f8f3acd71ca44994aec05db4c1d Mon Sep 17 00:00:00 2001 From: jongough Date: Mon, 8 Jun 2020 17:29:13 +1000 Subject: [PATCH] Update to latest frontend2 version --- .circleci/config.yml | 6 ++-- CMakeLists.txt | 4 +-- ci/circleci-build-debian.sh | 2 +- cmake/PluginConfigure.cmake | 62 ++++++++++++++++++---------------- cmake/PluginLocalization.cmake | 4 +++ cmake/PluginPackage.cmake | 5 +++ cmake/PluginSetup.cmake | 15 +++++--- 7 files changed, 57 insertions(+), 41 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 86249f21..6e680829 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ --- -version: 2 +version: 2.1 jobs: build-armhf-stretch: machine: true @@ -99,7 +99,7 @@ jobs: docker: - image: circleci/buildpack-deps:bionic-scm environment: - - BUILD_GTK3: 1 + - BUILD_GTK3: true - OCPN_TARGET: bionic-gtk3 steps: - checkout @@ -134,7 +134,7 @@ jobs: docker: - image: circleci/buildpack-deps:focal-scm environment: - - BUILD_GTK3: 1 + - BUILD_GTK3: true - OCPN_TARGET: focal-gtk3 steps: - checkout diff --git a/CMakeLists.txt b/CMakeLists.txt index 2edcbf26..9fd3c675 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ project(${PACKAGE}) set(VERSION_MAJOR "1") set(VERSION_MINOR "8") set(VERSION_PATCH "0") -set(VERSION_TWEAK "4") +set(VERSION_TWEAK "5") set(VERSION_DATE "08/06/2020") set(OCPN_MIN_VERSION "ov50") set(OCPN_API_VERSION_MAJOR "1") @@ -81,7 +81,7 @@ set(CMAKE_BUILD_TYPE CACHE STRING "Choose the type of build") set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "None" "Debug" "Release" "RelWithDebInfo" "MinSizeRel") -message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +message(STATUS "${CMLOC}Build type: ${CMAKE_BUILD_TYPE}") include("cmake/PluginSetup.cmake") diff --git a/ci/circleci-build-debian.sh b/ci/circleci-build-debian.sh index f424faef..cd2f30a9 100644 --- a/ci/circleci-build-debian.sh +++ b/ci/circleci-build-debian.sh @@ -15,7 +15,7 @@ rm -f ./*all.deb tag=$(git tag --contains HEAD) -if [ -n "$BUILD_GTK3" ]; then +if [ -n "$BUILD_GTK3" ] && [ "$BUILD_GTK3" = "true" ]; then sudo update-alternatives --set wx-config /usr/lib/*-linux-*/wx/config/gtk3-unicode-3.0 fi diff --git a/cmake/PluginConfigure.cmake b/cmake/PluginConfigure.cmake index 1bc42ac4..d8bd4435 100644 --- a/cmake/PluginConfigure.cmake +++ b/cmake/PluginConfigure.cmake @@ -2,6 +2,7 @@ # Author: Jon Gough (Based on the work of Sean D'Epagnier and Pavel Kalian) Copyright: 2019 License: GPLv3+ # --------------------------------------------------------------------------- +set(SAVE_CMLOC ${CMLOC}) set(CMLOC "PluginConfigure: ") message(STATUS "${CMLOC}*** Staging to build ${PACKAGE_NAME} ***") @@ -101,6 +102,33 @@ else($ENV{OCPN_TARGET} MATCHES "(.*)gtk3") endif($ENV{OCPN_TARGET} MATCHES "(.*)gtk3") message(STATUS "${CMLOC}PKG_TARGET_GTK: ${PKG_TARGET_GTK}") +if(UNIX) + # Handle gtk3 build variant + string(STRIP "${PKG_TARGET}" PKG_TARGET) + string(TOLOWER "${PKG_TARGET}" PKG_TARGET) + + # Generate architecturally uniques names for linux output packages + if(ARCH MATCHES "arm64") + set(PKG_TARGET_ARCH "-ARM64") + elseif(ARCH MATCHES "armhf") + set(PKG_TARGET_ARCH "-ARMHF") + elseif(ARCH MATCHES "i386") + set(PKG_TARGET_ARCH "-i386") + else() + set(PKG_TARGET_ARCH "-x86_64") + endif() +else() + set(PKG_TARGET_ARCH "-${ARCH}") +endif() + +set(PKG_TARGET_FULL "${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_ARCH}") +message(STATUS "${CMLOC}PKG_TARGET_FULL: ${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_ARCH}") +message(STATUS "${CMLOC}*.in files generated in ${CMAKE_CURRENT_BINARY_DIR}") +configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/plugin.xml.in ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGING_NAME}.xml) +configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/pkg_version.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pkg_version.sh) +configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/cloudsmith-upload.sh.in ${CMAKE_CURRENT_BINARY_DIR}/cloudsmith-upload.sh @ONLY) + + message(STATUS "${CMLOC}Checking OCPN_FLATPAK_CONFIG: ${OCPN_FLATPAK_CONFIG}") if(OCPN_FLATPAK_CONFIG) configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/org.opencpn.OpenCPN.Plugin.yaml.in ${CMAKE_CURRENT_BINARY_DIR}/flatpak/org.opencpn.OpenCPN.Plugin.${PACKAGE}.yaml) @@ -108,9 +136,11 @@ if(OCPN_FLATPAK_CONFIG) message(STATUS "${CMLOC}Done OCPN_FLATPAK CONFIG") message(STATUS "${CMLOC}Directory used: ${CMAKE_CURRENT_BINARY_DIR}/flatpak") message(STATUS "${CMLOC}Git Branch: ${GIT_REPOSITORY_BRANCH}") + set(CMLOC ${SAVE_CMLOC}) return() endif(OCPN_FLATPAK_CONFIG) + set(CMAKE_VERBOSE_MAKEFILE ON) include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src) @@ -361,36 +391,6 @@ endif( AND NOT APPLE AND NOT QT_ANDROID) -if(UNIX) - # Handle gtk3 build variant - string(STRIP "${PKG_TARGET}" PKG_TARGET) - string(TOLOWER "${PKG_TARGET}" PKG_TARGET) - if(NOT DEFINED wxWidgets_LIBRARIES) - message(FATAL_ERROR "PluginSetup: required wxWidgets_LIBRARIES missing") - elseif("${wxWidgets_LIBRARIES}" MATCHES "gtk3u" AND PKG_TARGET STREQUAL "ubuntu") - message(STATUS "${CMLOC}PluginSetup: gtk3 found") - set(PKG_TARGET_GTK "-gtk3") - endif() - - # Generate architecturally uniques names for linux output packages - if(ARCH MATCHES "arm64") - set(PKG_TARGET_ARCH "-ARM64") - elseif(ARCH MATCHES "armhf") - set(PKG_TARGET_ARCH "-ARMHF") - elseif(ARCH MATCHES "i386") - set(PKG_TARGET_ARCH "-i386") - else() - set(PKG_TARGET_ARCH "-x86_64") - endif() -endif() - -set(PKG_TARGET_FULL "${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_ARCH}") -message(STATUS "${CMLOC}PKG_TARGET_FULL: ${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_ARCH}") -message(STATUS "${CMLOC}*.in files generated in ${CMAKE_CURRENT_BINARY_DIR}") -configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/plugin.xml.in ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGING_NAME}.xml) -configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/pkg_version.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pkg_version.sh) -configure_file(${CMAKE_SOURCE_DIR}/cmake/in-files/cloudsmith-upload.sh.in ${CMAKE_CURRENT_BINARY_DIR}/cloudsmith-upload.sh @ONLY) - # On Android, PlugIns need a specific linkage set.... if(QT_ANDROID) # These libraries are needed to create PlugIns on Android. @@ -420,3 +420,5 @@ if(QT_ANDROID) endif(QT_ANDROID) find_package(Gettext REQUIRED) + +set(CMLOC ${SAVE_CMLOC}) diff --git a/cmake/PluginLocalization.cmake b/cmake/PluginLocalization.cmake index 85039074..58aa2604 100644 --- a/cmake/PluginLocalization.cmake +++ b/cmake/PluginLocalization.cmake @@ -2,9 +2,11 @@ # Author: Pavel Kalian / Sean D'Epagnier Copyright: License: GPLv3+ # --------------------------------------------------------------------------- +set(SAVE_CMLOC ${CMLOC}) set(CMLOC "PluginLocalization: ") if(OCPN_FLATPAK_CONFIG) + set(CMLOC ${SAVE_CMLOC}) return() endif(OCPN_FLATPAK_CONFIG) @@ -113,3 +115,5 @@ if(GETTEXT_MSGFMT_EXECUTABLE) endif(GETTEXT_MSGFMT_EXECUTABLE) file(MAKE_DIRECTORY "Resources") message(STATUS "${CMLOC}Creating Resources directory") + +set(CMLOC ${SAVE_CMLOC}) diff --git a/cmake/PluginPackage.cmake b/cmake/PluginPackage.cmake index 3fd04ffe..569acd56 100644 --- a/cmake/PluginPackage.cmake +++ b/cmake/PluginPackage.cmake @@ -2,6 +2,7 @@ # Author: Pavel Kalian (Based on the work of Sean D'Epagnier) Copyright: 2014 License: GPLv3+ # --------------------------------------------------------------------------- +set(SAVE_CMLOC ${CMLOC}) set(CMLOC "PluginPackage: ") # build a FLATPAK installer package @@ -23,6 +24,8 @@ if(OCPN_FLATPAK_CONFIG) TARGET flatpak-pkg COMMAND ${TAR} -czf ${PKG_NVR}-${ARCH}_${PKG_TARGET_NVR}.tar.gz --transform 's|.*/files/|${PACKAGE}-flatpak-${PACKAGE_VERSION}/|' ${CMAKE_CURRENT_BINARY_DIR}/app/files COMMAND chmod -R a+wr ../build) + + set(CMLOC ${SAVE_CMLOC}) return() endif(OCPN_FLATPAK_CONFIG) @@ -152,3 +155,5 @@ if(NOT STANDALONE MATCHES "BUNDLED") include(CPack) endif(NOT STANDALONE MATCHES "BUNDLED") + +set(CMLOC ${SAVE_CMLOC}) diff --git a/cmake/PluginSetup.cmake b/cmake/PluginSetup.cmake index a22a2378..fa3bcad9 100644 --- a/cmake/PluginSetup.cmake +++ b/cmake/PluginSetup.cmake @@ -1,5 +1,8 @@ -# +# --------------------------------------------------------------------------- +# Author: Jon Gough based on the work of Pavel Kalian (Based on the work of Sean D'Epagnier) Copyright: 2020 License: GPLv3+ +# --------------------------------------------------------------------------- +set(SAVE_CMLOC ${CMLOC}) set(CMLOC "PluginSetup: ") # Export variables used in plugin setup: GIT_HASH, GIT_COMMIT, PKG_TARGET, PKG_TARGET_VERSION and PKG_NVR @@ -71,10 +74,10 @@ if(NOT WIN32) set(ARCH "i386") if(UNIX AND NOT APPLE) - message(STATUS "*** Will install to ${CMAKE_INSTALL_PREFIX} ***") + message(STATUS "${CMLOC}*** Will install to ${CMAKE_INSTALL_PREFIX} ***") if(EXISTS /etc/debian_version) - message(STATUS "*** Debian detected ***") + message(STATUS "${CMLOC}*** Debian detected ***") set(PACKAGE_FORMAT "DEB") set(PACKAGE_DEPS "libc6, libwxgtk3.0-0, wx3.0-i18n, libglu1-mesa (>= 7.0.0), libgl1-mesa-glx (>= 7.0.0), zlib1g, bzip2, libportaudio2") set(PACKAGE_RECS "xcalib,xdg-utils") @@ -106,7 +109,7 @@ if(NOT WIN32) if(NOT DEFINED PACKAGE_FORMAT) if(EXISTS /etc/redhat-release) - message(STATUS "*** Redhat detected ***") + message(STATUS "${CMLOC}*** Redhat detected ***") set(PACKAGE_FORMAT "RPM") set(PACKAGE_DEPS "opencpn") if(CMAKE_SIZEOF_VOID_P MATCHES "8") @@ -124,7 +127,7 @@ if(NOT WIN32) OR EXISTS /etc/sysconfig/SuSEfirewall2.d OR EXISTS /etc/suse-release OR EXISTS /etc/SuSE-release) - message(STATUS "*** OpenSUSE detected ***") + message(STATUS "${CMLOC}*** OpenSUSE detected ***") set(PACKAGE_FORMAT "RPM") set(PACKAGE_DEPS "opencpn") if(CMAKE_SIZEOF_VOID_P MATCHES "8") @@ -227,3 +230,5 @@ if(CMAKE_VERSION VERSION_GREATER 3.9) set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXECUTABLE}) endif() endif() + +set(CMLOC ${SAVE_CMLOC})