blob: 5a3bfb76575e3503a48fb80d07692b075890b4c0 [file]
#!/bin/sh
# This script builds the webtry server; before compilation we need to create the code template
# so that it contains all publicly available header files in skia/include.
#
# By default, the script expects to be run out of the buildbot/webtry directory;
# if we move directories around this can be overridden by setting the BUILDBOT_ROOT and WEBTRY_ROOT
# environment variables to point to the buildbot source tree and the webtry source tree,
# respectively.
#
# It also expects the skia source to be a sibling of the buildbot source. Again, this can
# be overridden by using the SKIA_ROOT environment variable.
[ -z "$BUILDBOT_ROOT" ] && BUILDBOT_ROOT=".."
[ -z "$SKIA_ROOT" ] && SKIA_ROOT="${HOME}/skia"
[ -z "$WEBTRY_ROOT" ] && WEBTRY_ROOT=`pwd`
[ -z "$GOROOT" ] && export GOROOT=/home/webtry/go
[ -z "$GOPATH" ] && export GOPATH=/home/webtry/golib
PATH=$PATH:$GOROOT/bin
cd ${SKIA_ROOT}/include
echo "Creating compile template..."
find core effects pathops c -maxdepth 1 -name "*.h" \
| sed "s/.*\///" \
| sed "s/\(.*\)/#include \"\1\"/" \
| sort \
> ${WEBTRY_ROOT}/templates/template.cpp
echo '#include "sk_tool_utils.h"' >> ${WEBTRY_ROOT}/templates/template.cpp
echo '#include "SkCommandLineFlags.h"' >> ${WEBTRY_ROOT}/templates/template.cpp
echo '' >> ${WEBTRY_ROOT}/templates/template.cpp
echo "SkBitmap source;" >> ${WEBTRY_ROOT}/templates/template.cpp
echo "{{.Code}}" >> ${WEBTRY_ROOT}/templates/template.cpp
cd ${WEBTRY_ROOT}
echo "Building webtry..."
go install -v ./go/webtry
echo "Done!"