commit:     ab5303b4ea459e7a829d36fe3198c7e350953e8d
Author:     Craig Andrews <candrews <AT> gentoo <DOT> org>
AuthorDate: Tue May 15 16:24:10 2018 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Thu May 17 17:30:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab5303b4

app-emulation/containerd: Fix "overflows _Ctype_ulonglong" error with GCC 8

Closes: https://bugs.gentoo.org/655804
Package-Manager: Portage-2.3.36, Repoman-2.3.9

 .../containerd-1.0.3_p20180223-r1.ebuild           | 58 ++++++++++++++++++++++
 ...p20180223-remove-c-constant-redefinitions.patch | 38 ++++++++++++++
 2 files changed, 96 insertions(+)

diff --git a/app-emulation/containerd/containerd-1.0.3_p20180223-r1.ebuild 
b/app-emulation/containerd/containerd-1.0.3_p20180223-r1.ebuild
new file mode 100644
index 00000000000..a25ff621428
--- /dev/null
+++ b/app-emulation/containerd/containerd-1.0.3_p20180223-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+EGO_PN="github.com/containerd/${PN}"
+
+inherit toolchain-funcs
+
+if [[ ${PV} == *9999 ]]; then
+       inherit golang-vcs
+else
+       MY_PV="${PV/_rc/-rc.}"
+       EGIT_COMMIT="v${MY_PV}"
+       CONTAINERD_COMMIT="4ac4fd0b6a268fe6f38b2b2e32e40daa7e424fac"
+       SRC_URI="https://${EGO_PN}/archive/${CONTAINERD_COMMIT}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm ~ppc64"
+       inherit golang-vcs-snapshot
+fi
+
+DESCRIPTION="A daemon to control runC"
+HOMEPAGE="https://containerd.tools";
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="+btrfs hardened"
+
+DEPEND="btrfs? ( sys-fs/btrfs-progs )"
+RDEPEND="|| ( >=app-emulation/docker-runc-1.0.0_rc4
+       >=app-emulation/runc-1.0.0_rc4 )
+       sys-libs/libseccomp"
+
+S=${WORKDIR}/${P}/src/${EGO_PN}
+
+RESTRICT="test"
+
+PATCHES=(
+       "${FILESDIR}"/"${P}-remove-c-constant-redefinitions.patch"
+)
+
+src_prepare() {
+       default
+       if [[ ${PV} != *9999* ]]; then
+               sed -i -e "s/git describe --match.*$/echo ${PV})/"\
+                       -e "s/git rev-parse HEAD.*$/echo $CONTAINERD_COMMIT)/"\
+                       -e "s/-s -w//" \
+                       Makefile || die
+       fi
+}
+
+src_compile() {
+       local options=( $(usex btrfs "" "no_btrfs") )
+       export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor
+       LDFLAGS=$(usex hardened '-extldflags -fno-PIC' '') emake 
BUILDTAGS="${options[@]}"
+}
+
+src_install() {
+       dobin bin/containerd{-shim,-stress,} bin/ctr
+}

diff --git 
a/app-emulation/containerd/files/containerd-1.0.3_p20180223-remove-c-constant-redefinitions.patch
 
b/app-emulation/containerd/files/containerd-1.0.3_p20180223-remove-c-constant-redefinitions.patch
new file mode 100644
index 00000000000..f08fab6e592
--- /dev/null
+++ 
b/app-emulation/containerd/files/containerd-1.0.3_p20180223-remove-c-constant-redefinitions.patch
@@ -0,0 +1,38 @@
+From 9686d822284aa8fc9d4d136cc01314f5bf455cba Mon Sep 17 00:00:00 2001
+From: Stephen J Day <stephen....@docker.com>
+Date: Fri, 2 Mar 2018 13:23:31 -0800
+Subject: [PATCH] btrfs: remove C constant redefinitions
+
+Signed-off-by: Stephen J Day <stephen....@docker.com>
+---
+ btrfs.go | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/vendor/github.com/containerd/btrfs/btrfs.go 
b/vendor/github.com/containerd/btrfs/btrfs.go
+index 1deab47..efdf528 100644
+--- a/vendor/github.com/containerd/btrfs/btrfs.go
++++ b/vendor/github.com/containerd/btrfs/btrfs.go
+@@ -7,10 +7,6 @@ import "sort"
+ #include <btrfs/ioctl.h>
+ #include "btrfs.h"
+ 
+-// Required because Go has struct casting rules for negative numbers
+-const __u64 u64_BTRFS_LAST_FREE_OBJECTID = (__u64)BTRFS_LAST_FREE_OBJECTID;
+-const __u64 negative_one = (__u64)-1;
+-
+ static char* get_name_btrfs_ioctl_vol_args_v2(struct btrfs_ioctl_vol_args_v2* 
btrfs_struct) {
+       return btrfs_struct->name;
+ }
+@@ -100,9 +96,9 @@ func subvolMap(path string) (map[uint64]*Info, error) {
+       args.key.min_type = C.BTRFS_ROOT_ITEM_KEY
+       args.key.max_type = C.BTRFS_ROOT_BACKREF_KEY
+       args.key.min_objectid = C.BTRFS_FS_TREE_OBJECTID
+-      args.key.max_objectid = C.u64_BTRFS_LAST_FREE_OBJECTID
+-      args.key.max_offset = C.negative_one
+-      args.key.max_transid = C.negative_one
++      args.key.max_objectid = C.BTRFS_LAST_FREE_OBJECTID
++      args.key.max_offset = ^C.__u64(0)
++      args.key.max_transid = ^C.__u64(0)
+ 
+       subvolsByID := make(map[uint64]*Info)
+ 

Reply via email to