2020-04-12 12:08:47 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoPackage
|
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, libapparmor
|
|
|
|
, apparmor-parser
|
|
|
|
, libseccomp
|
|
|
|
}:
|
2016-05-21 16:18:24 +00:00
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
buildGoPackage rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "runc";
|
2020-01-24 03:13:52 +00:00
|
|
|
version = "1.0.0-rc10";
|
2016-05-21 16:18:24 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opencontainers";
|
|
|
|
repo = "runc";
|
2017-01-11 08:32:26 +00:00
|
|
|
rev = "v${version}";
|
2020-01-24 03:13:52 +00:00
|
|
|
sha256 = "0pi3rvj585997m4z9ljkxz2z9yxf9p2jr0pmqbqrc7bc95f5hagk";
|
2016-05-21 16:18:24 +00:00
|
|
|
};
|
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
goPackagePath = "github.com/opencontainers/runc";
|
2020-04-28 01:50:57 +00:00
|
|
|
outputs = [ "out" "man" ];
|
2016-05-21 16:18:24 +00:00
|
|
|
|
2020-04-12 12:08:47 +00:00
|
|
|
nativeBuildInputs = [ go-md2man installShellFiles pkg-config which ];
|
|
|
|
buildInputs = [ libseccomp libapparmor apparmor-parser ];
|
2016-05-21 16:18:24 +00:00
|
|
|
|
2019-10-28 09:17:49 +00:00
|
|
|
makeFlags = [ "BUILDTAGS+=seccomp" "BUILDTAGS+=apparmor" ];
|
2016-05-21 16:18:24 +00:00
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
buildPhase = ''
|
|
|
|
cd go/src/${goPackagePath}
|
2016-05-21 16:18:24 +00:00
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace libcontainer/apparmor/apparmor.go \
|
|
|
|
--replace /sbin/apparmor_parser ${apparmor-parser}/bin/apparmor_parser
|
2020-04-12 12:08:47 +00:00
|
|
|
make ${toString makeFlags} runc man
|
2016-05-21 16:18:24 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-04-28 01:50:57 +00:00
|
|
|
install -Dm755 runc $out/bin/runc
|
2020-05-10 01:24:04 +00:00
|
|
|
installManPage man/*/*.[1-9]
|
2016-05-21 16:18:24 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-12 12:08:47 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/opencontainers/runc";
|
2016-05-21 16:18:24 +00:00
|
|
|
description = "A CLI tool for spawning and running containers according to the OCI specification";
|
|
|
|
license = licenses.asl20;
|
2020-04-03 10:11:26 +00:00
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.podman.members;
|
2016-05-21 16:18:24 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|