asterisk-chan-dongle: adapt BUILD_NLS handling 775/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Sat, 16 Jul 2022 18:24:48 +0000 (20:24 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sat, 16 Jul 2022 18:34:25 +0000 (20:34 +0200)
openwrt recently stopped using libiconv-stub in the BUILD_NLS=n case.
Instead the libc's iconv has to be used.

This commit changes the iconv include path passed to
asterisk-chan-dongle for the BUILD_NLS=n case to
$(TOOLCHAIN_DIR)/include. That's where musl and glibc store iconv.h.

Also, the patch 200-fix-iconv-detection.patch gets replaced with a sed
script that only runs in the BUILD_NLS=y case.

And finally, $(AUTORELEASE) is added.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk-chan-dongle/Makefile
net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch [deleted file]

index 297a74810a2f3bdaf9d0b79746eb1ccefadfd32c..7276d049cd348159c203c63a851c9914f7de4e1f 100644 (file)
@@ -13,7 +13,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/wdoekes/asterisk-chan-dongle.git
 PKG_SOURCE_VERSION:=3d046f7d6842298c6838b5ce5b51d495d383b158
 PKG_SOURCE_DATE=2021-10-06
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 PKG_MIRROR_HASH:=d485c89a7230ab8c318eed6c3a954b154d7e53cc7a0194abf96f4dcb83e6909c
 
 PKG_FIXUP:=autoreconf
@@ -43,8 +43,13 @@ endef
 
 CONFIGURE_ARGS+= \
        --with-asterisk=$(STAGING_DIR)/usr/include \
-       --with-astversion=18 \
-       --with-iconv=$(ICONV_PREFIX)/include
+       --with-astversion=18
+
+ifeq ($(CONFIG_BUILD_NLS),y)
+CONFIGURE_ARGS+=--with-iconv=$(ICONV_PREFIX)/include
+else
+CONFIGURE_ARGS+=--with-iconv=$(TOOLCHAIN_DIR)/include
+endif
 
 MAKE_FLAGS+=LD="$(TARGET_CC)"
 
@@ -79,4 +84,14 @@ fi
 exit 0
 endef
 
+define Build/Prepare
+       $(call Build/Prepare/Default)
+ifeq ($(QUILT),)
+ifeq ($(CONFIG_BUILD_NLS),y)
+       $(SED) 's/\[iconv\], \[c iconv\]/[libiconv], [iconv]/' \
+               "$(PKG_BUILD_DIR)/configure.ac"
+endif
+endif
+endef
+
 $(eval $(call BuildPackage,asterisk-chan-dongle))
diff --git a/net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch b/net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch
deleted file mode 100644 (file)
index cd39b16..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -90,7 +90,7 @@ fi
- dnl Checks for libraries.
- dnl AC_CHECK_LIB([pthread], [pthread_create])  # should use ast_pthread_join everywhere?
--AC_SEARCH_LIBS([iconv], [c iconv],,AC_MSG_ERROR([iconv library missing]))
-+AC_SEARCH_LIBS([libiconv], [iconv],,AC_MSG_ERROR([iconv library missing]))
- AC_CHECK_LIB([sqlite3], [sqlite3_open],,AC_MSG_ERROR([sqlite3 library missing]))
- dnl Checks for header files.