2016-02-05 06:41:35 +00:00
|
|
|
{ stdenv, lib, autoreconfHook, acl, go, file, git, wget, gnupg1, trousers, squashfsTools,
|
2016-04-23 19:33:21 +01:00
|
|
|
cpio, fetchurl, fetchFromGitHub, iptables, systemd, makeWrapper, glibc }:
|
2015-08-19 11:04:34 +01:00
|
|
|
|
2015-09-01 10:08:44 +01:00
|
|
|
let
|
2016-06-08 16:43:42 +01:00
|
|
|
# Always get the information from
|
|
|
|
# https://github.com/coreos/rkt/blob/v${VERSION}/stage1/usr_from_coreos/coreos-common.mk
|
|
|
|
coreosImageRelease = "1032.0.0";
|
|
|
|
coreosImageSystemdVersion = "229";
|
2015-11-17 11:44:32 +00:00
|
|
|
|
|
|
|
# TODO: track https://github.com/coreos/rkt/issues/1758 to allow "host" flavor.
|
2016-01-15 13:11:08 +00:00
|
|
|
stage1Flavours = [ "coreos" "fly" "host" ];
|
2015-09-03 14:04:59 +01:00
|
|
|
|
2015-09-01 10:08:44 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2016-06-10 00:28:30 +01:00
|
|
|
version = "1.8.0";
|
2015-08-19 11:04:34 +01:00
|
|
|
name = "rkt-${version}";
|
2015-10-25 00:57:06 +01:00
|
|
|
BUILDDIR="build-${name}";
|
2015-08-19 11:04:34 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "coreos";
|
|
|
|
repo = "rkt";
|
2016-06-10 00:28:30 +01:00
|
|
|
sha256 = "0n4xjvvvkqk83npiqz13cv82lmnsqpzzyjc03lyz6svw2pdszmhd";
|
2015-08-19 11:04:34 +01:00
|
|
|
};
|
|
|
|
|
2015-10-25 00:57:06 +01:00
|
|
|
stage1BaseImage = fetchurl {
|
2016-02-05 19:14:13 +00:00
|
|
|
url = "http://alpha.release.core-os.net/amd64-usr/${coreosImageRelease}/coreos_production_pxe_image.cpio.gz";
|
2016-06-08 16:43:42 +01:00
|
|
|
sha256 = "1lmyhncvw5cby4nbpw6ryiki05wra90fsr6xnsdgi9yqqs6v2d1f";
|
2015-09-01 10:08:44 +01:00
|
|
|
};
|
2015-09-03 14:04:59 +01:00
|
|
|
|
2016-01-15 13:11:08 +00:00
|
|
|
buildInputs = [
|
2016-04-23 19:33:21 +01:00
|
|
|
glibc.out glibc.static
|
2016-02-05 06:41:35 +00:00
|
|
|
autoreconfHook go file git wget gnupg1 trousers squashfsTools cpio acl systemd
|
2016-01-15 13:11:08 +00:00
|
|
|
makeWrapper
|
|
|
|
];
|
2015-09-03 14:04:59 +01:00
|
|
|
|
2015-08-19 11:04:34 +01:00
|
|
|
preConfigure = ''
|
|
|
|
./autogen.sh
|
2015-10-25 00:57:06 +01:00
|
|
|
configureFlagsArray=(
|
2015-11-17 11:44:32 +00:00
|
|
|
--with-stage1-flavors=${builtins.concatStringsSep "," stage1Flavours}
|
|
|
|
${if lib.findFirst (p: p == "coreos") null stage1Flavours != null then "
|
2015-10-25 00:57:06 +01:00
|
|
|
--with-coreos-local-pxe-image-path=${stage1BaseImage}
|
|
|
|
--with-coreos-local-pxe-image-systemd-version=v${coreosImageSystemdVersion}
|
2015-11-17 11:44:32 +00:00
|
|
|
" else "" }
|
2015-10-25 00:57:06 +01:00
|
|
|
);
|
2015-08-19 11:04:34 +01:00
|
|
|
'';
|
|
|
|
|
2015-09-03 14:04:59 +01:00
|
|
|
preBuild = ''
|
2015-10-25 00:57:06 +01:00
|
|
|
export BUILDDIR
|
2015-09-03 14:04:59 +01:00
|
|
|
'';
|
|
|
|
|
2015-08-19 11:04:34 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2015-10-25 00:57:06 +01:00
|
|
|
cp -Rv $BUILDDIR/bin/* $out/bin
|
2016-01-15 13:11:08 +00:00
|
|
|
wrapProgram $out/bin/rkt \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${systemd}/lib \
|
|
|
|
--prefix PATH : ${iptables}/bin
|
2015-08-19 11:04:34 +01:00
|
|
|
'';
|
2015-09-03 14:04:59 +01:00
|
|
|
|
2015-08-19 11:04:34 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A fast, composable, and secure App Container runtime for Linux";
|
2015-10-25 00:57:06 +01:00
|
|
|
homepage = https://github.com/coreos/rkt;
|
2015-08-19 11:04:34 +01:00
|
|
|
license = licenses.asl20;
|
2015-10-25 00:57:06 +01:00
|
|
|
maintainers = with maintainers; [ ragge steveej ];
|
2015-08-26 17:55:22 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-08-19 11:04:34 +01:00
|
|
|
};
|
|
|
|
}
|