#!/bin/bash

#
# install-dependencies-zypper
#
# Copyright (C) 2009-12 by RStudio, Inc.
#
# Unless you have received this program directly from RStudio pursuant
# to the terms of a commercial license agreement with RStudio, then
# this program is licensed to you under the terms of version 3 of the
# GNU Affero General Public License. This program is distributed WITHOUT
# ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
# AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
#
#

set -e

# build/development tools
sudo zypper --non-interactive in make
sudo zypper --non-interactive in gcc
sudo zypper --non-interactive in gcc-c++
sudo zypper --non-interactive in gcc-fortran
sudo zypper --non-interactive in build
sudo zypper --non-interactive in cmake

# core system libraries
sudo zypper --non-interactive in libbz2-devel
sudo zypper --non-interactive in zlib-devel
sudo zypper --non-interactive in libuuid-devel
sudo zypper --non-interactive in libopenssl-devel
sudo zypper --non-interactive in pam-devel

# boost
sudo zypper --non-interactive in boost-devel

# pango cairo
sudo zypper --non-interactive in pango-devel

# gwt prereqs
sudo zypper --non-interactive in java-1_6_0-openjdk-devel
sudo zypper --non-interactive in ant

# overlay
if [ -e install-overlay-zypper ]
then
  ./install-overlay-zypper
fi

# common
cd ../common
./install-common
cd ../linux

# desktop dependencies (qt)
if [ "$1" != "--exclude-qt-sdk" ]
then
   # install Qt 5.4 SDK 
   ./install-qt-sdk

   # install headers needed by Qt 5 (GL, xslt)
   sudo zypper --non-interactive in mesa-devel
   sudo zypper --non-interactive in libxslt-devel
fi



