devops: support webkit-wpe compilation

This patch:
- teaches `//browser_patches/webkit/build.sh` to accept the `--wpe` flag
- teaches `//browser_patches/webkit/archive.sh` to accept the `--wpe` flag
- teaches `//browser_patches/webkit/pw_run.sh` to parse the `--headless`
flag. In this case, we will assume that
`//browser_patches/webkit/checkout` is built for WPE and will pass
proper dependencies.
This commit is contained in:
Andrey Lushnikov 2020-01-10 19:14:55 -08:00
parent f9a86c0781
commit 14b2d5c83d
3 changed files with 52 additions and 28 deletions

View file

@ -3,20 +3,19 @@ set -e
set +x
if [[ ("$1" == "-h") || ("$1" == "--help") ]]; then
echo "usage: $(basename $0) [output-absolute-path]"
echo "usage: $(basename $0) [--wpe] [output-absolute-path]"
echo
echo "Generate distributable .zip archive from ./checkout folder that was previously built."
echo
exit 0
fi
if [[ $# != 1 ]]; then
echo "error: missing zip output path"
echo "try '$(basename $0) --help' for details"
exit 1
fi
ZIP_PATH=$1
USE_WPE=""
if [[ "$ZIP_PATH" == "--wpe" ]]; then
ZIP_PATH=$2
USE_WPE="true"
fi
if [[ $ZIP_PATH != /* ]]; then
echo "ERROR: path $ZIP_PATH is not absolute"
exit 1
@ -55,20 +54,35 @@ createZipForLinux() {
local tmpdir=$(mktemp -d -t webkit-deploy-XXXXXXXXXX)
mkdir -p $tmpdir
# copy all relevant binaries
cp -t $tmpdir ./WebKitBuild/Release/bin/MiniBrowser ./WebKitBuild/Release/bin/WebKit*Process
# copy runner
cp -t $tmpdir ../pw_run.sh
# copy protocol
node ../concat_protocol.js > $tmpdir/protocol.json
# copy all relevant shared objects
LD_LIBRARY_PATH="$PWD/WebKitBuild/DependenciesGTK/Root/lib" ldd WebKitBuild/Release/bin/MiniBrowser | grep -o '[^ ]*WebKitBuild/[^ ]*' | xargs cp -t $tmpdir
# we failed to nicely build libgdk_pixbuf - expect it in the env
rm $tmpdir/libgdk_pixbuf*
if [[ -n $USE_WPE ]]; then
# copy all relevant binaries
cp -t $tmpdir ./WebKitBuild/Release/bin/MiniBrowser ./WebKitBuild/Release/bin/WPE*Process
# copy all relevant shared objects
LD_LIBRARY_PATH="$PWD/WebKitBuild/DependenciesWPE/Root/lib" ldd WebKitBuild/Release/bin/MiniBrowser | grep -o '[^ ]*WebKitBuild/[^ ]*' | xargs cp -t $tmpdir
LD_LIBRARY_PATH="$PWD/WebKitBuild/DependenciesWPE/Root/lib" ldd WebKitBuild/Release/bin/WPENetworkProcess | grep -o '[^ ]*WebKitBuild/[^ ]*' | xargs cp -t $tmpdir
LD_LIBRARY_PATH="$PWD/WebKitBuild/DependenciesWPE/Root/lib" ldd WebKitBuild/Release/bin/WPEWebProcess | grep -o '[^ ]*WebKitBuild/[^ ]*' | xargs cp -t $tmpdir
cd $tmpdir
ln -s libWPEBackend-fdo-1.0.so.1 libWPEBackend-fdo-1.0.so
cd -
else
# copy all relevant binaries
cp -t $tmpdir ./WebKitBuild/Release/bin/MiniBrowser ./WebKitBuild/Release/bin/WebKit*Process
# copy all relevant shared objects
LD_LIBRARY_PATH="$PWD/WebKitBuild/DependenciesGTK/Root/lib" ldd WebKitBuild/Release/bin/MiniBrowser | grep -o '[^ ]*WebKitBuild/[^ ]*' | xargs cp -t $tmpdir
# we failed to nicely build libgdk_pixbuf - expect it in the env
rm $tmpdir/libgdk_pixbuf*
fi
# tar resulting directory and cleanup TMP.
zip -jr $ZIP_PATH $tmpdir
cd $tmpdir
zip --symlinks -r $ZIP_PATH ./
cd -
rm -rf $tmpdir
}

View file

@ -10,11 +10,17 @@ if [[ "$(uname)" == "Darwin" ]]; then
./Tools/Scripts/build-webkit --release --touch-events
elif [[ "$(uname)" == "Linux" ]]; then
cd "checkout"
# Check that WebKitBuild exists and is not empty.
if ! [[ (-d ./WebKitBuild) && (-n $(ls -1 ./WebKitBuild/)) ]]; then
yes | DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitgtk-libs
if [[ "$1" == "--wpe" ]]; then
if ! [[ -d ./WebKitBuild/DependenciesWPE ]]; then
yes | DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitwpe-libs
fi
./Tools/Scripts/build-webkit --wpe --release --touch-events MiniBrowser
else
if ! [[ -d ./WebKitBuild/DependenciesGTK ]]; then
yes | DEBIAN_FRONTEND=noninteractive ./Tools/Scripts/update-webkitgtk-libs
fi
./Tools/Scripts/build-webkit --gtk --release --touch-events MiniBrowser
fi
./Tools/Scripts/build-webkit --gtk --release --touch-events MiniBrowser
elif [[ "$(uname)" == MINGW* ]]; then
/c/Windows/System32/cmd.exe "/c buildwin.bat"
else

View file

@ -2,11 +2,11 @@
function runOSX() {
# if script is run as-is
if [ -d $SCRIPT_PATH/checkout/WebKitBuild/Release/MiniBrowser.app ]; then
if [[ -d $SCRIPT_PATH/checkout/WebKitBuild/Release/MiniBrowser.app ]]; then
DYLIB_PATH="$SCRIPT_PATH/checkout/WebKitBuild/Release"
elif [ -d $SCRIPT_PATH/MiniBrowser.app ]; then
elif [[ -d $SCRIPT_PATH/MiniBrowser.app ]]; then
DYLIB_PATH="$SCRIPT_PATH"
elif [ -d $SCRIPT_PATH/WebKitBuild/Release/MiniBrowser.app ]; then
elif [[ -d $SCRIPT_PATH/WebKitBuild/Release/MiniBrowser.app ]]; then
DYLIB_PATH="$SCRIPT_PATH/WebKitBuild/Release"
else
echo "Cannot find a MiniBrowser.app in neither location" 1>&2
@ -18,14 +18,18 @@ function runOSX() {
function runLinux() {
# if script is run as-is
if [ -d $SCRIPT_PATH/checkout/WebKitBuild ]; then
LD_PATH="$SCRIPT_PATH/checkout/WebKitBuild/DependenciesGTK/Root/lib:$SCRIPT_PATH/checkout/WebKitBuild/Release/bin"
DEPENDENCIES_FOLDER="DependenciesGTK"
if [[ "$*" == *--headless* ]]; then
DEPENDENCIES_FOLDER="DependenciesWPE";
fi
if [[ -d $SCRIPT_PATH/checkout/WebKitBuild ]]; then
LD_PATH="$SCRIPT_PATH/checkout/WebKitBuild/$DEPENDENCIES_FOLDER/Root/lib:$SCRIPT_PATH/checkout/WebKitBuild/Release/bin"
MINIBROWSER="$SCRIPT_PATH/checkout/WebKitBuild/Release/bin/MiniBrowser"
elif [ -f $SCRIPT_PATH/MiniBrowser ]; then
elif [[ -f $SCRIPT_PATH/MiniBrowser ]]; then
LD_PATH="$SCRIPT_PATH"
MINIBROWSER="$SCRIPT_PATH/MiniBrowser"
elif [ -d $SCRIPT_PATH/WebKitBuild ]; then
LD_PATH="$SCRIPT_PATH/WebKitBuild/DependenciesGTK/Root/lib:$SCRIPT_PATH/WebKitBuild/Release/bin"
elif [[ -d $SCRIPT_PATH/WebKitBuild ]]; then
LD_PATH="$SCRIPT_PATH/WebKitBuild/$DEPENDENCIES_FOLDER/Root/lib:$SCRIPT_PATH/WebKitBuild/Release/bin"
MINIBROWSER="$SCRIPT_PATH/WebKitBuild/Release/bin/MiniBrowser"
else
echo "Cannot find a MiniBrowser.app in neither location" 1>&2
@ -35,9 +39,9 @@ function runLinux() {
}
SCRIPT_PATH="$(cd "$(dirname "$0")" ; pwd -P)"
if [ "$(uname)" == "Darwin" ]; then
if [[ "$(uname)" == "Darwin" ]]; then
runOSX "$@"
elif [ "$(uname)" == "Linux" ]; then
elif [[ "$(uname)" == "Linux" ]]; then
runLinux "$@"
else
echo "ERROR: cannot run on this platform!" 1>&2