Skip to content

Commit 11014f6

Browse files
vtjnashKristofferC
authored andcommitted
deps: fix rpath of 7z after moving to libexecdir (#60098)
(cherry picked from commit 8795edd)
1 parent 013c7af commit 11014f6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Make.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ $(foreach D,build_libdir build_private_libdir,$(eval $(call cache_rel_path,$(D),
381381
# Save a special one: reverse_private_libdir_rel: usually just `../`, but good to be general:
382382
reverse_private_libdir_rel_eval = $(call rel_path,$(private_libdir),$(libdir))
383383
reverse_private_libdir_rel = $(call hit_cache,reverse_private_libdir_rel_eval)
384+
reverse_private_libexecdir_rel_eval = $(call rel_path,$(private_libexecdir),$(libdir))
385+
reverse_private_libexecdir_rel = $(call hit_cache,reverse_private_libexecdir_rel_eval)
386+
reverse_build_private_libexecdir_rel_eval = $(call rel_path,$(build_private_libexecdir),$(build_libdir))
387+
reverse_build_private_libexecdir_rel = $(call hit_cache,reverse_build_private_libexecdir_rel_eval)
384388

385389
INSTALL_F := $(JULIAHOME)/contrib/install.sh 644
386390
INSTALL_M := $(JULIAHOME)/contrib/install.sh 755

deps/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ endif
7272
endif
7373
endif
7474

75+
PATCHELF_MANIFEST :=
7576
ifneq (,$(findstring $(OS),Linux FreeBSD OpenBSD))
7677
ifeq ($(USE_SYSTEM_PATCHELF), 0)
7778
DEP_LIBS += patchelf
7879
PATCHELF:=$(build_depsbindir)/patchelf
80+
PATCHELF_MANIFEST:=$(build_prefix)/manifest/patchelf
7981
else
8082
PATCHELF:=patchelf
8183
endif

deps/p7zip.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ $(eval $(call bb-install,p7zip,P7ZIP,false))
5151
# move from bindir to shlibdir, where we expect to install it
5252
install-p7zip: post-install-p7zip
5353
uninstall-p7zip: pre-uninstall-p7zip
54-
post-install-p7zip: $(build_prefix)/manifest/p7zip
54+
post-install-p7zip: $(build_prefix)/manifest/p7zip $(PATCHELF_MANIFEST)
5555
mkdir -p $(build_private_libexecdir)/
5656
[ ! -e $(build_bindir)/7z$(EXE) ] || mv $(build_bindir)/7z$(EXE) $(build_private_libexecdir)/7z$(EXE)
5757
[ -e $(build_private_libexecdir)/7z$(EXE) ]
58+
ifneq (,$(findstring $(OS),Linux FreeBSD))
59+
[ -L $(build_private_libexecdir)/7z ] || \
60+
$(PATCHELF) $(PATCHELF_SET_RPATH_ARG) '$$ORIGIN/$(reverse_build_private_libexecdir_rel)' $(build_private_libexecdir)/7z$(EXE)
61+
endif
5862
pre-uninstall-p7zip:
5963
-rm -f $(build_private_libexecdir)/7z$(EXE)
6064

0 commit comments

Comments
 (0)