Source code

Revision control

Other Tools

1
#!/bin/sh
2
3
set -v -e -x
4
5
if [ $# -lt 1 ]; then
6
echo "Usage: update-libjpeg.sh /path/to/libjpeg-turbo/ [tag]"
7
exit 1
8
fi
9
10
srcdir=`realpath $(dirname $0)`
11
topsrcdir=${srcdir}/..
12
rm -rf $srcdir/libjpeg
13
14
repo=$1
15
tag=${2-HEAD}
16
17
(cd $repo; git archive --prefix=media/libjpeg/ $tag) | (cd $srcdir/..; tar xf -)
18
19
cd $srcdir/libjpeg
20
cp win/jsimdcfg.inc simd/
21
22
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"
23
if test -d ${topsrcdir}/.hg; then
24
hg revert --no-backup $revert_files
25
elif test -d ${topsrcdir}/.git; then
26
git checkout HEAD -- $revert_files
27
fi
28
29
patch -p0 -i mozilla.diff
30
patch -p0 -i 1050342.diff
31
patch -p3 -i externalize-table.diff
32
patch -p3 -i assembly-tables.diff
33
patch -p0 -i 1520760-avx2-detection.diff