patos/pkgs/kexec-tools/default.nix

70 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPackages,
fetchFromGitHub,
autoconf,
autoreconfHook,
zlib,
}:
stdenv.mkDerivation {
pname = "kexec-tools";
version = "main";
src = fetchFromGitHub {
owner = "horms";
repo = "kexec-tools";
rev = "v2.0.31";
hash = "sha256-Tgmc8mFlmzzRj7tEaBes7Udw4fRl6cSfe76iPNa3Ffs=";
};
dontPatchShebangs = true;
hardeningDisable = [
"format"
"pic"
"relro"
"pie"
];
preAutoreconf = "./bootstrap";
configurePlatforms = [
"build"
"host"
];
configureFlags = [ "BUILD_CC=${buildPackages.stdenv.cc.targetPrefix}cc" "--prefix=/"];
depsBuildBuild = [ buildPackages.stdenv.cc ];
installPhase = ''
make DESTDIR=$out install
'';
nativeBuildInputs = [
autoconf
autoreconfHook
];
buildInputs = [
zlib
];
enableParallelBuilding = true;
meta = with lib; {
homepage = "http://horms.net/projects/kexec/kexec-tools";
description = "Tools related to the kexec Linux feature";
platforms = platforms.linux;
badPlatforms = [
"microblaze-linux"
"microblazeel-linux"
"riscv64-linux"
"riscv32-linux"
"sparc-linux"
"sparc64-linux"
];
license = licenses.gpl2Only;
};
}