diff options
Diffstat (limited to 'pkgs/development/libraries/spdk/default.nix')
-rw-r--r-- | pkgs/development/libraries/spdk/default.nix | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/pkgs/development/libraries/spdk/default.nix b/pkgs/development/libraries/spdk/default.nix index bcf6b804ed6..c7b83db5348 100644 --- a/pkgs/development/libraries/spdk/default.nix +++ b/pkgs/development/libraries/spdk/default.nix @@ -1,5 +1,4 @@ { lib, stdenv -, fetchpatch , fetchFromGitHub , ncurses , python3 @@ -10,65 +9,70 @@ , libuuid , numactl , openssl -, fetchurl +, pkg-config +, zlib +, libpcap +, libnl +, libelf +, jansson +, ensureNewerSourcesForZipFilesHook }: -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 { +stdenv.mkDerivation rec { pname = "spdk"; - version = "21.10"; + + version = "23.09"; src = fetchFromGitHub { owner = "spdk"; repo = "spdk"; rev = "v${version}"; - sha256 = "sha256-pFynTbbSF1g58VD9bOhe3c4oCozeqE+35kECTQwDBDM="; + sha256 = "sha256-P10NDa+MIEY8B3bu34Dq2keyuv2a24XV5Wf+Ah701b8="; + fetchSubmodules = true; }; - patches = [ - # Backport of upstream patch for ncurses-6.3 support. - # Will be in next release after 21.10. - ./ncurses-6.3.patch - - # DPDK 21.11 compatibility. - (fetchpatch { - url = "https://github.com/spdk/spdk/commit/f72cab94dd35d7b45ec5a4f35967adf3184ca616.patch"; - sha256 = "sha256-sSetvyNjlM/hSOUsUO3/dmPzAliVcteNDvy34yM5d4A="; - }) - ]; - nativeBuildInputs = [ python3 + python3.pkgs.setuptools + pkg-config + ensureNewerSourcesForZipFilesHook ]; buildInputs = [ - cunit dpdk' libaio libbsd libuuid numactl openssl ncurses + cunit + dpdk + jansson + libaio + libbsd + libelf + libuuid + libpcap + libnl + numactl + openssl + ncurses + zlib + ]; + + patches = [ + # https://review.spdk.io/gerrit/c/spdk/spdk/+/20394 + ./setuptools.patch ]; postPatch = '' patchShebangs . - - # glibc-2.36 adds arc4random, so we don't need the custom implementation - # here anymore. Fixed upstream in https://github.com/spdk/spdk/commit/43a3984c6c8fde7201d6c8dfe1b680cb88237269, - # but the patch doesn't apply here. - sed -i -e '1i #define HAVE_ARC4RANDOM 1' lib/iscsi/iscsi.c ''; enableParallelBuilding = true; - configureFlags = [ "--with-dpdk=${dpdk'}" ]; + configureFlags = [ + "--with-dpdk=${dpdk}" + "--pydir=${placeholder "out"}/${python3.sitePackages}" + ]; env.NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile. # otherwise does not find strncpy when compiling - NIX_LDFLAGS = "-lbsd"; + env.NIX_LDFLAGS = "-lbsd"; meta = with lib; { description = "Set of libraries for fast user-mode storage"; |