Blame clean_qtwebengine.sh

Kevin Kofler 17d045
#!/bin/bash
Kevin Kofler bd1324
# Copyright 2015-2017 Kevin Kofler <Kevin@tigcc.ticalc.org>
Kevin Kofler 17d045
# Permission is hereby granted, free of charge, to any person obtaining
Kevin Kofler 17d045
# a copy of this software and associated documentation files (the
Kevin Kofler 17d045
# "Software"), to deal in the Software without restriction, including
Kevin Kofler 17d045
# without limitation the rights to use, copy, modify, merge, publish,
Kevin Kofler 17d045
# distribute, sublicense, and/or sell copies of the Software, and to
Kevin Kofler 17d045
# permit persons to whom the Software is furnished to do so, subject to
Kevin Kofler 17d045
# the following conditions:
Kevin Kofler 17d045
#
Kevin Kofler 17d045
# The above copyright notice and this permission notice shall be included
Kevin Kofler 17d045
# in all copies or substantial portions of the Software.
Kevin Kofler 17d045
#
Kevin Kofler 17d045
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Kevin Kofler 17d045
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Kevin Kofler 17d045
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Kevin Kofler 17d045
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
Kevin Kofler 17d045
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Kevin Kofler 17d045
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
Kevin Kofler 17d045
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Kevin Kofler 17d045
Kevin Kofler 17d045
if [ -z "$1" ] ; then
Kevin Kofler 17d045
  echo "usage: ./clean_qtwebengine.sh VERSION"
dc623b
  echo "e.g.: ./clean_qtwebengine.sh 5.11.1"
Kevin Kofler 17d045
  exit 1
Kevin Kofler 17d045
fi
Kevin Kofler 17d045
Kevin Kofler bd1324
DIRNAME="qtwebengine-everywhere-src-$1"
Kevin Kofler 17d045
Kevin Kofler 17d045
echo "removing $DIRNAME"
Kevin Kofler 17d045
rm -rf "$DIRNAME" || exit $?
Kevin Kofler 17d045
Kevin Kofler 17d045
if [ -f "$DIRNAME.tar.xz" ] ; then
Kevin Kofler 17d045
  echo "unpacking $DIRNAME.tar.xz"
Kevin Kofler 17d045
  tar xJf "$DIRNAME.tar.xz" || exit $?
Kevin Kofler 17d045
elif [ -f "$DIRNAME.tar.bz2" ] ; then
Kevin Kofler 17d045
  echo "unpacking $DIRNAME.tar.bz2"
Kevin Kofler 17d045
  tar xjf "$DIRNAME.tar.bz2" || exit $?
Kevin Kofler 17d045
elif [ -f "$DIRNAME.tar.gz" ] ; then
Kevin Kofler 17d045
  echo "unpacking $DIRNAME.tar.gz"
Kevin Kofler 17d045
  tar xzf "$DIRNAME.tar.gz" || exit $?
Kevin Kofler 17d045
elif [ -f "$DIRNAME.7z" ] ; then
Kevin Kofler 17d045
  echo "unpacking $DIRNAME.7z"
Kevin Kofler 17d045
  if type 7za >/dev/null 2>/dev/null ; then
Kevin Kofler 17d045
    7za x "$DIRNAME.7z" || exit $?
Kevin Kofler 17d045
  elif type 7z >/dev/null 2>/dev/null ; then
Kevin Kofler 17d045
    7z x "$DIRNAME.7z" || exit $?
Kevin Kofler 17d045
  else
Kevin Kofler 17d045
    echo "error: p7zip required"
Kevin Kofler 17d045
    exit 1
Kevin Kofler 17d045
  fi
Kevin Kofler 17d045
else
Kevin Kofler 17d045
  echo "error: no archive for $DIRNAME found"
Kevin Kofler 17d045
  exit 1
Kevin Kofler 17d045
fi
Kevin Kofler 17d045
Kevin Kofler 17d045
echo "running clean_ffmpeg.sh"
Kevin Kofler 778be1
./clean_ffmpeg.sh "$DIRNAME/src/3rdparty/chromium" || exit $?
Kevin Kofler 17d045
Kevin Kofler 392efd
echo "ripping out openh264 sources"
Kevin Kofler 392efd
rm -rf "$DIRNAME/src/3rdparty/chromium/third_party/openh264/src" || exit $?
Kevin Kofler 392efd
Kevin Kofler 17d045
echo "repacking as $DIRNAME-clean.tar.xz"
Kevin Kofler 17d045
XZ_OPT="-9 -f" tar cJf "$DIRNAME-clean.tar.xz" "$DIRNAME" || exit $?
Kevin Kofler 17d045
Kevin Kofler 17d045
echo "removing $DIRNAME"
Kevin Kofler 17d045
rm -rf "$DIRNAME" || exit $?
Kevin Kofler 17d045
Kevin Kofler 17d045
echo "done"
Kevin Kofler 17d045
exit 0