media/update-libjpeg.sh
author Ciure Andrei <aciure@mozilla.com>
Wed, 05 Dec 2018 05:47:39 +0200
changeset 508588 269d79ff36b604dd349b76b756dd1883baa35244
parent 502104 67bada7dcad029d68c0abe1d7c03fc225352f2ec
child 514769 1e76cea31571ed9274acd577b515e2c928cd207b
permissions -rwxr-xr-x
Backed out 2 changesets (bug 1512052)for causing build bustages CLOSED TREE Backed out changeset 4773a3f46c22 (bug 1512052) Backed out changeset 2f48c5afbe57 (bug 1512052)

#!/bin/sh

set -v -e -x

if [ $# -lt 1 ]; then
  echo "Usage: update-libjpeg.sh /path/to/libjpeg-turbo/ [tag]"
  exit 1
fi

srcdir=`realpath $(dirname $0)`
topsrcdir=${srcdir}/..
rm -rf $srcdir/libjpeg

repo=$1
tag=${2-HEAD}

(cd $repo; git archive --prefix=media/libjpeg/ $tag) | (cd $srcdir/..; tar xf -)

cd $srcdir/libjpeg
cp win/jsimdcfg.inc simd/

revert_files="1050342.diff assembly-tables.diff externalize-table.diff jconfig.h jconfigint.h jpeg_nbits_table.c moz.build MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
if test -d ${topsrcdir}/.hg; then
    hg revert --no-backup $revert_files
elif test -d ${topsrcdir}/.git; then
    git checkout HEAD -- $revert_files
fi

patch -p0 -i mozilla.diff
patch -p0 -i 1050342.diff
patch -p3 -i externalize-table.diff
patch -p3 -i assembly-tables.diff