From 4a3a1e066c1ac1532ee39936f0bf38797ae7cad5 Mon Sep 17 00:00:00 2001 From: Al Johri Date: Wed, 30 Sep 2026 03:14:54 -0400 Subject: [PATCH] Write libssh2.pc with paths relative to pcfiledir Root cause: build.rs substituted absolute OUT_DIR paths into the .pc and used placeholder names libssh2.pc.in no longer has, so Version, Requires and Libs kept literal @...@ tokens. libdir also pointed at lib/, while the archive is built into build/. --- libssh2-sys/build.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index a96f22ae..59598ebb 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -183,13 +183,15 @@ fn main() { pkgconfig.join("libssh2.pc"), fs::read_to_string("libssh2/libssh2.pc.in") .unwrap() - .replace("@prefix@", dst.to_str().unwrap()) + .replace("@prefix@", "${pcfiledir}/../..") .replace("@exec_prefix@", "") - .replace("@libdir@", dst.join("lib").to_str().unwrap()) - .replace("@includedir@", include.to_str().unwrap()) - .replace("@LIBS@", "") - .replace("@LIBSREQUIRED@", "") - .replace("@LIBSSH2VER@", version), + .replace("@libdir@", "${prefix}/build") + .replace("@includedir@", "${prefix}/include") + .replace("@LIBSSH2_PC_REQUIRES@", "") + .replace("@LIBSSH2_PC_REQUIRES_PRIVATE@", "") + .replace("@LIBSSH2_PC_LIBS@", "") + .replace("@LIBSSH2_PC_LIBS_PRIVATE@", "") + .replace("@LIBSSH2_VERSION@", version), ) .unwrap();