media/update-libjpeg.sh
author Andreas Tolfsen <ato@sny.no>
Wed, 13 Mar 2019 14:35:57 +0000
changeset 524707 95f4b83aed87e9d8638987cf30b40f5ac6cd1821
parent 514769 1e76cea31571ed9274acd577b515e2c928cd207b
permissions -rwxr-xr-x
bug 1534827: remote: fix constants in transitionToLoadFlag; r=yulia The transitionType is converted into undefined because there is a typo in the constants. These should be "FLAGS" rather than "FLAG". Thanks-to: Mark Banner <standard8@mozilla.com> Differential Revision: https://phabricator.services.mozilla.com/D23315

#!/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 1520760-avx2-detection.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
patch -p0 -i 1520760-avx2-detection.diff