tech-pkg archive

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

builtin libiconv on macOS 13+



Greetings,

Starting with macOS 13, the built-in version of iconv has been changed from GNU to Citrus. Our converters/libiconv/builtin.mk is not able to detect it, because it expects that libiconv.* does not exist, while there is one shipped with Xcode:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libiconv.2.tbd.

In my opinion, it should be preferable to use system iconv. I've encountered problems with some Rust crates, which couldn't be linked properly when two conflicting libiconvs exist - the one from the system, and another from pkgsrc.

Below is a patch I use to fix the problem. By the way, I've also removed empty :U operators, which I think are superfluous - correct me if I'm wrong.

If there is no objection, I would like to commit the change.

Kind regards,
Adam



--- builtin.mk	23 Jan 2023 15:22:24 -0000	1.26
+++ builtin.mk	13 Nov 2023 20:40:29 -0000
@@ -30,7 +30,7 @@
 IS_BUILTIN.iconv=	no
 .  if empty(H_ICONV:M__nonexistent__) && \
       empty(H_ICONV:M${LOCALBASE}/*) && \
-      ${BUILTIN_LIB_FOUND.iconv:U:tl} == yes
+      ${BUILTIN_LIB_FOUND.iconv:tl} == yes
 IS_BUILTIN.iconv=	yes
 .  endif
 .endif
@@ -95,7 +95,7 @@
 # XXX
 .    if empty(H_GLIBC_ICONV:M__nonexistent__) && \
 	empty(H_GLIBC_ICONV:M${LOCALBASE}/*) && \
-	${BUILTIN_LIB_FOUND.iconv:U:tl} == no
+	${BUILTIN_LIB_FOUND.iconv:tl} == no
 USE_BUILTIN.iconv=	yes
 H_ICONV=		${H_GLIBC_ICONV}
 .    endif
@@ -105,7 +105,7 @@
 # XXX
 .    if empty(H_CITRUS_ICONV:M__nonexistent__) && \
 	empty(H_CITRUS_ICONV:M${LOCALBASE}/*) && \
-	${BUILTIN_LIB_FOUND.iconv:U:tl} == no
+	(${BUILTIN_LIB_FOUND.iconv:tl} == no || ${OPSYS} == "Darwin")
 USE_BUILTIN.iconv=	yes
 H_ICONV=		${H_CITRUS_ICONV}
 .    endif
@@ -135,7 +135,7 @@
 # Define BUILTIN_LIBNAME.iconv to be the base name of the built-in
 # iconv library.
 #
-.if ${BUILTIN_LIB_FOUND.iconv:U:tl} == yes
+.if ${BUILTIN_LIB_FOUND.iconv:tl} == yes
 BUILTIN_LIBNAME.iconv=	iconv
 .else
 BUILTIN_LIBNAME.iconv=	# empty (part of the C library)
@@ -166,7 +166,7 @@
 .    endif
 .  endif
 
-.  if defined(GNU_CONFIGURE) && ${GNU_CONFIGURE_ICONV:Uyes:M[yY][eE][sS]}
+.  if defined(GNU_CONFIGURE) && ${GNU_CONFIGURE_ICONV:Uyes:tl} == yes
 .    if ${USE_BUILTIN.iconv:tl} == no
 CONFIGURE_ARGS+=	--with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
 .    endif



Home | Main Index | Thread Index | Old Index