nixpkgs/pkgs/applications/virtualization/lkl/default.nix

57 lines
1.9 KiB
Nix
Raw Normal View History

2017-01-16 22:24:21 +01:00
{ stdenv, fetchFromGitHub, bc, python, fuse, libarchive }:
stdenv.mkDerivation rec {
2017-11-11 21:23:05 +01:00
name = "lkl-2017-11-10";
rev = "52a6a643c7d1dd3031c0cbec75e1ac7a999f3d57";
2017-01-16 22:24:21 +01:00
outputs = [ "dev" "lib" "out" ];
nativeBuildInputs = [ bc python ];
buildInputs = [ fuse libarchive ];
2017-01-16 22:24:21 +01:00
src = fetchFromGitHub {
inherit rev;
2017-01-17 19:40:58 +01:00
owner = "lkl";
2017-01-16 22:24:21 +01:00
repo = "linux";
2017-11-11 21:23:05 +01:00
sha256 = "1i5ywrfxqpykjjalwh9g4rwd4s186cqk3j806d327a67xb2ivxnp";
2017-01-16 22:24:21 +01:00
};
# Fix a /usr/bin/env reference in here that breaks sandboxed builds
prePatch = "patchShebangs arch/lkl/scripts";
2017-01-16 22:24:21 +01:00
installPhase = ''
mkdir -p $out/bin $lib/lib $dev
2017-01-16 22:24:21 +01:00
cp tools/lkl/bin/lkl-hijack.sh $out/bin
sed -i $out/bin/lkl-hijack.sh \
-e "s,LD_LIBRARY_PATH=.*,LD_LIBRARY_PATH=$lib/lib,"
2017-01-16 22:24:21 +01:00
cp tools/lkl/{cptofs,cpfromfs,fs2tar,lklfuse} $out/bin
cp -r tools/lkl/include $dev/
cp tools/lkl/liblkl*.{a,so} $lib/lib
2017-01-16 22:24:21 +01:00
'';
# We turn off format and fortify because of these errors (fortify implies -O2, which breaks the jitter entropy code):
# fs/xfs/xfs_log_recover.c:2575:3: error: format not a string literal and no format arguments [-Werror=format-security]
# crypto/jitterentropy.c:54:3: error: #error "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy.c."
hardeningDisable = [ "format" "fortify" ];
makeFlags = "-C tools/lkl";
enableParallelBuilding = true;
2017-01-16 22:24:21 +01:00
meta = with stdenv.lib; {
description = "The Linux kernel as a library";
longDescription = ''
LKL (Linux Kernel Library) aims to allow reusing the Linux kernel code as
extensively as possible with minimal effort and reduced maintenance
overhead
'';
2017-05-21 15:25:55 +02:00
homepage = https://github.com/lkl/linux/;
platforms = [ "x86_64-linux" "aarch64-linux" ]; # Darwin probably works too but I haven't tested it
2017-01-16 22:24:21 +01:00
license = licenses.gpl2;
maintainers = with maintainers; [ copumpkin ];
};
}