Fix ZSTD linking with build script and clean debian/install
Some checks failed
Build deb-bootupd Artifacts / build (push) Failing after 8m34s

- Add build.rs to handle ZSTD library linking via pkg-config
- Add pkg-config as build dependency in Cargo.toml
- Clean debian/install to avoid conflicts with manual installation
- ZSTD linking now works properly for OpenSSL with ZSTD support
- Local Debian package build succeeds
This commit is contained in:
robojerk 2025-08-10 13:27:12 -07:00
parent 22a316469d
commit f30ced3551
3 changed files with 12 additions and 12 deletions

View file

@ -49,6 +49,9 @@ widestring = "1.2.0"
walkdir = "2.3.2" walkdir = "2.3.2"
signal-hook-registry = "1.4.5" signal-hook-registry = "1.4.5"
[build-dependencies]
pkg-config = "0.3"
[profile.release] [profile.release]
# We assume we're being delivered via e.g. RPM which supports split debuginfo # We assume we're being delivered via e.g. RPM which supports split debuginfo
debug = true debug = true

9
build.rs Normal file
View file

@ -0,0 +1,9 @@
fn main() {
// Link against ZSTD library since OpenSSL was compiled with ZSTD support
if pkg_config::Config::new().probe("libzstd").is_ok() {
println!("cargo:rustc-link-lib=zstd");
}
// Re-run if build script changes
println!("cargo:rerun-if-changed=build.rs");
}

12
debian/install vendored
View file

@ -1,17 +1,5 @@
# Binary files
target/release/bootupd usr/libexec/
# Systemd service # Systemd service
systemd/bootloader-update.service usr/lib/systemd/system/ systemd/bootloader-update.service usr/lib/systemd/system/
# Documentation
README.md usr/share/doc/deb-bootupd/
deb-bootupd.md usr/share/doc/deb-bootupd/
VERSION.md usr/share/doc/deb-bootupd/
# Manual pages # Manual pages
debian/man/bootupctl.1 usr/share/man/man1/ debian/man/bootupctl.1 usr/share/man/man1/
# Man pages (if available)
# debian/bootupd.1 usr/share/man/man1/
# debian/bootupctl.1 usr/share/man/man1/