update-libjpeg.sh 663 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. set -v -e -x
  3. if [ $# -lt 1 ]; then
  4. echo "Usage: update-libjpeg.sh /path/to/libjpeg-turbo/ [tag]"
  5. exit 1
  6. fi
  7. srcdir=`realpath $(dirname $0)`
  8. topsrcdir=${srcdir}/..
  9. rm -rf $srcdir/libjpeg
  10. repo=$1
  11. tag=${2-HEAD}
  12. (cd $repo; git archive --prefix=media/libjpeg/ $tag) | (cd $srcdir/..; tar xf -)
  13. cd $srcdir/libjpeg
  14. cp win/jsimdcfg.inc simd/
  15. revert_files="1050342.diff jconfig.h jconfigint.h moz.build MOZCHANGES mozilla.diff simd/jsimdcfg.inc"
  16. if test -d ${topsrcdir}/.hg; then
  17. hg revert --no-backup $revert_files
  18. elif test -d ${topsrcdir}/.git; then
  19. git checkout HEAD -- $revert_files
  20. fi
  21. patch -p0 -i mozilla.diff
  22. patch -p0 -i 1050342.diff