nixpkgs/pkgs/development/libraries/spdk/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv
2021-12-09 02:42:05 +00:00
, fetchpatch
2020-06-30 14:08:22 +00:00
, fetchFromGitHub
, ncurses
, python3
, cunit
, dpdk
, libaio
, libbsd
, libuuid
, numactl
, openssl
2022-05-10 06:11:21 +00:00
, fetchurl
2020-06-30 14:08:22 +00:00
}:
2018-05-21 01:59:30 +00:00
2022-05-10 06:11:21 +00:00
let
# The old version has some CVEs howver they should not affect SPDK's usage of the framework: https://github.com/NixOS/nixpkgs/pull/171648#issuecomment-1121964568
dpdk' = dpdk.overrideAttrs (old: rec {
name = "dpdk-21.11";
src = fetchurl {
url = "https://fast.dpdk.org/rel/${name}.tar.xz";
sha256 = "sha256-Mkbj7WjuKzaaXYviwGzxCKZp4Vf01Bxby7sha/Wr06E=";
};
});
in stdenv.mkDerivation rec {
pname = "spdk";
2021-12-09 02:42:05 +00:00
version = "21.10";
2018-05-21 01:59:30 +00:00
src = fetchFromGitHub {
owner = "spdk";
repo = "spdk";
rev = "v${version}";
2021-12-09 02:42:05 +00:00
sha256 = "sha256-pFynTbbSF1g58VD9bOhe3c4oCozeqE+35kECTQwDBDM=";
2018-05-21 01:59:30 +00:00
};
patches = [
# Backport of upstream patch for ncurses-6.3 support.
# Will be in next release after 21.10.
./ncurses-6.3.patch
2021-12-09 02:42:05 +00:00
# DPDK 21.11 compatibility.
(fetchpatch {
url = "https://github.com/spdk/spdk/commit/f72cab94dd35d7b45ec5a4f35967adf3184ca616.patch";
sha256 = "sha256-sSetvyNjlM/hSOUsUO3/dmPzAliVcteNDvy34yM5d4A=";
})
];
2020-06-30 14:08:22 +00:00
nativeBuildInputs = [
python3
];
2018-05-21 01:59:30 +00:00
2020-06-30 14:08:22 +00:00
buildInputs = [
2022-05-10 06:11:21 +00:00
cunit dpdk' libaio libbsd libuuid numactl openssl ncurses
2020-06-30 14:08:22 +00:00
];
2018-05-21 01:59:30 +00:00
2018-05-21 03:39:54 +00:00
postPatch = ''
patchShebangs .
'';
2021-12-01 09:12:37 +00:00
enableParallelBuilding = true;
2022-05-10 06:11:21 +00:00
configureFlags = [ "--with-dpdk=${dpdk'}" ];
2018-05-21 01:59:30 +00:00
2019-10-30 11:34:47 +00:00
NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
2021-05-24 06:22:01 +00:00
# otherwise does not find strncpy when compiling
NIX_LDFLAGS = "-lbsd";
2018-05-21 01:59:30 +00:00
meta = with lib; {
2018-05-21 01:59:30 +00:00
description = "Set of libraries for fast user-mode storage";
homepage = "https://spdk.io/";
2018-05-21 01:59:30 +00:00
license = licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ orivej ];
};
}