Skip to content

Commit

Permalink
Merge pull request #289 from jongough/updates
Browse files Browse the repository at this point in the history
Updates for OCPN 5.7.1 builds
  • Loading branch information
jongough authored Feb 26, 2023
2 parents 883c99b + edd18ea commit be002ca
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 14 deletions.
65 changes: 63 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ workflows:
<<: *std-filters
- build-armhf-debian-buster:
<<: *std-filters
- build-arm64-debian-buster:
<<: *std-filters
## Ready to build gtk3 version of armhf debian buster
- build-armhf-debian-buster-gtk3:
<<: *std-filters
Expand Down Expand Up @@ -58,13 +60,18 @@ workflows:
<<: *std-filters
- build-buster:
<<: *std-filters
- build-bullseye:
<<: *std-filters
- build-flatpak-x86-2008:
<<: *std-filters
- build-flatpak-x86-2208:
<<: *std-filters
## Been removed from allowable environments
## - build-flatpak-x86-2008-beta:
## <<: *std-filters
- build-flatpak-x86-1808:
<<: *std-filters
## Obsolete not available anymore
## - build-flatpak-x86-1808:
## <<: *std-filters
- build-flatpak-arm64:
<<: *std-filters
- build-macos:
Expand Down Expand Up @@ -230,6 +237,22 @@ jobs:
command: ci/circleci-build-raspbian-armhf.sh
no_output_timeout: 30m
- deploy-code
build-arm64-debian-buster:
machine:
image: ubuntu-2004:202104-01
environment:
- OCPN_TARGET=buster-arm64
- DOCKER_IMAGE=jongough/debian-arm64:buster
- BUILD_FLAGS=-j3
- BUILD_ENV=debian
- DEPLOY_USE_ORB: true
steps:
- checkout
- run: chmod a+x ./ci/*.sh
- run:
command: ci/circleci-build-raspbian-armhf.sh
no_output_timeout: 30m
- deploy-code
build-arm64-debian-bullseye:
machine:
image: ubuntu-2004:202104-01
Expand Down Expand Up @@ -383,6 +406,7 @@ jobs:
- image: cimg/base:edge-22.04
environment:
- BUILD_GTK3: true
- WX_VER: 32
- OCPN_TARGET: jammy
- DEPLOY_USE_ORB: true
- BUILD_ENV=ubuntu
Expand All @@ -392,6 +416,8 @@ jobs:
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ jammy main" | sudo tee -a /etc/apt/sources.list
- run: >
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates main" | sudo tee -a /etc/apt/sources.list
- run: >
echo "deb [trusted=yes] https://ppa.launchpadcontent.net/bdbcat/opencpn/ubuntu/ jammy main" | sudo tee -a /etc/apt/sources.list
- run: cat /etc/apt/sources.list
- run: chmod a+x ci/*.sh
- run: ci/circleci-build-debian.sh
Expand All @@ -414,6 +440,25 @@ jobs:
- run: chmod a+x ci/*.sh
- run: ci/circleci-build-debian.sh
- deploy-code
build-bullseye:
docker:
- image: circleci/buildpack-deps:bullseye-scm
environment:
- OCPN_TARGET: bullseye
- BUILD_GTK3: true
- DEPLOY_USE_ORB: true
steps:
- checkout
- run: >
echo "deb-src http://ftp.us.debian.org/debian bullseye main"
| sudo tee -a /etc/apt/sources.list
- run: >
echo "deb-src http://ftp.us.debian.org/debian bullseye-updates main"
| sudo tee -a /etc/apt/sources.list
- run: cat /etc/apt/sources.list
- run: chmod a+x ci/*.sh
- run: ci/circleci-build-debian.sh
- deploy-code
build-flatpak:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -478,6 +523,22 @@ jobs:
command: bash ci/circleci-build-flatpak.sh
no_output_timeout: 30m
- deploy-code
build-flatpak-x86-2208:
machine:
image: ubuntu-2004:202010-01
environment:
- OCPN_TARGET: flatpak
- FLATPAK_BRANCH: beta
- CLOUDSMITH_PKG_EXT: gz
- SDK_VER: 22.08
- DEPLOY_USE_ORB: true
steps:
- checkout
- run: chmod a+x ci/*.sh
- run:
command: bash ci/circleci-build-flatpak.sh
no_output_timeout: 30m
- deploy-code
build-flatpak-arm64:
machine:
image: ubuntu-2004:202101-01
Expand Down
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 "223")
set(VERSION_PATCH "227")
set(VERSION_TWEAK "0")
set(VERSION_DATE "15/01/2023") # DD/MM/YYYY format
set(VERSION_DATE "23/02/2023") # DD/MM/YYYY format
set(OCPN_MIN_VERSION "ov50")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")
Expand Down
142 changes: 142 additions & 0 deletions Testplugin-CI-Cmake-v1.0.160.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
This is destined eventually for the antora/asciidoc manuals folder in github/testpluging_pi\manual\testplugin\modules\ROOT\pages or somewhere else I think.

Instructions to PI Developers to use CI CMake by Jon Gough

1. Software needed
See Compiling for your OS
Git bash from Git GUI (Windows) Required.
Winmerge (Windows) very useful.
Linux tools are in the OS already.

2. Service Accounts Required (Free opensource) Login with Github
Github Account: Plugin Code Repository (essential)
Circleci Account: Build Service
Appveyor Account: Build Service for Windows
Cloudsmith Account: Deploy Service, tarball, metadata, package repository
Github.com/opencpn/plugins: Plugin Manager Catalog Repository
Refer to the graphic diagram for the process.

3. Basic Local Github Setup
A. Make a local working branch of your remote plugin. Update your local github/<plugin> from the remote repository. From local github/<plugin> master branch, git checkout -b master-cmake
B. From your remote github (after you have forked the remote jongough/Testplugin repository) make a PR from jongough master and merge it into your master.
C. From local, cd documents/github/testplugin_pi then git pull origin (or upstream) master to update locally.
D. From local in bash cd watchdog_pi make sure you are in master-cmake branch
E. From local using WinMerge open a comparison between testplugin_pi and watchdog_pi
F.Now you're ready to update the plugin. Please note not all environments will work immediately because the plugin code inevitably needs to be updated and adjusted to these more current standards.

4. Folders unique to the PI which should not be changed (some may not exist)
build,
data,
include,
po (language),
src, (normally has TexFont.h file)
forms,
manuals/<plugin> Documentation
ui

5. Folders copied from Testplugin to the github/<plugin> to be identical.
circleci,
buildosx,
buildwin,
ci,
cmake,
extinclude,
extsrc,
libs (also all libs/<subdir, leave other existing)
libs/ocpn-api with ocpn_plugin.h, opencpn.lib (msvc), libopencpn.dll (mingw)
ocpnsrc glu and Texfont.cpp
ocpninclude GL (4 files) + TexFont.h Are other files needed?

6. Copy files from Testplugin to github/<plugin>
travis.yml,
appveyor.yml

7. Remove folder and files
api-16
buildandroid (maybe) which are bdbcat and may not be needed.
include watchdog may have an android/datectrl.h file may not be needed

8. Edit the CMakeLists.txt file appropriately and carefully to build locally.
It is best to follow the form of Testplugin where possible, modifying entries for the specific plugin.
The CMakeLists.txt has explanatory notations for the PI Dev's modifications.

Remove these lines if they exist.
set(LIBSSRC libs/wxJSON/src/jsonreader.cpp libs/wxJSON/src/jsonval.cpp libs/wxJSON/src/jsonwriter.cpp)

For example moving src/jsoncpp and src/nmea0183 to libs/<sub-dir> format involved the following:

Add these lines (Note: Order is important and affects building)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpninclude)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/jsoncpp)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/nmea0183/src)

The watchdog order in this section is now
# include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include) #maybe needed for android datectrl.h?
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpninclude)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpnsrc/glu/include)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/${EXTINCLUDE_DIR})
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/wx/include)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/jsoncpp)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/nmea0183/src)

Remove other lines that are no longer current such as
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src/jsoncpp)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/wxJSON) (then removed)

Remove ${SRC_JSON} and ${SRC_NMEA0183} from
target_sources(${PACKAGE_NAME} PUBLIC ${SRCS} ${HDRS} ${OCPNSRC} ${EXTSRC} ${LIBSSRC} )

Added add_subdirectory and target_link_libraries
add_subdirectory(libs/nmea0183)
target_link_libraries(${PACKAGE_NAME} ocpn::nmea0183)

Added cmake/SimpleWxConfig.cmake file
Fixed libs/nmea0183/CMakeLists.txt file

Commented out special cmake files that did the same thing and now not needed
#include("PluginNMEA") #not for wxfax
#include("PluginJSON") #not for wxfax #commented out using libs

Commented out Ubuntu #if(UNIX) In lieu of "-fPIC"
#set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Moved wxjson/wx/json_defs.h, jsonreader.h, jsonval.h, jsonwriter.h to be under libs, then removed these files.

Moved src/jsoncpp/ (17 files with similar files as 4 above) to libs/jsoncpp/include/json/ and libs/jsoncpp/src

Edited and fixed libs/jsoncpp/CMakeLists.txt to work.
In pluginsetup.cmake added src/TexFont.h to the list.

Questions
In CMakeLists.txt SET(SRC..add src/signalk.cpp?
In pluginsetup.cmake should we add signalk.h back into the list?
In CmakeLists.txt why able to remove #set(CMAKE_POSITION_INDEPENDENT_CODE ON)?
In ocpninclude -Does watchdog need this directory? Can't we remove it?
- pluginsetup.cmake is using src/TexFont.h
- libs/GL exists (Can't we use this? See next item.)
- CMakeLists remove this?
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpninclude)
In CMakeLists should I remove or keep
- set(LIBHDRS libs/GL/gl.h libs/GL/gl_private.h libs/GL/glext.h libs/GL/glu.h)
- Remove or keep ${LIBHDRS} from target line?
- or should we add
In ocpnsrc there is opnsrc/glu folder and TexFont.cpp Can ocpnsrc be removed?
- libs/glu exists (do not know if it is the same, as you made changes to this area.
- perhaps copy ocpnsrc/glu to libs/glu?
- src/TexFont.cpp could be moved to src
- src/TextFont.cpp added to CMakeLists.txt list SET(SRCs ,,,
- change CMakeLists.txt
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpnsrc/glu/include)
to include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/glu/include)?
In libs can I remove libs/bzip2 safely?
How would I fix the tinyxml -fPic error in xenial and trusty builds?
#if(UNIX)
# Add this in lieu of add_definitions ("-fPIC")
# set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#endif(UNIX)
How can I fix the android builds? Should I ask bdbcat? His ci scripts are not being used.
Can buildandroid folder be removed now without affecting? - no
Can leftover include/android/wx/datectrl.h be moved, deleted or not? -no


13 changes: 3 additions & 10 deletions cmake/PluginConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ else()
endif()
message(STATUS "${CMLOC}PKG_TARGET_GTK: ${PKG_TARGET_GTK}")

#message(STATUS "${CMLOC}ENV WX_VER: $ENV{WX_VER}")
#if(NOT "$ENV{WX_VER}" STREQUAL "")
# set(PKG_TARGET_WX_VER "-$ENV{WX_VER}")
#else()
# set(PKG_TARGET_WX_VER "")
#endif()

if(UNIX AND NOT APPLE)
# Handle gtk3 build variant
string(STRIP "${PKG_TARGET}" PKG_TARGET)
Expand Down Expand Up @@ -242,10 +235,10 @@ else()
if(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC)
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)
else(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC)
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(OCPN_FLATPAK_CONFIG OR OCPN_FLATPAK_BUILD OR MINGW OR MSVC)
endif(DEFINED ENV{OCPN_TARGET})
if(OCPN_FLATPAK_CONFIG)
message(STATUS "${CMLOG}Checking for flatpak extensions")
Expand Down Expand Up @@ -278,7 +271,7 @@ endif()
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}")
set(PKG_TARGET_FULL "${PKG_TARGET}${PKG_TARGET_GTK}${PKG_TARGET_WX_VER}${PKG_TARGET_ARCH}")
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}")
Expand Down

0 comments on commit be002ca

Please sign in to comment.