update.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Usage: ./update.sh [blink-core-source-directory]
  2. #
  3. # Copies the needed files from a directory containing the original
  4. # Decimal.h and Decimal.cpp source that we need.
  5. # If [blink-core-source-directory] is not specified, this script will
  6. # attempt to download the latest versions using git.
  7. set -e
  8. FILES=(
  9. "Decimal.h"
  10. "Decimal.cpp"
  11. )
  12. OWN_NAME=`basename $0`
  13. if [ $# -gt 1 ]; then
  14. echo "$OWN_NAME: Too many arguments">&2
  15. exit 1
  16. fi
  17. if [ $# -eq 1 ]; then
  18. BLINK_CORE_DIR="$1"
  19. for F in "${FILES[@]}"
  20. do
  21. P="$BLINK_CORE_DIR/$F"
  22. if [ ! -f "$P" ]; then
  23. echo "$OWN_NAME: Couldn't find file: $P">&2
  24. exit 1
  25. fi
  26. done
  27. for F in "${FILES[@]}"
  28. do
  29. P="$BLINK_CORE_DIR/$F"
  30. cp "$P" .
  31. done
  32. else
  33. LATEST_SHA=$(git ls-remote https://chromium.googlesource.com/chromium/src.git/ | awk "/refs\/heads\/master/ {print \$1}")
  34. REPO_PATH="https://chromium.googlesource.com/chromium/src.git/+/$LATEST_SHA/third_party/WebKit/Source/platform"
  35. #REPO_PATH="https://github.com/WebKit/webkit/tree/master/Source/WebCore/platform"
  36. for F in "${FILES[@]}"
  37. do
  38. printf "Downloading `basename $F`..."
  39. curl "$REPO_PATH/${F}?format=TEXT" | base64 -D > "$F"
  40. echo done.
  41. done
  42. echo $LATEST_SHA > UPSTREAM-GIT-SHA
  43. fi
  44. # Apply patches:
  45. patch -p3 < zero-serialization.patch
  46. patch -p3 < comparison-with-nan.patch
  47. patch -p3 < mfbt-abi-markers.patch
  48. patch -p3 < to-moz-dependencies.patch
  49. # The following is disabled. See
  50. # https://bugzilla.mozilla.org/show_bug.cgi?id=1208357#c7
  51. #patch -p3 < fix-wshadow-warnings.patch