buildroot/package/cracklib
Fabrice Fontaine 42eae73ef1 package/cracklib: python needs autoreconf
Set CRACKLIB_AUTORECONF when building python to regenerate py-compile
and avoid the following build failure with python 3.12 (which removed
imp module) raised since commit
36e635d2d5:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp'
make[3]: *** [Makefile:485: install-pythonPYTHON] Error 1

Indeed, after autoreconf, py-compile will contain:

if test "$python_major" -le 2; then
  import_lib=imp
  import_test="hasattr(imp, 'get_tag')"
  import_call=imp.cache_from_source
  import_arg2=', False' # needed in one call and not the other
else
  import_lib=importlib
  import_test="hasattr(sys.implementation, 'cache_tag')"
  import_call=importlib.util.cache_from_source
  import_arg2=
fi

$PYTHON -c "
import sys, os, py_compile, $import_lib

instead of:

import sys, os, py_compile, imp

Fixes: 36e635d2d5
 - http://autobuild.buildroot.org/results/aec4c19fdf8087c76c1d5f472e855e0f84fcf7fd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-13 15:00:17 +02:00
..
Config.in
cracklib.hash
cracklib.mk package/cracklib: python needs autoreconf 2024-07-13 15:00:17 +02:00