bdbcat / oesenc_pi

GNU General Public License v2.0
10 stars 17 forks source link

Is "Manager" side of Oesenc_pi done? #72

Closed rgleason closed 4 years ago

rgleason commented 4 years ago

I would like to try this as a template

bdbcat commented 4 years ago

Rick... oesenc_pi master branch is "done" with respect to CI process and "managed" status support. I'll use the same structure for oeRNC, and any other plugins I adapt. Feel free to use this structure going forward as a template.

rgleason commented 4 years ago

Good, trying this on my repos squiddio on a branch ci. If it works will push to mauro

First hurdle. What are all those buildOSX ..installOSX DL_store? Have not seen that before. Do I just copy those files & folders over? PS: except oesenc_pi.pkgproj.in?

bdbcat commented 4 years ago

DL_store is a strange MacOS artifact, and I should remove them from the guthub tree. Meanwhile, you can just copy them verbatim.

rgleason commented 4 years ago

Ok For recording purposes. Have copied the following directories to squiddio_pi branch ci overwriting what is there. {Have tried to edit this to be an accurate list of changes)

GENERIC MANAGED PLUGIN FILES (draft)

LIST of FILES copied over to SQUIDDIO (some compared noted)

Directories

Files

COMPARISON & CHANGES REQUIRED

FILES NOT NECESSARY (Not copied into squiddio)

KEEP EXISTING DIRECTORIES AND FILES

rgleason commented 4 years ago

Should we use newer Cmake version 3.1.1?

rgleason commented 4 years ago

oesenc_pi/CMakeLists.tx Line 302 onward

INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src/wxJSON)
INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src/cpl)
INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src/dsa)
INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR})

if (OCPN_USE_API_16) 
  INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/api-16)
else ()
  INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/api-13)  <---doesn't exist
endif ()

Can you confirm if we need these lines and associated directories copied from oesenc/src/ into squiddio/src ?

I looks to me like cpl and dsa are particular to oesenc mapping and encryption and not needed. Also it looks like api-13 does not exist so we don't need that include.

Mauro has the following in src

Will change it to this ( removing src/cpl and src/dsa)

INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src/wxJSON)
INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src)
#INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src/cpl)
#INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/src/dsa)
INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR})

if (OCPN_USE_API_16) 
  INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/api-16)
#else ()
#  INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/api-13)  <---doesn't exist
endif ()

Then will compare wxJSON in both oesenc and squiddio

rgleason commented 4 years ago

The android part of CMakeLists.txt is using curl so I am copying src/curl over. Also there is a a Findtinyxml package, so I am copying src/tinyXML over but don't know what to do about the duplication of files.

rgleason commented 4 years ago

There are a number of places where oesenc needs to be changed to squiddio. Use test editor search or search and replace.

rgleason commented 4 years ago

I am trying to run CMake and now it is asking for

-- Configuring done
CMake Error at CMakeLists.txt:547 (ADD_LIBRARY):
  Cannot find source file:
    src/ochartShop.cpp
  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
CMake Error at CMakeLists.txt:547 (ADD_LIBRARY):
  No SOURCES given to target: squiddio_pi
CMake Error at CMakeLists.txt:547 (ADD_LIBRARY):
  No SOURCES given to target: squiddio_pi
CMake Generate step failed.  Build files cannot be regenerated correctly.

We do not need ochart, do not want to go down this road. The line number does not seem to be related to the cmakelists.txt line numbers. 547 Something needs to be commented out.

rgleason commented 4 years ago

This line INSTALL(FILES "src/rrc_eula_ChartSetsForOpenCPN-v16-12.txt" We don't need this. So we probably don't need any of these folders:

Dave, please give the me the Lines that need deletion in the CMAKE file. Can't go any further. Thanks.

rgleason commented 4 years ago

Maybe this is all I need. Line 376

#IF(NOT QT_ANDROID)
#    SET(SRC_OSHOP 
#        src/ochartShop.cpp
#        src/ochartShop.h
#        )
#ENDIF(NOT QT_ANDROID)
bdbcat commented 4 years ago

Rick... Do not need:

  1. ci-bak
  2. include ( will be replaced by squiddio's include directory )
  3. build-no-local
bdbcat commented 4 years ago

Rick... Appveyor.yml is necessary. This is how the plugin is built for Windows platform

rgleason commented 4 years ago

OK have removed

    ci-bak
    include ( will be replaced by squiddio's include directory )
    build-no-local

Latest cmake error.

  CPack: - Install project: squiddio_pi
  CMake Error at C:/Users/Rick/Documents/GitHub/squiddio_pi/build/cmake_install.cmake:60 (file):
    file INSTALL cannot find
    "C:/Users/Rick/Documents/GitHub/squiddio_pi/src/rrc_eula_ChartSetsForOpenCPN-v16-12.txt".
  CPack: Install projects
  CPack: - Install project: squiddio_pi
  CMake Error at C:/Users/Rick/Documents/GitHub/squiddio_pi/build/cmake_install.cmake:60 (file):
    file INSTALL cannot find
    "C:/Users/Rick/Documents/GitHub/squiddio_pi/src/rrc_eula_ChartSetsForOpenCPN-v16-12.txt".

EXEC : CPack error : Error when generating package: squiddio_pi [C:\Users\Rick\Documents\GitHub\squiddio_pi\build\package.vcxproj]
bdbcat commented 4 years ago

Rick... It looks like you are trying to use the oesenc_pi CMakeLists.txt file to build Squiddio. If this is your plan, then you will need to heavily edit it to ensure the correct sourcefiles are found and compiled

If you would like, I'll take a quick look at it. Where is the repo you are working on? Dave

rgleason commented 4 years ago

Yes, I am comparing oesenc cmakelists to squiddio. I have been essentially using oesenc only and changing it over to suiddio values. It is almost compiling now.

I will now do the first push of this new branch "ci" up to remote so you can see it. https://github.com/rgleason/squiddio_pi

I will need to make a commit too. I won't change anything until I hear back. Thanks.

bdbcat commented 4 years ago

Rick.. I do not see the ci branch yet...have you pushed it: $git push origin ci

rgleason commented 4 years ago

Yes, just pushed Had some trouble adding and removing will attach a file. https://github.com/rgleason/squiddio_pi/tree/ci

I hope I didn't screw it up. There were 4 files at the top one of which I though I needed, they show git rm and I could not git rm them.

rgleason-squiddio-ci.txt

rgleason commented 4 years ago

Just tried to compiile Win again same error as above

rgleason commented 4 years ago

Appveyor.yml is necessary. This is how the plugin is built for Windows platform yes, have it and .travis and circleci/config.yml

bdbcat commented 4 years ago

Rick... I have trouble making a PR to a branch other than master, so I will give manual directions.

  1. The original "include" directory from Mauro's repo is missing. Add it back.
  2. In CmakeLists.txt, change line 545 to: ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRC_SQUIDDIO} ${SRC_NMEA} ${SRC_JSON} ${SRC_LTINYXML})
rgleason commented 4 years ago

If you want you can make a PR to master, but when making a PR and trying to switch the direction, and branches, the widget automaticallly closes and compares within the repository, then you have to open it again and continue setting the repos and branches you want.

They don't just have a "switch" button to reverse the direction of the pull.

Anyway these changes will be easy.

rgleason commented 4 years ago

Oddly, there is no "include" directory. https://github.com/mauroc/squiddio_pi

bdbcat commented 4 years ago

Yes, that is odd. I'll be back...

bdbcat commented 4 years ago

Rick..

In file squiddioPrefsDialogBase.h: Remove first line:

include "wxWTranslateCatalog.h"

With that, it builds OK on linux. So, lets see what happens with circleci build. You should add this project on your circleci home page. Also can do the same for travisci, and appveyor. Don't worry yet about the cloudsmith uploads.

rgleason commented 4 years ago

OK. have made those changes, compiling in Win I still get linkage errors, so something is miissing I noticed that squiddio originally has cmake/wxWTranslateCatalog.h.in, but when I copied over oesenc/cmake that was deleted because oesenc does not have that file.

I have now copied it back, but I think we need something in cmake to create the wxWTranslateCatalog.h on the fly. It would be in the original squiddio cmake file beginning with "configure" I think. See attached linkage errors.

still-a-linkage-problem.txt

I'll try to get this going on my circleci and possibly my cloudsmith next.

rgleason commented 4 years ago

In oesenc and the new squiddio CMakeList.txt file

   configure_file(
        ${CMAKE_SOURCE_DIR}/squiddio-plugin.xml.in
        ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}.xml
    )
    add_custom_target(flatpak-build ALL
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/flatpak
        COMMAND flatpak-builder --force-clean
            ${CMAKE_CURRENT_BINARY_DIR}/app
            org.opencpn.OpenCPN.Plugin.squiddio.yaml
    )
    add_custom_target("package")
    add_custom_command(
        TARGET package
# Configure for plugin
        COMMAND ${TAR}
            -czf ${PKG_NVR}_${PKG_TARGET_NVR}.tar.gz
            --transform 's|.*/files/|squiddio_pi-flatpak-${PACKAGE_VERSION}/|'
            ${CMAKE_CURRENT_BINARY_DIR}/app/files
    )
    return ()
endif()

The OLD.cmakelists.txt from squiddio has

    configure_file(
        ${CMAKE_SOURCE_DIR}/${PACKAGE}-plugin.xml.in
        ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}.xml
    )
    configure_file(
        ${CMAKE_SOURCE_DIR}/cmake/org.opencpn.OpenCPN.Plugin.${PACKAGE}.yaml.in
        ${CMAKE_SOURCE_DIR}/flatpak/org.opencpn.OpenCPN.Plugin.${PACKAGE}.yaml
    )
    add_custom_target(flatpak-build ALL
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/flatpak
        COMMAND /usr/bin/flatpak-builder --force-clean
            ${CMAKE_CURRENT_BINARY_DIR}/app
            org.opencpn.OpenCPN.Plugin.${PACKAGE}.yaml
    )
    add_custom_target("flatpak-pkg")
    add_custom_command(
        TARGET flatpak-pkg

        COMMAND ${TAR}
            -czf ${PKG_NVR}_${PKG_TARGET_NVR}.tar.gz
            --transform 's|.*/files/|${PACKAGE}-flatpak-${PACKAGE_VERSION}/|'
            ${CMAKE_CURRENT_BINARY_DIR}/app/files
    )
    return ()
endif()

# Prefer libGL.so to libOpenGL.so, see CMP0072
set(OpenGL_GL_PREFERENCE "LEGACY")
bdbcat commented 4 years ago

You will need to push "cmake/wxWTranslateCatalog.h.in" to github ci branch so I can see it. Dave

bdbcat commented 4 years ago

Rick...

  1. "cmake/wxWTranslateCatalog.h.in" is not important now.
  2. Have no idea about windows link errors. Lets defer and let Mauro deal with this when he gets the PR.
  3. Focus on the CI process: Of course, appveyor will fail (Windows build) What about circleci and travis?
bdbcat commented 4 years ago

I forgot: For sure you need to modify:

CMakeLists.txt:545 ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRC_SQUIDDIO} ${SRC_NMEA0183} ${SRC_JSON} ${SRC_LTINYXML})

rgleason commented 4 years ago

Dave, can't seem to get Circleci to "see" my "ci" branch. It may have something to do with their new Pipelines or I may be something in cmake that prevents getting to the circleci scripts. Will work on it tomorrow.

Now have 3 tries for Manager that are all failing: squiddio (from oesenc), vdr (from testplugin), weatherfax (from testplugin) not so good. If I can't succeed, I'll have to quit.

Thanks for all your help.

bdbcat commented 4 years ago

Rick... Take heart, you are not far away. It generally took me at least ten tries to get the CI stuff working. But when it is done, it is done for good.

In the file ".circleci/config.yml"... At the bottom you will see a bunch of lines like:

 - build-xenial:
      filters:
        branches:
          only: master

Change "master" to "ci"

Dave

rgleason commented 4 years ago

Darn, I forgot about that!!!! Thanks. Will change it.

I was thinking that I needed to set my git settings somewhere. In weather_routing_pi "branch: api-1.16 using Jon's - "JG Manager" version he has these settings in CMakeLists.txt which is pretty nice, but I guess the software machine behind it gets complicated because the scripts have to be built at run time and you need .in files.

set(PARENT "opencpn")
set(PACKAGE "weather_routing")  #used for Package name
set(GIT_USER "rgleason")
set(GIT_REPOSITORY_NAME "weather_routing_pi")
message(STATUS "CIRCLECI: ${CIRCLECLI}, Env CIRCLECI: $ENV{CIRCLECI}")
if($ENV{CIRCLECI})
  set(GIT_REPOSITORY_HOST "github.com")
  set(GIT_REPOSITORY_DIR "${GIT_USER}/")
#  set(GIT_REPOSITORY_BRANCH "master")
#  set(GIT_REPOSITORY_BRANCH "cmake_flatpak_test")
  set(GIT_REPOSITORY_BRANCH "api-1.16")
endif()
# set(CLOUDSMITH_USER "sean-depagnier")
set(CLOUDSMITH_USER "rick-gleason")
#set(CLOUDSMITH_BASE_REPOSITORY "${GIT_REPOSITORY_NAME}")
set(CLOUDSMITH_BASE_REPOSITORY "opencpn-plugins")
set(XML_INFO_URL "https://opencpn.org/OpenCPN/plugins/weatherroute.html")  
set(XML_SUMMARY "Plugin to complete optimal routing with weather files")
set(XML_DESCRIPTION "Weather_Routing Plugin optimizes weather routing")
set(APPVEYOR_TEST_DEPLOY_TO_CLOUDSMITH "true")
option(PLUGIN_USE_SVG "Use SVG graphics" ON)

Incidentally, I don't mind going into .travis, circleci-upload.sh, and appveyor.upload to change the Cloudsmith path. That is just 3 diversions.

However there is one other thing that I've been thinking about as a problem. In the CMakeLists.txt file there are situations where "oesenc" is used and refers to some other file location that also uses "oesenc". If I go through CMakeLists with text editor search and replace to change it to "squiddio" the compile will break. So I have to go through each one and follow it to change the corresponding reference. Is it possible to make a more generic definition? Would that screw things up?

in CMakeLists.txt

and put ${SHORT_NAME} in

Not line 549, 361-368

rgleason commented 4 years ago

Regarding _\squiddio_pi\buildosx\InstallOSX\squiddiopi.pkgproj.in

   -  So this file is made automatically using {PACKAGE_NAME}

In  _squiddio_pi\buildosx\InstallOSX\_  I want to delete all files and directories except
- squiddio_pi.pkgproj.in
- pkg-background.jpg 

In  _\squiddio_pi\buildosx_
I want to delete everything except
- InstallOSX
- create.dmg
- README.txt

Also Remove
- oeserverd   (Remove?)
- support  (Remove?)

**\GitHub\squiddio_pi\flatpak\org.opencpn.OpenCPN.Plugin.oesenc.yaml**

Can't we name this whopper something generic?
org.opencpn.OpenCPN.Plugin.flatpak.yaml  OR  ?
Does this file have to be specially configured?  **_Yes_**

modules:


Could we use  {$SHORT_NAME}?  See example above.  I count 4  "oesenc"
rgleason commented 4 years ago

This is tedious. We need to make this a simple package or PI Dev will not use it. Some of them have never really delved into CMake and have just accepted what Pavel did as a PR!

Just setting up the accounts is daunting enough. If we were to use the Cloudsmith OpenCPN Organization repositories, and set the upload scripts to that, it might make certification auth keys and configuration easier.

rgleason commented 4 years ago

Fedora build https://app.circleci.com/pipelines/github/rgleason/squiddio_pi/155/workflows/edad7c4c-2be5-4036-8a02-d1cbc0f9b298/jobs/319

/usr/bin/cpack --config ./CPackConfig.cmake
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: squiddio_pi
CPack: - Install project: squiddio_pi
CMake Error at /home/circleci/project/build/cmake_install.cmake:57 (file):
  file INSTALL cannot find
  "/home/circleci/project/src/rrc_eula_ChartSetsForOpenCPN-v16-12.txt".

CPack Error: Error when generating package: squiddio_pi
Makefile:132: recipe for target 'package' failed
make: *** [package] Error 1

For squiddio we don't need this.
What lines should be removed from CMakeLists.txt? It occurs from 644 to 670 about

Also while I am here in CMakelists.txt, is this about permissions to read charts? Shouldn't a bunch of this be removed? do I even need oeserervd or any of its relatives? There are some files to remove too.

IF(WIN32)
    INSTALL(FILES "buildwin/oeserverd/oeserverd.exe"
       PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE
       DESTINATION "plugins\\\\${PACKAGE_NAME}")

    FILE(GLOB vcdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/oeserverd/*.dll")
    INSTALL(FILES ${vcdll_files}
       PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE
       DESTINATION "plugins\\\\${PACKAGE_NAME}")

    #INSTALL(FILES "buildwin/oeserverd/SglW32.dll"
    #   PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE
    #   DESTINATION "plugins\\\\${PACKAGE_NAME}")

    INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION "plugins")
    SET(INSTALL_DIRECTORY "plugins\\\\${PACKAGE_NAME}")

    INSTALL(FILES "src/rrc_eula_ChartSetsForOpenCPN-v16-12.txt"
      PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
      DESTINATION ${INSTALL_DIRECTORY} )

ENDIF(WIN32)

Also other environments similar

rgleason commented 4 years ago

Dave can you separate out or identify the CMakeList.txt lines that are for oesenc charts? Then we can identify which files can also be removed and make a list of those too.

bdbcat commented 4 years ago

Rick... Take heart, you are not far away. It generally took me at least ten tries to get the CI stuff working. But when it is done, it is done for good.

In the file ".circleci/config.yml"... At the bottom you will see a bunch of lines like:

 - build-xenial:
      filters:
        branches:
          only: master

Change "master" to "ci"

Dave

rgleason commented 4 years ago

MacOS

https://app.circleci.com/pipelines/github/rgleason/squiddio_pi/155/workflows/edad7c4c-2be5-4036-8a02-d1cbc0f9b298/jobs/316

 Plugin is building with embedded tinyxml
CMake Error: File /Users/distiller/project/src/rrc_eula_ChartSetsForOpenCPN.txt does not exist.
CMake Error at CMakeLists.txt:690 (configure_file):
  configure_file Problem configuring file

Thought I got them all. Ok comment out that one, but I question if we even need the entire IF....then for Apple line 673-694. If that is true, then there are others to comment out too, and files to remove.

bdbcat commented 4 years ago

Rick... It may be possible to build a generic scripted CMakeLists for all plugins, but that is a big job, for later days.

Meanwhile... Windows build: PluginConfigure.cmake:line 56 SET(wxWidgets_USE_LIBS base core net xml html adv aui)

how did the circleci builds go?

bdbcat commented 4 years ago

Rick... Trust me. The way forward is to remove little things, one line at a time, until the entire process works for at least one platform. Then go back and tweak for the others. Hacking out sections whose function is not clear will lead to misery....

rgleason commented 4 years ago

Ok, one step at a time. Is this format/ process ok with you?

Circleci is running now! Thanks. Do you have access to this? Is it public? https://circleci.com/gh/rgleason/squiddio_pi

rgleason commented 4 years ago

Made that change and tried compile. recent-win-build-fail.txt

Have seen that change adding aui before.

bdbcat commented 4 years ago

Rick... I can see circleci. If you read the log for example build-buster, you will see that it succeeds until the cloudsmith upload task. This is good progress. You can see that it is trying to upload to: REPO=mauro-calvi/squiddio-pi

Clearly not right.

bdbcat commented 4 years ago

Windows build... I think you missed my comment: CmakeLists.txt:544 ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRC_SQUIDDIO} ${SRC_NMEA0183} ${SRC_JSON} ${SRC_LTINYXML})

rgleason commented 4 years ago

Thanks, I missed the difference. nmea0183. Sorry.
Tried to fix uploads & nmea0183 now pushed.

rgleason commented 4 years ago

Now MacOS wants ChartsSetsforOpenCPN.txt, something else needs commenting out?

  • Plugin is building with embedded tinyxml CMake Error: File /Users/distiller/project/src/rrc_eula_ChartSetsForOpenCPN.txt does not exist. CMake Error at CMakeLists.txt:689 (configure_file): configure_file Problem configuring file
bdbcat commented 4 years ago

CMakeLists.txt:667

Remove: IF(APPLE)

INSTALL(FILES "buildosx/oeserverd/oeserverd" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE DESTINATION "OpenCPN.app/Contents/PlugIns/")

INSTALL(FILES "src/rrc_eula_ChartSetsForOpenCPN.txt" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ DESTINATION "OpenCPN.app/Contents/SharedSupport/plugins/${PACKAGE_NAME}" )

We also need to copy the helper utility and required dylibs to the binary build directory so that the PACKAGES scripts will find it.

configure_file(${PROJECT_SOURCE_DIR}/buildosx/oeserverd/oeserverd ${CMAKE_CURRENT_BINARY_DIR}/oeserverd COPYONLY)

configure_file(${PROJECT_SOURCE_DIR}/buildosx/oeserverd/libsglmac-2.29.0.0.dylib.x86_64 ${CMAKE_CURRENT_BINARY_DIR}/libsglmac-2.29.0.0.dylib.x86_64 COPYONLY)

configure_file(${PROJECT_SOURCE_DIR}/src/rrc_eula_ChartSetsForOpenCPN.txt ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

ENDIF(APPLE)

rgleason commented 4 years ago

So the macos compile wants cmakelists.txt lines 678-680 uncommented, but we commented that out because the file does not exist. Is this file even necessary? Isnt it for oesenc?

Error is at 689 so have commented that out and 690 to configur_file..

bdbcat commented 4 years ago

I'll be offline rest of today, back tonight @1900 Resume then. We'll get it.....