#!/bin/sh

dnf groupinstall development-libs development-tools gnome-software-development
dnf install gtk3-devel gstreamer1-devel clutter-devel \
  libgda-devel gobject-introspection-devel vala vala-devel vala-doc \
  libchamplain-devel libgdl-devel libgudev-devel espeak-devel vte291-devel \
  ncurses-devel gstreamer1-plugins-base gstreamer1-plugins-good \
  gstreamer1-plugins-base-devel ninja-build meson vala

# To build mwp-plot-elevation and other tools, golang
dnf install golang

## Shallow clone mwp ....
# git clone --depth 1 https://github.com/stronnag/mwptools
## Follow build instructions
## https://github.com/stronnag/mwptools/wiki/Building-with-meson-and-ninja"

## for bbox-replay stuff
dnf install ruby

## On some versions *F27*, the you may also need
dnf install rubygem-json

## if you want to use speech-dispatcher instead of espeak for voice
## synthesis (or have a choice of either)
## gsettings set org.mwptools.planner speech-api 'speechd'
## or (default)
## gsettings set org.mwptools.planner speech-api 'espeak'

# dnf install speech-dispatcher-devel

## optionally, flite for text to speech ...
## However, at for for fedora 28 and prior, this is pointless as we need 2.x and Fedora ships 1.x
## dnf install flite flite-devel

## For plot-elevation.rb
# dnf install gnuplot rubygem-nokogiri

## for MQTT
# dnf install paho-c-devel
## **OR ** for MQTT
# dnf install mosquitto-devel

## To use KMZ as an overlay format, you need 'unzip
#dnf install unzip

## If you want to use serial devices for bbox replay (and you probably
## don't) then see
##  https://developer.fedoraproject.org/tech/languages/ruby/gems-installation.html

## You must install the blackbox utilities
## https://github.com/iNavFlight/blackbox-tools
## in order to replay blackbox logs.

# git clone --depth 1  https://github.com/iNavFlight/blackbox-tools
# cd blackbox-tools/
# make
# sudo cp  obj/blackbox_decode obj/blackbox_render /usr/local/bin/

## and you can use this file to install everything:)
## In some cases, removing the comments (like above for blackbox)

# cp fedora.txt /tmp/fedora-deps.sh
# chmod +x /tmp/fedora-deps.sh
# sudo /tmp/fedora-deps.sh

## Then build mwptools
## https://github.com/stronnag/mwptools/wiki/Building-with-meson-and-ninja"
## cd mwptools
## meson build --buildtype=release --strip --prefix /usr
## cd build
## ninja && sudo ninja install

## The default instruction only set up the master branch (in order in
## minimise the initial setup) .
## In order to access other branches:
# git remote set-branches origin '*'
# git fetch -v
## Then:
## $ git branch
##   development
## * master
### And one can checkout development
#  git checkout development
## Switched to branch 'development'
## Your branch is up to date with 'origin/development'.

## Note: If you change a dependency (e.g. add addtional text to speech
## modules) then you may need to force a rebuild for mwp to recognise the
## change:
##
## cd mwptools/build
## ninja clean
## ninja && sudo ninja install
##
