From fb53577d562c73796d88f44dbcd4fcc46e9ac331 Mon Sep 17 00:00:00 2001 From: jongough Date: Fri, 27 Oct 2023 08:47:30 +1100 Subject: [PATCH 01/10] Add example file for running circleci locally --- run-circleci-local.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 run-circleci-local.txt diff --git a/run-circleci-local.txt b/run-circleci-local.txt new file mode 100644 index 00000000..ec244b53 --- /dev/null +++ b/run-circleci-local.txt @@ -0,0 +1 @@ +circleci local execute build-ubuntu-x86_64-1804-bionic -e CIRCLECI_LOCAL=true -v "/home/jon/opencpn/circleci-output:/home/circleci/circleci-output" -e LOCAL_DEPLOY -e CLOUDSMITH_API_KEY="123" From abcebe5864b440e508539c93484db4be9b3e39d5 Mon Sep 17 00:00:00 2001 From: jongough Date: Fri, 27 Oct 2023 19:10:43 +1100 Subject: [PATCH 02/10] Update to correct test for local_deploy --- CMakeLists.txt | 6 +++--- cmake/in-files/cloudsmith-upload.sh.in | 2 +- run-circleci-local.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a61f9f8e..b76372f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugin(TP) v1.0.272 22/10/2023 DD/MM/YYYY format +# Testplugin(TP) v1.0.273 27/10/2023 DD/MM/YYYY format # buildCI:yes useODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -55,9 +55,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 "272") +set(VERSION_PATCH "273") set(VERSION_TWEAK "0") -set(VERSION_DATE "22/10/2023")#DD/MM/YYYY format +set(VERSION_DATE "27/10/2023")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") set(OCPN_API_VERSION_MAJOR "1") diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index 10e2d986..fab1fa58 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -231,7 +231,7 @@ function have_any() { [ $# -gt 0 ] } -if [ ! -z ${LOCAL_DEPLOY+x} ]; then +if [ $LOCAL_DEPLOY = true ]; then if [ -d "/home/circleci/circleci-output" ]; then sudo cp build/*.gz ~/circleci-output if have_any ./build/*.deb; then diff --git a/run-circleci-local.txt b/run-circleci-local.txt index ec244b53..332d7fc0 100644 --- a/run-circleci-local.txt +++ b/run-circleci-local.txt @@ -1 +1 @@ -circleci local execute build-ubuntu-x86_64-1804-bionic -e CIRCLECI_LOCAL=true -v "/home/jon/opencpn/circleci-output:/home/circleci/circleci-output" -e LOCAL_DEPLOY -e CLOUDSMITH_API_KEY="123" +circleci local execute build-ubuntu-x86_64-1804-bionic -e CIRCLECI_LOCAL=true -v "/home/jon/opencpn/circleci-output:/home/circleci/circleci-output" -e LOCAL_DEPLOY=true -e CLOUDSMITH_API_KEY="123" From 963e2c04bab2b9fe726a4081aed39872cea659cb Mon Sep 17 00:00:00 2001 From: jongough Date: Fri, 27 Oct 2023 19:24:59 +1100 Subject: [PATCH 03/10] Fix new if statement --- CMakeLists.txt | 4 ++-- cmake/in-files/cloudsmith-upload.sh.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b76372f4..fc5636c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugin(TP) v1.0.273 27/10/2023 DD/MM/YYYY format +# Testplugin(TP) v1.0.273.1 27/10/2023 DD/MM/YYYY format # buildCI:yes useODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -56,7 +56,7 @@ 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 "273") -set(VERSION_TWEAK "0") +set(VERSION_TWEAK "1") set(VERSION_DATE "27/10/2023")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index fab1fa58..a9b94384 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -231,7 +231,7 @@ function have_any() { [ $# -gt 0 ] } -if [ $LOCAL_DEPLOY = true ]; then +if [ ${LOCAL_DEPLOY:+x) = true ]; then if [ -d "/home/circleci/circleci-output" ]; then sudo cp build/*.gz ~/circleci-output if have_any ./build/*.deb; then From 2567191c20371437b36d6a00405c658c16ad2bda Mon Sep 17 00:00:00 2001 From: jongough Date: Fri, 27 Oct 2023 19:28:13 +1100 Subject: [PATCH 04/10] Fix typo --- cmake/in-files/cloudsmith-upload.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index a9b94384..2000b2d2 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -231,7 +231,7 @@ function have_any() { [ $# -gt 0 ] } -if [ ${LOCAL_DEPLOY:+x) = true ]; then +if [ ${LOCAL_DEPLOY:+x} = true ]; then if [ -d "/home/circleci/circleci-output" ]; then sudo cp build/*.gz ~/circleci-output if have_any ./build/*.deb; then From 14b17e964cd395cdb886f86b197f73885f55d719 Mon Sep 17 00:00:00 2001 From: jongough Date: Sat, 28 Oct 2023 09:59:59 +1100 Subject: [PATCH 05/10] Update to allow correct installable tar.gz file to be created for MSVC --- CMakeLists.txt | 8 ++++---- cmake/in-files/cloudsmith-upload.sh.in | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc5636c1..4df69264 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugin(TP) v1.0.273.1 27/10/2023 DD/MM/YYYY format +# Testplugin(TP) v1.0.274.0 28/10/2023 DD/MM/YYYY format # buildCI:yes useODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -55,9 +55,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 "273") -set(VERSION_TWEAK "1") -set(VERSION_DATE "27/10/2023")#DD/MM/YYYY format +set(VERSION_PATCH "274") +set(VERSION_TWEAK "0") +set(VERSION_DATE "28/10/2023")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") set(OCPN_API_VERSION_MAJOR "1") diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index 2000b2d2..da245ffa 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -175,7 +175,7 @@ fi echo $VERSION echo $REPO -if [ "$APPVEYOR" ] || [ LOCAL_BUILD=true ]; then +if [ "$APPVEYOR" ] || [ $LOCAL_BUILD=true ]; then echo 'substituting xml file variables for windows build' while read line; do line=${line//--pkg_repo--/$REPO} @@ -201,7 +201,7 @@ rm -f metadata.xml tarball_tar=$(ls *.tar) xml_here=$(ls *.xml) cp -f $xml_here metadata.xml -if [ "$TRAVIS" ] || [ "$CIRCLECI" ]; then +if [ "$TRAVIS" ] || [ "$CIRCLECI" ] || [ ! -z ${LOCAL_DEPLOY+x} ]; then mkdir build_tar cp $tarball_tar build_tar/. cd build_tar @@ -231,7 +231,7 @@ function have_any() { [ $# -gt 0 ] } -if [ ${LOCAL_DEPLOY:+x} = true ]; then +if [ ! -z ${LOCAL_DEPLOY+x} ]; then if [ -d "/home/circleci/circleci-output" ]; then sudo cp build/*.gz ~/circleci-output if have_any ./build/*.deb; then From 220b04bd401ac3f49c76c09d3940bf6db74e8c01 Mon Sep 17 00:00:00 2001 From: jongough Date: Sun, 29 Oct 2023 08:49:42 +1100 Subject: [PATCH 06/10] Update for circleci local build of arm(hf/64) with example text file of command to use --- CMakeLists.txt | 6 +++--- ci/circleci-build-android-arm64.sh | 7 ------- ci/circleci-build-android-armhf.sh | 6 ------ run-circleci-local.txt | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4df69264..0436007e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugin(TP) v1.0.274.0 28/10/2023 DD/MM/YYYY format +# Testplugin(TP) v1.0.275.0 29/10/2023 DD/MM/YYYY format # buildCI:yes useODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -55,9 +55,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 "274") +set(VERSION_PATCH "275") set(VERSION_TWEAK "0") -set(VERSION_DATE "28/10/2023")#DD/MM/YYYY format +set(VERSION_DATE "29/10/2023")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") set(OCPN_API_VERSION_MAJOR "1") diff --git a/ci/circleci-build-android-arm64.sh b/ci/circleci-build-android-arm64.sh index a1998643..b2eb3056 100755 --- a/ci/circleci-build-android-arm64.sh +++ b/ci/circleci-build-android-arm64.sh @@ -73,13 +73,6 @@ cmake \ -DCMAKE_INSTALL_PREFIX=/ \ .. -# Get number of processors and use this on make to speed up build -#procs=$(awk -F- '{print $2}' /sys/fs/cgroup/cpuset/cpuset.cpus) -#procs=$((procs + 1)) -#make_cmd="make -j"$procs -#eval $make_cmd -make package - # All below for local docker build #ls -l diff --git a/ci/circleci-build-android-armhf.sh b/ci/circleci-build-android-armhf.sh index 3639dc02..c9eae97b 100755 --- a/ci/circleci-build-android-armhf.sh +++ b/ci/circleci-build-android-armhf.sh @@ -90,12 +90,6 @@ cmake \ -DCMAKE_INSTALL_PREFIX=/ \ .. -# Get number of processors and use this on make to speed up build -procs=$(awk -F- '{print $2}' /sys/fs/cgroup/cpuset/cpuset.cpus) -procs=$((procs + 1)) -make_cmd="make -j"$procs -eval $make_cmd - make package # All below for local docker build diff --git a/run-circleci-local.txt b/run-circleci-local.txt index 332d7fc0..076b4ea0 100644 --- a/run-circleci-local.txt +++ b/run-circleci-local.txt @@ -1 +1 @@ -circleci local execute build-ubuntu-x86_64-1804-bionic -e CIRCLECI_LOCAL=true -v "/home/jon/opencpn/circleci-output:/home/circleci/circleci-output" -e LOCAL_DEPLOY=true -e CLOUDSMITH_API_KEY="123" +circleci local execute build-debian-x86_64-11-bullseye -e CIRCLECI_LOCAL=true -v "/home/jon/opencpn/circleci-output:/home/circleci/circleci-output" -v "/home/jon/opencpn/circleci-cache:/home/circleci/circleci-cache" -e LOCAL_DEPLOY=true -e CLOUDSMITH_API_KEY="123" From 78f387653cfa577a4f6203606710ddb5037eb619 Mon Sep 17 00:00:00 2001 From: jongough Date: Mon, 30 Oct 2023 10:05:01 +1100 Subject: [PATCH 07/10] Update to latest version --- opencpn-libs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencpn-libs b/opencpn-libs index 7ea37a15..facd6f68 160000 --- a/opencpn-libs +++ b/opencpn-libs @@ -1 +1 @@ -Subproject commit 7ea37a15682c432df63ca7a25967954a8f9f13ad +Subproject commit facd6f684e8b851619a100e5601626e2002e1d42 From d7c8dd1c173b2d412ef08c19d0dd7aa2dece0f12 Mon Sep 17 00:00:00 2001 From: jongough Date: Mon, 30 Oct 2023 14:50:00 +1100 Subject: [PATCH 08/10] Add new modules --- cmake/android-aarch64-toolchain.cmake | 23 +++++++++++++++++++++++ cmake/android-armhf-toolchain.cmake | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 cmake/android-aarch64-toolchain.cmake create mode 100644 cmake/android-armhf-toolchain.cmake diff --git a/cmake/android-aarch64-toolchain.cmake b/cmake/android-aarch64-toolchain.cmake new file mode 100644 index 00000000..2ee7b34c --- /dev/null +++ b/cmake/android-aarch64-toolchain.cmake @@ -0,0 +1,23 @@ +# ~~~ +# Summary: Cmake toolchain file for android arm64 +# License: GPLv3+ +# 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(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSTEM_VERSION 21) +set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) +if (DEFINED ENV{NDK_HOME}) + set(CMAKE_ANDROID_NDK $ENV{NDK_HOME}) +else () + set(CMAKE_ANDROID_NDK /opt/android/ndk) +endif () + +set(ARM_ARCH aarch64 CACHE STRING "Selected arm architecture" FORCE) diff --git a/cmake/android-armhf-toolchain.cmake b/cmake/android-armhf-toolchain.cmake new file mode 100644 index 00000000..dcec280a --- /dev/null +++ b/cmake/android-armhf-toolchain.cmake @@ -0,0 +1,20 @@ +# ~~~ +# Summary: Cmake toolchain file for 32-bit android armhf +# License: GPLv3+ +# 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(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSTEM_VERSION 21) +set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a) +if (DEFINED ENV{NDK_HOME}) + set(CMAKE_ANDROID_NDK $ENV{NDK_HOME}) +else () + set(CMAKE_ANDROID_NDK /opt/android/ndk) +endif () +set(ARM_ARCH armhf CACHE STRING "Selected arm architecture" FORCE) From 37c86d802e39fd703fc232e8061d21868b422523 Mon Sep 17 00:00:00 2001 From: jongough Date: Mon, 30 Oct 2023 14:50:15 +1100 Subject: [PATCH 09/10] Update to match Dave's mods --- .circleci/config.yml | 3 +- CMakeLists.txt | 20 +++++++------ ci/circleci-build-android-arm64.sh | 40 ++++++++++---------------- ci/circleci-build-android-armhf.sh | 40 +++++++++----------------- cmake/PluginConfigure.cmake | 27 ++--------------- cmake/in-files/cloudsmith-upload.sh.in | 4 +-- include/testplugin_pi.h | 16 +---------- 7 files changed, 46 insertions(+), 104 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec802971..7ecdc254 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -350,8 +350,7 @@ jobs: ## --------------------- build-macos: macos: - xcode: "12.5.1" - resource_class: macos.x86.medium.gen2 + xcode: "13.4" environment: - OCPN_TARGET: macos - CLOUDSMITH_PKG_EXT: pkg diff --git a/CMakeLists.txt b/CMakeLists.txt index 0436007e..315791af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * #----------------------------------------------------------------------------- # Frontend2 Author: Jon Gough -# Testplugin(TP) v1.0.275.0 29/10/2023 DD/MM/YYYY format +# Testplugin(TP) v1.0.276.0 30/10/2023 DD/MM/YYYY format # buildCI:yes useODAPI:yes validateJSON:yes # --------------------------------------------------------------------------- ## -- When changing this file do NOT change the order of the sections. -- ## @@ -38,7 +38,7 @@ if(COMMAND cmake_policy) endif(POLICY CMP0043) cmake_policy(SET CMP0048 NEW) # Need cmake 3.13 to implement this, but raspbian builds are at 3.7.2 and bionic at 3.10 and xenial builds at 3.5.1 -# cmake_policy(SET CMP0076 NEW) + cmake_policy(SET CMP0076 NEW) if(POLICY CMP0077) cmake_policy(SET CMP0077 NEW) endif(POLICY CMP0077) @@ -55,9 +55,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 "275") +set(VERSION_PATCH "276") set(VERSION_TWEAK "0") -set(VERSION_DATE "29/10/2023")#DD/MM/YYYY format +set(VERSION_DATE "30/10/2023")#DD/MM/YYYY format set(OCPN_MIN_VERSION "ov58") set(OCPN_API_VERSION_MAJOR "1") @@ -97,7 +97,7 @@ set(CMAKE_CXX_STANDARD 11) # Use local version of GLU library # requires libs/glu directory -set(USE_LOCAL_GLU TRUE) +set(USE_LOCAL_GLU FALSE) # Prefer libGL.so to libOpenGL.so, see CMP0072 set(OpenGL_GL_PREFERENCE "LEGACY") #not operational @@ -214,8 +214,10 @@ if(NOT OCPN_FLATPAK_CONFIG) # so following statements will not work message(STATUS "${CMLOC}Adding target link libraries to ${PACKAGE_NAME}") -# add_subdirectory(opencpn-libs/WindowsHeaders) -# target_link_libraries(${PACKAGE_NAME} windows::headers) + if (WIN32) + add_subdirectory(opencpn-libs/WindowsHeaders) + target_link_libraries(${PACKAGE_NAME} windows::headers) + endif (WIN32) add_subdirectory(opencpn-libs/api-17) target_link_libraries(${PACKAGE_NAME} ocpn::api) @@ -232,8 +234,8 @@ if(NOT OCPN_FLATPAK_CONFIG) add_subdirectory(opencpn-libs/wxJSON) target_link_libraries(${PACKAGE_NAME} ocpn::wxjson) - add_subdirectory(opencpn-libs/plugingl) - target_link_libraries(${PACKAGE_NAME} ocpn::plugingl) + add_subdirectory(opencpn-libs/plugin_dc) + target_link_libraries(${PACKAGE_NAME} ocpn::plugin-dc) endif(NOT OCPN_FLATPAK_CONFIG) diff --git a/ci/circleci-build-android-arm64.sh b/ci/circleci-build-android-arm64.sh index b2eb3056..7e98d688 100755 --- a/ci/circleci-build-android-arm64.sh +++ b/ci/circleci-build-android-arm64.sh @@ -60,36 +60,26 @@ mkdir -p build cd build rm -f CMakeCache.txt -COMPDIR=$(find ~/. -regex ".*/ndk/22.[0-9].[0-9]*") -cmake \ +# Install python to get a recent version of cmake +sudo apt install python3-pip +python3 -m pip install --user --force-reinstall -q pip setuptools +sudo apt remove python3-six python3-colorama python3-urllib3 +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +python3 -m pip install --user -q cmake + + +last_ndk=$(ls -d /home/circleci/android-sdk/ndk/* | tail -1) +test -d /opt/android || sudo mkdir -p /opt/android +sudo ln -sf $last_ndk /opt/android/ndk + +cmake -DCMAKE_TOOLCHAIN_FILE=cmake/android-aarch64-toolchain.cmake \ -D_wx_selected_config=androideabi-qt-arm64 \ -DwxQt_Build=build_android_release_64_static_O3 \ -DQt_Build=build_arm64/qtbase \ - -DCMAKE_AR=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar \ - -DCMAKE_CXX_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++ \ - -DCMAKE_C_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang \ -DOCPN_Android_Common=OCPNAndroidCommon-master \ - -DCMAKE_INSTALL_PREFIX=/ \ .. -# All below for local docker build -#ls -l - -#xml=$(ls *.xml) -#tarball=$(ls *.tar.gz) -#tarball_basename=${tarball##*/} - -#echo $xml -#echo $tarball -#echo $tarball_basename -#sudo sed -i -e "s|@filename@|$tarball_basename|" $xml - +make VERBOSE=1 -#tmpdir=repack.$$ -#sudo rm -rf $tmpdir && sudo mkdir $tmpdir -#sudo tar -C $tmpdir -xf $tarball_basename -#sudo cp oesenc-plugin-android-arm64-16.xml metadata.xml -#sudo cp metadata.xml $tmpdir -#sudo tar -C $tmpdir -czf $tarball_basename . -#sudo rm -rf $tmpdir +make package diff --git a/ci/circleci-build-android-armhf.sh b/ci/circleci-build-android-armhf.sh index c9eae97b..7b10e0a9 100755 --- a/ci/circleci-build-android-armhf.sh +++ b/ci/circleci-build-android-armhf.sh @@ -79,36 +79,24 @@ cd build rm -f CMakeCache.txt COMPDIR=$(find ~/. -regex ".*/ndk/22.[0-9].[0-9]*") -cmake \ +# Install python to get a recent version of cmake +sudo apt install python3-pip +python3 -m pip install --user --force-reinstall -q pip setuptools +sudo apt remove python3-six python3-colorama python3-urllib3 +export LC_ALL=C.UTF-8 LANG=C.UTF-8 +python3 -m pip install --user -q cmake + +last_ndk=$(ls -d /home/circleci/android-sdk/ndk/* | tail -1) +test -d /opt/android || sudo mkdir -p /opt/android +sudo ln -sf $last_ndk /opt/android/ndk + +cmake -DCMAKE_TOOLCHAIN_FILE=cmake/android-armhf-toolchain.cmake \ -D_wx_selected_config=androideabi-qt-armhf \ -DwxQt_Build=build_android_release_19_static_O3 \ -DQt_Build=build_arm32_19_O3/qtbase \ - -DCMAKE_AR=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar \ - -DCMAKE_CXX_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ \ - -DCMAKE_C_COMPILER=$COMPDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang \ -DOCPN_Android_Common=OCPNAndroidCommon-master \ - -DCMAKE_INSTALL_PREFIX=/ \ .. -make package - -# All below for local docker build -#ls -l - -#xml=$(ls *.xml) -#tarball=$(ls *.tar.gz) -#tarball_basename=${tarball##*/} +make VERBOSE=1 -#echo $xml -#echo $tarball -#echo $tarball_basename -#sudo sed -i -e "s|@filename@|$tarball_basename|" $xml - - -#tmpdir=repack.$$ -#sudo rm -rf $tmpdir && sudo mkdir $tmpdir -#sudo tar -C $tmpdir -xf $tarball_basename -#sudo cp oesenc-plugin-android-armhf-16.xml metadata.xml -#sudo cp metadata.xml $tmpdir -#sudo tar -C $tmpdir -czf $tarball_basename . -#sudo rm -rf $tmpdir +make package diff --git a/cmake/PluginConfigure.cmake b/cmake/PluginConfigure.cmake index c1923437..beafda18 100644 --- a/cmake/PluginConfigure.cmake +++ b/cmake/PluginConfigure.cmake @@ -437,8 +437,6 @@ IF(DEFINED _wx_selected_config) MESSAGE (STATUS "${CMLOC}Using GLESv2 for Android") ADD_DEFINITIONS(-DUSE_ANDROID_GLES2) ADD_DEFINITIONS(-DUSE_GLSL) - include_directories( ${PROJECT_SOURCE_DIR}/libs/glshim/include/GLES ) - set(EXTINCLUDE_DIR ${EXTINCLUDE_DIR} ${PROJECT_SOURCE_DIR}/libs/glshim/include/GLES) ENDIF(_wx_selected_config MATCHES "androideabi-qt") ENDIF(DEFINED _wx_selected_config) @@ -454,7 +452,7 @@ IF(QT_ANDROID) set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-soname,libgorp.so ") #set(CMAKE_POSITION_INDEPENDENT_CODE ON) - SET(CMAKE_CXX_FLAGS "-pthread -fPIC") + SET(CMAKE_CXX_FLAGS "-pthread -fPIC ") ## Compiler flags add_compile_options("-Wno-inconsistent-missing-override" @@ -491,21 +489,7 @@ if((NOT OPENGLES_FOUND) AND (NOT QT_ANDROID)) message(STATUS "${CMLOC}OpenGL disabled by option...") endif(USE_GL MATCHES "ON") - if(USE_LOCAL_GLU) - message(STATUS "${CMLOC} Adding local GLU") - if (WIN32) - add_subdirectory(opencpn-libs/WindowsHeaders) - target_link_libraries(${PACKAGE_NAME} windows::headers) - endif(WIN32) - - add_subdirectory(opencpn-libs/glu) - message(STATUS "${CMLOC}PACKAGE_NAME: ${PACKAGE_NAME}") - target_link_libraries(${PACKAGE_NAME} ocpn::glu_static) - add_definitions(-DocpnUSE_GL) - - set(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl) - message(STATUS "${CMLOC} Revised GL Lib (with local): " ${OPENGL_LIBRARIES}) - elseif(OPENGL_FOUND) + if(OPENGL_FOUND) set(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl) include_directories(${OPENGL_INCLUDE_DIR}) @@ -649,13 +633,6 @@ else(NOT QT_ANDROID) # Needed for android builds include_directories(BEFORE ${qt_android_include}) - if(USE_LOCAL_GLU) - message(STATUS "${CMLOC} Android:Adding local GLU") - add_subdirectory(opencpn-libs/glu) - message(STATUS "${CMLOC}PACKAGE_NAME: ${PACKAGE_NAME}") - target_link_libraries(${PACKAGE_NAME} ocpn::glu_static) - endif() - endif(NOT QT_ANDROID) find_package(Gettext REQUIRED) diff --git a/cmake/in-files/cloudsmith-upload.sh.in b/cmake/in-files/cloudsmith-upload.sh.in index da245ffa..c3b4d95e 100644 --- a/cmake/in-files/cloudsmith-upload.sh.in +++ b/cmake/in-files/cloudsmith-upload.sh.in @@ -235,9 +235,9 @@ if [ ! -z ${LOCAL_DEPLOY+x} ]; then if [ -d "/home/circleci/circleci-output" ]; then sudo cp build/*.gz ~/circleci-output if have_any ./build/*.deb; then - sudo cp build/*.deb ~/circleci-output + sudo cp ./build/*.deb ~/circleci-output elif have_any ./build/*.exe; then - sudo cp build/*.exe ~/circleci-output + sudo cp ./build/*.exe ~/circleci-output fi else echo "Directory ~/circleci-output not found" diff --git a/include/testplugin_pi.h b/include/testplugin_pi.h index 0540e8ad..a84ba059 100644 --- a/include/testplugin_pi.h +++ b/include/testplugin_pi.h @@ -120,22 +120,8 @@ std::cout << x << std::endl ; } while (0) #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) -#ifdef __WXMSW__ -#include "GL/gl.h" // local copy for Windows -#include -#else - -#ifdef USE_ANDROID_GLES2 -//#include -#endif - -#ifndef __OCPN__ANDROID__ -#include -#include -#else +#ifdef __OCPN__ANDROID__ #include "qopengl.h" // this gives us the qt runtime gles2.h -//#include "GL/gl_private.h" -#endif #endif #include "wxWTranslateCatalog.h" From ac1ca0ad44152e308329b3705ca51361518a58bb Mon Sep 17 00:00:00 2001 From: jongough Date: Mon, 30 Oct 2023 16:20:01 +1100 Subject: [PATCH 10/10] Update for policy cmp0076 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 315791af..c3c6e105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,9 @@ if(COMMAND cmake_policy) endif(POLICY CMP0043) cmake_policy(SET CMP0048 NEW) # Need cmake 3.13 to implement this, but raspbian builds are at 3.7.2 and bionic at 3.10 and xenial builds at 3.5.1 - cmake_policy(SET CMP0076 NEW) + if(POLICY CMP0076) + cmake_policy(SET CMP0076 NEW) + endif(POLICY CMP0076) if(POLICY CMP0077) cmake_policy(SET CMP0077 NEW) endif(POLICY CMP0077)