diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/spdk')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/spdk/default.nix | 67 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch | 17 |
2 files changed, 84 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/spdk/default.nix b/nixpkgs/pkgs/development/libraries/spdk/default.nix new file mode 100644 index 000000000000..a0c875079c44 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/spdk/default.nix @@ -0,0 +1,67 @@ +{ lib, stdenv +, fetchurl +, fetchFromGitHub +, fetchpatch +, ncurses +, python3 +, cunit +, dpdk +, libaio +, libbsd +, libuuid +, numactl +, openssl +}: + +let + dpdk-compat-patch = fetchurl { + url = "https://review.spdk.io/gerrit/plugins/gitiles/spdk/spdk/+/6acb9a58755856fb9316baf9dbbb7239dc6b9446%5E%21/?format=TEXT"; + sha256 = "18q0956fkjw19r29hp16x4pygkfv01alj9cld2wlqqyfgp41nhn0"; + }; +in stdenv.mkDerivation rec { + pname = "spdk"; + version = "20.04.1"; + + src = fetchFromGitHub { + owner = "spdk"; + repo = "spdk"; + rev = "v${version}"; + sha256 = "ApMyGamPrMalzZLbVkJlcwatiB8dOJmoxesdjkWZElk="; + }; + + patches = [ + ./spdk-dpdk-meson.patch + # https://review.spdk.io/gerrit/c/spdk/spdk/+/3134 + (fetchpatch { + url = "https://github.com/spdk/spdk/commit/c954b5b722c5c163774d3598458ff726c48852ab.patch"; + sha256 = "1n149hva5qxmpr0nmav10nya7zklafxi136f809clv8pag84g698"; + }) + ]; + + nativeBuildInputs = [ + python3 + ]; + + buildInputs = [ + cunit dpdk libaio libbsd libuuid numactl openssl ncurses + ]; + + postPatch = '' + patchShebangs . + base64 -d ${dpdk-compat-patch} | patch -p1 + ''; + + configureFlags = [ "--with-dpdk=${dpdk}" ]; + + NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile. + + enableParallelBuilding = true; + + 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/spdk-dpdk-meson.patch b/nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch new file mode 100644 index 000000000000..9cc6d89ce50e --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch @@ -0,0 +1,17 @@ +1. dpdk built with meson generates rte_build_config.h rather than rte_config.h. +2. dpdk configured with libbsd requires that dependents link with libbsd. + +--- a/lib/env_dpdk/env.mk ++++ b/lib/env_dpdk/env.mk +@@ -140,6 +140,9 @@ endif + +-ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_config.h)) +-ifneq (,$(shell grep -e "define RTE_LIBRTE_VHOST_NUMA 1" -e "define RTE_EAL_NUMA_AWARE_HUGEPAGES 1" $(DPDK_INC_DIR)/rte_config.h)) ++ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_build_config.h)) ++ifneq (,$(shell grep -e "define RTE_LIBRTE_VHOST_NUMA 1" -e "define RTE_EAL_NUMA_AWARE_HUGEPAGES 1" $(DPDK_INC_DIR)/rte_build_config.h)) + ENV_LINKER_ARGS += -lnuma + endif ++ifneq (,$(shell grep -e "define RTE_USE_LIBBSD 1" $(DPDK_INC_DIR)/rte_build_config.h)) ++ENV_LINKER_ARGS += -lbsd ++endif + endif |