diff --git a/ports/libiconv/build.sh b/ports/libiconv/build.sh new file mode 100755 index 00000000..6ee141dd --- /dev/null +++ b/ports/libiconv/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash ../install.sh + +NAME='libiconv' +VERSION='1.18' +DOWNLOAD_URL="https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$VERSION.tar.gz#3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8" +CONFIG_SUB=('build-aux/config.sub' 'libcharset/build-aux/config.sub') +CONFIGURE_OPTIONS=( + '--disable-nls' + 'CFLAGS=-std=c11' +) + +pre_configure() { + echo '#include_next ' > srclib/sys_types.in.h +} + +post_install() { + # remove libtool file + rm -f $BANAN_SYSROOT/usr/lib/libcharset.la + rm -f $BANAN_SYSROOT/usr/lib/libiconv.la +} diff --git a/ports/libiconv/patches/0001-add-shared-library-support.patch b/ports/libiconv/patches/0001-add-shared-library-support.patch new file mode 100644 index 00000000..0d5828a5 --- /dev/null +++ b/ports/libiconv/patches/0001-add-shared-library-support.patch @@ -0,0 +1,31 @@ +diff -ruN libiconv-1.18/configure libiconv-1.18-banan_os/configure +--- libiconv-1.18/configure 2024-12-15 13:57:14.000000000 +0200 ++++ libiconv-1.18-banan_os/configure 2025-08-07 23:49:03.383717069 +0300 +@@ -8779,6 +8779,10 @@ + lt_cv_deplibs_check_method=pass_all + ;; + ++banan_os*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ + beos*) + lt_cv_deplibs_check_method=pass_all + ;; +@@ -14510,6 +14514,16 @@ + esac + ;; + ++banan_os*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ dynamic_linker="$host_os DynamicLoader.so" ++ shlibpath_var=LD_LIBRARY_PATH ++ ;; ++ + beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" diff --git a/ports/libiconv/patches/0002-implement-getprogname.patch b/ports/libiconv/patches/0002-implement-getprogname.patch new file mode 100644 index 00000000..20d9f192 --- /dev/null +++ b/ports/libiconv/patches/0002-implement-getprogname.patch @@ -0,0 +1,21 @@ +diff -ruN libiconv-1.18/srclib/getprogname.c libiconv-1.18-banan_os/srclib/getprogname.c +--- libiconv-1.18/srclib/getprogname.c 2024-07-12 14:55:16.000000000 +0300 ++++ libiconv-1.18-banan_os/srclib/getprogname.c 2025-08-07 23:42:50.691745454 +0300 +@@ -50,7 +50,7 @@ + # include + #endif + +-#if defined __SCO_VERSION__ || defined __sysv5__ ++#if defined __SCO_VERSION__ || defined __sysv5__ || defined __banan_os__ + # include + # include + #endif +@@ -265,7 +265,7 @@ + } + } + return NULL; +-# elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */ ++# elif defined __SCO_VERSION__ || defined __sysv5__ || defined __banan_os__ /* SCO OpenServer6/UnixWare */ + char buf[80]; + int fd; + sprintf (buf, "/proc/%d/cmdline", getpid()); diff --git a/userspace/libraries/LibC/include/iconv.h b/userspace/libraries/LibC/include/iconv.h deleted file mode 100644 index 587a7d2b..00000000 --- a/userspace/libraries/LibC/include/iconv.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _ICONV_H -#define _ICONV_H 1 - -// https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/iconv.h.html - -#include - -__BEGIN_DECLS - -#define __need_size_t -#include - -typedef void* iconv_t; - -size_t iconv(iconv_t cd, char** __restrict inbuf, size_t* __restrict inbytesleft, char** __restrict outbuf, size_t* __restrict outbytesleft); -int iconv_close(iconv_t cd); -iconv_t iconv_open(const char* tocode, const char* fromcode); - -__END_DECLS - -#endif