Skip to content

Local Build

leamas edited this page Oct 20, 2021 · 17 revisions

Build Dependencies HOWTO

Before making a local build, build dependencies needs to be installed. This document tries to describe the procedures.

Windows

Before build, run the buildwin\win_deps.bat file. The file requires a working choco installation, see https://docs.chocolatey.org/en-us/choco/setup.

The first run will install various software using choco, and should be invoked with administrative privileges.

Subsequent builds should still invoke the file, but it can be done with regular permissions.


Batch files for use with Visual Studio 2017

Batch files have been found useful for modifying the source code with Visual Studio 2017:

Place the batch files in a root directory, one which can contain OpenCPN plugin clones.

The first batch file creates a folder ShipDriver_pi clones the github repo and then builds the plugin. The tarball is made in the directory build.

If you have already cloned the plugin the second batch file finds the ShipDriver_pi directory and builds the plugin. If you already have the directory ShipDriver_pi/build remove this before running the batch file.

The batch files allow work in a directory separate from your other github repo clones. After changes to the source code the edited files can be copied to the directory that is used to push work to the github repo origin.

Debian/Ubuntu

Install build dependencies using something like:

$ sudo apt install devscripts equivs
$ sudo mk-build-deps -ir build-deps/control
$ sudo apt-get -q --allow-unauthenticated install -f

Flatpak

  • Install flatpak and flatpak-builder as described in https://flatpak.org/

  • Install the SDK and runtime. At the time of writing version 20.08 is used. Check flatpak/org.opencpn.*.yaml for the version actually used, look for "runtime-version:". Install the proper runtime and SDK, for example:

    $ sudo flatpak install flathub org.freedesktop.Platform//20.08
    $ sudo flatpak install flathub org.freedesktop.Sdk//20.08
  • Install the opencpn flatpak package using latest official version on flathub:

    $ flatpak install --user flathub org.opencpn.OpenCPN
  • Occasionally, there are also OpenCPN beta releases available, usually using flatpak install --user https://flathub.org/beta-repo/appstream/org.opencpn.OpenCPN.flatpakref. Such releases can be used in parallel with the regular, stable release.

  • The shipdriver flatpak plugin can now be built and installed using

    $ cd build
    $ cmake ..
    $ make flatpak

MacOS

Use the ci script, which just installs the build deps and configures when used in a non-CI environment:

$ ci/circleci-build-macos

After the initial run the build dependencies are in place and configured. Make for example the tarball using cd build; make tarball

Clone this wiki locally