about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/spdk
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/spdk')
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/0001-fix-setuptools-installation.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/default.nix89
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/setuptools.patch25
3 files changed, 143 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/spdk/0001-fix-setuptools-installation.patch b/nixpkgs/pkgs/development/libraries/spdk/0001-fix-setuptools-installation.patch
new file mode 100644
index 000000000000..3c3fb50fc152
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spdk/0001-fix-setuptools-installation.patch
@@ -0,0 +1,29 @@
+From 3f718fc1873c9c138684ea019e9bd42c9b24506c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
+Date: Tue, 28 Nov 2023 11:28:11 +0100
+Subject: [PATCH] fix setuptools installation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+---
+ python/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/python/Makefile b/python/Makefile
+index f835daa..b41995a 100644
+--- a/python/Makefile
++++ b/python/Makefile
+@@ -12,7 +12,7 @@ setup_cmd += --root $(DESTDIR)
+ endif
+ 
+ ifneq ($(CONFIG_PYDIR),)
+-setup_cmd += --install-purelib $(CONFIG_PYDIR)
++setup_cmd += --root / --prefix $(CONFIG_PYDIR)
+ purelibdir := $(CONFIG_PYDIR)
+ else
+ purelibdir := $(shell python3 -c "import sysconfig; print(sysconfig.get_paths()['purelib'])")
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/spdk/default.nix b/nixpkgs/pkgs/development/libraries/spdk/default.nix
new file mode 100644
index 000000000000..c62f54b14091
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spdk/default.nix
@@ -0,0 +1,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 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spdk/setuptools.patch b/nixpkgs/pkgs/development/libraries/spdk/setuptools.patch
new file mode 100644
index 000000000000..b3e7644c0076
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spdk/setuptools.patch
@@ -0,0 +1,25 @@
+From 3a72290ba7e2d71ca887225fc0eb8792ca863be2 Mon Sep 17 00:00:00 2001
+From: Jörg Thalheim <joerg@thalheim.io>
+Date: Tue, 24 Oct 2023 14:30:53 +0200
+Subject: [PATCH] python: drop deprecated distutils
+
+This is scheduled for removal in python 3.12: https://docs.python.org/3/whatsnew/3.12.html
+
+Change-Id: I728dc0cf4ed20f22016d3d58cca8aee3af2bcd8b
+Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+---
+
+diff --git a/python/setup.py b/python/setup.py
+index 47e2104..ae4dff7 100755
+--- a/python/setup.py
++++ b/python/setup.py
+@@ -2,8 +2,7 @@
+ # SPDX-License-Identifier: BSD-3-Clause
+ # Copyright (C) 2023 Intel Corporation.  All rights reserved.
+ 
+-from distutils.core import setup
+-from setuptools import find_packages
++from setuptools import setup, find_packages
+ from spdk import __version__
+ 
+