blob: 8536dbce16d03ab8ceb0a919f3aeffc8f244a574 [file] [log] [blame]
humperd85ad502014-09-09 15:57:26 -07001#!/bin/sh
2
3# This script builds the webtry server; before compilation we need to create the code template
4# so that it contains all publicly available header files in skia/include.
5#
6# By default, the script expects to be run out of the skia/experimental/webtry directory;
7# if we move directories around this can be overridden by setting the SKIA_ROOT and WEBTRY_ROOT
8# environment variables to point to the skia source tree and the webtry source tree,
9# respectively.
10
11[ -z "$SKIA_ROOT" ] && SKIA_ROOT="../.."
12[ -z "$WEBTRY_ROOT" ] && WEBTRY_ROOT=`pwd`
13
humperb77955e2014-10-01 14:27:31 -070014[ -z "$GOROOT" ] && export GOROOT=/home/webtry/go
15[ -z "$GOPATH" ] && export GOPATH=/home/webtry/golib
16
17PATH=$PATH:$GOROOT/bin
18
humperd85ad502014-09-09 15:57:26 -070019cd ${SKIA_ROOT}/include
20echo "Creating compile template..."
21find core effects pathops -maxdepth 1 -name "*.h" | sed "s#^[^\/]*\/##g" | sed "s/\(.*\)/#include \"\1\"/" | sort > ${WEBTRY_ROOT}/templates/template.cpp
22echo "SkBitmap source;" >> ${WEBTRY_ROOT}/templates/template.cpp
23echo "{{.Code}}" >> ${WEBTRY_ROOT}/templates/template.cpp
24cd ${WEBTRY_ROOT}
25echo "Building webtry..."
26go build webtry.go
27echo "Done!"