1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/.go-autogen
Aleksa Sarai 4357ed4a73 *: purge dockerinit from source code
dockerinit has been around for a very long time. It was originally used
as a way for us to do configuration for LXC containers once the
container had started. LXC is no longer supported, and /.dockerinit has
been dead code for quite a while. This removes all code and references
in code to dockerinit.

Signed-off-by: Aleksa Sarai <asarai@suse.com>
2016-01-26 23:47:02 +11:00

63 lines
1.9 KiB
Bash

#!/bin/bash
rm -rf autogen
cat > dockerversion/version_autogen.go <<DVEOF
// +build autogen
// Package dockerversion is auto-generated at build-time
package dockerversion
// 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}"
)
// AUTOGENERATED FILE; see $BASH_SOURCE
DVEOF
# Compile the Windows resources into the sources
mkdir -p autogen/winresources
cat > autogen/winresources/resources.go <<WREOF
// Package winresources is auto-generated at build-time
// 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 \
-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
fi