media/update-libjpeg.sh
author Andrew Osmond <aosmond@mozilla.com>
Mon, 13 Sep 2021 21:55:12 +0000
changeset 591817 da5b090edd2b4a9d46125c5af15773fff2d9c025
parent 454752 1e76cea31571ed9274acd577b515e2c928cd207b
permissions -rwxr-xr-x
Bug 1709303 - Part 1. Prepare scripts and patches for libjpeg-turbo update. r=jrmuizel,tnikkel media/libjpeg/1050342.diff is no longer necessary and a correction appears to have been made in the library. Chromium no longer uses this patch either. media/libjpeg/assembly-tables.diff and media/libjpeg/externalize-table.diff require significant changes in order to apply. This may be done in a future followup patch, but is deemed less important than updating libjpeg-turbo. With these patches, an update to libjpeg-turbo 2.1.1 should apply cleanly and build. Differential Revision: https://phabricator.services.mozilla.com/D125458

#!/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

revert_files="jconfig.h jconfigint.h moz.build MOZCHANGES mozilla.diff"
if test -d ${topsrcdir}/.hg; then
    hg revert --no-backup $revert_files
elif test -e ${topsrcdir}/.git; then
    git checkout HEAD -- $revert_files
fi

patch -p0 -i mozilla.diff