btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / sp / spdk / package.nix
blobb611792755062deca72491b40ae6cb97493338c3
1 { lib, stdenv
2 , fetchFromGitHub
3 , ncurses
4 , python3
5 , cunit
6 , dpdk
7 , fuse3
8 , libaio
9 , libbsd
10 , libuuid
11 , numactl
12 , openssl
13 , pkg-config
14 , zlib
15 , zstd
16 , libpcap
17 , libnl
18 , elfutils
19 , jansson
20 , ensureNewerSourcesForZipFilesHook
23 stdenv.mkDerivation rec {
24   pname = "spdk";
26   version = "24.09";
28   src = fetchFromGitHub {
29     owner = "spdk";
30     repo = "spdk";
31     rev = "v${version}";
32     hash = "sha256-27mbIycenOk51PLQrAfU1cZcjiWddNtxoyC6Q9wxqFg=";
33     fetchSubmodules = true;
34   };
36   nativeBuildInputs = [
37     python3
38     python3.pkgs.pip
39     python3.pkgs.setuptools
40     python3.pkgs.wheel
41     python3.pkgs.wrapPython
42     pkg-config
43     ensureNewerSourcesForZipFilesHook
44   ];
46   buildInputs = [
47     cunit
48     dpdk
49     fuse3
50     jansson
51     libaio
52     libbsd
53     elfutils
54     libuuid
55     libpcap
56     libnl
57     numactl
58     openssl
59     ncurses
60     zlib
61     zstd
62   ];
64   propagatedBuildInputs = [
65     python3.pkgs.configshell
66   ];
68   postPatch = ''
69     patchShebangs .
70   '';
72   enableParallelBuilding = true;
74   configureFlags = [
75     "--with-dpdk=${dpdk}"
76   ];
78   postCheck = ''
79     python3 -m spdk
80   '';
82   postFixup = ''
83     wrapPythonPrograms
84   '';
86   env.NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
87   # otherwise does not find strncpy when compiling
88   env.NIX_LDFLAGS = "-lbsd";
90   meta = with lib; {
91     description = "Set of libraries for fast user-mode storage";
92     homepage = "https://spdk.io/";
93     license = licenses.bsd3;
94     platforms =  [ "x86_64-linux" ];
95     maintainers = with maintainers; [ orivej ];
96   };