spdk: Fix RPATH in build

This commit is contained in:
Jack O'Sullivan 2024-07-15 14:52:34 +01:00
parent 341a4c486f
commit e0a3f4e2bb
2 changed files with 28 additions and 4 deletions

View File

@ -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/";

View File

@ -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=\