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