From b0eb53e279dcae19ada1ba0dba6c5103315a2fe1 Mon Sep 17 00:00:00 2001 From: Alex J Lennon Date: Sat, 8 May 2021 11:29:06 +0100 Subject: [PATCH 1/3] layer.conf: Add layer compatibility Signed-off-by: Alex J Lennon --- conf/layer.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/layer.conf b/conf/layer.conf index 722f801..201c1ba 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -9,3 +9,5 @@ BBFILE_PATTERN_meta-micropython := "^${LAYERDIR}/" BBFILE_PRIORITY_meta-micropython = "7" LAYERDEPENDS_meta-micropython = "core" + +LAYERSERIES_COMPAT_meta-micropython = "honister hardknott gatesgarth dunfell" From eca52614d561b72ca68216123084d05e73c82928 Mon Sep 17 00:00:00 2001 From: Alex J Lennon Date: Sat, 8 May 2021 12:39:11 +0100 Subject: [PATCH 2/3] Fix a couple of problems with build - Python not being found - Warnings treated as errors - No GNU_HASH in output This builds and runs under standard Poky QEmu Signed-off-by: Alex J Lennon --- .../micropython/001-force-python3.patch | 27 +++++++++++++++++++ .../micropython/micropython_1.8.7.bb | 12 ++++----- 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 recipes-devtools/micropython/micropython/001-force-python3.patch diff --git a/recipes-devtools/micropython/micropython/001-force-python3.patch b/recipes-devtools/micropython/micropython/001-force-python3.patch new file mode 100644 index 0000000..27ac26f --- /dev/null +++ b/recipes-devtools/micropython/micropython/001-force-python3.patch @@ -0,0 +1,27 @@ +diff -ur git.org/tools/make-frozen.py git/tools/make-frozen.py +--- git.org/tools/make-frozen.py 2021-05-08 11:07:17.883825233 +0000 ++++ git/tools/make-frozen.py 2021-05-08 11:07:57.808084055 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Create frozen modules structure for MicroPython. + # +diff -ur git.org/tools/pyboard.py git/tools/pyboard.py +--- git.org/tools/pyboard.py 2021-05-08 11:07:17.883825233 +0000 ++++ git/tools/pyboard.py 2021-05-08 11:08:03.044117995 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + """ + pyboard interface +diff -ur git.org/tools/pydfu.py git/tools/pydfu.py +--- git.org/tools/pydfu.py 2021-05-08 11:07:17.883825233 +0000 ++++ git/tools/pydfu.py 2021-05-08 11:08:09.056156964 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # This file is part of the OpenMV project. + # Copyright (c) 2013/2014 Ibrahim Abdelkader + # This work is licensed under the MIT license, see the file LICENSE for diff --git a/recipes-devtools/micropython/micropython_1.8.7.bb b/recipes-devtools/micropython/micropython_1.8.7.bb index dbbf8fd..66de88f 100644 --- a/recipes-devtools/micropython/micropython_1.8.7.bb +++ b/recipes-devtools/micropython/micropython_1.8.7.bb @@ -5,30 +5,31 @@ SECTION = "devel/python" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=a8a14efdd86622bc2a34296228779da7" -inherit autotools-brokensep +inherit autotools-brokensep pkgconfig INC_PR = "r1" PR = "${INC_PR}.0" SRC_URI = " \ gitsm://github.com/micropython/micropython.git;name=src;tag=v${PV} \ + file://001-force-python3.patch \ " S = "${WORKDIR}/git" -DEPENDS = "libffi" - -CPPFLAGS_append = " -Wno-error" +DEPENDS = "libffi python3-native" EXTRA_OEMAKE = " \ -C ${S}/unix \ MICROPY_USE_READLINE=0 \ V=1 \ DESTDIR="${D}" \ + CWARN=" -Wno-error" \ CC="${CC}" \ LD="${LD}" \ CROSS_COMPILE="${TARGET_PREFIX}" \ PREFIX="${D}/usr" \ + PYTHON="python3" \ " do_compile() { @@ -42,7 +43,6 @@ do_configure() { RRECOMMENDS_${PN} = "micropython-lib" -INSANE_SKIP_${PN} = "already-stripped" +INSANE_SKIP_${PN} = "already-stripped ldflags" BBCLASSEXTEND = "native" - From 9861ce964acc374d6a5b0a946c0046bb38b4ccd4 Mon Sep 17 00:00:00 2001 From: Alex J Lennon Date: Sat, 8 May 2021 13:58:54 +0100 Subject: [PATCH 3/3] Updated Micropython to v1.15 Signed-off-by: Alex J Lennon --- ...-lib_1.8.6.bb => micropython-lib_1.9.3.bb} | 9 ++----- .../micropython/001-force-python3.patch | 18 ------------- ...cropython_1.8.7.bb => micropython_1.15.bb} | 26 ++++++++++++------- 3 files changed, 19 insertions(+), 34 deletions(-) rename recipes-devtools/micropython/{micropython-lib_1.8.6.bb => micropython-lib_1.9.3.bb} (69%) rename recipes-devtools/micropython/{micropython_1.8.7.bb => micropython_1.15.bb} (66%) diff --git a/recipes-devtools/micropython/micropython-lib_1.8.6.bb b/recipes-devtools/micropython/micropython-lib_1.9.3.bb similarity index 69% rename from recipes-devtools/micropython/micropython-lib_1.8.6.bb rename to recipes-devtools/micropython/micropython-lib_1.9.3.bb index a63e9ac..508e5b2 100644 --- a/recipes-devtools/micropython/micropython-lib_1.8.6.bb +++ b/recipes-devtools/micropython/micropython-lib_1.9.3.bb @@ -5,17 +5,14 @@ SECTION = "devel/python" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=b4c9cf84e44b0961b744ae0ca6617ae6" -inherit autotools - INC_PR = "r1" PR = "${INC_PR}.0" SRC_URI = " \ - https://github.com/micropython/micropython-lib/archive/v${PV}.tar.gz;name=src \ + git://github.com/micropython/micropython-lib.git;name=src;tag=v${PV} \ " -SRC_URI[src.md5sum] = "e0b313e7d6378f52607844fd30d79630" -SRC_URI[src.sha256sum] = "eb696009ff8c33004211e484649b34edb14f3efb2ff618942bc8888716757a55" +S = "${WORKDIR}/git" RDEPENDS_${PN} = "micropython" RDEPENDS_${PN}-native = "micropython-native" @@ -37,5 +34,3 @@ do_install() { FILES_${PN} = " \ ${libdir}/micropython/* \ " - -BBCLASSEXTEND = "native" diff --git a/recipes-devtools/micropython/micropython/001-force-python3.patch b/recipes-devtools/micropython/micropython/001-force-python3.patch index 27ac26f..b292e82 100644 --- a/recipes-devtools/micropython/micropython/001-force-python3.patch +++ b/recipes-devtools/micropython/micropython/001-force-python3.patch @@ -7,21 +7,3 @@ diff -ur git.org/tools/make-frozen.py git/tools/make-frozen.py # # Create frozen modules structure for MicroPython. # -diff -ur git.org/tools/pyboard.py git/tools/pyboard.py ---- git.org/tools/pyboard.py 2021-05-08 11:07:17.883825233 +0000 -+++ git/tools/pyboard.py 2021-05-08 11:08:03.044117995 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - """ - pyboard interface -diff -ur git.org/tools/pydfu.py git/tools/pydfu.py ---- git.org/tools/pydfu.py 2021-05-08 11:07:17.883825233 +0000 -+++ git/tools/pydfu.py 2021-05-08 11:08:09.056156964 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # This file is part of the OpenMV project. - # Copyright (c) 2013/2014 Ibrahim Abdelkader - # This work is licensed under the MIT license, see the file LICENSE for diff --git a/recipes-devtools/micropython/micropython_1.8.7.bb b/recipes-devtools/micropython/micropython_1.15.bb similarity index 66% rename from recipes-devtools/micropython/micropython_1.8.7.bb rename to recipes-devtools/micropython/micropython_1.15.bb index 66de88f..edb3a7a 100644 --- a/recipes-devtools/micropython/micropython_1.8.7.bb +++ b/recipes-devtools/micropython/micropython_1.15.bb @@ -3,9 +3,7 @@ HOMEPAGE = "https://micropython.org" SECTION = "devel/python" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=a8a14efdd86622bc2a34296228779da7" - -inherit autotools-brokensep pkgconfig +LIC_FILES_CHKSUM = "file://LICENSE;md5=4d13714d609dce89ca5832f2e0864344" INC_PR = "r1" PR = "${INC_PR}.0" @@ -19,30 +17,40 @@ S = "${WORKDIR}/git" DEPENDS = "libffi python3-native" +inherit autotools-brokensep + EXTRA_OEMAKE = " \ - -C ${S}/unix \ MICROPY_USE_READLINE=0 \ V=1 \ DESTDIR="${D}" \ - CWARN=" -Wno-error" \ CC="${CC}" \ LD="${LD}" \ CROSS_COMPILE="${TARGET_PREFIX}" \ + CWARN=" -Wno-error" \ PREFIX="${D}/usr" \ PYTHON="python3" \ " do_compile() { - oe_runmake axtls - oe_runmake micropython + make -C ${S}/mpy-cross + oe_runmake -C ${S}/ports/unix submodules + oe_runmake -C ${S}/ports/unix } do_configure() { : } +do_install() { + install -d ${D}${bindir}/ + cp -r --preserve=mode,links ${B}/ports/unix/micropython ${D}${bindir}/ +} + +FILES_${PN} = " \ + ${bindir}/micropython \ +" + + RRECOMMENDS_${PN} = "micropython-lib" INSANE_SKIP_${PN} = "already-stripped ldflags" - -BBCLASSEXTEND = "native"