]> git.99rst.org Git - openwrt-packages.git/commitdiff
tvheadend: require GNU libiconv and drop the iconv self-test patch
authorJosef Schlehofer <redacted>
Fri, 21 Aug 2026 06:54:05 +0000 (08:54 +0200)
committerJosef Schlehofer <redacted>
Thu, 10 Sep 2026 06:53:25 +0000 (08:53 +0200)
tvheadend has no transliteration of its own.  It asks iconv for
"<charset>//TRANSLIT//IGNORE", a GNU extension that musl does not
implement.  Converting "ŽluťoučkýKůň" to ASCII on mpc85xx/p2020
(Turris 1.x), musl 1.2.6:

    charset                   musl             GNU libiconv
    ASCII//TRANSLIT//IGNORE   EINVAL           "Zlutouck'yKun"
    ASCII//TRANSLIT           EINVAL           "Zlutouck'yKun"
    ASCII                     "*lu*ou*k*K**"   EILSEQ

050-iconv-test-continue.patch removed the abort() from the startup
self-test that reports this, so the package could be built against
musl's iconv.  That silenced the check without fixing anything:
intlconv_utf8() still returns -EIO, so cleanup_filename() in
src/dvr/dvr_rec.c cannot build a recording file name and
pvr_generate_filename() fails.  The charset cannot be avoided either,
because intlconv_filesystem_charset() returns "ASCII" unless $LANG
names a UTF-8 locale, which OpenWrt does not set by default.

Depend on libiconv-full instead of $(ICONV_DEPENDS), which pulls it in
only when BUILD_NLS is set, and point the compiler at its staging prefix
when nls.mk has not already done so.  The binary then links against
libiconv.so.2, the self-test passes and the patch can be dropped.

Signed-off-by: Josef Schlehofer <redacted>
multimedia/tvheadend/Makefile
multimedia/tvheadend/patches/050-iconv-test-continue.patch [deleted file]

index 7d81c27d7d1ee7f01f01badd44621b347eae1514..c68eb12c174f18984244b26e891e482aa17755fd 100644 (file)
@@ -20,6 +20,15 @@ PKG_BUILD_DEPENDS:=gettext-full/host
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
+# tvheadend needs iconv //TRANSLIT to build recording file names, which musl
+# does not implement, so always build against GNU libiconv.
+# With BUILD_NLS set, nls.mk already adds these for the same prefix.
+ifneq ($(CONFIG_BUILD_NLS),y)
+       ICONV_FULL_PREFIX:=$(STAGING_DIR)/usr/lib/libiconv-full
+       TARGET_CFLAGS += -I$(ICONV_FULL_PREFIX)/include
+       TARGET_LDFLAGS += -L$(ICONV_FULL_PREFIX)/lib -Wl,-rpath-link=$(ICONV_FULL_PREFIX)/lib
+endif
+
 define Package/tvheadend
   SECTION:=multimedia
   CATEGORY:=Multimedia
@@ -32,7 +41,7 @@ define Package/tvheadend
        +librt \
        +libffi \
        +libopenssl \
-       $(ICONV_DEPENDS) \
+       +libiconv-full \
        +zlib \
        +TVHEADEND_AVAHI_SUPPORT:libavahi-client \
        +TVHEADEND_REGEX_PCRE2:libpcre2 \
diff --git a/multimedia/tvheadend/patches/050-iconv-test-continue.patch b/multimedia/tvheadend/patches/050-iconv-test-continue.patch
deleted file mode 100644 (file)
index bdfc435..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/intlconv.c
-+++ b/src/intlconv.c
-@@ -37,9 +37,8 @@ intlconv_test( void )
-       (strcmp(s, "ZlutouckyKun") &&
-        strcmp(s, "Zlutouck'yKun") &&
-        strcmp(s, "?lu?ou?k?K??"))) {
--    tvherror(LS_MAIN, "iconv() routine is not working properly (%s), aborting!", s);
-+    tvherror(LS_MAIN, "iconv() routine is not working properly (%s)", s);
-     tvh_safe_usleep(2000000);
--    abort();
-   }
-   free(s);
- }
git clone https://git.99rst.org/PROJECT