pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rust193: replicate openssl-sys patch for earlier versions, allowing build...



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Sun Jan 25 09:02:51 2026 +0000
Changeset:	1237622489432fa50a2ea8eb465c4b866804a2c5

Modified Files:
	rust193/distinfo
Added Files:
	rust193/patches/patch-vendor_openssl-sys-0.9.111_build_find__normal.rs
	rust193/patches/patch-vendor_openssl-sys-0.9.111_build_main.rs

Log Message:
rust193: replicate openssl-sys patch for earlier versions, allowing build...

...for ilp32 NetBSD targets.  Perhaps oddly, 32-bit arm succeeds without,
but neither does powerpc nor i386.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1237622489432fa50a2ea8eb465c4b866804a2c5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust193/distinfo                                   |  2 ++
 ...endor_openssl-sys-0.9.111_build_find__normal.rs | 30 ++++++++++++++++++++++
 .../patch-vendor_openssl-sys-0.9.111_build_main.rs | 23 +++++++++++++++++
 3 files changed, 55 insertions(+)

diffs:
diff --git a/rust193/distinfo b/rust193/distinfo
index 7d7833f266..7bd923d6ea 100644
--- a/rust193/distinfo
+++ b/rust193/distinfo
@@ -164,6 +164,8 @@ SHA1 (patch-vendor_openssl-sys-0.9.107_build_find__normal.rs) = b3de2b9137882e36
 SHA1 (patch-vendor_openssl-sys-0.9.107_build_main.rs) = 46627c013821166688d16d97f6f8ff4ccb552241
 SHA1 (patch-vendor_openssl-sys-0.9.109_build_find__normal.rs) = 96b7b6067e857ef1ef4c8b832dcbe13496e21ca4
 SHA1 (patch-vendor_openssl-sys-0.9.109_build_main.rs) = bc892cf8e13b6b8c6e30804fa41696bcedbabde3
+SHA1 (patch-vendor_openssl-sys-0.9.111_build_find__normal.rs) = 7548f8ef9ae7e1771035814398d72bec867e59a7
+SHA1 (patch-vendor_openssl-sys-0.9.111_build_main.rs) = 87e4f6c55eaf88ebbc81ff927991d013bfca5a38
 SHA1 (patch-vendor_openssl-sys-0.9.92_build_find__normal.rs) = 0ed143b603eea7c0bddf39e97916608c58978202
 SHA1 (patch-vendor_openssl-sys-0.9.92_build_main.rs) = 842ad74284518fbe8ff65222f7f6f81fb6381e49
 SHA1 (patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs) = 4e86aec4c89db9a331950a12f8ec7b8aaa50eed7
diff --git a/rust193/patches/patch-vendor_openssl-sys-0.9.111_build_find__normal.rs b/rust193/patches/patch-vendor_openssl-sys-0.9.111_build_find__normal.rs
new file mode 100644
index 0000000000..96a2d0e1ba
--- /dev/null
+++ b/rust193/patches/patch-vendor_openssl-sys-0.9.111_build_find__normal.rs
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Add hack for Darwin when homebrew is installed.
+
+--- vendor/openssl-sys-0.9.111/build/find_normal.rs.orig	2026-01-25 08:56:08.257782732 +0000
++++ vendor/openssl-sys-0.9.111/build/find_normal.rs
+@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir: 
+ fn find_openssl_dir(target: &str) -> OsString {
+     let host = env::var("HOST").unwrap();
+ 
+-    if host == target && target.ends_with("-apple-darwin") {
+-        let homebrew_dir = match target {
+-            "aarch64-apple-darwin" => "/opt/homebrew",
+-            _ => "/usr/local",
+-        };
+-
+-        if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
+-            return dir.into();
+-        } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
+-            // pkgsrc
+-            return dir.into();
+-        } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
+-            // MacPorts
+-            return dir.into();
+-        }
+-    }
+-
+     try_pkg_config();
+     try_vcpkg();
+ 
diff --git a/rust193/patches/patch-vendor_openssl-sys-0.9.111_build_main.rs b/rust193/patches/patch-vendor_openssl-sys-0.9.111_build_main.rs
new file mode 100644
index 0000000000..fa70956e3f
--- /dev/null
+++ b/rust193/patches/patch-vendor_openssl-sys-0.9.111_build_main.rs
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Patterned after Linux and Android, on 32-bit NetBSD ports
+include -latomic.  Parts of this inspired by
+https://github.com/sfackler/rust-openssl/commit/a0a1d1d29263abb7c47fc2e58cef8dab13762a45
+
+--- vendor/openssl-sys-0.9.111/build/main.rs.orig	2026-01-25 08:57:28.677889187 +0000
++++ vendor/openssl-sys-0.9.111/build/main.rs
+@@ -279,6 +279,14 @@ fn main() {
+         println!("cargo:rustc-link-lib=atomic");
+     }
+ 
++    // Patterned of the above, make sure we include -latomic
++    // on ilp32 ports (yes, this only tests the "p32" part).
++    if env::var("CARGO_CFG_TARGET_OS").unwrap() == "netbsd"
++       && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
++    {
++        println!("cargo:rustc-link-lib=atomic");
++    }
++
+     if kind == "static" && target.contains("windows") {
+         println!("cargo:rustc-link-lib=dylib=gdi32");
+         println!("cargo:rustc-link-lib=dylib=user32");


Home | Main Index | Thread Index | Old Index