Skip to content

Commit

Permalink
Merge pull request #357 from jongough/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
jongough authored Oct 30, 2023
2 parents 9f79dd6 + ac1ca0a commit 847ff9d
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 119 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.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. -- ##
Expand All @@ -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)
Expand All @@ -55,9 +57,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 "276")
set(VERSION_TWEAK "0")
set(VERSION_DATE "22/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")
Expand Down Expand Up @@ -97,7 +99,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

Expand Down Expand Up @@ -214,8 +216,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)
Expand All @@ -232,8 +236,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)

Expand Down
47 changes: 15 additions & 32 deletions ci/circleci-build-android-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,43 +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=/ \
..

# 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
make VERBOSE=1

#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


#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
44 changes: 13 additions & 31 deletions ci/circleci-build-android-armhf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,42 +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=/ \
..

# 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 VERBOSE=1

make package

# 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


#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
27 changes: 2 additions & 25 deletions cmake/PluginConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions cmake/android-aarch64-toolchain.cmake
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions cmake/android-armhf-toolchain.cmake
Original file line number Diff line number Diff line change
@@ -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)
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 @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
16 changes: 1 addition & 15 deletions include/testplugin_pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <GL/glu.h>
#else

#ifdef USE_ANDROID_GLES2
//#include <gl2.h>
#endif

#ifndef __OCPN__ANDROID__
#include <GL/gl.h>
#include <GL/glu.h>
#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"
Expand Down
2 changes: 1 addition & 1 deletion opencpn-libs
Submodule opencpn-libs updated 59 files
+0 −0 WindowsHeaders/include/GL/gl.h
+0 −0 WindowsHeaders/include/GL/glu.h
+12 −89 glu/CMakeLists.txt
+66 −0 plugin_dc/CMakeLists.txt
+18 −0 plugin_dc/README.md
+54 −0 plugin_dc/dc_utils/CMakeLists.txt
+0 −0 plugin_dc/dc_utils/include/TexFont.h
+0 −0 plugin_dc/dc_utils/include/linmath.h
+0 −0 plugin_dc/dc_utils/include/pi_shaders.h
+8 −1 plugin_dc/dc_utils/include/pidc.h
+0 −0 plugin_dc/dc_utils/include/qtstylesheet.h
+0 −0 plugin_dc/dc_utils/include/shaders.h
+0 −0 plugin_dc/dc_utils/src/TexFont.cpp
+0 −0 plugin_dc/dc_utils/src/pi_shaders.cpp
+0 −2 plugin_dc/dc_utils/src/pidc.cpp
+0 −0 plugin_dc/dc_utils/src/qtstylesheet.cpp
+86 −0 plugin_dc/glu/CMakeLists.txt
+0 −0 plugin_dc/glu/include/GL/gl.h
+0 −0 plugin_dc/glu/include/GL/gl_private.h
+0 −0 plugin_dc/glu/include/GL/glext.h
+0 −0 plugin_dc/glu/include/GL/glu.h
+24 −0 plugin_dc/glu/include/glu_gl.h
+0 −0 plugin_dc/glu/include/gluos.h
+0 −0 plugin_dc/glu/libtess/README
+0 −0 plugin_dc/glu/libtess/alg-outline
+0 −0 plugin_dc/glu/libtess/dict-list.h
+0 −0 plugin_dc/glu/libtess/dict.c
+0 −0 plugin_dc/glu/libtess/dict.h
+0 −0 plugin_dc/glu/libtess/geom.c
+0 −0 plugin_dc/glu/libtess/geom.h
+0 −0 plugin_dc/glu/libtess/memalloc.c
+0 −0 plugin_dc/glu/libtess/memalloc.h
+0 −0 plugin_dc/glu/libtess/mesh.c
+0 −0 plugin_dc/glu/libtess/mesh.h
+0 −0 plugin_dc/glu/libtess/normal.c
+0 −0 plugin_dc/glu/libtess/normal.h
+0 −0 plugin_dc/glu/libtess/priorityq-heap.c
+0 −0 plugin_dc/glu/libtess/priorityq-heap.h
+0 −0 plugin_dc/glu/libtess/priorityq-sort.h
+0 −0 plugin_dc/glu/libtess/priorityq.c
+0 −0 plugin_dc/glu/libtess/priorityq.h
+0 −0 plugin_dc/glu/libtess/render.c
+0 −0 plugin_dc/glu/libtess/render.h
+0 −0 plugin_dc/glu/libtess/sweep.c
+0 −0 plugin_dc/glu/libtess/sweep.h
+0 −0 plugin_dc/glu/libtess/tess.c
+0 −0 plugin_dc/glu/libtess/tess.h
+0 −0 plugin_dc/glu/libtess/tessmono.c
+0 −0 plugin_dc/glu/libtess/tessmono.h
+0 −0 plugin_dc/glu/libutil/.dirstamp
+0 −0 plugin_dc/glu/libutil/error.c
+0 −0 plugin_dc/glu/libutil/glue.c
+0 −0 plugin_dc/glu/libutil/gluint.h
+0 −0 plugin_dc/glu/libutil/mipmap.c
+0 −0 plugin_dc/glu/libutil/project.c
+0 −0 plugin_dc/glu/libutil/quad.c
+0 −0 plugin_dc/glu/libutil/registry.c
+0 −59 plugingl/CMakeLists.txt
+0 −2,750 plugingl/include/android/GL/gl_private.h
1 change: 1 addition & 0 deletions run-circleci-local.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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"

0 comments on commit 847ff9d

Please sign in to comment.