Crossbuild std go libraries for MacOS and Windows 47/15147/1
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Mon, 9 Jul 2018 17:59:48 +0000 (19:59 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Mon, 9 Jul 2018 18:00:50 +0000 (20:00 +0200)
Standard go librairies must be compiled at least once to be able to
build go code for other OSes.
Note that you must be root in order to write resulting static
libraries into /usr/lib/go-X.Y/pkg/windows_amd64 and
/usr/lib/go-X.Y/pkg/darwin_amd64

Change-Id: Icdf09f627ad2c5c1bbf1b42fb8c92f9d9e65469d
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
packer/provision/agl_dependencies.sh

index 148e65e..cac5d31 100644 (file)
@@ -6,7 +6,7 @@ set -x
 sudo su -c "echo 'deb http://ftp.debian.org/debian jessie-backports main' >> /etc/apt/sources.list"
 sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 8B48AD6246925553
 
-# go 
+# go
 sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com F6BC817356A3D45E
 
 cat /etc/apt/sources.list
@@ -120,4 +120,8 @@ EOF"
 sudo apt-get update
 sudo apt-get install golang-go
 
+# Crossbuild standard go libraries for MacOS and Windows
+sudo GOOS=darwin GOARCH=amd64 go install -v -a std
+sudo GOOS=windows GOARCH=amd64 go install -v -a std
+
 exit 0