2020-04-12 13:08:47 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2021-06-16 23:52:14 +01:00
|
|
|
, buildGoModule
|
2020-04-12 13:08:47 +01:00
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, libapparmor
|
|
|
|
, apparmor-parser
|
|
|
|
, libseccomp
|
2020-05-13 12:37:48 +01:00
|
|
|
, libselinux
|
2020-11-22 00:37:18 +00:00
|
|
|
, makeWrapper
|
|
|
|
, procps
|
2020-05-19 01:41:00 +01:00
|
|
|
, nixosTests
|
2020-04-12 13:08:47 +01:00
|
|
|
}:
|
2016-05-21 17:18:24 +01:00
|
|
|
|
2021-06-16 23:52:14 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "runc";
|
2021-06-22 07:17:08 +01:00
|
|
|
version = "1.0.0";
|
2016-05-21 17:18:24 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opencontainers";
|
|
|
|
repo = "runc";
|
2017-01-11 08:32:26 +00:00
|
|
|
rev = "v${version}";
|
2021-06-22 07:17:08 +01:00
|
|
|
sha256 = "sha256-slNVSlyJLaqIFF4uJP/7u4M0AkJLQjqkHO5TeKFYgSA=";
|
2016-05-21 17:18:24 +01:00
|
|
|
};
|
|
|
|
|
2021-06-16 23:52:14 +01:00
|
|
|
vendorSha256 = null;
|
2020-04-28 02:50:57 +01:00
|
|
|
outputs = [ "out" "man" ];
|
2016-05-21 17:18:24 +01:00
|
|
|
|
2020-11-22 00:37:18 +00:00
|
|
|
nativeBuildInputs = [ go-md2man installShellFiles makeWrapper pkg-config which ];
|
2016-05-21 17:18:24 +01:00
|
|
|
|
2021-02-04 09:29:07 +00:00
|
|
|
buildInputs = [ libselinux libseccomp libapparmor ];
|
2020-05-13 12:37:48 +01:00
|
|
|
|
2021-02-04 09:29:07 +00:00
|
|
|
makeFlags = [ "BUILDTAGS+=seccomp" ];
|
2016-05-21 17:18:24 +01:00
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
buildPhase = ''
|
2021-03-31 07:52:07 +01:00
|
|
|
runHook preBuild
|
2016-05-21 17:18:24 +01:00
|
|
|
patchShebangs .
|
2020-04-12 13:08:47 +01:00
|
|
|
make ${toString makeFlags} runc man
|
2021-03-31 07:52:07 +01:00
|
|
|
runHook postBuild
|
2016-05-21 17:18:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-03-31 07:52:07 +01:00
|
|
|
runHook preInstall
|
2020-04-28 02:50:57 +01:00
|
|
|
install -Dm755 runc $out/bin/runc
|
2020-05-10 02:24:04 +01:00
|
|
|
installManPage man/*/*.[1-9]
|
2020-11-22 00:37:18 +00:00
|
|
|
wrapProgram $out/bin/runc \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ procps ]} \
|
|
|
|
--prefix PATH : /run/current-system/systemd/bin
|
2021-03-31 07:52:07 +01:00
|
|
|
runHook postInstall
|
2016-05-21 17:18:24 +01:00
|
|
|
'';
|
|
|
|
|
2020-11-22 00:59:08 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) cri-o docker podman; };
|
2020-05-19 01:41:00 +01:00
|
|
|
|
2020-04-12 13:08:47 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/opencontainers/runc";
|
2016-05-21 17:18:24 +01:00
|
|
|
description = "A CLI tool for spawning and running containers according to the OCI specification";
|
|
|
|
license = licenses.asl20;
|
2020-04-03 11:11:26 +01:00
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.podman.members;
|
2016-05-21 17:18:24 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|