Fork and Build (Linux)

Requirements

  • Register with GitHub and obtained a profile. This allows the setting up of repositories where your code can be published.

  • Git

  • CMake

Process

  • Using GitHub and working from your main GitHub folder make a fork of DR_pi from https://github.com/Rasbats/DR_pi

  • Using 'Terminal' clone the plugin onto your machine:

clone.png

git_clone.png

  • Make the 'build' directory and cd to 'build':

mkdir_build_cd.png

  • 'CMake' a 'CodeBlocks' project:

cmake_codeblocks.png

build_files_for_codeblocks.png

  • To see what files have been made use 'Files' to navigate to 'learning/DR_pi/build'. The 'CodeBlocks' project is called 'DR_pi.cbp'.

codeblocks_project.png

  • Start 'CodeBlocks' and 'Build' the project.

cb_build.png

  • There are some warnings but no errors.

  • This builds the plugin file 'libDR_pi.so' in the 'build' directory

install_1.png

  • The .so file can be moved to the plugins folder 'usr/lib/opencpn' using 'Terminal'.

install_2.png

Alternative plugin installation using the Software Centre

  • It may be easier to make a package and install this using the 'Ubuntu Software Centre'.

  • From 'Terminal', in 'build', 'sudo make install', 'sudo make package'. The .deb package is made in the 'build' folder.

package_1.png

  • Open the .deb file from 'build' in the 'Ubuntu Software Centre'.

software_centre.png

  • A warning

software_centre_warning.png

  • Carry on!

software_centre_2.png

software_centre_3.png

  • The plugin libDR_pi.so has been installed in '/usr/lib/opencpn'.

  • When you enable the DR plugin you should see the plugin icon on the toolbar.

p_on_toolbar.png

p_working.png

Notes

The next guide will show the DR_pi plugin being renamed as 'oplaydo1_pi' and modified.

'oplaydo1_pi' will allow the user to input start and finish positions. From these positions a GPX file will be created that can be imported and viewed in OpenCPN.