pkgsrc-WIP-changes archive

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

newsboat237: Explicitly use GNU iconv library symbols from Rust.



Module Name:	pkgsrc-wip
Committed By:	Taylor R Campbell <riastradh%NetBSD.org@localhost>
Pushed By:	riastradh
Date:		Tue Jan 21 21:06:02 2025 +0000
Changeset:	8c10f94655c73b2058f370e6926dca2e1c457f8f

Modified Files:
	newsboat237/Makefile
	newsboat237/distinfo
Added Files:
	newsboat237/patches/patch-rust_libnewsboat_src_utils.rs

Log Message:
newsboat237: Explicitly use GNU iconv library symbols from Rust.

The Rust code doesn't respect the declarations in iconv.h, so we have
to tell it explicitly what symbols to use.

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

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

diffstat:
 newsboat237/Makefile                               |  2 +-
 newsboat237/distinfo                               |  1 +
 .../patches/patch-rust_libnewsboat_src_utils.rs    | 31 ++++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)

diffs:
diff --git a/newsboat237/Makefile b/newsboat237/Makefile
index 747d8efe93..acba13c6bd 100644
--- a/newsboat237/Makefile
+++ b/newsboat237/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 DISTNAME=	newsboat-2.37
-PKGREVISION=	1
+PKGREVISION=	2
 CATEGORIES=	news
 MASTER_SITES=	https://newsboat.org/releases/2.37/
 EXTRACT_SUFX=	.tar.xz
diff --git a/newsboat237/distinfo b/newsboat237/distinfo
index a8a1487865..4690144ce1 100644
--- a/newsboat237/distinfo
+++ b/newsboat237/distinfo
@@ -729,3 +729,4 @@ Size (xdg-2.5.2.crate) = 14394 bytes
 SHA1 (patch-Makefile) = 8ad3625d15c5d1782a0848f77b24373273197819
 SHA1 (patch-config.sh) = af48319845183552a4d9cea2f117a948b059647d
 SHA1 (patch-newsboat.cpp) = fc29e931269dae31c61d2f15fb3a9da4fc63ca51
+SHA1 (patch-rust_libnewsboat_src_utils.rs) = 44ae16b60b75e8302dbe0cba09015ef6e14f8dc3
diff --git a/newsboat237/patches/patch-rust_libnewsboat_src_utils.rs b/newsboat237/patches/patch-rust_libnewsboat_src_utils.rs
new file mode 100644
index 0000000000..54bd147bc4
--- /dev/null
+++ b/newsboat237/patches/patch-rust_libnewsboat_src_utils.rs
@@ -0,0 +1,31 @@
+$NetBSD$
+
+Use GNU iconv symbols explicitly, since Rust doesn't consult the C
+header file.
+
+--- rust/libnewsboat/src/utils.rs.orig	2024-09-22 15:05:50.000000000 +0000
++++ rust/libnewsboat/src/utils.rs
+@@ -815,12 +815,15 @@ type iconv_t = *mut c_void;
+ // On FreeBSD, link with GNU libiconv; the iconv implementation in libc doesn't support //TRANSLIT
+ // and WCHAR_T. This is also why we change the symbol names from "iconv" to "libiconv" below.
+ #[cfg_attr(target_os = "freebsd", link(name = "iconv"))]
++#[cfg_attr(target_os = "netbsd", link(name = "iconv"))]
+ #[cfg_attr(target_os = "openbsd", link(name = "iconv"))]
+ extern "C" {
+     #[cfg_attr(target_os = "freebsd", link_name = "libiconv_open")]
++    #[cfg_attr(target_os = "netbsd", link_name = "libiconv_open")]
+     #[cfg_attr(target_os = "openbsd", link_name = "libiconv_open")]
+     pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t;
+     #[cfg_attr(target_os = "freebsd", link_name = "libiconv")]
++    #[cfg_attr(target_os = "netbsd", link_name = "libiconv")]
+     #[cfg_attr(target_os = "openbsd", link_name = "libiconv")]
+     pub fn iconv(
+         cd: iconv_t,
+@@ -830,6 +833,7 @@ extern "C" {
+         outbytesleft: *mut size_t,
+     ) -> size_t;
+     #[cfg_attr(target_os = "freebsd", link_name = "libiconv_close")]
++    #[cfg_attr(target_os = "netbsd", link_name = "libiconv_close")]
+     #[cfg_attr(target_os = "openbsd", link_name = "libiconv_close")]
+     pub fn iconv_close(cd: iconv_t) -> c_int;
+ }


Home | Main Index | Thread Index | Old Index