|
1 |
| -#! /bin/sh |
| 1 | +#!/bin/sh |
2 | 2 | set -e
|
3 | 3 |
|
4 | 4 | go install github.com/gopherjs/gopherjs/...
|
5 | 5 |
|
6 | 6 | go generate github.com/gopherjs/gopherjs.github.io/playground/internal/imports
|
7 | 7 |
|
8 |
| -gopherjs install -m github.com/gopherjs/gopherjs.github.io/playground github.com/gopherjs/gopherjs/js |
9 |
| -cp $GOPATH/bin/playground.js $GOPATH/src/github.com/gopherjs/gopherjs.github.io/playground/playground.js |
10 |
| -cp $GOPATH/bin/playground.js.map $GOPATH/src/github.com/gopherjs/gopherjs.github.io/playground/playground.js.map |
| 8 | +# Build playground itself. |
| 9 | +gopherjs build -m |
11 | 10 |
|
12 |
| -PKG=$GOPATH/src/github.com/gopherjs/gopherjs.github.io/playground/pkg |
| 11 | +# The GOPATH workspace where the GopherJS project is. |
| 12 | +GOPHERJSGOPATH=$(go list -f '{{.Root}}' github.com/gopherjs/gopherjs) |
13 | 13 |
|
| 14 | +PKG=pkg |
14 | 15 | rm -r $PKG
|
15 | 16 |
|
| 17 | +# Use an empty GOPATH workspace with just gopherjs, |
| 18 | +# so that all the standard library packages get written to GOROOT/pkg. |
| 19 | +export GOPATH=/tmp/gopherjsplayground_gopath |
| 20 | +mkdir -p $GOPATH/src/github.com/gopherjs/gopherjs |
| 21 | +cp -r $GOPHERJSGOPATH/src/github.com/gopherjs/gopherjs/* $GOPATH/src/github.com/gopherjs/gopherjs |
| 22 | + |
| 23 | +gopherjs install -m github.com/gopherjs/gopherjs/js github.com/gopherjs/gopherjs/nosync |
16 | 24 | mkdir -p $PKG/github.com/gopherjs/gopherjs
|
17 | 25 | cp $GOPATH/pkg/darwin_js_min/github.com/gopherjs/gopherjs/js.a $PKG/github.com/gopherjs/gopherjs/js.a
|
18 | 26 | cp $GOPATH/pkg/darwin_js_min/github.com/gopherjs/gopherjs/nosync.a $PKG/github.com/gopherjs/gopherjs/nosync.a
|
19 | 27 |
|
20 |
| -gopherjs install -m github.com/gopherjs/gopherjs/js archive/tar archive/zip bufio bytes compress/bzip2 compress/flate compress/gzip compress/lzw compress/zlib container/heap container/list container/ring crypto/aes crypto/cipher crypto/des crypto/dsa crypto/ecdsa crypto/elliptic crypto/hmac crypto/md5 crypto/rand crypto/rc4 crypto/rsa crypto/sha1 crypto/sha256 crypto/sha512 crypto/subtle database/sql/driver debug/gosym debug/pe encoding/ascii85 encoding/asn1 encoding/base32 encoding/base64 encoding/binary encoding/csv encoding/gob encoding/hex encoding/json encoding/pem encoding/xml errors fmt go/ast go/doc go/format go/printer go/token hash/adler32 hash/crc32 hash/crc64 hash/fnv html html/template image image/color image/draw image/gif image/jpeg image/png index/suffixarray io io/ioutil math math/big math/cmplx math/rand mime net/http/cookiejar net/http/fcgi net/http/httptest net/http/httputil net/mail net/smtp net/textproto net/url path path/filepath reflect regexp regexp/syntax sort strconv strings sync/atomic testing testing/iotest testing/quick text/scanner text/tabwriter text/template text/template/parse time unicode unicode/utf16 unicode/utf8 |
| 28 | +# Make a copy of GOROOT that is user-writeable, |
| 29 | +# use it to build and copy out standard library packages. |
| 30 | +cp -r $(go env GOROOT) /tmp/gopherjsplayground_goroot |
| 31 | +export GOROOT=/tmp/gopherjsplayground_goroot |
| 32 | +gopherjs install -m archive/tar archive/zip bufio bytes compress/bzip2 compress/flate compress/gzip compress/lzw compress/zlib container/heap container/list container/ring crypto/aes crypto/cipher crypto/des crypto/dsa crypto/ecdsa crypto/elliptic crypto/hmac crypto/md5 crypto/rand crypto/rc4 crypto/rsa crypto/sha1 crypto/sha256 crypto/sha512 crypto/subtle database/sql/driver debug/gosym debug/pe encoding/ascii85 encoding/asn1 encoding/base32 encoding/base64 encoding/binary encoding/csv encoding/gob encoding/hex encoding/json encoding/pem encoding/xml errors fmt go/ast go/doc go/format go/printer go/token hash/adler32 hash/crc32 hash/crc64 hash/fnv html html/template image image/color image/draw image/gif image/jpeg image/png index/suffixarray io io/ioutil math math/big math/cmplx math/rand mime net/http/cookiejar net/http/fcgi net/http/httptest net/http/httputil net/mail net/smtp net/textproto net/url path path/filepath reflect regexp regexp/syntax runtime/internal/sys sort strconv strings sync/atomic testing testing/iotest testing/quick text/scanner text/tabwriter text/template text/template/parse time unicode unicode/utf16 unicode/utf8 |
21 | 33 | cp -r $GOROOT/pkg/darwin_js_min/* $PKG
|
22 | 34 | cp -r $GOROOT/pkg/darwin_amd64_js_min/* $PKG
|
23 | 35 |
|
24 |
| -rename 's/\.a/\.a.js/' `find $PKG -name "*.a"` |
| 36 | +rm -r /tmp/gopherjsplayground_goroot |
| 37 | +rm -r /tmp/gopherjsplayground_gopath |
| 38 | + |
| 39 | +rename 's/\.a/\.a.js/' $(find $PKG -name "*.a") |
0 commit comments