2016-02-05 06:41:35 +00:00
|
|
|
{ stdenv, lib, autoreconfHook, acl, go, file, git, wget, gnupg1, trousers, squashfsTools,
|
2016-04-23 18:33:21 +00:00
|
|
|
cpio, fetchurl, fetchFromGitHub, iptables, systemd, makeWrapper, glibc }:
|
2015-08-19 10:04:34 +00:00
|
|
|
|
2015-09-01 09:08:44 +00:00
|
|
|
let
|
2016-10-15 03:00:54 +00:00
|
|
|
# Always get the information from
|
2016-06-08 15:43:42 +00:00
|
|
|
# https://github.com/coreos/rkt/blob/v${VERSION}/stage1/usr_from_coreos/coreos-common.mk
|
2016-11-26 17:18:00 +00:00
|
|
|
coreosImageRelease = "1235.0.0";
|
2016-09-06 21:04:17 +00:00
|
|
|
coreosImageSystemdVersion = "231";
|
2015-11-17 11:44:32 +00:00
|
|
|
|
|
|
|
# TODO: track https://github.com/coreos/rkt/issues/1758 to allow "host" flavor.
|
2016-06-24 19:55:03 +00:00
|
|
|
stage1Flavours = [ "coreos" "fly" ];
|
2016-07-23 01:18:29 +00:00
|
|
|
stage1Dir = "lib/rkt/stage1-images";
|
2015-09-03 13:04:59 +00:00
|
|
|
|
2015-09-01 09:08:44 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2017-01-22 17:21:16 +00:00
|
|
|
version = "1.23.0";
|
2015-08-19 10:04:34 +00:00
|
|
|
name = "rkt-${version}";
|
2015-10-24 23:57:06 +00:00
|
|
|
BUILDDIR="build-${name}";
|
2015-08-19 10:04:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coreos";
|
|
|
|
repo = "rkt";
|
2016-09-23 09:42:51 +00:00
|
|
|
rev = "v${version}";
|
2017-01-22 17:21:16 +00:00
|
|
|
sha256 = "0fgvc3s8rb6da3jgrd8jmqv9xky7mq1y184jbm4lgy0rds4zhkf4";
|
2015-08-19 10:04:34 +00:00
|
|
|
};
|
|
|
|
|
2015-10-24 23:57:06 +00: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-11-26 17:18:00 +00:00
|
|
|
sha256 = "05gk28a7zzp3j0d1y96cr1xwy9gdl4s0lpnbakzqppa4w3c4m3lq";
|
2015-09-01 09:08:44 +00:00
|
|
|
};
|
2015-09-03 13:04:59 +00:00
|
|
|
|
2016-01-15 13:11:08 +00:00
|
|
|
buildInputs = [
|
2016-04-23 18:33:21 +00: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 13:04:59 +00:00
|
|
|
|
2015-08-19 10:04:34 +00:00
|
|
|
preConfigure = ''
|
|
|
|
./autogen.sh
|
2015-10-24 23:57:06 +00: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-24 23:57:06 +00: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 "" }
|
2016-07-23 01:18:29 +00:00
|
|
|
--with-stage1-default-location=$out/${stage1Dir}/stage1-${builtins.elemAt stage1Flavours 0}.aci
|
2015-10-24 23:57:06 +00:00
|
|
|
);
|
2015-08-19 10:04:34 +00:00
|
|
|
'';
|
|
|
|
|
2015-09-03 13:04:59 +00:00
|
|
|
preBuild = ''
|
2015-10-24 23:57:06 +00:00
|
|
|
export BUILDDIR
|
2015-09-03 13:04:59 +00:00
|
|
|
'';
|
|
|
|
|
2015-08-19 10:04:34 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2016-07-19 07:31:52 +00:00
|
|
|
cp -Rv $BUILDDIR/target/bin/rkt $out/bin
|
|
|
|
|
|
|
|
mkdir -p $out/lib/rkt/stage1-images/
|
2016-07-23 01:18:29 +00:00
|
|
|
cp -Rv $BUILDDIR/target/bin/stage1-*.aci $out/${stage1Dir}/
|
2016-07-19 07:31:52 +00:00
|
|
|
|
2016-01-15 13:11:08 +00:00
|
|
|
wrapProgram $out/bin/rkt \
|
2016-10-18 18:00:44 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${systemd.lib}/lib \
|
2016-01-15 13:11:08 +00:00
|
|
|
--prefix PATH : ${iptables}/bin
|
2015-08-19 10:04:34 +00:00
|
|
|
'';
|
2015-09-03 13:04:59 +00:00
|
|
|
|
2015-08-19 10:04:34 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A fast, composable, and secure App Container runtime for Linux";
|
2015-10-24 23:57:06 +00:00
|
|
|
homepage = https://github.com/coreos/rkt;
|
2015-08-19 10:04:34 +00:00
|
|
|
license = licenses.asl20;
|
2015-10-24 23:57:06 +00:00
|
|
|
maintainers = with maintainers; [ ragge steveej ];
|
2015-08-26 16:55:22 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-08-19 10:04:34 +00:00
|
|
|
};
|
|
|
|
}
|