139 lines
4.6 KiB
Bash
139 lines
4.6 KiB
Bash
# Template file for 'docker'
|
|
pkgname=docker
|
|
version=19.03.15
|
|
revision=1
|
|
create_wrksrc=yes
|
|
build_style=go
|
|
hostmakedepends="pkg-config cmake tar"
|
|
makedepends="libbtrfs-devel sqlite-devel device-mapper-devel libseccomp-devel
|
|
libapparmor-devel libltdl-devel"
|
|
depends="containerd runc"
|
|
short_desc="Pack, ship and run any application as a lightweight container"
|
|
maintainer="Andrea Brancaleoni <abc@pompel.me>"
|
|
license="Apache-2.0, MIT"
|
|
homepage="http://www.docker.io"
|
|
|
|
_tini_version=0.18.0
|
|
_libnetwork="bump_${version%.${version#*.*.}}"
|
|
|
|
distfiles="
|
|
https://github.com/docker/docker-ce/archive/v${version}.tar.gz>docker-ce-$version.tar.gz
|
|
https://github.com/krallin/tini/archive/v$_tini_version.tar.gz>tini-$_tini_version.tar.gz
|
|
https://github.com/moby/libnetwork/archive/$_libnetwork.tar.gz>libnetwork-$_libnetwork.tar.gz"
|
|
checksum="f2f31dd4137eaa735a26e590c9718fb06867afff4d8415cc80feb6cdc9e4a8cd
|
|
1097675352d6317b547e73f9dc7c6839fd0bb0d96dafc2e5c95506bb324049a2
|
|
753615b94b6a8e37a612f766870d9e2af7e17cae7820bc6104ba67b4c6c1109a"
|
|
|
|
|
|
# These are required at run-time.
|
|
depends+=" iptables xz git"
|
|
nopie=yes
|
|
nostrip=yes
|
|
archs="aarch64* armv[67]l* x86_64* ppc64le*"
|
|
system_groups="docker"
|
|
|
|
do_configure() {
|
|
msg_normal "Configuring docker-init\n"
|
|
mkdir -p $wrksrc/tini-$_tini_version/build
|
|
cd $wrksrc/tini-$_tini_version/build
|
|
local cmake_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None"
|
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
x86_64*) _CMAKE_SYSTEM_PROCESSOR=x86_64 ;;
|
|
aarch64*) _CMAKE_SYSTEM_PROCESSOR=aarch64 ;;
|
|
arm*) _CMAKE_SYSTEM_PROCESSOR=arm ;;
|
|
ppc64le*) _CMAKE_SYSTEM_PROCESSOR=ppc64le ;;
|
|
*) msg_error "BUG: $pkgver: unknown target machine\n" ;;
|
|
esac
|
|
cat >cross_${XBPS_CROSS_TRIPLET}.cmake <<-_EOF
|
|
SET(CMAKE_SYSTEM_NAME Linux)
|
|
SET(CMAKE_SYSTEM_VERSION 1)
|
|
|
|
SET(CMAKE_C_COMPILER ${CC})
|
|
SET(CMAKE_CXX_COMPILER ${CXX})
|
|
SET(CMAKE_CROSSCOMPILING TRUE)
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR ${_CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH ${XBPS_CROSS_BASE})
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
_EOF
|
|
cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
|
|
fi
|
|
CFLAGS="${CFLAGS/ -pipe / }" CXXFLAGS="${CXXFLAGS/ -pipe / }" \
|
|
cmake ${cmake_args} ..
|
|
|
|
mkdir -p $wrksrc/gopath/src/github.com/docker
|
|
|
|
msg_normal "Preparing docker-proxy import path\n"
|
|
cd $wrksrc/libnetwork-$_libnetwork
|
|
rm -f $wrksrc/gopath/src/github.com/docker/libnetwork
|
|
ln -s "$PWD" $wrksrc/gopath/src/github.com/docker/libnetwork
|
|
|
|
msg_normal "Preparing docker-cli import path\n"
|
|
cd $wrksrc/docker-ce-$version
|
|
rm -f $wrksrc/gopath/src/github.com/docker/cli
|
|
ln -s "$PWD/components/cli" $wrksrc/gopath/src/github.com/docker/cli
|
|
rm -f $wrksrc/gopath/src/github.com/docker/docker
|
|
ln -s "$PWD/components/engine" $wrksrc/gopath/src/github.com/docker/docker
|
|
|
|
BUILDTIME=$(date --utc --rfc-3339 ns)
|
|
BUILDTIME=${BUILDTIME/ /T}
|
|
vsed -i -e "
|
|
/GitCommit/s/\".*\"/\"v$version\"/;
|
|
/Version/s/\".*\"/\"$version\"/;
|
|
/BuildTime/s/\".*\"/\"$BUILDTIME\"/;
|
|
" \
|
|
components/engine/dockerversion/version_lib.go \
|
|
components/cli/cli/version/version.go
|
|
}
|
|
|
|
do_build() {
|
|
export GOPATH="$wrksrc/gopath"
|
|
mkdir -p $wrksrc/gopath/bin
|
|
|
|
msg_normal "Building docker-init\n"
|
|
cd $wrksrc/tini-$_tini_version/build
|
|
make tini-static
|
|
|
|
msg_normal "Building docker-proxy\n"
|
|
go build -buildmode=pie \
|
|
-ldflags="$go_ldflags -linkmode=external" \
|
|
-o $wrksrc/gopath/bin/docker-proxy \
|
|
github.com/docker/libnetwork/cmd/proxy
|
|
|
|
msg_normal "Building docker cli\n"
|
|
go build -buildmode=pie \
|
|
-ldflags="$go_ldflags" -o $wrksrc/gopath/bin/docker \
|
|
github.com/docker/cli/cmd/docker
|
|
|
|
msg_normal "Building docker daemon\n"
|
|
go build -buildmode=pie \
|
|
-tags 'libdm_dlsym_deferred_remove seccomp apparmor' \
|
|
-ldflags="$go_ldflags" \
|
|
-o $wrksrc/gopath/bin/dockerd \
|
|
github.com/docker/docker/cmd/dockerd
|
|
}
|
|
|
|
do_install() {
|
|
vbin tini-$_tini_version/build/tini-static docker-init
|
|
vlicense tini-$_tini_version/LICENSE docker-init.MIT
|
|
vbin gopath/bin/docker-proxy
|
|
vbin gopath/bin/docker
|
|
vbin gopath/bin/dockerd
|
|
cd docker-ce-$version
|
|
vcompletion components/cli/contrib/completion/bash/docker bash
|
|
vcompletion components/cli/contrib/completion/zsh/_docker zsh
|
|
vcompletion components/cli/contrib/completion/fish/docker.fish fish
|
|
vinstall components/engine/contrib/syntax/vim/syntax/dockerfile.vim 644 \
|
|
usr/share/vim/vimfiles/syntax/dockerfile.vim
|
|
vinstall components/engine/contrib/syntax/vim/ftdetect/dockerfile.vim 644 \
|
|
usr/share/vim/vimfiles/ftdetect/dockerfile.vim
|
|
vlicense components/engine/contrib/syntax/vim/LICENSE dockerfile.vim.BSD-2-Clause
|
|
vsv docker
|
|
}
|