| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "The Python Programming Language" | 
|  | 2 | HOMEPAGE = "http://www.python.org" | 
|  | 3 | LICENSE = "PSFv2" | 
|  | 4 | SECTION = "devel/python" | 
|  | 5 |  | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=33223c9ef60c31e3f0e866cb09b65e83" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 |  | 
|  | 8 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | 
|  | 9 | file://run-ptest \ | 
|  | 10 | file://create_manifest3.py \ | 
|  | 11 | file://get_module_deps3.py \ | 
|  | 12 | file://python3-manifest.json \ | 
|  | 13 | file://check_build_completeness.py \ | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 14 | file://reformat_sysconfig.py \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | file://cgi_py.patch \ | 
|  | 16 | file://0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch \ | 
|  | 17 | ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \ | 
|  | 18 | file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \ | 
|  | 19 | file://python-config.patch \ | 
|  | 20 | file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 22 | file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \ | 
|  | 23 | file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \ | 
|  | 24 | file://crosspythonpath.patch \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | file://0001-Use-FLAG_REF-always-for-interned-strings.patch \ | 
|  | 26 | file://0001-test_locale.py-correct-the-test-output-format.patch \ | 
|  | 27 | file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \ | 
|  | 28 | file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \ | 
|  | 29 | file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \ | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 31 | file://0001-Lib-sysconfig.py-use-libdir-values-from-configuratio.patch \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | " | 
|  | 33 |  | 
|  | 34 | SRC_URI_append_class-native = " \ | 
|  | 35 | file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \ | 
|  | 36 | file://12-distutils-prefix-is-inside-staging-area.patch \ | 
|  | 37 | file://0001-Don-t-search-system-for-headers-libraries.patch \ | 
|  | 38 | " | 
| Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame] | 39 | SRC_URI[sha256sum] = "991c3f8ac97992f3d308fefeb03a64db462574eadbff34ce8bc5bb583d9903ff" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 40 |  | 
|  | 41 | # exclude pre-releases for both python 2.x and 3.x | 
|  | 42 | UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar" | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 43 | UPSTREAM_CHECK_URI = "https://www.python.org/downloads/source/" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 44 |  | 
|  | 45 | CVE_PRODUCT = "python" | 
|  | 46 |  | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 47 | # Upstream consider this expected behaviour | 
|  | 48 | CVE_CHECK_WHITELIST += "CVE-2007-4559" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 49 | # This is not exploitable when glibc has CVE-2016-10739 fixed. | 
|  | 50 | CVE_CHECK_WHITELIST += "CVE-2019-18348" | 
|  | 51 |  | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 52 | # This is windows only issue. | 
|  | 53 | CVE_CHECK_WHITELIST += "CVE-2020-15523" | 
|  | 54 |  | 
|  | 55 | PYTHON_MAJMIN = "3.9" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 56 |  | 
|  | 57 | S = "${WORKDIR}/Python-${PV}" | 
|  | 58 |  | 
|  | 59 | BBCLASSEXTEND = "native nativesdk" | 
|  | 60 |  | 
|  | 61 | inherit autotools pkgconfig qemu ptest multilib_header update-alternatives | 
|  | 62 |  | 
|  | 63 | MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}" | 
|  | 64 |  | 
|  | 65 | ALTERNATIVE_${PN}-dev = "python3-config" | 
|  | 66 | ALTERNATIVE_LINK_NAME[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config" | 
|  | 67 | ALTERNATIVE_TARGET[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}" | 
|  | 68 |  | 
|  | 69 |  | 
|  | 70 | DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2" | 
|  | 71 | DEPENDS_append_class-target = " python3-native" | 
|  | 72 | DEPENDS_append_class-nativesdk = " python3-native" | 
|  | 73 |  | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 74 | EXTRA_OECONF = " --without-ensurepip --enable-shared --with-platlibdir=${baselib}" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 75 | EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}" | 
|  | 76 |  | 
|  | 77 | export CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/" | 
|  | 78 |  | 
|  | 79 | EXTRANATIVEPATH += "python3-native" | 
|  | 80 |  | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 81 | # LTO will be enabled via packageconfig depending upong distro features | 
|  | 82 | LTO_class-target = "" | 
|  | 83 |  | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 84 | CACHED_CONFIGUREVARS = " \ | 
|  | 85 | ac_cv_file__dev_ptmx=yes \ | 
|  | 86 | ac_cv_file__dev_ptc=no \ | 
|  | 87 | ac_cv_working_tzset=yes \ | 
|  | 88 | " | 
| Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 89 |  | 
|  | 90 | def possibly_include_pgo(d): | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 91 | # PGO currently causes builds to not be reproducible, so disable it for | 
|  | 92 | # now. See YOCTO #13407 | 
|  | 93 | if bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', True, False, d) and d.getVar('BUILD_REPRODUCIBLE_BINARIES') != '1': | 
| Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 94 | return 'pgo' | 
|  | 95 |  | 
|  | 96 | return '' | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 97 |  | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 98 | PACKAGECONFIG_class-target ??= "readline ${@possibly_include_pgo(d)} gdbm ${@bb.utils.filter('DISTRO_FEATURES', 'lto', d)}" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 99 | PACKAGECONFIG_class-native ??= "readline gdbm" | 
|  | 100 | PACKAGECONFIG_class-nativesdk ??= "readline gdbm" | 
|  | 101 | PACKAGECONFIG[readline] = ",,readline" | 
|  | 102 | # Use profile guided optimisation by running PyBench inside qemu-user | 
|  | 103 | PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native" | 
|  | 104 | PACKAGECONFIG[tk] = ",,tk" | 
|  | 105 | PACKAGECONFIG[gdbm] = ",,gdbm" | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 106 | PACKAGECONFIG[lto] = "--with-lto,," | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 107 |  | 
|  | 108 | do_configure_prepend () { | 
|  | 109 | mkdir -p ${B}/Modules | 
|  | 110 | cat > ${B}/Modules/Setup.local << EOF | 
|  | 111 | *disabled* | 
|  | 112 | ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)} | 
|  | 113 | ${@bb.utils.contains('PACKAGECONFIG', 'readline', '', 'readline', d)} | 
|  | 114 | EOF | 
|  | 115 | } | 
|  | 116 |  | 
|  | 117 | CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid" | 
|  | 118 |  | 
|  | 119 | EXTRA_OEMAKE = '\ | 
|  | 120 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 
|  | 121 | STAGING_INCDIR=${STAGING_INCDIR} \ | 
|  | 122 | LIB=${baselib} \ | 
|  | 123 | ' | 
|  | 124 |  | 
|  | 125 | do_compile_prepend_class-target() { | 
|  | 126 | if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then | 
|  | 127 | qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}" | 
|  | 128 | cat >pgo-wrapper <<EOF | 
|  | 129 | #!/bin/sh | 
|  | 130 | cd ${B} | 
|  | 131 | $qemu_binary "\$@" | 
|  | 132 | EOF | 
|  | 133 | chmod +x pgo-wrapper | 
|  | 134 | fi | 
|  | 135 | } | 
|  | 136 |  | 
|  | 137 | do_install_prepend() { | 
|  | 138 | ${WORKDIR}/check_build_completeness.py ${T}/log.do_compile | 
|  | 139 | } | 
|  | 140 |  | 
|  | 141 | do_install_append_class-target() { | 
|  | 142 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | 
|  | 143 | } | 
|  | 144 |  | 
|  | 145 | do_install_append_class-native() { | 
|  | 146 | # Make sure we use /usr/bin/env python | 
|  | 147 | for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do | 
|  | 148 | sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT | 
|  | 149 | done | 
|  | 150 | # Add a symlink to the native Python so that scripts can just invoke | 
|  | 151 | # "nativepython" and get the right one without needing absolute paths | 
|  | 152 | # (these often end up too long for the #! parser in the kernel as the | 
|  | 153 | # buffer is 128 bytes long). | 
|  | 154 | ln -s python3-native/python3 ${D}${bindir}/nativepython3 | 
|  | 155 | } | 
|  | 156 |  | 
|  | 157 | do_install_append() { | 
|  | 158 | mkdir -p ${D}${libdir}/python-sysconfigdata | 
|  | 159 | sysconfigfile=`find ${D} -name _sysconfig*.py` | 
|  | 160 | cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py | 
|  | 161 |  | 
|  | 162 | sed -i  \ | 
|  | 163 | -e "s,^ 'LIBDIR'.*, 'LIBDIR': '${STAGING_LIBDIR}'\,,g" \ | 
|  | 164 | -e "s,^ 'INCLUDEDIR'.*, 'INCLUDEDIR': '${STAGING_INCDIR}'\,,g" \ | 
|  | 165 | -e "s,^ 'CONFINCLUDEDIR'.*, 'CONFINCLUDEDIR': '${STAGING_INCDIR}'\,,g" \ | 
|  | 166 | -e "/^ 'INCLDIRSTOMAKE'/{N; s,/usr/include,${STAGING_INCDIR},g}" \ | 
|  | 167 | -e "/^ 'INCLUDEPY'/s,/usr/include,${STAGING_INCDIR},g" \ | 
|  | 168 | ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py | 
| Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 169 |  | 
|  | 170 | # Unfortunately the following pyc files are non-deterministc due to 'frozenset' | 
|  | 171 | # being written without strict ordering, even with PYTHONHASHSEED = 0 | 
|  | 172 | # Upstream is discussing ways to solve the issue properly, until then let's | 
|  | 173 | # just not install the problematic files. | 
|  | 174 | # More info: http://benno.id.au/blog/2013/01/15/python-determinism | 
|  | 175 | rm ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython* | 
|  | 176 | rm ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython* | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 177 | } | 
|  | 178 |  | 
|  | 179 | do_install_append_class-nativesdk () { | 
|  | 180 | create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' | 
|  | 181 | } | 
|  | 182 |  | 
|  | 183 | SSTATE_SCAN_FILES += "Makefile _sysconfigdata.py" | 
|  | 184 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | 
|  | 185 |  | 
|  | 186 | py_package_preprocess () { | 
|  | 187 | # Remove references to buildmachine paths in target Makefile and _sysconfigdata | 
|  | 188 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ | 
|  | 189 | -e 's|${DEBUG_PREFIX_MAP}||g' \ | 
|  | 190 | -e 's:${HOSTTOOLS_DIR}/::g' \ | 
|  | 191 | -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ | 
|  | 192 | -e 's:${RECIPE_SYSROOT}::g' \ | 
|  | 193 | -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ | 
|  | 194 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile \ | 
|  | 195 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \ | 
|  | 196 | ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config | 
|  | 197 |  | 
|  | 198 | # Reformat _sysconfigdata after modifying it so that it remains | 
|  | 199 | # reproducible | 
|  | 200 | for c in ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do | 
|  | 201 | python3 ${WORKDIR}/reformat_sysconfig.py $c | 
|  | 202 | done | 
|  | 203 |  | 
|  | 204 | # Recompile _sysconfigdata after modifying it | 
|  | 205 | cd ${PKGD} | 
|  | 206 | sysconfigfile=`find . -name _sysconfigdata_*.py` | 
|  | 207 | ${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | 
|  | 208 | -c "from py_compile import compile; compile('$sysconfigfile')" | 
|  | 209 | ${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | 
|  | 210 | -c "from py_compile import compile; compile('$sysconfigfile', optimize=1)" | 
|  | 211 | ${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | 
|  | 212 | -c "from py_compile import compile; compile('$sysconfigfile', optimize=2)" | 
|  | 213 | cd - | 
|  | 214 |  | 
|  | 215 | mv ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX} | 
|  | 216 |  | 
|  | 217 | #Remove the unneeded copy of target sysconfig data | 
|  | 218 | rm -rf ${PKGD}/${libdir}/python-sysconfigdata | 
|  | 219 | } | 
|  | 220 |  | 
|  | 221 | # We want bytecode precompiled .py files (.pyc's) by default | 
|  | 222 | # but the user may set it on their own conf | 
|  | 223 | INCLUDE_PYCS ?= "1" | 
|  | 224 |  | 
|  | 225 | python(){ | 
|  | 226 | import collections, json | 
|  | 227 |  | 
|  | 228 | filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json') | 
|  | 229 | # This python changes the datastore based on the contents of a file, so mark | 
|  | 230 | # that dependency. | 
|  | 231 | bb.parse.mark_dependency(d, filename) | 
|  | 232 |  | 
|  | 233 | with open(filename) as manifest_file: | 
|  | 234 | manifest_str =  manifest_file.read() | 
|  | 235 | json_start = manifest_str.find('# EOC') + 6 | 
|  | 236 | manifest_file.seek(json_start) | 
|  | 237 | manifest_str = manifest_file.read() | 
|  | 238 | python_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict) | 
|  | 239 |  | 
|  | 240 | # First set RPROVIDES for -native case | 
|  | 241 | # Hardcoded since it cant be python3-native-foo, should be python3-foo-native | 
|  | 242 | pn = 'python3' | 
|  | 243 | rprovides = d.getVar('RPROVIDES').split() | 
|  | 244 |  | 
|  | 245 | # ${PN}-misc-native is not in the manifest | 
|  | 246 | rprovides.append(pn + '-misc-native') | 
|  | 247 |  | 
|  | 248 | for key in python_manifest: | 
|  | 249 | pypackage = pn + '-' + key + '-native' | 
|  | 250 | if pypackage not in rprovides: | 
|  | 251 | rprovides.append(pypackage) | 
|  | 252 |  | 
|  | 253 | d.setVar('RPROVIDES_class-native', ' '.join(rprovides)) | 
|  | 254 |  | 
|  | 255 | # Then work on the target | 
|  | 256 | include_pycs = d.getVar('INCLUDE_PYCS') | 
|  | 257 |  | 
|  | 258 | packages = d.getVar('PACKAGES').split() | 
|  | 259 | pn = d.getVar('PN') | 
|  | 260 |  | 
|  | 261 | newpackages=[] | 
|  | 262 | for key in python_manifest: | 
|  | 263 | pypackage = pn + '-' + key | 
|  | 264 |  | 
|  | 265 | if pypackage not in packages: | 
|  | 266 | # We need to prepend, otherwise python-misc gets everything | 
|  | 267 | # so we use a new variable | 
|  | 268 | newpackages.append(pypackage) | 
|  | 269 |  | 
|  | 270 | # "Build" python's manifest FILES, RDEPENDS and SUMMARY | 
|  | 271 | d.setVar('FILES_' + pypackage, '') | 
|  | 272 | for value in python_manifest[key]['files']: | 
|  | 273 | d.appendVar('FILES_' + pypackage, ' ' + value) | 
|  | 274 |  | 
|  | 275 | # Add cached files | 
|  | 276 | if include_pycs == '1': | 
|  | 277 | for value in python_manifest[key]['cached']: | 
|  | 278 | d.appendVar('FILES_' + pypackage, ' ' + value) | 
|  | 279 |  | 
|  | 280 | for value in python_manifest[key]['rdepends']: | 
|  | 281 | # Make it work with or without $PN | 
|  | 282 | if '${PN}' in value: | 
|  | 283 | value=value.split('-', 1)[1] | 
|  | 284 | d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value) | 
|  | 285 |  | 
|  | 286 | for value in python_manifest[key].get('rrecommends', ()): | 
|  | 287 | if '${PN}' in value: | 
|  | 288 | value=value.split('-', 1)[1] | 
|  | 289 | d.appendVar('RRECOMMENDS_' + pypackage, ' ' + pn + '-' + value) | 
|  | 290 |  | 
|  | 291 | d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary']) | 
|  | 292 |  | 
|  | 293 | # Prepending so to avoid python-misc getting everything | 
|  | 294 | packages = newpackages + packages | 
|  | 295 | d.setVar('PACKAGES', ' '.join(packages)) | 
|  | 296 | d.setVar('ALLOW_EMPTY_${PN}-modules', '1') | 
|  | 297 | d.setVar('ALLOW_EMPTY_${PN}-pkgutil', '1') | 
|  | 298 | } | 
|  | 299 |  | 
|  | 300 | # Files needed to create a new manifest | 
|  | 301 |  | 
|  | 302 | do_create_manifest() { | 
|  | 303 | # This task should be run with every new release of Python. | 
|  | 304 | # We must ensure that PACKAGECONFIG enables everything when creating | 
|  | 305 | # a new manifest, this is to base our new manifest on a complete | 
|  | 306 | # native python build, containing all dependencies, otherwise the task | 
|  | 307 | # wont be able to find the required files. | 
|  | 308 | # e.g. BerkeleyDB is an optional build dependency so it may or may not | 
|  | 309 | # be present, we must ensure it is. | 
|  | 310 |  | 
|  | 311 | cd ${WORKDIR} | 
|  | 312 | # This needs to be executed by python-native and NOT by HOST's python | 
|  | 313 | nativepython3 create_manifest3.py ${PYTHON_MAJMIN} | 
|  | 314 | cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json | 
|  | 315 | } | 
|  | 316 |  | 
|  | 317 | # bitbake python -c create_manifest | 
|  | 318 | addtask do_create_manifest | 
|  | 319 |  | 
|  | 320 | # Make sure we have native python ready when we create a new manifest | 
|  | 321 | do_create_manifest[depends] += "${PN}:do_prepare_recipe_sysroot" | 
|  | 322 | do_create_manifest[depends] += "${PN}:do_patch" | 
|  | 323 |  | 
|  | 324 | # manual dependency additions | 
|  | 325 | RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules" | 
| Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 326 | RRECOMMENDS_${PN}-crypt_append_class-target = " ${MLPREFIX}openssl ${MLPREFIX}ca-certificates" | 
|  | 327 | RRECOMMENDS_${PN}-crypt_append_class-nativesdk = " ${MLPREFIX}openssl ${MLPREFIX}ca-certificates" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 328 |  | 
|  | 329 | # For historical reasons PN is empty and provided by python3-modules | 
|  | 330 | FILES_${PN} = "" | 
|  | 331 | RPROVIDES_${PN}-modules = "${PN}" | 
|  | 332 |  | 
|  | 333 | FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3" | 
|  | 334 | FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}" | 
|  | 335 |  | 
|  | 336 | # provide python-pyvenv from python3-venv | 
| Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 337 | RPROVIDES_${PN}-venv += "${MLPREFIX}python3-pyvenv" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 338 |  | 
|  | 339 | # package libpython3 | 
|  | 340 | PACKAGES =+ "libpython3 libpython3-staticdev" | 
|  | 341 | FILES_libpython3 = "${libdir}/libpython*.so.*" | 
|  | 342 | FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}-*/libpython${PYTHON_MAJMIN}.a" | 
|  | 343 | INSANE_SKIP_${PN}-dev += "dev-elf" | 
|  | 344 |  | 
|  | 345 | # catch all the rest (unsorted) | 
|  | 346 | PACKAGES += "${PN}-misc" | 
| Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 347 | RDEPENDS_${PN}-misc += "\ | 
|  | 348 | ${PN}-core \ | 
|  | 349 | ${PN}-email \ | 
|  | 350 | ${PN}-codecs \ | 
|  | 351 | ${PN}-pydoc \ | 
|  | 352 | ${PN}-pickle \ | 
|  | 353 | ${PN}-audio \ | 
|  | 354 | ${PN}-numbers \ | 
|  | 355 | " | 
| Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 356 | RDEPENDS_${PN}-modules_append_class-target = " ${MLPREFIX}python3-misc" | 
|  | 357 | RDEPENDS_${PN}-modules_append_class-nativesdk = " ${MLPREFIX}python3-misc" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 358 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN} ${libdir}/python${PYTHON_MAJMIN}/lib-dynload" | 
|  | 359 |  | 
|  | 360 | # catch manpage | 
|  | 361 | PACKAGES += "${PN}-man" | 
|  | 362 | FILES_${PN}-man = "${datadir}/man" | 
|  | 363 |  | 
|  | 364 | # See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395 | 
|  | 365 | RDEPENDS_libpython3_append_libc-glibc = " libgcc" | 
| Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 366 | RDEPENDS_${PN}-ctypes_append_libc-glibc = " ${MLPREFIX}ldconfig" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 367 | RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip bzip2 libgcc tzdata-europe coreutils sed" | 
|  | 368 | RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-tr-tr.iso-8859-9" | 
|  | 369 | RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk tk-lib', '', d)}" | 
| Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 370 | RDEPENDS_${PN}-idle += "${@bb.utils.contains('PACKAGECONFIG', 'tk', '${PN}-tkinter tcl', '', d)}" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 371 | RDEPENDS_${PN}-dev = "" | 
|  | 372 |  | 
| Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 373 | RDEPENDS_${PN}-tests_append_class-target = " ${MLPREFIX}bash" | 
|  | 374 | RDEPENDS_${PN}-tests_append_class-nativesdk = " ${MLPREFIX}bash" |