From a28c46933ef5038fb7a2dd483b85152a539c7969 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Mon, 15 Jul 2024 14:52:34 +0100 Subject: [PATCH] spdk: Fix RPATH in build --- pkgs/by-name/sp/spdk/package.nix | 8 ++++---- pkgs/by-name/sp/spdk/revert-patchelf.patch | 24 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 pkgs/by-name/sp/spdk/revert-patchelf.patch diff --git a/pkgs/by-name/sp/spdk/package.nix b/pkgs/by-name/sp/spdk/package.nix index b61179275506..5be71412e89c 100644 --- a/pkgs/by-name/sp/spdk/package.nix +++ b/pkgs/by-name/sp/spdk/package.nix @@ -33,6 +33,10 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + ./revert-patchelf.patch + ]; + nativeBuildInputs = [ python3 python3.pkgs.pip @@ -83,10 +87,6 @@ stdenv.mkDerivation rec { wrapPythonPrograms ''; - 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/"; diff --git a/pkgs/by-name/sp/spdk/revert-patchelf.patch b/pkgs/by-name/sp/spdk/revert-patchelf.patch new file mode 100644 index 000000000000..01cc2b6af720 --- /dev/null +++ b/pkgs/by-name/sp/spdk/revert-patchelf.patch @@ -0,0 +1,24 @@ +diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk +index 19f0192c2..90a40c86f 100644 +--- a/mk/spdk.common.mk ++++ b/mk/spdk.common.mk +@@ -501,8 +501,7 @@ UNINSTALL_SHARED_LIB=\ + INSTALL_APP=\ + $(Q)echo " INSTALL $(DESTDIR)$(bindir)/$(notdir $<)"; \ + install -d -m 755 "$(DESTDIR)$(bindir)"; \ +- install -m 755 "$<" "$(DESTDIR)$(bindir)/"; \ +- patchelf --remove-rpath "$(DESTDIR)$(bindir)/$(notdir $<)" || true ++ install -m 755 "$<" "$(DESTDIR)$(bindir)/"; + + # Uninstall an app binary + UNINSTALL_APP=\ +@@ -513,8 +512,7 @@ UNINSTALL_APP=\ + INSTALL_EXAMPLE=\ + $(Q)echo " INSTALL $(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \ + install -d -m 755 "$(DESTDIR)$(bindir)"; \ +- install -m 755 "$<" "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \ +- patchelf --remove-rpath "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))/$(notdir $<)" || true ++ install -m 755 "$<" "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; + + # Uninstall an example binary + UNINSTALL_EXAMPLE=\