From 991cf74b46c9f90fbc222bd152572d789cc83e20 Mon Sep 17 00:00:00 2001 From: d2weber <29163905+d2weber@users.noreply.github.com> Date: Sat, 26 Sep 2026 11:03:58 +0200 Subject: [PATCH] fix: regenerate deltachat.pc if env changed Paths in deltachat.pc are passed via env variables to build.rs. With this fix, the pc will be regenerated if these env variables change. This came up when building via CMake: the paths depend on CMAKE_INSTALL_PREFIX, if the CMAKE_INSTALL_PREFIX changes during a reconfigure, deltachat.pc should have the corresponding paths adjusted. --- deltachat-ffi/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deltachat-ffi/build.rs b/deltachat-ffi/build.rs index f771f4f98c..2f460bea04 100644 --- a/deltachat-ffi/build.rs +++ b/deltachat-ffi/build.rs @@ -21,9 +21,9 @@ fn main() { url = env::var("CARGO_PKG_HOMEPAGE").unwrap_or_else(|_| "".to_string()), version = env::var("CARGO_PKG_VERSION").unwrap(), libs_priv = libs_priv, - prefix = env::var("PREFIX").unwrap_or_else(|_| "/usr/local".to_string()), - libdir = env::var("LIBDIR").unwrap_or_else(|_| "/usr/local/lib".to_string()), - includedir = env::var("INCLUDEDIR").unwrap_or_else(|_| "/usr/local/include".to_string()), + prefix = option_env!("PREFIX").unwrap_or_else(|| "/usr/local"), + libdir = option_env!("LIBDIR").unwrap_or_else(|| "/usr/local/lib"), + includedir = option_env!("INCLUDEDIR").unwrap_or_else(|| "/usr/local/include"), ); fs::create_dir_all(target_path.join("pkgconfig")).unwrap();