#!/bin/bash
# Author:    Igor Calì (igor.cali0@gmail.com)
# last modify 2022-03-17

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' wx-common|grep "install ok installed")
echo Checking for wx-common
if [ "" == "$PKG_OK" ]; then
  echo "Setting up wx-common."
  sudo apt-get --force-yes --yes install wx-common
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libwxgtk3.0-dev|grep "install ok installed")
echo Checking for libwxgtk3.0-dev
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libwxgtk3.0-dev."
  sudo apt-get --force-yes --yes install libwxgtk3.0-dev
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libwxgtk3.0-dbg|grep "install ok installed")
echo Checking for libwxgtk3.0-dbg
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libwxgtk3.0-dbg."
  sudo apt-get --force-yes --yes install libwxgtk3.0-dbg
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' build-essential|grep "install ok installed")
echo Checking for build-essential
if [ "" == "$PKG_OK" ]; then
  echo "Setting up build-essential."
  sudo apt-get --force-yes --yes install build-essential
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' wxfb-wxadditions|grep "install ok installed")
echo Checking for wxfb-wxadditions
if [ "" == "$PKG_OK" ]; then
  echo "Setting up wxfb-wxadditions."
  sudo add-apt-repository ppa:wxformbuilder/release
  sudo apt-get update
  sudo apt-get --force-yes --yes install wxfb-wxadditions
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libwxadditions30-dev|grep "install ok installed")
echo Checking for somelib: libwxadditions30-dev
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libwxadditions30-dev."
  sudo apt-get --force-yes --yes install libwxadditions30-dev
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libwxadditions30-dbg|grep "install ok installed")
echo Checking for libwxadditions30-dbg
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libwxadditions30-dbg."
  sudo apt-get --force-yes --yes install libwxadditions30-dbg
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' xsltproc|grep "install ok installed")
echo Checking for xsltproc
if [ "" == "$PKG_OK" ]; then
  echo "Setting up xsltproc."
  sudo apt-get --force-yes --yes install xsltproc
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' poxml|grep "install ok installed")
echo Checking for poxml
if [ "" == "$PKG_OK" ]; then
  echo "Setting up poxml."
  sudo apt-get --force-yes --yes install poxml
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libgtk-3-dev|grep "install ok installed")
echo Checking for libgtk-3-dev
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libgtk-3-dev."
  sudo apt-get --force-yes --yes install libgtk-3-dev
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libappindicator3-dev|grep "install ok installed")
echo Checking for libappindicator3-dev
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libappindicator3-dev."
  sudo apt-get --force-yes --yes install libappindicator3-dev
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libsqlcipher-dev|grep "install ok installed")
echo Checking for libsqlcipher-dev
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libsqlcipher-dev."
  sudo apt-get --yes install libsqlcipher-dev
fi

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' libosmgpsmap-1.0-dev|grep "install ok installed")
echo Checking for libosmgpsmap-1.0-dev
if [ "" == "$PKG_OK" ]; then
  echo "Setting up libosmgpsmap-1.0-dev."
  sudo apt-get --yes install libosmgpsmap-1.0-dev
fi

echo Toolchain installed.

