pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rust183: add use of patchelf in the install step.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Sun Jan 26 12:19:46 2025 +0100
Changeset:	643b92b0270478ff7e932715e0beb245235a1ca7

Modified Files:
	rust183/Makefile

Log Message:
rust183: add use of patchelf in the install step.

This so that the new rpath checks in pkgsrc pass, and the result
works as instended.  I suspect this is because we suppress $ORIGIN
rpaths in pkgsrc, as has been discussed on tech-pkg@.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=643b92b0270478ff7e932715e0beb245235a1ca7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust183/Makefile | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diffs:
diff --git a/rust183/Makefile b/rust183/Makefile
index 183b776489..e7c7e51f51 100644
--- a/rust183/Makefile
+++ b/rust183/Makefile
@@ -19,6 +19,10 @@ USE_LANGUAGES=		c c++
 USE_LIBTOOL=		yes
 USE_TOOLS+=		bash grep gmake perl:build pkg-config
 
+TOOL_DEPENDS+=		patchelf-[0-9]*:../../devel/patchelf
+
+FORCE_RPATH=		--force-rpath
+
 # This is a bug:
 #   https://github.com/rust-lang/rust/issues/130708
 # "Building rust 1.81.0 does network access in the "build" phase"
@@ -544,11 +548,28 @@ do-test:
 	${SETENV} ${MAKE_ENV}						\
 		${PYTHONBIN} ./x.py -v test -j ${_MAKE_JOBS_N}
 
+PATCH_BINARIES+=	bin/cargo
+PATCH_BINARIES+=	bin/cargo-clippy
+PATCH_BINARIES+=	bin/clippy-driver
+PATCH_BINARIES+=	bin/rust-analyzer
+PATCH_BINARIES+=	bin/rustc
+PATCH_BINARIES+=	bin/rustdoc
+PATCH_BINARIES+=	bin/rustfmt
+PATCH_BINARIES+=	libexec/rust-analyzer-proc-macro-srv
+
 do-install:
 	${RUN}${_ULIMIT_CMD}						\
 	cd ${WRKSRC} &&							\
 	${SETENV} ${MAKE_ENV} ${INSTALL_ENV} 				\
-		${PYTHONBIN} ./x.py -v install -j ${_MAKE_JOBS_N}
+		${PYTHONBIN} ./x.py -v install -j ${_MAKE_JOBS_N};	\
+	for bin in ${PATCH_BINARIES}; do				\
+		f=${DESTDIR}${PREFIX}/$${bin};				\
+		if [ -f $$f ]; then					\
+cmd="${PREFIX}/bin/patchelf ${FORCE_RPATH} --set-rpath ${PREFIX}/lib $$f"; \
+			echo $$cmd; 					\
+			$$cmd;						\
+		fi; 							\
+	done
 
 SUBST_CLASSES+=		destdir
 SUBST_STAGE.destdir=	post-install


Home | Main Index | Thread Index | Old Index