[Buildroot] [PATCH 13/30] package/python3: update patch and partly use upstream build system to disable tk module

Arnout Vandecappelle arnout at mind.be
Sat Nov 4 17:47:14 UTC 2023


  Bernd, Adam,

On 26/10/2023 11:26, Adam Duskett wrote:
> From: Bernd Kuhls <bernd at kuhls.net>
> 
> Signed-off-by: Bernd Kuhls <bernd at kuhls.net>
> Signed-off-by: Adam Duskett <adam.duskett at amarulasolutions.com>
> ---
>   ...d-an-option-to-disable-the-tk-module.patch | 33 +++++++------------
>   package/python3/python3.mk                    |  2 ++
>   2 files changed, 14 insertions(+), 21 deletions(-)
> 
> diff --git a/package/python3/0014-Add-an-option-to-disable-the-tk-module.patch b/package/python3/0014-Add-an-option-to-disable-the-tk-module.patch
> index b89e1d27bc..1ed8959dba 100644
> --- a/package/python3/0014-Add-an-option-to-disable-the-tk-module.patch
> +++ b/package/python3/0014-Add-an-option-to-disable-the-tk-module.patch
> @@ -20,15 +20,15 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in
>   index 9f4cdf14cf..4f83911200 100644
>   --- a/Makefile.pre.in
>   +++ b/Makefile.pre.in
> -@@ -1920,7 +1920,6 @@ LIBSUBDIRS=	asyncio \
> - 		multiprocessing multiprocessing/dummy \
> +@@ -1921,7 +1921,6 @@
>    		re \
>    		site-packages \
> + 		sqlite3 \
>   -		tkinter \
>    		tomllib \
>    		turtledemo \
>    		unittest \
> -@@ -2038,9 +2038,6 @@
> +@@ -2039,12 +2038,15 @@
>    		test/xmltestdata \
>    		test/xmltestdata/c14n-20 \
>    		test/ziptestdata \
> @@ -37,10 +37,6 @@ index 9f4cdf14cf..4f83911200 100644
>   -		tkinter/test/test_ttk \
>    		unittest/test \
>    		unittest/test/testmock
> - ifeq (@PYDOC@,yes)
> -@@ -2021,6 +2018,13 @@ ifeq (@SQLITE3@,yes)
> - LIBSUBDIRS += sqlite3
> - endif
>    
>   +ifeq (@TK@,yes)
>   +LIBSUBDIRS += tkinter
> @@ -48,30 +44,25 @@ index 9f4cdf14cf..4f83911200 100644
>   +	tkinter/test/test_ttk
>   +endif
>   +
> -+
> - TEST_MODULES=@TEST_MODULES@
> - libinstall:	all $(srcdir)/Modules/xxmodule.c
> - 	@for i in $(SCRIPTDIR) $(LIBDEST); \
> + ifeq (@PYDOC@,yes)
> + LIBSUBDIRS += pydoc_data
> + endif
>   diff --git a/configure.ac b/configure.ac
>   index 4cc0951ab9..f4ce506801 100644
>   --- a/configure.ac
>   +++ b/configure.ac
> -@@ -4180,6 +4180,15 @@ if test "$SQLITE3" = "no" ; then
> -    DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
> - fi
> +@@ -4202,6 +4202,11 @@
> + 	AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
> + 	[ PYDOC="${enableval}" ], [ PYDOC=yes ])
>    
>   +AC_SUBST(TK)
>   +AC_ARG_ENABLE(tk,
>   +	AS_HELP_STRING([--disable-tk], [disable tk]),
>   +	[ TK="${enableval}" ], [ TK=yes ])
>   +
> -+if test "$TK" = "no"; then
> -+   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
> -+fi
> -+

  By doing the refresh in the same commit as the actual change to the patch, 
it's hard to see what really changed.

  After this change, it makes me wonder if the --disable-tk option is even 
relevant any more? AFAICS all it does is to avoid doing a test for tk, the 
result of which is anyway not going to be used.

  In that case, of course, the --disable-tk options also need to be removed from 
.mk.

> - AC_SUBST(PYDOC)
> -
> - AC_ARG_ENABLE(pydoc,
> + # Check for enable-ipv6
> + AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
> + AC_MSG_CHECKING([if --enable-ipv6 is specified])
>   --
>   2.34.1
>   
> diff --git a/package/python3/python3.mk b/package/python3/python3.mk
> index 8b06c28fde..04105289d6 100644
> --- a/package/python3/python3.mk
> +++ b/package/python3/python3.mk
> @@ -43,6 +43,7 @@ HOST_PYTHON3_CONF_ENV += \
>   	py_cv_module__codecs_kr=n/a \
>   	py_cv_module__codecs_tw=n/a \
>   	py_cv_module__sqlite3=n/a \
> +	py_cv_module__tkinter=n/a \

  IIUC this applies to 3.11 already, so we could use this part of the patch 
without any other change?

  Regards,
  Arnout

>   	py_cv_module__uuid=n/a \
>   	ac_cv_prog_HAS_HG=/bin/false
>   
> @@ -176,6 +177,7 @@ PYTHON3_CONF_ENV += \
>   	ac_cv_file__dev_ptc=yes \
>   	ac_cv_working_tzset=yes \
>   	py_cv_module_nis=n/a \
> +	py_cv_module__tkinter=n/a \
>   	ac_cv_prog_HAS_HG=/bin/false
>   
>   # GCC is always compliant with IEEE754



More information about the buildroot mailing list