2017-02-13 14:01:54 -05:00
|
|
|
#!/usr/bin/env bash
|
2015-02-04 16:22:38 -05:00
|
|
|
|
|
|
|
rm -rf autogen
|
2015-03-03 14:41:26 -05:00
|
|
|
|
2018-02-16 13:51:30 -05:00
|
|
|
source hack/dockerfile/install/runc.installer
|
|
|
|
source hack/dockerfile/install/tini.installer
|
|
|
|
source hack/dockerfile/install/containerd.installer
|
2016-10-24 18:18:58 -04:00
|
|
|
|
2015-11-09 13:32:46 -05:00
|
|
|
cat > dockerversion/version_autogen.go <<DVEOF
|
|
|
|
// +build autogen
|
2015-11-26 07:16:39 -05:00
|
|
|
|
2015-11-30 03:34:07 -05:00
|
|
|
// Package dockerversion is auto-generated at build-time
|
2015-10-27 21:19:14 -04:00
|
|
|
package dockerversion
|
2015-02-04 16:22:38 -05:00
|
|
|
|
2015-11-09 13:32:46 -05:00
|
|
|
// Default build-time variable for library-import.
|
|
|
|
// This file is overridden on build with build-time informations.
|
|
|
|
const (
|
2016-10-24 18:18:58 -04:00
|
|
|
GitCommit string = "$GITCOMMIT"
|
|
|
|
Version string = "$VERSION"
|
|
|
|
BuildTime string = "$BUILDTIME"
|
|
|
|
IAmStatic string = "${IAMSTATIC:-true}"
|
2017-09-22 09:52:41 -04:00
|
|
|
ContainerdCommitID string = "${CONTAINERD_COMMIT}"
|
2017-12-05 09:29:37 -05:00
|
|
|
PlatformName string = "${PLATFORM}"
|
2016-11-11 11:02:23 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// AUTOGENERATED FILE; see /go/src/github.com/docker/docker/hack/make/.go-autogen
|
|
|
|
DVEOF
|
|
|
|
|
|
|
|
cat > dockerversion/version_autogen_unix.go <<DVEOF
|
|
|
|
// +build autogen,!windows
|
|
|
|
|
|
|
|
// 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 (
|
2017-09-22 09:52:41 -04:00
|
|
|
RuncCommitID string = "${RUNC_COMMIT}"
|
|
|
|
InitCommitID string = "${TINI_COMMIT}"
|
2015-02-04 16:22:38 -05:00
|
|
|
)
|
2016-10-24 18:18:58 -04:00
|
|
|
|
|
|
|
// AUTOGENERATED FILE; see /go/src/github.com/docker/docker/hack/make/.go-autogen
|
2015-05-06 11:41:17 -04:00
|
|
|
DVEOF
|
|
|
|
|
|
|
|
# Compile the Windows resources into the sources
|
2016-04-23 18:11:08 -04:00
|
|
|
if [ "$(go env GOOS)" = "windows" ]; then
|
|
|
|
mkdir -p autogen/winresources/tmp autogen/winresources/docker autogen/winresources/dockerd
|
|
|
|
cp hack/make/.resources-windows/resources.go autogen/winresources/docker/
|
|
|
|
cp hack/make/.resources-windows/resources.go autogen/winresources/dockerd/
|
|
|
|
|
|
|
|
if [ "$(go env GOHOSTOS)" == "windows" ]; then
|
|
|
|
WINDRES=windres
|
2016-04-22 20:16:14 -04:00
|
|
|
WINDMC=windmc
|
2016-04-23 18:11:08 -04:00
|
|
|
else
|
|
|
|
# Cross compiling
|
|
|
|
WINDRES=x86_64-w64-mingw32-windres
|
2016-04-22 20:16:14 -04:00
|
|
|
WINDMC=x86_64-w64-mingw32-windmc
|
2016-04-23 18:11:08 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Generate a Windows file version of the form major,minor,patch,build (with any part optional)
|
|
|
|
VERSION_QUAD=$(echo -n $VERSION | sed -re 's/^([0-9.]*).*$/\1/' | tr . ,)
|
|
|
|
|
|
|
|
# Pass version and commit information into the resource compiler
|
|
|
|
defs=
|
|
|
|
[ ! -z $VERSION ] && defs="$defs -D DOCKER_VERSION=\"$VERSION\""
|
|
|
|
[ ! -z $VERSION_QUAD ] && defs="$defs -D DOCKER_VERSION_QUAD=$VERSION_QUAD"
|
|
|
|
[ ! -z $GITCOMMIT ] && defs="$defs -D DOCKER_COMMIT=\"$GITCOMMIT\""
|
|
|
|
|
|
|
|
function makeres {
|
|
|
|
$WINDRES \
|
|
|
|
-i hack/make/.resources-windows/$1 \
|
|
|
|
-o $3 \
|
|
|
|
-F $2 \
|
|
|
|
--use-temp-file \
|
|
|
|
-I autogen/winresources/tmp \
|
|
|
|
$defs
|
|
|
|
}
|
|
|
|
|
2016-04-22 20:16:14 -04:00
|
|
|
$WINDMC \
|
|
|
|
hack/make/.resources-windows/event_messages.mc \
|
|
|
|
-h autogen/winresources/tmp \
|
|
|
|
-r autogen/winresources/tmp
|
|
|
|
|
2016-04-23 18:11:08 -04:00
|
|
|
makeres docker.rc pe-x86-64 autogen/winresources/docker/rsrc_amd64.syso
|
|
|
|
makeres docker.rc pe-i386 autogen/winresources/docker/rsrc_386.syso
|
|
|
|
makeres dockerd.rc pe-x86-64 autogen/winresources/dockerd/rsrc_amd64.syso
|
|
|
|
|
|
|
|
rm -r autogen/winresources/tmp
|
2015-05-06 11:41:17 -04:00
|
|
|
fi
|