2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoPackage
|
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, libapparmor
|
|
|
|
, apparmor-parser
|
|
|
|
, libseccomp
|
2020-05-15 21:57:56 +00:00
|
|
|
, libselinux
|
2020-05-29 06:06:01 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
pname = "runc";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "1.0.0-rc92";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opencontainers";
|
|
|
|
repo = "runc";
|
|
|
|
rev = "v${version}";
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "0r4zbxbs03xr639r7848282j1ybhibfdhnxyap9p76j5w8ixms94";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
goPackagePath = "github.com/opencontainers/runc";
|
2020-05-15 21:57:56 +00:00
|
|
|
outputs = [ "out" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ go-md2man installShellFiles pkg-config which ];
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
buildInputs = [ libselinux libseccomp libapparmor apparmor-parser ];
|
|
|
|
|
|
|
|
makeFlags = [ "BUILDTAGS+=seccomp" "BUILDTAGS+=apparmor" "BUILDTAGS+=selinux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
cd go/src/${goPackagePath}
|
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace libcontainer/apparmor/apparmor.go \
|
|
|
|
--replace /sbin/apparmor_parser ${apparmor-parser}/bin/apparmor_parser
|
|
|
|
make ${toString makeFlags} runc man
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
install -Dm755 runc $out/bin/runc
|
|
|
|
installManPage man/*/*.[1-9]
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-24 20:58:05 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) cri-o docker podman; };
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/opencontainers/runc";
|
|
|
|
description = "A CLI tool for spawning and running containers according to the OCI specification";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.podman.members;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|