2015-02-04 21:22:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
rm -rf autogen
|
2015-03-03 19:41:26 +00:00
|
|
|
|
2015-11-09 18:32:46 +00:00
|
|
|
cat > dockerversion/version_autogen.go <<DVEOF
|
|
|
|
// +build autogen
|
2015-11-26 12:16:39 +00:00
|
|
|
|
2015-11-30 08:34:07 +00:00
|
|
|
// Package dockerversion is auto-generated at build-time
|
2015-10-28 01:19:14 +00:00
|
|
|
package dockerversion
|
2015-02-04 21:22:38 +00:00
|
|
|
|
2015-11-09 18:32:46 +00:00
|
|
|
// Default build-time variable for library-import.
|
|
|
|
// This file is overridden on build with build-time informations.
|
|
|
|
const (
|
|
|
|
GitCommit string = "$GITCOMMIT"
|
|
|
|
Version string = "$VERSION"
|
|
|
|
BuildTime string = "$BUILDTIME"
|
|
|
|
IAmStatic string = "${IAMSTATIC:-true}"
|
2015-02-04 21:22:38 +00:00
|
|
|
)
|
2015-11-09 18:32:46 +00:00
|
|
|
// AUTOGENERATED FILE; see $BASH_SOURCE
|
2015-05-06 15:41:17 +00:00
|
|
|
DVEOF
|
|
|
|
|
|
|
|
# Compile the Windows resources into the sources
|
|
|
|
mkdir -p autogen/winresources
|
|
|
|
cat > autogen/winresources/resources.go <<WREOF
|
2015-11-30 08:34:07 +00:00
|
|
|
// Package winresources is auto-generated at build-time
|
2015-05-06 15:41:17 +00:00
|
|
|
// 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:
|
|
|
|
|
2016-01-20 11:53:54 +00:00
|
|
|
- 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
|
2015-05-06 15:41:17 +00:00
|
|
|
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 \
|
2016-01-14 00:27:53 +00:00
|
|
|
-arch "amd64" \
|
|
|
|
-o autogen/winresources/rsrc_amd64.syso > /dev/null
|
|
|
|
|
|
|
|
rsrc \
|
|
|
|
-manifest hack/make/.resources-windows/docker.exe.manifest \
|
|
|
|
-ico hack/make/.resources-windows/docker.ico \
|
|
|
|
-arch "386" \
|
|
|
|
-o autogen/winresources/rsrc_386.syso > /dev/null
|
2015-05-06 15:41:17 +00:00
|
|
|
fi
|