summaryrefslogtreecommitdiff
path: root/www/freenginx-acme/files
diff options
context:
space:
mode:
Diffstat (limited to 'www/freenginx-acme/files')
-rw-r--r--www/freenginx-acme/files/patch-build.rs37
-rw-r--r--www/freenginx-acme/files/patch-cargo-crates_nginx-sys-0.5.0_build_main.rs19
2 files changed, 56 insertions, 0 deletions
diff --git a/www/freenginx-acme/files/patch-build.rs b/www/freenginx-acme/files/patch-build.rs
new file mode 100644
index 000000000000..c45057b059a1
--- /dev/null
+++ b/www/freenginx-acme/files/patch-build.rs
@@ -0,0 +1,37 @@
+--- build.rs.orig 2025-10-08 22:59:16 UTC
++++ build.rs
+@@ -50,6 +50,11 @@ fn detect_nginx_features() {
+ if let Ok(os) = env::var("DEP_NGINX_OS") {
+ println!("cargo::rustc-cfg=ngx_os=\"{os}\"");
+ }
++ // Read nginx name detected by nginx-sys and pass to the compiler.
++ println!("cargo::rerun-if-env-changed=DEP_NGINX_NAME");
++ if let Ok(ngx_name) = env::var("DEP_NGINX_NAME") {
++ println!("cargo::rustc-cfg=ngx_name=\"{ngx_name}\"");
++ }
+
+ // Generate cfg values for version checks
+
+@@ -58,13 +63,16 @@ fn detect_nginx_features() {
+ println!("cargo::rerun-if-env-changed=DEP_NGINX_VERSION_NUMBER");
+ if let Ok(version) = env::var("DEP_NGINX_VERSION_NUMBER") {
+ let version: u64 = version.parse().unwrap();
++ let ngx_name: String = env::var("DEP_NGINX_NAME").unwrap_or("any()".to_string());
+
+- if version >= 1_027_002 {
+- println!("cargo::rustc-cfg=ngx_ssl_cache");
+- }
+-
+- if version >= 1_029_002 {
+- println!("cargo::rustc-cfg=ngx_ssl_client_hello_cb");
++ if ngx_name != "freenginx" {
++ if version >= 1_027_002 {
++ println!("cargo::rustc-cfg=ngx_ssl_cache");
++ }
++
++ if version >= 1_029_002 {
++ println!("cargo::rustc-cfg=ngx_ssl_client_hello_cb");
++ }
+ }
+ }
+ }
diff --git a/www/freenginx-acme/files/patch-cargo-crates_nginx-sys-0.5.0_build_main.rs b/www/freenginx-acme/files/patch-cargo-crates_nginx-sys-0.5.0_build_main.rs
new file mode 100644
index 000000000000..079db70f01b4
--- /dev/null
+++ b/www/freenginx-acme/files/patch-cargo-crates_nginx-sys-0.5.0_build_main.rs
@@ -0,0 +1,19 @@
+--- cargo-crates/nginx-sys-0.5.0/build/main.rs.orig 2006-07-24 01:21:28 UTC
++++ cargo-crates/nginx-sys-0.5.0/build/main.rs
+@@ -364,6 +364,8 @@ pub fn print_cargo_metadata<T: AsRef<Path>>(
+
+ if name == "nginx_build" {
+ println!("cargo::metadata=build={}", unquote(value));
++ } else if name == "nginx_name" {
++ println!("cargo::metadata=name={}", unquote(value));
+ } else if name == "nginx_version" {
+ println!("cargo::metadata=version={}", unquote(value));
+ } else if name == "nginx_version_number" {
+@@ -453,6 +455,7 @@ RUST_CONF_NGINX_BUILD=NGINX_VER_BUILD
+ #endif
+
+ RUST_CONF_NGINX_BUILD=NGINX_VER_BUILD
++RUST_CONF_NGINX_NAME=NGINX_NAME
+ RUST_CONF_NGINX_VERSION=NGINX_VER
+ RUST_CONF_NGINX_VERSION_NUMBER=nginx_version
+ "