runc-9999.ebuild 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils multilib
  5. DESCRIPTION="runc container cli tools"
  6. HOMEPAGE="http://runc.io"
  7. GITHUB_URI="github.com/opencontainers/runc"
  8. if [[ ${PV} == *9999* ]]; then
  9. EGIT_REPO_URI="git://${GITHUB_URI}.git"
  10. inherit git-r3
  11. else
  12. SRC_URI="https://${GITHUB_URI}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  13. KEYWORDS="~amd64 ~ppc64"
  14. fi
  15. LICENSE="Apache-2.0"
  16. SLOT="0"
  17. IUSE="+seccomp"
  18. DEPEND=">=dev-lang/go-1.4:="
  19. RDEPEND="seccomp? ( sys-libs/libseccomp )
  20. !app-emulation/docker-runc"
  21. src_compile() {
  22. # Taken from app-emulation/docker-1.7.0-r1
  23. export CGO_CFLAGS="-I${ROOT}/usr/include"
  24. export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
  25. # Setup GOPATH so things build
  26. rm -rf .gopath
  27. mkdir -p .gopath/src/"$(dirname "${GITHUB_URI}")"
  28. ln -sf ../../../.. .gopath/src/"${GITHUB_URI}"
  29. export GOPATH="${PWD}/.gopath:${PWD}/vendor"
  30. # build up optional flags
  31. local options=( $(usex seccomp "seccomp") )
  32. emake BUILDTAGS="${options[@]}"
  33. }
  34. src_install() {
  35. dobin runc
  36. }