Skip to content

Commit

Permalink
Merge pull request #262 from jongough/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
jongough authored May 13, 2022
2 parents 4a71509 + ad213be commit 6a80981
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 62 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ set(LONG_DESCRIPTION "testplugin Plugin is used to test out the ODraw API and de

set(VERSION_MAJOR "1")
set(VERSION_MINOR "0")
set(VERSION_PATCH "201")
set(VERSION_PATCH "204")
set(VERSION_TWEAK "0")
set(VERSION_DATE "04/05/2022") # DD/MM/YYYY format
set(VERSION_DATE "13/05/2022") # DD/MM/YYYY format
set(OCPN_MIN_VERSION "ov50")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")
Expand Down
30 changes: 22 additions & 8 deletions ci/circleci-build-android-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,30 @@ pwd

ls -la

sudo apt-get -q update
sudo apt-get -y install git cmake gettext unzip

# Get the OCPN Android build support package.
# FOR LOCAL BUILD - have a local version to avoid big download each run - need to stage it but not commit it. DO NOT COMMIT AND PUSH master.zip
echo "CIRCLECI_LOCAL: $CIRCLECI_LOCAL"
if [ -z "$CIRCLECI_LOCAL" ]; then
wget https://github.com/bdbcat/OCPNAndroidCommon/archive/master.zip
if [ "${CIRCLECI_LOCAL,,}" = "true" ]; then
if [[ -d ~/circleci-cache ]]; then
if [[ -f ~/circleci-cache/apt-proxy ]]; then
cat ~/circleci-cache/apt-proxy | sudo tee -a /etc/apt/apt.conf.d/00aptproxy
cat /etc/apt/apt.conf.d/00aptproxy
fi
if [[ ! -f ~/circleci-cache/master.zip ]]; then
sudo wget https://github.com/bdbcat/OCPNAndroidCommon/archive/master.zip -O ~/circleci-cache/master.zip
fi
MASTER_LOC=~/circleci-cache
#unzip -qq -o /home/circleci/circleci-cache/master.zip
fi
else
MASTER_LOC=$(pwd)
wget https://github.com/bdbcat/OCPNAndroidCommon/archive/master.zip
#unzip -qq -o master.zip
fi
unzip -qq -o master.zip
echo "unzipping $MASTER_LOC/master.zip"

unzip -qq -o $MASTER_LOC/master.zip

sudo apt-get -q update
sudo apt-get -y install git cmake gettext unzip

pwd
ls -la
Expand Down
10 changes: 10 additions & 0 deletions ci/circleci-build-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
# Build the Debian artifacts
#
set -xe

if [ "${CIRCLECI_LOCAL,,}" = "true" ]; then
if [[ -d ~/circleci-cache ]]; then
if [[ -f ~/circleci-cache/apt-proxy ]]; then
cat ~/circleci-cache/apt-proxy | sudo tee -a /etc/apt/apt.conf.d/00aptproxy
cat /etc/apt/apt.conf.d/00aptproxy
fi
fi
fi

sudo apt-get -qq update
sudo apt-get install devscripts equivs

Expand Down
10 changes: 10 additions & 0 deletions ci/circleci-build-flatpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@

# bailout on errors and echo commands.
set -xe

if [ "${CIRCLECI_LOCAL,,}" = "true" ]; then
if [[ -d ~/circleci-cache ]]; then
if [[ -f ~/circleci-cache/apt-proxy ]]; then
cat ~/circleci-cache/apt-proxy | sudo tee -a /etc/apt/apt.conf.d/00aptproxy
cat /etc/apt/apt.conf.d/00aptproxy
fi
fi
fi

sudo apt-get -q -y --allow-unauthenticated --allow-downgrades --allow-remove-essential --allow-change-held-packages update

#PLUGIN=bsb4
Expand Down
81 changes: 56 additions & 25 deletions cmake/PluginConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,74 @@ else()
endif(MINGW)
endif()

message(STATUS "${CMLOC}ARCH: ${ARCH}")

if("${PKG_BUILD_TARGET}" STREQUAL "")
set(PKG_BUILD_TARGET "${PKG_TARGET}")
set(PKG_TARGET_BUILD "-${PKG_BUILD_TARGET}")
endif()
set(PKG_BUILD_GTK "${PKG_TARGET_GTK}")

if(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
find_package(GTK2)

if(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk2)
include_directories(${GTK2_INCLUDE_DIRS})
set(GTK_LIBRARIES ${GTK2_LIBRARIES})
set(PKG_BUILT_WITH_GTK "gtk2")
message(STATUS "${CMLOC}Building against GTK2...")
else(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
find_package(GTK3)
if(GTK3_FOUND)
include_directories(${GTK3_INCLUDE_DIRS})
set(GTK_LIBRARIES ${GTK3_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__WXGTK3__")
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk3)
set(PKG_BUILT_WITH_GTK "gtk3")
message(STATUS "${CMLOC}Building against GTK3...")
else(GTK3_FOUND)
message(STATUS "${CMLOC} Unix: Neither FATAL_ERROR GTK2 nor GTK3")
set(PKG_BUILT_WITH_GTK "")
endif(GTK3_FOUND)
endif(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
set(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES})
else()
set(PKG_BUILT_WITH_GTK "${PKG_TARGET_GTK}")
endif(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)

if(NOT "${PKG_TARGET_GTK}" STREQUAL "")
set(PKG_BUILD_GTK "-${PKG_TARGET_GTK}")
set(PKG_TARGET_GTK "-${PKG_TARGET_GTK}")
endif()

message(STATUS "${CMLOC}PKG_NVR: ${PKG_NVR}, PKG_TARGET: ${PKG_TARGET}, ARCH: ${ARCH}, PKG_TARGET_WX_VER: ${PKG_TARGET_WX_VER}, PKG_BUILD_GTK: ${PKG_BUILD_GTK}, PKG_TARGET_VERSION: ${PKG_TARGET_VERSION}")
if(DEFINED ENV{OCPN_TARGET})
message(STATUS "${CMLOC}OCPN_TARGET defined: $ENV{OCPN_TARGET}")
if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}${PKG_TARGET_WX_VER}${PKG_BUILD_GTK}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}${PKG_TARGET_WX_VER}${PKG_BUILD_GTK}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}")
else(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
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(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
else()
if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}")
else(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}${PKG_BUILD_GTK}")
endif(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
endif(DEFINED ENV{OCPN_TARGET})
message(STATUS "${CMLOC}PACKAGING_NAME: ${PACKAGING_NAME}")
message(STATUS "${CMLOC}PACKAGING_NAME_XML: ${PACKAGING_NAME_XML}")

set(PKG_TARGET_FULL "${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_ARCH}${PKG_TARGET_WX_VER}")
message(STATUS "${CMLOC}PKG_TARGET_FULL: ${PKG_TARGET_FULL}")
message(STATUS "${CMLOC}PKG_BUILD_TARGET: ${PKG_BUILD_TARGET}")
message(STATUS "${CMLOC}PKG_BUILD_GTK: ${PKG_TARGET_GTK}")
message(STATUS "${CMLOC}PKG_BUILT_WITH_GTK: ${PKG_BUILT_WITH_GTK}")
message(STATUS "${CMLOC}*.in files generated in ${CMAKE_CURRENT_BINARY_DIR}")
message(STATUS "${CMLOC}PACKAGING_NAME_XML: ${PACKAGING_NAME_XML}")
configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/plugin.xml.in ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGING_NAME_XML}.xml)
configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/pkg_version.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pkg_version.sh)
configure_file(${PROJECT_SOURCE_DIR}/cmake/in-files/cloudsmith-upload.sh.in ${CMAKE_CURRENT_BINARY_DIR}/cloudsmith-upload.sh @ONLY)
Expand Down Expand Up @@ -548,29 +602,6 @@ else(NOT QT_ANDROID)
ENDIF(_wx_selected_config MATCHES "androideabi-qt-arm64")
endif(NOT QT_ANDROID)

if(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
find_package(GTK2)

if(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk2)
include_directories(${GTK2_INCLUDE_DIRS})
set(GTK_LIBRARIES ${GTK2_LIBRARIES})
message(STATUS "${CMLOC}Building against GTK2...")
else(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
find_package(GTK3)
if(GTK3_FOUND)
include_directories(${GTK3_INCLUDE_DIRS})
set(GTK_LIBRARIES ${GTK3_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__WXGTK3__")
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk3)
message(STATUS "${CMLOC}Building against GTK3...")
else(GTK3_FOUND)
message(STATUS "${CMLOC} Unix: Neither FATAL_ERROR GTK2 nor GTK3")
endif(GTK3_FOUND)
endif(GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
set(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES})
endif(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)

find_package(Gettext REQUIRED)

set(CMLOC ${SAVE_CMLOC})
24 changes: 2 additions & 22 deletions cmake/PluginSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ else()
endif()

message(STATUS "${CMLOC}OCPN_FLATPAK_CONFIG: ${OCPN_FLATPAK_CONFIG}, OCPN_FLATPAK_BUILD: ${OCPN_FLATPAK_BUILD}, UNIX: ${UNIX}")
set(PKG_TARGET_WX_VER "")
unset(PKG_TARGET_WX_VER)
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}")
else()
set(PKG_TARGET_WX_VER "")
unset(PKG_TARGET_WX_VER)
endif()
message(STATUS "${CMLOC}PKG_TARGET_WX_VER: ${PKG_TARGET_WX_VER}")
elseif(MINGW)
Expand Down Expand Up @@ -244,26 +244,6 @@ if(NOT DEFINED ENV{OCPN_TARGET})
endif()
endif()

if(DEFINED ENV{OCPN_TARGET})
message(STATUS "${CMLOC}OCPN_TARGET defined: $ENV{OCPN_TARGET}")
if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}${PKG_TARGET_WX_VER}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}${PKG_TARGET_WX_VER}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}")
else(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}-$ENV{OCPN_TARGET}")
endif(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
else()
if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}")
else(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
set(PACKAGING_NAME "${PKG_NVR}-${PKG_TARGET}-${PKG_TARGET_VERSION}")
set(PACKAGING_NAME_XML "${PKG_NVR}-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION}")
endif(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW)
endif(DEFINED ENV{OCPN_TARGET})
message(STATUS "${CMLOC}PACKAGING_NAME: ${PACKAGING_NAME}")
message(STATUS "${CMLOC}PACKAGING_NAME_XML: ${PACKAGING_NAME_XML}")

set(PLUGIN_NAME ${PACKAGE}-plugin-${PKG_TARGET}-${ARCH}-${PKG_TARGET_VERSION})

Expand Down
8 changes: 4 additions & 4 deletions cmake/in-files/cloudsmith-upload.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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_TARGET_VERSION}-${OCPN_TARGET}-tarball
tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@ARCH@@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_TARGET_VERSION}-tarball
tarball_name=@PACKAGE_NAME@-@PACKAGE_VERSION@-${PKG_TARGET}-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-${PKG_TARGET_VERSION}-tarball
fi

if [ "$(ls $BUILD_DIR/*.${PKG_EXT})" ]; then
Expand Down Expand Up @@ -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_TARGET_VERSION@-${OCPN_TARGET}-metadata \
--name @PACKAGE_NAME@-@PACKAGE_VERSION@-@PKG_TARGET@-@ARCH@@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
Expand All @@ -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_TARGET_VERSION@-${OCPN_TARGET}.${PKG_EXT} \
--name opencpn-package-@PACKAGE@-@PACKAGE_VERSION@-@PKG_TARGET@-@ARCH@@PKG_TARGET_WX_VER@@PKG_BUILD_GTK@-@PKG_TARGET_VERSION@-${OCPN_TARGET}.${PKG_EXT} \
--version ${VERSION} \
--summary "@PACKAGE@ .${PKG_EXT} installation package" \
$REPO $pkg
Expand Down
2 changes: 1 addition & 1 deletion cmake/in-files/plugin.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<target>${PKG_TARGET_FULL}</target>
<build-target>${PKG_BUILD_TARGET}</build-target>
<build-gtk>${PKG_BUILD_GTK}</build-gtk>
<build-gtk>${PKG_BUILT_WITH_GTK}</build-gtk>
<target-version>${PKG_TARGET_VERSION}</target-version>
<target-arch>${ARCH}</target-arch>
<tarball-url>
Expand Down

0 comments on commit 6a80981

Please sign in to comment.