Andrey Lushnikov 14b2d5c83d 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.
2020-01-17 13:33:52 -08:00

50 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
function runOSX() {
# if script is run as-is
if [[ -d $SCRIPT_PATH/checkout/WebKitBuild/Release/MiniBrowser.app ]]; then
DYLIB_PATH="$SCRIPT_PATH/checkout/WebKitBuild/Release"
elif [[ -d $SCRIPT_PATH/MiniBrowser.app ]]; then
DYLIB_PATH="$SCRIPT_PATH"
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
exit 1
fi
MINIBROWSER="$DYLIB_PATH/MiniBrowser.app/Contents/MacOS/MiniBrowser"
DYLD_FRAMEWORK_PATH=$DYLIB_PATH DYLD_LIBRARY_PATH=$DYLIB_PATH $MINIBROWSER "$@"
}
function runLinux() {
# if script is run as-is
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
LD_PATH="$SCRIPT_PATH"
MINIBROWSER="$SCRIPT_PATH/MiniBrowser"
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
exit 1
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_PATH $MINIBROWSER "$@"
}
SCRIPT_PATH="$(cd "$(dirname "$0")" ; pwd -P)"
if [[ "$(uname)" == "Darwin" ]]; then
runOSX "$@"
elif [[ "$(uname)" == "Linux" ]]; then
runLinux "$@"
else
echo "ERROR: cannot run on this platform!" 1>&2
exit 1;
fi