--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{5,6,7} )
+
+inherit python-single-r1
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/hpc/${PN}.git"
+ S="${WORKDIR}/${P}"
+else
+ SRC_URI="https://github.com/hpc/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Lightweight user-defined software stacks for high-performance computing"
+HOMEPAGE="https://hpc.github.io/charliecloud/"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+IUSE="doc examples +pv"
+
+# Extensive test suite exists, but downloads container images
+# directly and via Docker and installs packages inside using apt/yum.
+# Additionally, clashes with portage namespacing and sandbox.
+RESTRICT="test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ pv? ( sys-apps/pv )
+"
+DEPEND="doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ net-misc/rsync
+ )"
+
+PATCHES=(
+ # See upstream bug: https://github.com/hpc/charliecloud/pull/481/
+ "${FILESDIR}"/"${PN}-${PV}"-fix-hardcoded-gcc.patch
+)
+
+src_compile() {
+ emake
+ use doc && emake -C doc-src
+}
+
+src_install() {
+ emake install PREFIX="${EPREFIX}/usr" DESTDIR="${D}" DOCDIR="${ED}/usr/share/doc/${PF}" LIBEXEC_DIR="libexec/${PF}"
+ if use examples; then
+ docompress -x "/usr/share/doc/${PF}/examples"
+ dodoc -r examples
+ fi
+ einstalldocs
+}
--- /dev/null
+From bae9f01ed5ad0ef5d6c0b48cbc1a7fde73ae45ae Mon Sep 17 00:00:00 2001
+From: Oliver Freyermuth <o.freyermuth@googlemail.com>
+Date: Mon, 15 Jul 2019 18:36:24 +0200
+Subject: [PATCH] test/Makefile: Remove hardcoded call to gcc, error out if
+ CC=icc.
+
+---
+ test/Makefile | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/test/Makefile b/test/Makefile
+index 97a9316b..7c28ce2a 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -10,7 +10,7 @@ images_eg := $(sort $(wildcard ../examples/*/*/Build)) \
+ $(sort $(wildcard ../examples/*/*/Docker_Pull)) \
+ $(sort $(wildcard ../examples/*/*/Docker_Pull.*))
+ images := $(images_ch) $(images_eg)
+-sotests := sotest/bin/sotest sotest/lib/libsotest.so.1.0
++sotests := check-no-icc sotest/bin/sotest sotest/lib/libsotest.so.1.0
+
+ # Favor embedded Bats, if installed, over system Bats.
+ export PATH := $(CURDIR)/bats/bin:$(PATH)
+@@ -76,13 +76,18 @@ sotest/bin/sotest: sotest/sotest
+ sotest/lib/libsotest.so.1.0: sotest/libsotest.so.1.0
+ cp -a $^ $@
+
+-# We hardcode gcc here because some other compilers (hello, Intel) link the
++# We exclude icc here because it links the
+ # resulting binaries with extra shared libraries that are then not copied into
+ # the container. (Issue #227.)
+
++check-no-icc:
++ifeq ($(patsubst %icc,,$(lastword $(CC))),)
++ $(error ICC not supported since it overlinks extra shared libraries)
++endif
++
+ sotest/sotest: sotest/sotest.c sotest/libsotest.so.1.0
+- gcc -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -L./sotest -lsotest $^
++ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -L./sotest -lsotest $^
+ sotest/libsotest.so.1.0: sotest/libsotest.c
+- gcc -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -Wl,-soname,libsotest.so.1 -lc $^
++ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -Wl,-soname,libsotest.so.1 -lc $^
+ ln -f -s libsotest.so.1.0 sotest/libsotest.so
+ ln -f -s libsotest.so.1.0 sotest/libsotest.so.1