2015-02-04 16:22:38 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
rm -rf autogen
|
2015-03-03 14:41:26 -05:00
|
|
|
|
2015-02-04 16:22:38 -05:00
|
|
|
mkdir -p autogen/dockerversion
|
2015-05-06 11:41:17 -04:00
|
|
|
cat > autogen/dockerversion/dockerversion.go <<DVEOF
|
2015-02-04 16:22:38 -05:00
|
|
|
// AUTOGENERATED FILE; see $BASH_SOURCE
|
|
|
|
package dockerversion
|
|
|
|
|
|
|
|
var (
|
|
|
|
GITCOMMIT string = "$GITCOMMIT"
|
|
|
|
VERSION string = "$VERSION"
|
|
|
|
|
|
|
|
IAMSTATIC string = "${IAMSTATIC:-true}"
|
|
|
|
INITSHA1 string = "$DOCKER_INITSHA1"
|
|
|
|
INITPATH string = "$DOCKER_INITPATH"
|
|
|
|
)
|
2015-05-06 11:41:17 -04:00
|
|
|
DVEOF
|
|
|
|
|
|
|
|
# Compile the Windows resources into the sources
|
|
|
|
mkdir -p autogen/winresources
|
|
|
|
cat > autogen/winresources/resources.go <<WREOF
|
|
|
|
// AUTOGENERATED FILE; see $BASH_SOURCE
|
|
|
|
package winresources
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
This package is for embedding a manifest file and an icon into docker.exe.
|
|
|
|
The benefit of this is that a manifest file does not need to be alongside
|
|
|
|
the .exe, and there is an icon when docker runs, or viewed through Windows
|
|
|
|
explorer.
|
|
|
|
|
|
|
|
When make binary is run, the Dockerfile prepares the build environment by:
|
|
|
|
|
|
|
|
- Cloning github.com/akavel/rsrc
|
|
|
|
|
|
|
|
- Go-installing the rsrc executable
|
|
|
|
|
|
|
|
make.sh invokes hack/make/.go-autogen to:
|
|
|
|
|
|
|
|
- Run rsrc to create a binary file (autogen/winresources/rsrc.syso) that
|
|
|
|
contains the manifest and icon. This file is automatically picked up by
|
|
|
|
'go build', so no post-processing steps are required. The sources for
|
|
|
|
rsrc.syso are under hack/make/.resources-windows.
|
|
|
|
|
|
|
|
*/
|
|
|
|
WREOF
|
|
|
|
if [ "$(go env GOOS)" = 'windows' ]; then
|
|
|
|
rsrc \
|
|
|
|
-manifest hack/make/.resources-windows/docker.exe.manifest \
|
|
|
|
-ico hack/make/.resources-windows/docker.ico \
|
|
|
|
-o autogen/winresources/rsrc.syso > /dev/null
|
|
|
|
fi
|