2019-06-16 20:59:06 +01:00
|
|
|
{ lib, fetchFromGitHub, buildGoPackage, go-md2man
|
2018-12-20 09:54:14 +00:00
|
|
|
, pkgconfig, libapparmor, apparmor-parser, libseccomp, which }:
|
2016-05-21 17:18:24 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "runc";
|
2019-10-05 14:42:04 +01:00
|
|
|
version = "1.0.0-rc9";
|
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}";
|
2019-10-05 14:42:04 +01:00
|
|
|
sha256 = "1ss5b46cbbckyqlwgj8dbd5l59c5y0kp679hcpc0ybaj53pmwxj7";
|
2016-05-21 17:18:24 +01:00
|
|
|
};
|
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
goPackagePath = "github.com/opencontainers/runc";
|
|
|
|
outputs = [ "bin" "out" "man" ];
|
2016-05-21 17:18:24 +01:00
|
|
|
|
|
|
|
hardeningDisable = ["fortify"];
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-12-20 09:54:14 +00:00
|
|
|
buildInputs = [ go-md2man libseccomp libapparmor apparmor-parser which ];
|
2016-05-21 17:18:24 +01:00
|
|
|
|
|
|
|
makeFlags = ''BUILDTAGS+=seccomp BUILDTAGS+=apparmor'';
|
|
|
|
|
2018-12-20 09:54:14 +00:00
|
|
|
buildPhase = ''
|
|
|
|
cd go/src/${goPackagePath}
|
2016-05-21 17:18:24 +01:00
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace libcontainer/apparmor/apparmor.go \
|
|
|
|
--replace /sbin/apparmor_parser ${apparmor-parser}/bin/apparmor_parser
|
2018-12-20 09:54:14 +00:00
|
|
|
make ${makeFlags} runc
|
2016-05-21 17:18:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-12-20 09:54:14 +00:00
|
|
|
install -Dm755 runc $bin/bin/runc
|
2016-05-21 17:18:24 +01:00
|
|
|
|
|
|
|
# Include contributed man pages
|
|
|
|
man/md2man-all.sh -q
|
|
|
|
manRoot="$man/share/man"
|
|
|
|
mkdir -p "$manRoot"
|
|
|
|
for manDir in man/man?; do
|
|
|
|
manBase="$(basename "$manDir")" # "man1"
|
|
|
|
for manFile in "$manDir"/*; do
|
|
|
|
manName="$(basename "$manFile")" # "docker-build.1"
|
|
|
|
mkdir -p "$manRoot/$manBase"
|
|
|
|
gzip -c "$manFile" > "$manRoot/$manBase/$manName.gz"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://runc.io/;
|
|
|
|
description = "A CLI tool for spawning and running containers according to the OCI specification";
|
|
|
|
license = licenses.asl20;
|
2019-10-05 14:42:04 +01:00
|
|
|
maintainers = with maintainers; [ offline vdemeester saschagrunert ];
|
2016-05-21 17:18:24 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|