2021-02-05 17:12:51 +00:00
{ lib , stdenv
2021-12-19 01:06:50 +00:00
, fetchpatch
2020-07-18 16:06:22 +00:00
, fetchFromGitHub
, ncurses
, python3
, cunit
, dpdk
, libaio
, libbsd
, libuuid
, numactl
, openssl
2022-05-18 14:49:53 +00:00
, fetchurl
2020-07-18 16:06:22 +00:00
} :
2020-04-24 23:36:52 +00:00
2022-05-18 14:49:53 +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 = " d p d k - 2 1 . 1 1 " ;
src = fetchurl {
url = " h t t p s : / / f a s t . d p d k . o r g / r e l / ${ name } . t a r . x z " ;
sha256 = " s h a 2 5 6 - M k b j 7 W j u K z a a X Y v i w G z x C K Z p 4 V f 0 1 B x b y 7 s h a / W r 0 6 E = " ;
} ;
} ) ;
in stdenv . mkDerivation rec {
2020-04-24 23:36:52 +00:00
pname = " s p d k " ;
2021-12-19 01:06:50 +00:00
version = " 2 1 . 1 0 " ;
2020-04-24 23:36:52 +00:00
src = fetchFromGitHub {
owner = " s p d k " ;
repo = " s p d k " ;
rev = " v ${ version } " ;
2021-12-19 01:06:50 +00:00
sha256 = " s h a 2 5 6 - p F y n T b b S F 1 g 5 8 V D 9 b O h e 3 c 4 o C o z e q E + 3 5 k E C T Q w D B D M = " ;
2020-04-24 23:36:52 +00:00
} ;
2021-12-06 16:07:01 +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-19 01:06:50 +00:00
# DPDK 21.11 compatibility.
( fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / s p d k / s p d k / c o m m i t / f 7 2 c a b 9 4 d d 3 5 d 7 b 4 5 e c 5 a 4 f 3 5 9 6 7 a d f 3 1 8 4 c a 6 1 6 . p a t c h " ;
sha256 = " s h a 2 5 6 - s S e t v y N j l M / h S O U s U O 3 / d m P z A l i V c t e N D v y 3 4 y M 5 d 4 A = " ;
} )
2021-12-06 16:07:01 +00:00
] ;
2020-07-18 16:06:22 +00:00
nativeBuildInputs = [
python3
] ;
2020-04-24 23:36:52 +00:00
2020-07-18 16:06:22 +00:00
buildInputs = [
2022-05-18 14:49:53 +00:00
cunit dpdk' libaio libbsd libuuid numactl openssl ncurses
2020-07-18 16:06:22 +00:00
] ;
2020-04-24 23:36:52 +00:00
postPatch = ''
patchShebangs .
'' ;
2021-12-06 16:07:01 +00:00
enableParallelBuilding = true ;
2022-05-18 14:49:53 +00:00
configureFlags = [ " - - w i t h - d p d k = ${ dpdk' } " ] ;
2020-04-24 23:36:52 +00:00
NIX_CFLAGS_COMPILE = " - m s s s e 3 " ; # Necessary to compile.
2021-05-28 09:39:13 +00:00
# otherwise does not find strncpy when compiling
NIX_LDFLAGS = " - l b s d " ;
2020-04-24 23:36:52 +00:00
2021-02-05 17:12:51 +00:00
meta = with lib ; {
2020-04-24 23:36:52 +00:00
description = " S e t o f l i b r a r i e s f o r f a s t u s e r - m o d e s t o r a g e " ;
homepage = " h t t p s : / / s p d k . i o / " ;
license = licenses . bsd3 ;
platforms = [ " x 8 6 _ 6 4 - l i n u x " ] ;
maintainers = with maintainers ; [ orivej ] ;
} ;
}