From 42574d54d4e864adeb4b00364069c963a685338d Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 6 Nov 2021 12:24:36 +0100 Subject: [PATCH 1/3] freeswitch: only include python3-version.mk We're just interested in the version, no need to include more than that. Signed-off-by: Sebastian Kemper --- net/freeswitch/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/freeswitch/Makefile b/net/freeswitch/Makefile index 84fe116..a3db3dc 100644 --- a/net/freeswitch/Makefile +++ b/net/freeswitch/Makefile @@ -234,7 +234,7 @@ include $(INCLUDE_DIR)/nls.mk FS_PERL_FEED:=$(TOPDIR)/feeds/packages/lang/perl -include $(TOPDIR)/feeds/packages/lang/python/python3-host.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-version.mk include $(FS_PERL_FEED)/perlver.mk PERL_SITELIB:=/usr/lib/perl$(PERL_MAJOR)/$(PERL_VERSION2) From eb145cd014cc210c3a41f4341e139b1f9bda407d Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 6 Nov 2021 12:25:54 +0100 Subject: [PATCH 2/3] freeswitch: don't check for distutils We're not using distutils, so don't check for it. This fixes #704. Signed-off-by: Sebastian Kemper --- .../460-remove-python-configure-checks.patch | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/net/freeswitch/patches/460-remove-python-configure-checks.patch b/net/freeswitch/patches/460-remove-python-configure-checks.patch index ccbedda..79f8e26 100644 --- a/net/freeswitch/patches/460-remove-python-configure-checks.patch +++ b/net/freeswitch/patches/460-remove-python-configure-checks.patch @@ -1,6 +1,25 @@ --- a/configure.ac +++ b/configure.ac -@@ -1865,24 +1865,12 @@ then +@@ -1853,36 +1853,24 @@ then + fi + AC_MSG_RESULT([$PYTHON3_VER]) + +- AC_MSG_CHECKING([for python3 distutils]) +- python3_result="`$PYTHON3 -c 'import distutils;' 2>&1`" +- if test -z "$python3_result" ; then ++ #AC_MSG_CHECKING([for python3 distutils]) ++ #python3_result="`$PYTHON3 -c 'import distutils;' 2>&1`" ++ #if test -z "$python3_result" ; then + python3_has_distutils="yes" +- else +- python3_has_distutils="no" +- fi +- AC_MSG_RESULT([$python3_has_distutils]) ++ #else ++ # python3_has_distutils="no" ++ #fi ++ #AC_MSG_RESULT([$python3_has_distutils]) + if test "$python3_has_distutils" != "no" ; then AC_MSG_CHECKING([location of python3 site-packages]) From 6004044dc0cd2aa434d75b195d1669f428acc9b7 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 6 Nov 2021 12:29:16 +0100 Subject: [PATCH 3/3] freeswitch: update 480-fix-libyuv-dependency.patch Update the patch with the version that actually was applied upstream. No functional change. Signed-off-by: Sebastian Kemper --- .../patches/480-fix-libyuv-dependency.patch | 114 +++++++++++------- 1 file changed, 73 insertions(+), 41 deletions(-) diff --git a/net/freeswitch/patches/480-fix-libyuv-dependency.patch b/net/freeswitch/patches/480-fix-libyuv-dependency.patch index 9c5f851..0dbc19e 100644 --- a/net/freeswitch/patches/480-fix-libyuv-dependency.patch +++ b/net/freeswitch/patches/480-fix-libyuv-dependency.patch @@ -1,55 +1,87 @@ ---- a/src/include/switch_core_video.h -+++ b/src/include/switch_core_video.h -@@ -394,6 +394,7 @@ SWITCH_DECLARE(switch_image_t *) switch_ - SWITCH_DECLARE(switch_status_t) switch_img_write_png(switch_image_t *img, char *file_name); - SWITCH_DECLARE(switch_status_t) switch_png_open(switch_png_t **pngP, const char *file_name); - SWITCH_DECLARE(void) switch_png_free(switch_png_t **pngP); -+#ifdef SWITCH_HAVE_YUV - SWITCH_DECLARE(switch_status_t) switch_img_data_url_png(switch_image_t *img, char **urlP); - SWITCH_DECLARE(switch_status_t) switch_img_data_url(switch_image_t *img, char **urlP, const char *type, int quality); - -@@ -405,6 +406,7 @@ SWITCH_DECLARE(switch_image_t *) switch_ - * \param[in] quality Only used in jpg, 1 ~ 100 - */ - SWITCH_DECLARE(switch_status_t) switch_img_write_to_file(switch_image_t *img, const char* file_name, int quality); -+#endif - - /*!\brief put a small img over a big IMG at position x,y, with alpha transparency - * +commit a2ce46c6fde38d6ac54a8a2ee1a5b391e2ed2071 +Author: Sebastian Kemper +Date: Mon Nov 1 09:59:09 2021 +0100 + + [core] fix "--disable-libyuv" + + Recent changes made it impossible to compile freeswitch without libyuv + support. + + src/switch_core_video.c: In function 'switch_img_read_from_file': + src/switch_core_video.c:3139:4: error: implicit declaration of function 'RAWToI420' [-Werror=implicit-function-declaration] + RAWToI420(data, width * 3, + ^ + src/switch_core_video.c:3148:4: error: implicit declaration of function 'ABGRToARGB' [-Werror=implicit-function-declaration] + ABGRToARGB(data, width * 4, img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED], width, height); + ^ + + Fix this my adding/moving the checks for "SWITCH_HAVE_YUV". + + Signed-off-by: Sebastian Kemper + --- a/src/switch_core_video.c +++ b/src/switch_core_video.c -@@ -48,13 +48,13 @@ - #include - #endif +@@ -3116,6 +3116,7 @@ SWITCH_DECLARE(switch_status_t) switch_i -+#ifdef SWITCH_HAVE_YUV - #define STB_IMAGE_IMPLEMENTATION - #include "../libs/stb/stb_image.h" - - #define STB_IMAGE_WRITE_IMPLEMENTATION - #include "../libs/stb/stb_image_write.h" - --#ifdef SWITCH_HAVE_YUV - static inline void switch_img_get_yuv_pixel(switch_image_t *img, switch_yuv_color_t *yuv, int x, int y); - #endif - -@@ -3114,6 +3114,7 @@ SWITCH_DECLARE(switch_status_t) switch_i - - #endif - -+#ifdef SWITCH_HAVE_YUV SWITCH_DECLARE(switch_image_t *) switch_img_read_from_file(const char* file_name, switch_img_fmt_t img_fmt) { ++#ifdef SWITCH_HAVE_YUV int width = 0, height = 0, channels = 0; -@@ -3301,7 +3302,7 @@ SWITCH_DECLARE(switch_status_t) switch_i + int comp = STBI_rgb; + unsigned char *data = NULL; +@@ -3155,12 +3156,16 @@ SWITCH_DECLARE(switch_image_t *) switch_ + } else if (data) { + stbi_image_free(data); + } ++#endif + + return NULL; + } + + SWITCH_DECLARE(switch_status_t) switch_img_write_to_file(switch_image_t *img, const char* file_name, int quality) + { ++#ifndef SWITCH_HAVE_YUV ++ return SWITCH_STATUS_FALSE; ++#else + int comp = STBI_rgb; + unsigned char *data = NULL; + const char *ext = strrchr(file_name, '.'); +@@ -3217,6 +3222,7 @@ SWITCH_DECLARE(switch_status_t) switch_i + free(data); return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; ++#endif } -- -+#endif /* SWITCH_HAVE_YUV */ - SWITCH_DECLARE(switch_status_t) switch_img_letterbox(switch_image_t *img, switch_image_t **imgP, int width, int height, const char *color) + typedef struct data_url_context_s { +@@ -3224,14 +3230,19 @@ typedef struct data_url_context_s { + char **urlP; + } data_url_context_t; + ++#ifdef SWITCH_HAVE_YUV + static void data_url_write_func(void *context, void *data, int size) { + switch_buffer_t *buffer = (switch_buffer_t *)context; + switch_buffer_write(buffer, data, size); + } ++#endif + + SWITCH_DECLARE(switch_status_t) switch_img_data_url(switch_image_t *img, char **urlP, const char *type, int quality) + { ++#ifndef SWITCH_HAVE_YUV ++ return SWITCH_STATUS_FALSE; ++#else + int comp = STBI_rgb; + unsigned char *data = NULL; + int stride_in_bytes = 0; +@@ -3300,6 +3311,7 @@ SWITCH_DECLARE(switch_status_t) switch_i + switch_buffer_destroy(&buffer); + + return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; ++#endif /* SWITCH_HAVE_YUV */ + } + + --- a/tests/unit/switch_core_video.c +++ b/tests/unit/switch_core_video.c @@ -48,6 +48,7 @@ FST_CORE_BEGIN("./conf")