From owner-dev-commits-ports-all@freebsd.org Thu Sep 9 09:20:27 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC0B266C9E4; Thu, 9 Sep 2021 09:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4tlH4mZGz3L1l; Thu, 9 Sep 2021 09:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 851401705C; Thu, 9 Sep 2021 09:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1899KRF8023995; Thu, 9 Sep 2021 09:20:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1899KRtO023994; Thu, 9 Sep 2021 09:20:27 GMT (envelope-from git) Date: Thu, 9 Sep 2021 09:20:27 GMT Message-Id: <202109090920.1899KRtO023994@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Kai Knoblich Subject: git: 31d969833496 - main - lang/micropython: Update to 1.17 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kai X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31d969833496d51cd1b6fd83121dbec79848fc06 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 09:20:28 -0000 The branch main has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=31d969833496d51cd1b6fd83121dbec79848fc06 commit 31d969833496d51cd1b6fd83121dbec79848fc06 Author: Kai Knoblich AuthorDate: 2021-09-09 09:10:17 +0000 Commit: Kai Knoblich CommitDate: 2021-09-09 09:10:17 +0000 lang/micropython: Update to 1.17 * Switch to GCC because building with Clang leads to a broken "mpy-cross" binary, which segfaults if issued with several parameters during build. * REINPLACE_CMD should not be used to replace static content, hence convert those occurrences into patches. * Also update pkg-descr and sort variables a bit according to the PHB. Reviewed by: decke (earlier revision) Approved by: kai (python, maintainer) Differential Revision: https://reviews.freebsd.org/D31855 --- lang/micropython/Makefile | 51 ++++++++++------------ lang/micropython/distinfo | 9 +++- lang/micropython/files/patch-mpy-cross_Makefile | 26 +++++++++++ lang/micropython/files/patch-ports_unix_Makefile | 13 ++++++ .../files/patch-tests_unix_ffi__callback.py | 13 ++++++ .../files/patch-tests_unix_ffi__float.py | 13 ++++++ lang/micropython/pkg-descr | 6 ++- 7 files changed, 100 insertions(+), 31 deletions(-) diff --git a/lang/micropython/Makefile b/lang/micropython/Makefile index 33aa73854595..de8cf98b52c3 100644 --- a/lang/micropython/Makefile +++ b/lang/micropython/Makefile @@ -1,48 +1,45 @@ PORTNAME= micropython -PORTVERSION= 1.5.1 +PORTVERSION= 1.17 DISTVERSIONPREFIX= v -PORTREVISION= 4 CATEGORIES= lang python MAINTAINER= python@FreeBSD.org COMMENT= Implementation of the Python language for microcontrollers LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE -LIB_DEPENDS= libffi.so:devel/libffi +BROKEN_armv6= fails to assemble: error: invalid operand for instruction +BROKEN_armv7= fails to assemble: error: invalid operand for instruction -USES= gmake pkgconfig python:3.4+,build readline shebangfix +LIB_DEPENDS= libffi.so:devel/libffi +USES= gmake pkgconfig python:,build +USE_GCC= yes USE_GITHUB= yes +GH_TUPLE= micropython:axtls:531cab9:axtls \ + pfalcon:berkeley-db-1.xx:35aaec4:bdb -PLIST_FILES= bin/micropython +MAKE_ARGS+= CC=${CC} CPP="${CC} -E" V=1 +MAKE_ENV+= CFLAGS_EXTRA="${CPPFLAGS} ${CFLAGS} -Wno-float-conversion" COPT="" -BROKEN_armv6= fails to assemble: error: invalid operand for instruction -BROKEN_armv7= fails to assemble: error: invalid operand for instruction +# With aarch64 (QEMU) the float_parse and the float_parse_doubleprec tests +# fail as they give a different output. +TEST_TARGET= test -WRKSRC_SUBDIR= unix +BINARY_ALIAS= python3=${PYTHON_CMD} -SHEBANG_FILES= ../tools/make-frozen.py -MAKE_ARGS+= V=1 -MAKE_ENV+= PYTHON=${PYTHON_CMD} CFLAGS_EXTRA="${CPPFLAGS} ${CFLAGS}" -TEST_TARGET= test +BUILD_WRKSRC= ${WRKSRC}/ports/unix +TEST_WRKSRC= ${WRKSRC}/ports/unix -post-patch: - @${REINPLACE_CMD} -e 's|-Werror||;/^COPT =/d; \ - s|ls -1 -v|ls -1|' ${WRKSRC}/Makefile - @${REINPLACE_CMD} -e 's|re_exec|mp_re_exec|' \ - ${WRKSRC}/../extmod/modure.c - @${REINPLACE_CMD} -e 's|AS =|AS ?=|;s|LD =|LD ?=|; \ - s|CC =|CC ?=|;s|PYTHON =|PYTHON ?=|' \ - ${WRKSRC}/../py/mkenv.mk - @${REINPLACE_CMD} -e 's|libc\.so\.6|libc\.so\.7|;' \ - ${WRKSRC}/../tests/unix/ffi_callback.py \ - ${WRKSRC}/../tests/unix/ffi_float.py +PLIST_FILES= bin/micropython -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/micropython ${STAGEDIR}${PREFIX}/bin +post-extract: + @${RM} -r ${WRKSRC}/lib/axtls ${WRKSRC}/lib/berkeley-db-1.xx + @${RLN} ${WRKSRC_axtls} ${WRKSRC}/lib/axtls + @${RLN} ${WRKSRC_bdb} ${WRKSRC}/lib/berkeley-db-1.xx -pre-test: - @${RM} ${WRKSRC}/../tests/basics/memoryerror.py +do-install: + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/micropython ${STAGEDIR}${PREFIX}/bin .include diff --git a/lang/micropython/distinfo b/lang/micropython/distinfo index 694f36951b7a..b719ca0cb403 100644 --- a/lang/micropython/distinfo +++ b/lang/micropython/distinfo @@ -1,2 +1,7 @@ -SHA256 (micropython-micropython-v1.5.1_GH0.tar.gz) = 95cc34089a1e40a992065ff9c9b67c121674c3bd6136a50882054fcac27485c2 -SIZE (micropython-micropython-v1.5.1_GH0.tar.gz) = 6635550 +TIMESTAMP = 1630664518 +SHA256 (micropython-micropython-v1.17_GH0.tar.gz) = c21dbf8144237b3dbe3847c9ad5264cd0f3104eb078c810b3986004cce8fcd70 +SIZE (micropython-micropython-v1.17_GH0.tar.gz) = 6467563 +SHA256 (micropython-axtls-531cab9_GH0.tar.gz) = cd1b9bf60d34e86e62046dd595ddb34b3960d36f44bf7a31d67e253a5bc24fe1 +SIZE (micropython-axtls-531cab9_GH0.tar.gz) = 1325384 +SHA256 (pfalcon-berkeley-db-1.xx-35aaec4_GH0.tar.gz) = 9c696582ce47557556c7d6a14c96236ae5913124d15a63d3a78b384336d1a817 +SIZE (pfalcon-berkeley-db-1.xx-35aaec4_GH0.tar.gz) = 273515 diff --git a/lang/micropython/files/patch-mpy-cross_Makefile b/lang/micropython/files/patch-mpy-cross_Makefile new file mode 100644 index 000000000000..c3df9d6e5083 --- /dev/null +++ b/lang/micropython/files/patch-mpy-cross_Makefile @@ -0,0 +1,26 @@ +* Avoid making all warnings into errors +* Extra optimizations via COPT should be overwritable + +--- mpy-cross/Makefile.orig 2021-09-01 14:07:13 UTC ++++ mpy-cross/Makefile +@@ -17,7 +17,7 @@ INC += -I$(BUILD) + INC += -I$(TOP) + + # compiler settings +-CWARN = -Wall -Werror ++CWARN = -Wall + CWARN += -Wextra -Wno-unused-parameter -Wpointer-arith + CFLAGS = $(INC) $(CWARN) -std=gnu99 $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA) + CFLAGS += -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables +@@ -25,9 +25,9 @@ CFLAGS += -fdata-sections -ffunction-sections -fno-asy + # Debugging/Optimization + ifdef DEBUG + CFLAGS += -g +-COPT = -O0 ++COPT ?= -O0 + else +-COPT = -Os #-DNDEBUG ++COPT ?= -Os #-DNDEBUG + endif + + # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. diff --git a/lang/micropython/files/patch-ports_unix_Makefile b/lang/micropython/files/patch-ports_unix_Makefile new file mode 100644 index 000000000000..ce7f336dcb19 --- /dev/null +++ b/lang/micropython/files/patch-ports_unix_Makefile @@ -0,0 +1,13 @@ +* Avoid making warnings into errors + +--- ports/unix/Makefile.orig 2021-09-04 05:19:26 UTC ++++ ports/unix/Makefile +@@ -38,7 +38,7 @@ INC += -I$(TOP) + INC += -I$(BUILD) + + # compiler settings +-CWARN = -Wall -Werror ++CWARN = -Wall + CWARN += -Wextra -Wno-unused-parameter -Wpointer-arith -Wdouble-promotion -Wfloat-conversion + CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) + diff --git a/lang/micropython/files/patch-tests_unix_ffi__callback.py b/lang/micropython/files/patch-tests_unix_ffi__callback.py new file mode 100644 index 000000000000..e14f0e237b1d --- /dev/null +++ b/lang/micropython/files/patch-tests_unix_ffi__callback.py @@ -0,0 +1,13 @@ +Required to let pass the test "ffi_callback" successfully + +--- tests/unix/ffi_callback.py.orig 2021-09-04 05:46:01 UTC ++++ tests/unix/ffi_callback.py +@@ -16,7 +16,7 @@ def ffi_open(names): + raise err + + +-libc = ffi_open(("libc.so", "libc.so.0", "libc.so.6", "libc.dylib")) ++libc = ffi_open(("libc.so", "libc.so.0", "libc.so.7", "libc.dylib")) + + qsort = libc.func("v", "qsort", "piip") + diff --git a/lang/micropython/files/patch-tests_unix_ffi__float.py b/lang/micropython/files/patch-tests_unix_ffi__float.py new file mode 100644 index 000000000000..652929c87477 --- /dev/null +++ b/lang/micropython/files/patch-tests_unix_ffi__float.py @@ -0,0 +1,13 @@ +Required to let pass the test "ffi_float" successfully + +--- tests/unix/ffi_float.py.orig 2021-09-04 05:47:22 UTC ++++ tests/unix/ffi_float.py +@@ -17,7 +17,7 @@ def ffi_open(names): + raise err + + +-libc = ffi_open(("libc.so", "libc.so.0", "libc.so.6", "libc.dylib")) ++libc = ffi_open(("libc.so", "libc.so.0", "libc.so.7", "libc.dylib")) + + try: + strtof = libc.func("f", "strtof", "sp") diff --git a/lang/micropython/pkg-descr b/lang/micropython/pkg-descr index 31c98cecd585..a11eba1e49e6 100644 --- a/lang/micropython/pkg-descr +++ b/lang/micropython/pkg-descr @@ -1,4 +1,6 @@ -Micro Python is a lean and fast implementation of the Python 3 programming -language that is optimised to run on a microcontroller. +Micro Python is a lean and efficient implementation of the Python 3 +programming language that includes a small subset of the Python +standard library and is optimised to run on microcontrollers and in +constrained environments. WWW: https://www.micropython.org/