#!/bin/bash

package=HandBrake

##version=-0.9.6
#version=-0.9.9
##version=-1.2.1
#version=-1.5.0
version=-1.5.1

progname=$0

#source ../../cascade-make/bin/script/test-setup.bash
source ../../cascade-make/lib/cascade-lib.bash

prefix=$GEXTVIDEO_INSTALLED

export PKG_CONFIG_PATH=$GEXTVIDEO_INSTALLED/lib/pkgconfig

opt_run_untar $force_untar $auto_untar $package $version ".tar.bz2"

if [ $force_configure ] ; then
  echo "*****"
  echo "For Handbrake to download supporting .tar.gz files via https, you"
  echo "need to set 'check_certificate = off' in gs2build/linux/bin/wgetrc"
  echo "*****"
  sleep 3
fi

export CXXFLAGS="$CXXFLAGS -fpermissive"

opt_run_configure $force_config $auto_config $package $version "$prefix" \
		  "--disable-gtk" "--disable-gst" "--force"

opt_run_tarclean $tarclean $package $version

# The first thing the run_make function does is change directory to
#o "$package$version", so I'll just append the build directory to the end of
# version... Mwuhahaha
make_path_suffix=${version}/build
opt_run_make $compile   $package $make_path_suffix
opt_run_make $install   $package $make_path_suffix "install"
opt_run_make $clean     $package $make_path_suffix "clean"
opt_run_make $distclean $package $make_path_suffix "distclean"


