pkgsrc-Users archive

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

Re: lang/rust still looks in /usr/pkg/



> Why can't the package run patchelf on the bootstrap kit's binaries
> automatically? It's already aware of the user's PREFIX.

Of course, my thinking was ... a bit off.

How does this diff look?

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/Makefile,v
retrieving revision 1.208
diff -u -r1.208 Makefile
--- Makefile	29 Nov 2020 20:15:15 -0000	1.208
+++ Makefile	13 Dec 2020 11:56:13 -0000
@@ -330,6 +330,12 @@
 SUBST_SED.cksum+=	-e 's,${from},${to},g'
 .endfor
 
+.if ${OPSYS} == "NetBSD"
+TOOL_DEPENDS+=	patchelf-[0-9]*:../../devel/patchelf
+PATCHELF=	${PREFIX}/bin/patchelf
+FORCE_RPATH=	--force-rpath
+.endif
+
 post-extract:
 	set -e;									\
 	if ${TEST} -e ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/install.sh	\
@@ -351,6 +357,12 @@
 	${LN} -s gcc-wrap c++-wrap; \
 	${LN} -s gcc-wrap clang++-wrap; \
 	${LN} -s gcc-wrap clang-wrap
+	# Fixup cargo rpath to pick up libcurl.so
+	RPATH='${PREFIX}/lib:/lib:/usr/lib:$$ORIGIN/../lib'; \
+	for f in bin/cargo; do \
+		f=${RUST_BOOTSTRAP_PATH:Q}/$$f; \
+		${PATCHELF} ${FORCE_RPATH} --set-rpath $${RPATH} $$f; \
+	done
 .endif
 
 .if ${OPSYS} == "FreeBSD"

It's either that or modifying PKGSRC_MAKE_ENV by adding
${PREFIX}/lib tere.

Regards,

- Håvard


Home | Main Index | Thread Index | Old Index