nixpkgs/pkgs/applications/virtualization/runc/default.nix
volth f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00

60 lines
1.6 KiB
Nix

{ lib, fetchFromGitHub, buildGoPackage, go-md2man
, pkgconfig, libapparmor, apparmor-parser, libseccomp, which }:
with lib;
buildGoPackage rec {
name = "runc-${version}";
version = "1.0.0-rc8";
src = fetchFromGitHub {
owner = "opencontainers";
repo = "runc";
rev = "v${version}";
sha256 = "05s4p12mgmdcy7gjralh41wlgds6m69zdgwbpdn1xjj2487dmhxf";
};
goPackagePath = "github.com/opencontainers/runc";
outputs = [ "bin" "out" "man" ];
hardeningDisable = ["fortify"];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ go-md2man libseccomp libapparmor apparmor-parser which ];
makeFlags = ''BUILDTAGS+=seccomp BUILDTAGS+=apparmor'';
buildPhase = ''
cd go/src/${goPackagePath}
patchShebangs .
substituteInPlace libcontainer/apparmor/apparmor.go \
--replace /sbin/apparmor_parser ${apparmor-parser}/bin/apparmor_parser
make ${makeFlags} runc
'';
installPhase = ''
install -Dm755 runc $bin/bin/runc
# 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;
maintainers = with maintainers; [ offline vdemeester ];
platforms = platforms.linux;
};
}