diff options
Diffstat (limited to 'meta/recipes-devtools/python')
| -rw-r--r-- | meta/recipes-devtools/python/python3/reformat_sysconfig.py | 21 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3_3.7.3.bb | 7 |
2 files changed, 28 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/meta/recipes-devtools/python/python3/reformat_sysconfig.py new file mode 100644 index 0000000000..c4164313e8 --- /dev/null +++ b/meta/recipes-devtools/python/python3/reformat_sysconfig.py | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #! /usr/bin/env python3 | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: MIT | ||
| 4 | # | ||
| 5 | # Copyright 2019 by Garmin Ltd. or its subsidiaries | ||
| 6 | # | ||
| 7 | # A script to reformat python sysconfig | ||
| 8 | |||
| 9 | import sys | ||
| 10 | import pprint | ||
| 11 | l = {} | ||
| 12 | g = {} | ||
| 13 | with open(sys.argv[1], 'r') as f: | ||
| 14 | exec(f.read(), g, l) | ||
| 15 | |||
| 16 | with open(sys.argv[1], 'w') as f: | ||
| 17 | for k in sorted(l.keys()): | ||
| 18 | f.write('%s = ' % k) | ||
| 19 | pprint.pprint(l[k], stream=f, width=sys.maxsize) | ||
| 20 | f.write('\n') | ||
| 21 | |||
diff --git a/meta/recipes-devtools/python/python3_3.7.3.bb b/meta/recipes-devtools/python/python3_3.7.3.bb index 8e77dbe959..3409d94ba0 100644 --- a/meta/recipes-devtools/python/python3_3.7.3.bb +++ b/meta/recipes-devtools/python/python3_3.7.3.bb | |||
| @@ -25,6 +25,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | |||
| 25 | file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \ | 25 | file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \ |
| 26 | file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \ | 26 | file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \ |
| 27 | file://crosspythonpath.patch \ | 27 | file://crosspythonpath.patch \ |
| 28 | file://reformat_sysconfig.py \ | ||
| 28 | " | 29 | " |
| 29 | 30 | ||
| 30 | SRC_URI_append_class-native = " \ | 31 | SRC_URI_append_class-native = " \ |
| @@ -165,6 +166,12 @@ py_package_preprocess () { | |||
| 165 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \ | 166 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \ |
| 166 | ${PKGD}/${bindir}/python${PYTHON_BINABI}-config | 167 | ${PKGD}/${bindir}/python${PYTHON_BINABI}-config |
| 167 | 168 | ||
| 169 | # Reformat _sysconfigdata after modifying it so that it remains | ||
| 170 | # reproducible | ||
| 171 | for c in ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do | ||
| 172 | python3 ${WORKDIR}/reformat_sysconfig.py $c | ||
| 173 | done | ||
| 174 | |||
| 168 | # Recompile _sysconfigdata after modifying it | 175 | # Recompile _sysconfigdata after modifying it |
| 169 | cd ${PKGD} | 176 | cd ${PKGD} |
| 170 | sysconfigfile=`find . -name _sysconfigdata_*.py` | 177 | sysconfigfile=`find . -name _sysconfigdata_*.py` |
