pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/micropython Update lang/micropython to v1.9.2.
details: https://anonhg.NetBSD.org/pkgsrc/rev/f075209031a1
branches: trunk
changeset: 372214:f075209031a1
user: hauke <hauke%pkgsrc.org@localhost>
date: Wed Nov 29 15:13:31 2017 +0000
description:
Update lang/micropython to v1.9.2.
Changes are many, but upstream does not maintain a changelog.
diffstat:
lang/micropython/DESCR | 2 +
lang/micropython/Makefile | 31 ++++++--
lang/micropython/PLIST | 8 +-
lang/micropython/distinfo | 19 +++--
lang/micropython/patches/patch-lib_utils_printf.c | 17 +++++
lang/micropython/patches/patch-mpy-cross_mpconfigport.h | 15 ++++
lang/micropython/patches/patch-py_mkenv.mk | 15 ++++
lang/micropython/patches/patch-py_obj.h | 15 ----
lang/micropython/patches/patch-unix_Makefile | 57 +++++-----------
lang/micropython/patches/patch-unix_mpconfigport.h | 10 +-
lang/micropython/patches/patch-unix_mpthreadport.c | 21 ++++++
11 files changed, 132 insertions(+), 78 deletions(-)
diffs (truncated from 303 to 300 lines):
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/DESCR
--- a/lang/micropython/DESCR Wed Nov 29 14:12:00 2017 +0000
+++ b/lang/micropython/DESCR Wed Nov 29 15:13:31 2017 +0000
@@ -11,3 +11,5 @@
collections.namedtuple, classes and instances. Builtin modules
include sys, time, and struct. Note that only subset of Python 3.4
functionality is implemented for the data types and modules.
+
+Documentation is at <http://docs.micropython.org/en/latest/>.
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/Makefile
--- a/lang/micropython/Makefile Wed Nov 29 14:12:00 2017 +0000
+++ b/lang/micropython/Makefile Wed Nov 29 15:13:31 2017 +0000
@@ -1,27 +1,42 @@
-# $NetBSD: Makefile,v 1.2 2016/03/22 19:01:17 joerg Exp $
+# $NetBSD: Makefile,v 1.3 2017/11/29 15:13:31 hauke Exp $
-DISTNAME= micropython-1.5.2
+DISTNAME= micropython-1.9.2
CATEGORIES= lang
-MASTER_SITES= ${MASTER_SITE_GITHUB:=micropython/}
-GITHUB_TAG= v1.5.2
+MASTER_SITES= http://micropython.org/resources/source/
+EXTRACT_SUFX= .tar.xz
MAINTAINER= agc%NetBSD.org@localhost
HOMEPAGE= https://micropython.org/
-COMMENT= Embedded version of python
+COMMENT= Embedded version of python 3
LICENSE= mit
DIST_SUBDIR= ${PKGNAME_NOREV}
BUILD_DIRS= unix
-USE_TOOLS+= gmake pkg-config
+USE_TOOLS+= pax gmake pkg-config
AUTO_MKDIRS= yes
-MAKE_FLAGS+= PYTHON=${PYTHONBIN}
+PYTHON_VERSIONS_INCOMPATIBLE= 27
+PYTHON_FOR_BUILD_ONLY= yes
+
+MAKE_ENV+= PYTHON=${PYTHONBIN:Q}
+MAKE_ENV+= MICROPY_CPYTHON3=${PYTHONBIN:Q}
REPLACE_PYTHON+= tools/make-frozen.py
+REPLACE_PYTHON+= tests/run-tests
-PYTHON_FOR_BUILD_ONLY= yes
+pre-configure:
+ cd ${WRKSRC}/lib/axtls && ${GMAKE} clean
+
+pre-build:
+ cd ${WRKSRC}/unix && ${GMAKE} axtls
+
+do-test:
+ cd ${WRKSRC}/unix && env ${MAKE_ENV} ${GMAKE} test
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/unix/micropython ${DESTDIR}${PREFIX}/bin
.include "../../devel/libffi/buildlink3.mk"
.include "../../lang/python/application.mk"
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/PLIST
--- a/lang/micropython/PLIST Wed Nov 29 14:12:00 2017 +0000
+++ b/lang/micropython/PLIST Wed Nov 29 15:13:31 2017 +0000
@@ -1,3 +1,7 @@
-@comment $NetBSD: PLIST,v 1.1 2016/01/18 07:54:51 agc Exp $
+@comment $NetBSD: PLIST,v 1.2 2017/11/29 15:13:31 hauke Exp $
bin/micropython
-bin/pip-micropython
+@pkgdir share/examples/micropython/unix
+@pkgdir share/examples/micropython/network
+@pkgdir share/examples/micropython/hwapi
+@pkgdir share/examples/micropython/embedding
+@pkgdir share/examples/micropython/SDdatalogger
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/distinfo
--- a/lang/micropython/distinfo Wed Nov 29 14:12:00 2017 +0000
+++ b/lang/micropython/distinfo Wed Nov 29 15:13:31 2017 +0000
@@ -1,9 +1,12 @@
-$NetBSD: distinfo,v 1.3 2016/03/25 21:11:16 joerg Exp $
+$NetBSD: distinfo,v 1.4 2017/11/29 15:13:31 hauke Exp $
-SHA1 (micropython-1.5.2/micropython-1.5.2.tar.gz) = 493cf36aa722b50b6034efb8de6433dcea546b0f
-RMD160 (micropython-1.5.2/micropython-1.5.2.tar.gz) = 0f5c316ecd716734fe8e1dbdf9a360ef6f126b85
-SHA512 (micropython-1.5.2/micropython-1.5.2.tar.gz) = 309dcb20a3369ac5bec92a6a5cd8af37d671fc2a8e3b6a36c4c49d1f4730eaaa46dffb2351eb5783de12f045069554c22ee70c0100cf98ab09138ef42594a65a
-Size (micropython-1.5.2/micropython-1.5.2.tar.gz) = 6673101 bytes
-SHA1 (patch-py_obj.h) = f148e1e88ef6347c93fca5d367b36be805267f74
-SHA1 (patch-unix_Makefile) = e40d7413ec1140e6a408b82708f1749b3cb879bb
-SHA1 (patch-unix_mpconfigport.h) = a93806f5db48cc61096a899ea3558afc46468ff1
+SHA1 (micropython-1.9.2/micropython-1.9.2.tar.xz) = c14b2e7ebaefe86e60f4b11cf738947cf8204fba
+RMD160 (micropython-1.9.2/micropython-1.9.2.tar.xz) = 9c22131546c3e49bfa28b5f71994b20ee819d094
+SHA512 (micropython-1.9.2/micropython-1.9.2.tar.xz) = 67d070d47c19a100d164f9b4e4ec7eba10cf5ee49089f5f4d6a8338a9d72d6cffa41c2f6de73c8b169ba8011961b8ef197241fa5bea6813f77f65ef4cf2f4e4b
+Size (micropython-1.9.2/micropython-1.9.2.tar.xz) = 6699860 bytes
+SHA1 (patch-lib_utils_printf.c) = 6c152cd10a5fb0091d1149a0a50b202df6a6e931
+SHA1 (patch-mpy-cross_mpconfigport.h) = 78cf0865c60bf8fbbecb318e4f0597662076459e
+SHA1 (patch-py_mkenv.mk) = ff844cd4bcb6f9a2a27e02a62a066b4b70899c88
+SHA1 (patch-unix_Makefile) = 51a636af55719e454f1464aa7c1c06c0808de56a
+SHA1 (patch-unix_mpconfigport.h) = 544c0217ffcc8755adbb8c63a4b325af9b7ff8a2
+SHA1 (patch-unix_mpthreadport.c) = 5a021a4b1b7426ea7bae302870a04008381ee9c7
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-lib_utils_printf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/micropython/patches/patch-lib_utils_printf.c Wed Nov 29 15:13:31 2017 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_utils_printf.c,v 1.1 2017/11/29 15:13:32 hauke Exp $
+
+Undefine macro names we intend to implement as functions
+
+--- lib/utils/printf.c.orig 2017-08-23 01:50:10.000000000 +0000
++++ lib/utils/printf.c
+@@ -40,6 +40,10 @@
+ #endif
+
+ #undef putchar // Some stdlibs have a #define for putchar
++
++#undef snprintf
++#undef vsnprintf
++
+ int printf(const char *fmt, ...);
+ int vprintf(const char *fmt, va_list ap);
+ int putchar(int c);
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-mpy-cross_mpconfigport.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/micropython/patches/patch-mpy-cross_mpconfigport.h Wed Nov 29 15:13:31 2017 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-mpy-cross_mpconfigport.h,v 1.1 2017/11/29 15:13:32 hauke Exp $
+
+Modern *BSDs heclare alloca() in <stdlib.h>
+
+--- mpy-cross/mpconfigport.h.orig 2017-08-23 01:50:10.000000000 +0000
++++ mpy-cross/mpconfigport.h
+@@ -115,7 +115,7 @@ typedef long mp_off_t;
+ #endif
+
+ // We need to provide a declaration/definition of alloca()
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+ #include <stdlib.h>
+ #elif defined( _WIN32 )
+ #include <malloc.h>
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-py_mkenv.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/micropython/patches/patch-py_mkenv.mk Wed Nov 29 15:13:31 2017 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-py_mkenv.mk,v 1.1 2017/11/29 15:13:32 hauke Exp $
+
+Set the Python's name in pkg Makefile
+
+--- py/mkenv.mk.orig 2017-11-01 00:19:56.000000000 +0000
++++ py/mkenv.mk
+@@ -42,7 +42,7 @@ ECHO = @echo
+ CP = cp
+ MKDIR = mkdir
+ SED = sed
+-PYTHON = python
++PYTHON ?= python
+
+ AS = $(CROSS_COMPILE)as
+ CC = $(CROSS_COMPILE)gcc
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-py_obj.h
--- a/lang/micropython/patches/patch-py_obj.h Wed Nov 29 14:12:00 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-$NetBSD: patch-py_obj.h,v 1.1 2016/03/22 19:01:17 joerg Exp $
-
-Avoid Undefined Behavior.
-
---- py/obj.h.orig 2016-03-02 16:07:50.524241926 +0000
-+++ py/obj.h
-@@ -81,7 +81,7 @@ typedef struct _mp_obj_base_t mp_obj_bas
- static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
- { return ((((mp_int_t)(o)) & 1) != 0); }
- #define MP_OBJ_SMALL_INT_VALUE(o) (((mp_int_t)(o)) >> 1)
--#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_int_t)(small_int)) << 1) | 1))
-+#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_int_t)(small_int)) * 2) | 1))
-
- static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
- { return ((((mp_int_t)(o)) & 3) == 2); }
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-unix_Makefile
--- a/lang/micropython/patches/patch-unix_Makefile Wed Nov 29 14:12:00 2017 +0000
+++ b/lang/micropython/patches/patch-unix_Makefile Wed Nov 29 15:13:31 2017 +0000
@@ -1,54 +1,31 @@
-$NetBSD: patch-unix_Makefile,v 1.1 2016/03/22 19:01:17 joerg Exp $
+$NetBSD: patch-unix_Makefile,v 1.2 2017/11/29 15:13:32 hauke Exp $
-Invoke gmake properly
+cpp(1) only accepts one file for input, we want cc -E here.
+
+Set up for pkgsrc install
---- unix/Makefile.orig 2015-12-31 14:43:19.000000000 +0000
+--- unix/Makefile.orig 2017-08-23 01:50:11.000000000 +0000
+++ unix/Makefile
-@@ -149,14 +149,13 @@ test: $(PROG) ../tests/run-tests
+@@ -73,6 +73,7 @@ LDFLAGS_ARCH = -Wl,-map,$@.map -Wl,-dead
+ else
+ # Use gcc syntax for map file
+ LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref -Wl,--gc-sections
++CPP = $(CC) -E
+ endif
+ LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
+
+@@ -193,12 +194,10 @@ test: $(PROG) $(TOP)/tests/run-tests
# install micropython in /usr/local/bin
TARGET = micropython
-PREFIX = $(DESTDIR)/usr/local
-BINDIR = $(PREFIX)/bin
-+BINDIR = $(DESTDIR)${PREFIX}/bin
- PIPSRC = ../tools/pip-micropython
- PIPTARGET = pip-micropython
++BINDIR = $(DESTDIR)$(PREFIX)/bin
install: micropython
-- install -D $(TARGET) $(BINDIR)/$(TARGET)
-- install -D $(PIPSRC) $(BINDIR)/$(PIPTARGET)
+- install -d $(BINDIR)
+- install $(TARGET) $(BINDIR)/$(TARGET)
+ ${BSD_INSTALL_PROGRAM} $(TARGET) $(BINDIR)/$(TARGET)
-+ ${BSD_INSTALL_SCRIPT} $(PIPSRC) $(BINDIR)/$(PIPTARGET)
# uninstall micropython
uninstall:
-@@ -196,12 +195,12 @@ $(BUILD)/_frozen_upip.c: $(BUILD)/frozen
- ../tools/make-frozen.py $(dir $^) > $@
-
- # Select latest upip version available
--UPIP_TARBALL := $(shell ls -1 -v ../tools/micropython-upip-*.tar.gz | tail -n1)
-+UPIP_TARBALL := $(shell ls -1 ../tools/micropython-upip-*.tar.gz | tail -n1)
-
- $(BUILD)/frozen_upip/upip.py: $(UPIP_TARBALL)
- $(ECHO) "MISC Preparing upip as frozen module"
- $(Q)rm -rf $(BUILD)/micropython-upip-*
-- $(Q)tar -C $(BUILD) -xz -f $^
-+ $(Q)tar -C $(BUILD) -x -z -f $^
- $(Q)rm -rf $(dir $@)
- $(Q)mkdir -p $(dir $@)
- $(Q)cp $(BUILD)/micropython-upip-*/upip*.py $(dir $@)
-@@ -224,10 +223,10 @@ libffi:
- cd ../lib/libffi; ./autogen.sh
- mkdir -p ../lib/libffi/build_dir; cd ../lib/libffi/build_dir; \
- ../configure $(CROSS_COMPILE_HOST) --prefix=$$PWD/out CC="$(CC)" CXX="$(CXX)" LD="$(LD)"; \
-- make install-exec-recursive; make -C include install-data-am
-+ ${MAKE} install-exec-recursive; ${MAKE} -C include install-data-am
-
- axtls:
- cd ../lib/axtls; cp config/upyconfig config/.config
-- cd ../lib/axtls; make oldconfig -B
-- cd ../lib/axtls; make clean
-- cd ../lib/axtls; make all CC="$(CC)" LD="$(LD)"
-+ cd ../lib/axtls; ${MAKE} oldconfig -B
-+ cd ../lib/axtls; ${MAKE} clean
-+ cd ../lib/axtls; ${MAKE} all CC="$(CC)" LD="$(LD)"
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-unix_mpconfigport.h
--- a/lang/micropython/patches/patch-unix_mpconfigport.h Wed Nov 29 14:12:00 2017 +0000
+++ b/lang/micropython/patches/patch-unix_mpconfigport.h Wed Nov 29 15:13:31 2017 +0000
@@ -1,16 +1,16 @@
-$NetBSD: patch-unix_mpconfigport.h,v 1.1 2016/03/22 19:01:17 joerg Exp $
+$NetBSD: patch-unix_mpconfigport.h,v 1.2 2017/11/29 15:13:32 hauke Exp $
-Generalise for all BSDs
+Modern *BSDs heclare alloca() in <stdlib.h>
---- unix/mpconfigport.h.orig 2015-12-31 14:43:19.000000000 +0000
+--- unix/mpconfigport.h.orig 2017-08-23 01:50:11.000000000 +0000
+++ unix/mpconfigport.h
-@@ -261,7 +261,8 @@ void mp_hal_dupterm_tx_strn(const char *
+@@ -291,7 +291,8 @@ void mp_unix_mark_exec(void);
// We need to provide a declaration/definition of alloca()
// unless support for it is disabled.
#if !defined(MICROPY_NO_ALLOCA) || MICROPY_NO_ALLOCA == 0
-#ifdef __FreeBSD__
+#include <sys/param.h>
-+#if (defined(BSD) && BSD >= 199506)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <stdlib.h>
#else
#include <alloca.h>
diff -r c855d5b60eb3 -r f075209031a1 lang/micropython/patches/patch-unix_mpthreadport.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/micropython/patches/patch-unix_mpthreadport.c Wed Nov 29 15:13:31 2017 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-unix_mpthreadport.c,v 1.1 2017/11/29 15:13:32 hauke Exp $
+
+NetBSD does not (yet) #define PTHREAD_STACK_MIN
+
+--- unix/mpthreadport.c.orig 2017-08-23 01:50:11.000000000 +0000
++++ unix/mpthreadport.c
+@@ -140,11 +140,13 @@ void mp_thread_create(void *(*entry)(voi
+ *stack_size = 8192 * BYTES_PER_WORD;
+ }
+
++#ifdef PTHREAD_STACK_MIN /* NetBSD */
+ // minimum stack size is set by pthreads
+ if (*stack_size < PTHREAD_STACK_MIN) {
+ *stack_size = PTHREAD_STACK_MIN;
+ }
+-
++#endif /* PTHREAD_STACK_MIN */
++
Home |
Main Index |
Thread Index |
Old Index