about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/spdk/default.nix
blob: c62f54b14091210a1e06fdf0d395d37a6d9d5618 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{ lib, stdenv
, fetchFromGitHub
, ncurses
, python3
, cunit
, dpdk
, libaio
, libbsd
, libuuid
, numactl
, openssl
, pkg-config
, zlib
, libpcap
, libnl
, libelf
, jansson
, ensureNewerSourcesForZipFilesHook
}:

stdenv.mkDerivation rec {
  pname = "spdk";

  version = "23.09";

  src = fetchFromGitHub {
    owner = "spdk";
    repo = "spdk";
    rev = "v${version}";
    sha256 = "sha256-P10NDa+MIEY8B3bu34Dq2keyuv2a24XV5Wf+Ah701b8=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    python3
    python3.pkgs.setuptools
    pkg-config
    ensureNewerSourcesForZipFilesHook
  ];

  buildInputs = [
    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
    ./0001-fix-setuptools-installation.patch
  ];

  postPatch = ''
    patchShebangs .
  '';

  enableParallelBuilding = true;

  configureFlags = [
    "--with-dpdk=${dpdk}"
    "--pydir=${placeholder "out"}"
  ];

  postCheck = ''
    python3 -m spdk
  '';

  env.NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
  # otherwise does not find strncpy when compiling
  env.NIX_LDFLAGS = "-lbsd";

  meta = with lib; {
    description = "Set of libraries for fast user-mode storage";
    homepage = "https://spdk.io/";
    license = licenses.bsd3;
    platforms =  [ "x86_64-linux" ];
    maintainers = with maintainers; [ orivej ];
  };
}