From f2ae6ba8091646583dcaebe2cd5146ce716ab528 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 8 Oct 2022 19:02:47 +0800 Subject: [PATCH] rustc: demote curl and libssh2 to recommended And, adjust LIBSSH2_SYS_USE_PKG_CONFIG according to if libssh2 is installed. Export it earlier so x.py build and x.py install will use the same LIBSSH2_SYS_USE_PKG_CONFIG value. This can reduce some repeated building process. --- general/prog/rust.xml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/general/prog/rust.xml b/general/prog/rust.xml index d3cf0d3015..70428b9949 100644 --- a/general/prog/rust.xml +++ b/general/prog/rust.xml @@ -200,18 +200,25 @@ Required - , - , and - + Recommended + , + , and (built with -DLLVM_LINK_LLVM_DYLIB=ON so that rust can link to system LLVM instead of building its shipped version) + + + If a recommended dependency is not installed, a shipped copy in the + Rustc source tarball will be built and used. + + + Optional (used by the testsuite if it is present) @@ -336,6 +343,8 @@ EOF src/tools/cargo/Cargo.toml && --> export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" && +{ [ ! -e /usr/include/libssh2.h ] || + export LIBSSH2_SYS_USE_PKG_CONFIG=1; } && python3 ./x.py build --exclude src/tools/miri @@ -414,8 +423,7 @@ python3 ./x.py build --exclude src/tools/miri Still as your normal user, do a DESTDIR install: -export LIBSSH2_SYS_USE_PKG_CONFIG=1 && -DESTDIR=${PWD}/install python3 ./x.py install && +DESTDIR=${PWD}/install python3 ./x.py install && unset LIBSSH2_SYS_USE_PKG_CONFIG @@ -512,11 +520,10 @@ cp -a install/* / will not stop at the first error. + - export LIBSSH2_SYS_USE_PKG_CONFIG=1: On some systems, - cairo fails to link during the install because it cannot find libssh2. - This seems to fix it, but again the reason why the problem occurs is not - understood. + export LIBSSH2_SYS_USE_PKG_CONFIG=1: Allow + cargo to link to system libssh2.