Skip to content

Commit

Permalink
Update to latest frontend2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
jongough committed Jun 8, 2020
1 parent 6545526 commit d469eae
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 2
version: 2.1
jobs:
build-armhf-stretch:
machine: true
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion ci/circleci-build-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
62 changes: 32 additions & 30 deletions cmake/PluginConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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} ***")
Expand Down Expand Up @@ -101,16 +102,45 @@ 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)

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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -420,3 +420,5 @@ if(QT_ANDROID)
endif(QT_ANDROID)

find_package(Gettext REQUIRED)

set(CMLOC ${SAVE_CMLOC})
4 changes: 4 additions & 0 deletions cmake/PluginLocalization.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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})
5 changes: 5 additions & 0 deletions cmake/PluginPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -152,3 +155,5 @@ if(NOT STANDALONE MATCHES "BUNDLED")
include(CPack)

endif(NOT STANDALONE MATCHES "BUNDLED")

set(CMLOC ${SAVE_CMLOC})
15 changes: 10 additions & 5 deletions cmake/PluginSetup.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -227,3 +230,5 @@ if(CMAKE_VERSION VERSION_GREATER 3.9)
set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXECUTABLE})
endif()
endif()

set(CMLOC ${SAVE_CMLOC})

0 comments on commit d469eae

Please sign in to comment.