mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 07:34:11 +00:00
c1b7380700
Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, buildGoPackage
|
|
, go-md2man
|
|
, installShellFiles
|
|
, pkg-config
|
|
, which
|
|
, libapparmor
|
|
, apparmor-parser
|
|
, libseccomp
|
|
, libselinux
|
|
, makeWrapper
|
|
, procps
|
|
, nixosTests
|
|
}:
|
|
|
|
buildGoPackage rec {
|
|
pname = "runc";
|
|
version = "1.0.0-rc93";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "opencontainers";
|
|
repo = "runc";
|
|
rev = "v${version}";
|
|
sha256 = "008d5wkznic80n5q1vwx727qn5ifalc7cydq68hc1gk9wrhna4v4";
|
|
};
|
|
|
|
goPackagePath = "github.com/opencontainers/runc";
|
|
outputs = [ "out" "man" ];
|
|
|
|
nativeBuildInputs = [ go-md2man installShellFiles makeWrapper pkg-config which ];
|
|
|
|
buildInputs = [ libselinux libseccomp libapparmor ];
|
|
|
|
makeFlags = [ "BUILDTAGS+=seccomp" ];
|
|
|
|
buildPhase = ''
|
|
cd go/src/${goPackagePath}
|
|
patchShebangs .
|
|
make ${toString makeFlags} runc man
|
|
'';
|
|
|
|
installPhase = ''
|
|
install -Dm755 runc $out/bin/runc
|
|
installManPage man/*/*.[1-9]
|
|
wrapProgram $out/bin/runc \
|
|
--prefix PATH : ${lib.makeBinPath [ procps ]} \
|
|
--prefix PATH : /run/current-system/systemd/bin
|
|
'';
|
|
|
|
passthru.tests = { inherit (nixosTests) cri-o docker podman; };
|
|
|
|
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;
|
|
};
|
|
}
|