fix: improve CSC criteria support

This commit is contained in:
Kevin Yue committed 2026-05-11 21:38:35 +08:00
1 parent 1efb9a86e6
commit 5974a60b59
10 files changed
+460 -106

No files matched your search

+9 -5
View File
@@ -1,6 +1,10 @@
use std::{env, path::PathBuf, process::Command};
use std::{
env,
path::{Path, PathBuf},
process::Command,
};
fn apply_patches(patches_dir: &PathBuf, build_src: &PathBuf) {
fn apply_patches(patches_dir: &Path, build_src: &Path) {
let patches = std::fs::read_dir(patches_dir)
.expect("Failed to read patches directory")
.filter_map(|entry| entry.ok())
@@ -30,7 +34,7 @@ fn apply_patches(patches_dir: &PathBuf, build_src: &PathBuf) {
}
}
fn build_libxml2(deps_dir: &PathBuf, out_dir: &PathBuf) -> PathBuf {
fn build_libxml2(deps_dir: &Path, out_dir: &Path) -> PathBuf {
let libxml2_dir = deps_dir.join("libxml2");
// The temporary location where we will build
@@ -89,7 +93,7 @@ fn build_libxml2(deps_dir: &PathBuf, out_dir: &PathBuf) -> PathBuf {
dst
}
fn build_openconnect(deps_dir: &PathBuf, out_dir: &PathBuf) -> PathBuf {
fn build_openconnect(deps_dir: &Path, out_dir: &Path) -> PathBuf {
let openconnect_dir = deps_dir.join("openconnect");
let patches_dir = deps_dir.join("patches");
@@ -200,6 +204,6 @@ fn main() {
cc::Build::new()
.file("src/ffi/vpn.c")
.include("src/ffi")
.include(&oc_dst.join("include"))
.include(oc_dst.join("include"))
.compile("vpn");
}
+2 -2
View File
@@ -44,11 +44,11 @@ fn find_executable(locations: &[&'static str]) -> Option<&'static str> {
}
pub fn find_vpnc_script() -> Option<&'static str> {
find_executable(&VPNC_SCRIPT_LOCATIONS)
find_executable(VPNC_SCRIPT_LOCATIONS)
}
pub fn find_csd_wrapper() -> Option<&'static str> {
find_executable(&CSD_WRAPPER_LOCATIONS)
find_executable(CSD_WRAPPER_LOCATIONS)
}
/// If file exists, check if it is executable