|
1 | 1 | #!/bin/bash -e |
2 | 2 |
|
3 | 3 | ROOTDIR=$PWD |
| 4 | +TARGETDIR=$ROOTDIR/build/target |
4 | 5 | REVISION=$(svn info --show-item last-changed-revision "https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-${npm_package_config_webkitGTK}") |
| 6 | +printf $REVISION |
5 | 7 |
|
6 | | -# compile |
7 | | -rm -rf $ROOTDIR/build/compiled |
8 | | -$ROOTDIR/scripts/compile/all.sh |
| 8 | +prep() { |
| 9 | + printf "\t\t=============== copy downloaded sources =====================" |
| 10 | + rm -rf $TARGETDIR |
| 11 | + cp -Rf $ROOTDIR/build/download $TARGETDIR |
9 | 12 |
|
10 | | -# create aar |
11 | | -cd $ROOTDIR/lib |
12 | | -./gradlew clean createAAR --project-prop revision="$REVISION" --project-prop i18n="$npm_package_config_i18n" |
13 | | -cd $ROOTDIR |
| 13 | + printf "\t\t=============== patch and make icu into target/icu/host =====================" |
| 14 | + ICU_VERSION_MAJOR="$(awk '/ICU_VERSION_MAJOR_NUM/ {print $3}' $TARGETDIR/icu/source/common/unicode/uvernum.h)" |
| 15 | + printf "ICU version: ${ICU_VERSION_MAJOR}" |
| 16 | + patch -d $TARGETDIR -p1 < $ROOTDIR/patches/icu.patch |
| 17 | + |
| 18 | + # use compiled .dat archive from Android Chromium |
| 19 | + cp $TARGETDIR/icu/android/icudtl.dat $TARGETDIR/icu/source/data/in/icudt${ICU_VERSION_MAJOR}l.dat |
| 20 | + rm $TARGETDIR/icu/source/data/translit/root_subset.txt $TARGETDIR/icu/source/data/translit/trnslocal.mk |
| 21 | + |
| 22 | + rm -rf $TARGETDIR/icu/host |
| 23 | + mkdir -p $TARGETDIR/icu/host |
| 24 | + cd $TARGETDIR/icu/host |
| 25 | + $TARGETDIR/icu/source/runConfigureICU Linux --prefix=$PWD/prebuilts CFLAGS="-Os" CXXFLAGS="--std=c++11" --disable-tests --disable-samples |
| 26 | + make -j5 |
| 27 | + cd $ROOTDIR |
| 28 | + |
| 29 | + printf "\t\t=============== patch jsc =====================" |
| 30 | + patch -d $TARGETDIR -p1 < $ROOTDIR/patches/jsc.patch |
| 31 | + |
| 32 | + # disable i18n for non-i18n build |
| 33 | + if ${I18N} |
| 34 | + then |
| 35 | + patch -d $TARGETDIR -N -p1 < $ROOTDIR/patches/intl/icu-disabled.patch |
| 36 | + fi |
| 37 | + |
| 38 | + #remove icu headers from WTF, so it won't use them instead of the ones from icu/host/common |
| 39 | + rm -rf "$TARGETDIR"/webkit/Source/WTF/icu |
| 40 | + |
| 41 | + printf "orig: $(find $ROOTDIR/build/target | grep \.orig || true)" |
| 42 | +} |
| 43 | + |
| 44 | +compile() { |
| 45 | + printf "\t\t=============== compile jsc =====================" |
| 46 | + rm -rf $ROOTDIR/build/compiled |
| 47 | + $ROOTDIR/scripts/compile/all.sh |
| 48 | +} |
| 49 | + |
| 50 | +createAAR() { |
| 51 | + printf "\t\t=============== create aar =====================" |
| 52 | + cd $ROOTDIR/lib |
| 53 | + ./gradlew clean createAAR --project-prop revision="$REVISION" --project-prop i18n="${I18N}" |
| 54 | + cd $ROOTDIR |
| 55 | +} |
| 56 | + |
| 57 | +export I18N=false |
| 58 | +prep |
| 59 | +compile |
| 60 | +createAAR |
| 61 | + |
| 62 | +export I18N=true |
| 63 | +prep |
| 64 | +compile |
| 65 | +createAAR |
14 | 66 |
|
15 | 67 | npm run info |
16 | 68 | echo "I am not slacking off, my code is compiling." |
0 commit comments