fb4a93a913
fetchzip is more efficient, because it doesn't do a full git clone, so it should be preferred where possible. Where hashes have not been changed, I have verified that they don't need to be. Where hashes have changed, in all cases this is because of .gitattributes files that exclude certain files from the tarball, and in these cases I have verified that the packages still build. sbsigntool still uses fetchgit because it has a submodule, and ell and iwd still use fetchgit because git.kernel.org does not provide snapshot links for them. Apparently this is intentional.
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{ stdenv, fetchzip, lib, dtc }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "kvmtool";
|
|
version = "unstable-2023-07-12";
|
|
|
|
src = fetchzip {
|
|
url = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/snapshot/kvmtool-106e2ea7756d980454d68631b87d5e25ba4e4881.tar.gz";
|
|
hash = "sha256-wpc5DfHnui0lBVH4uOq6a7pXVUZStjNLRvauu6QpRvE=";
|
|
};
|
|
|
|
patches = [ ./strlcpy-glibc-2.38-fix.patch ];
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [ dtc ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
makeFlags = [
|
|
"prefix=${placeholder "out"}"
|
|
] ++ lib.optionals stdenv.hostPlatform.isAarch64 ([
|
|
"LIBFDT_DIR=${dtc}/lib"
|
|
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
"CROSS_COMPILE=aarch64-unknown-linux-gnu-"
|
|
"ARCH=arm64"
|
|
]);
|
|
|
|
meta = with lib; {
|
|
description = "A lightweight tool for hosting KVM guests";
|
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/tree/README";
|
|
license = licenses.gpl2Only;
|
|
maintainers = with maintainers; [ astro mfrw ];
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
|
mainProgram = "lkvm";
|
|
};
|
|
}
|