summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3_3.5.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3_3.5.3.bb')
-rw-r--r--meta/recipes-devtools/python/python3_3.5.3.bb91
1 files changed, 87 insertions, 4 deletions
diff --git a/meta/recipes-devtools/python/python3_3.5.3.bb b/meta/recipes-devtools/python/python3_3.5.3.bb
index 7f54ea4ecd..970ba63445 100644
--- a/meta/recipes-devtools/python/python3_3.5.3.bb
+++ b/meta/recipes-devtools/python/python3_3.5.3.bb
@@ -1,6 +1,7 @@
1require recipes-devtools/python/python.inc 1require recipes-devtools/python/python.inc
2 2
3DEPENDS = "python3-native libffi bzip2 gdbm openssl readline sqlite3 zlib virtual/libintl xz" 3DEPENDS = "python3-native libffi bzip2 gdbm openssl readline sqlite3 zlib virtual/libintl xz"
4
4PR = "${INC_PR}.0" 5PR = "${INC_PR}.0"
5PYTHON_MAJMIN = "3.5" 6PYTHON_MAJMIN = "3.5"
6PYTHON_BINABI= "${PYTHON_MAJMIN}m" 7PYTHON_BINABI= "${PYTHON_MAJMIN}m"
@@ -196,11 +197,8 @@ py_package_preprocess () {
196 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py 197 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
197} 198}
198 199
199require python-${PYTHON_MAJMIN}-manifest.inc
200
201# manual dependency additions 200# manual dependency additions
202RPROVIDES_${PN}-modules = "${PN}" 201RPROVIDES_${PN}-modules = "${PN}"
203RRECOMMENDS_${PN}-core = "${PN}-readline"
204RRECOMMENDS_${PN}-crypt = "openssl" 202RRECOMMENDS_${PN}-crypt = "openssl"
205RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl" 203RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
206 204
@@ -219,7 +217,7 @@ INSANE_SKIP_${PN}-dev += "dev-elf"
219 217
220# catch all the rest (unsorted) 218# catch all the rest (unsorted)
221PACKAGES += "${PN}-misc" 219PACKAGES += "${PN}-misc"
222RDEPENDS_${PN}-misc += "${PN}-core ${PN}-email ${PN}-codecs ${PN}-textutils ${PN}-argparse" 220RDEPENDS_${PN}-misc += "${PN}-core ${PN}-email ${PN}-codecs"
223RDEPENDS_${PN}-modules += "${PN}-misc" 221RDEPENDS_${PN}-modules += "${PN}-misc"
224FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" 222FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
225 223
@@ -228,3 +226,88 @@ PACKAGES += "${PN}-man"
228FILES_${PN}-man = "${datadir}/man" 226FILES_${PN}-man = "${datadir}/man"
229 227
230BBCLASSEXTEND = "nativesdk" 228BBCLASSEXTEND = "nativesdk"
229
230RPROVIDES_${PN} += "${PN}-modules"
231
232# We want bytecode precompiled .py files (.pyc's) by default
233# but the user may set it on their own conf
234
235INCLUDE_PYCS ?= "1"
236
237python(){
238
239 pythondir = d.getVar('THISDIR',True)
240
241 # Read JSON manifest
242 import json
243 with open(pythondir+'/python3/python3-manifest.json') as manifest_file:
244 python_manifest=json.load(manifest_file)
245
246 include_pycs = d.getVar('INCLUDE_PYCS')
247
248 packages = d.getVar('PACKAGES').split()
249 pn = d.getVar('PN')
250
251 newpackages=[]
252 for key in python_manifest:
253 pypackage= pn + '-' + key
254
255 if pypackage not in packages:
256 # We need to prepend, otherwise python-misc gets everything
257 # so we use a new variable
258 newpackages.append(pypackage)
259
260 # "Build" python's manifest FILES, RDEPENDS and SUMMARY
261 d.setVar('FILES_' + pypackage, '')
262 for value in python_manifest[key]['files']:
263 d.appendVar('FILES_' + pypackage, ' ' + value)
264
265 # Add cached files
266 if include_pycs == '1':
267 for value in python_manifest[key]['cached']:
268 d.appendVar('FILES_' + pypackage, ' ' + value)
269
270 d.setVar('RDEPENDS_' + pypackage, '')
271 for value in python_manifest[key]['rdepends']:
272 # Make it work with or without $PN
273 if '${PN}' in value:
274 value=value.split('-')[1]
275 d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
276 d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
277
278 # We need to ensure staticdev packages match for files first so we sort in reverse
279 newpackages.sort(reverse=True)
280 # Prepending so to avoid python-misc getting everything
281 packages = newpackages + packages
282 d.setVar('PACKAGES', ' '.join(packages))
283 d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
284}
285do_split_packages[file-checksums] += "${THISDIR}/python/python3-manifest.json:True"
286
287
288
289# Files needed to create a new manifest
290SRC_URI += "file://create_manifest3.py file://get_module_deps3.py file://python3-manifest.json"
291
292do_create_manifest() {
293
294# This task should be run with every new release of Python.
295# We must ensure that PACKAGECONFIG enables everything when creating
296# a new manifest, this is to base our new manifest on a complete
297# native python build, containing all dependencies, otherwise the task
298# wont be able to find the required files.
299# e.g. BerkeleyDB is an optional build dependency so it may or may not
300# be present, we must ensure it is.
301
302cd ${WORKDIR}
303# This needs to be executed by python-native and NOT by HOST's python
304nativepython3 create_manifest3.py
305cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json
306}
307
308# bitbake python -c create_manifest
309addtask do_create_manifest
310
311# Make sure we have native python ready when we create a new manifest
312do_create_manifest[depends] += "python3:do_prepare_recipe_sysroot"
313do_create_manifest[depends] += "python3:do_patch"