diff options
-rw-r--r-- | lang/Makefile | 3 | ||||
-rw-r--r-- | lang/micropython/DESCR | 13 | ||||
-rw-r--r-- | lang/micropython/Makefile | 22 | ||||
-rw-r--r-- | lang/micropython/PLIST | 3 | ||||
-rw-r--r-- | lang/micropython/distinfo | 8 | ||||
-rw-r--r-- | lang/micropython/patches/patch-Makefile | 54 | ||||
-rw-r--r-- | lang/micropython/patches/patch-mpconfigport.h | 16 |
7 files changed, 118 insertions, 1 deletions
diff --git a/lang/Makefile b/lang/Makefile index 851439b4f98..11bee075367 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.425 2015/12/30 15:08:24 taca Exp $ +# $NetBSD: Makefile,v 1.426 2016/01/18 07:54:50 agc Exp $ # COMMENT= Programming languages @@ -121,6 +121,7 @@ SUBDIR+= lush SUBDIR+= maude SUBDIR+= mawk SUBDIR+= mercury +SUBDIR+= micropython SUBDIR+= minischeme SUBDIR+= mit-scheme-bin SUBDIR+= mono diff --git a/lang/micropython/DESCR b/lang/micropython/DESCR new file mode 100644 index 00000000000..8fd69d11c73 --- /dev/null +++ b/lang/micropython/DESCR @@ -0,0 +1,13 @@ +This is the MicroPython project, which aims to put an implementation +of Python 3.x on microcontrollers and small embedded systems. + +WARNING: this project is in beta stage and is subject to changes of +the code-base, including project-wide name changes and API changes. + +MicroPython implements the entire Python 3.4 syntax (including +exceptions, "with", "yield from", etc.). The following core datatypes +are provided: str (including basic Unicode support), bytes, +bytearray, tuple, list, dict, set, frozenset, array.array, +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. diff --git a/lang/micropython/Makefile b/lang/micropython/Makefile new file mode 100644 index 00000000000..8cfe3e44cfc --- /dev/null +++ b/lang/micropython/Makefile @@ -0,0 +1,22 @@ +# $NetBSD: Makefile,v 1.1 2016/01/18 07:54:51 agc Exp $ + +DISTNAME= micropython-1.5.2 +CATEGORIES= lang +MASTER_SITES= ${MASTER_SITE_GITHUB:=micropython/} +GITHUB_TAG= v1.5.2 + +MAINTAINER= agc@NetBSD.org +HOMEPAGE= https://micropython.org/ +COMMENT= Embedded version of python +LICENSE= mit + +WRKSRC= ${WRKDIR}/${DISTNAME}/unix +DIST_SUBDIR= ${PKGNAME_NOREV} + +USE_TOOLS+= gmake pkg-config + +AUTO_MKDIRS= yes + +.include "../../devel/libffi/buildlink3.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/lang/micropython/PLIST b/lang/micropython/PLIST new file mode 100644 index 00000000000..82190a86257 --- /dev/null +++ b/lang/micropython/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1 2016/01/18 07:54:51 agc Exp $ +bin/micropython +bin/pip-micropython diff --git a/lang/micropython/distinfo b/lang/micropython/distinfo new file mode 100644 index 00000000000..58a09f64d63 --- /dev/null +++ b/lang/micropython/distinfo @@ -0,0 +1,8 @@ +$NetBSD: distinfo,v 1.1 2016/01/18 07:54:51 agc 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-Makefile) = fd7a3c143cd6c4137782b0ed2e1b361e13910364 +SHA1 (patch-mpconfigport.h) = 7cd3b0604f6f7941e5a44d276fd8393ba71b5447 diff --git a/lang/micropython/patches/patch-Makefile b/lang/micropython/patches/patch-Makefile new file mode 100644 index 00000000000..265b5020531 --- /dev/null +++ b/lang/micropython/patches/patch-Makefile @@ -0,0 +1,54 @@ +$NetBSD: patch-Makefile,v 1.1 2016/01/18 07:54:51 agc Exp $ + +Invoke gmake properly + +--- Makefile 2016/01/09 21:43:06 1.1 ++++ Makefile 2016/01/09 21:51:39 +@@ -149,14 +149,13 @@ + + # 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 + + install: micropython +- install -D $(TARGET) $(BINDIR)/$(TARGET) +- install -D $(PIPSRC) $(BINDIR)/$(PIPTARGET) ++ ${BSD_INSTALL_PROGRAM} $(TARGET) $(BINDIR)/$(TARGET) ++ ${BSD_INSTALL_SCRIPT} $(PIPSRC) $(BINDIR)/$(PIPTARGET) + + # uninstall micropython + uninstall: +@@ -196,12 +195,12 @@ + ../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 @@ + 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 --git a/lang/micropython/patches/patch-mpconfigport.h b/lang/micropython/patches/patch-mpconfigport.h new file mode 100644 index 00000000000..26a676de311 --- /dev/null +++ b/lang/micropython/patches/patch-mpconfigport.h @@ -0,0 +1,16 @@ +$NetBSD: patch-mpconfigport.h,v 1.1 2016/01/18 07:54:51 agc Exp $ + +Generalise for all BSDs + +--- mpconfigport.h 2016/01/09 20:30:55 1.1 ++++ mpconfigport.h 2016/01/09 20:32:14 +@@ -251,7 +251,8 @@ + // 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) + #include <stdlib.h> + #else + #include <alloca.h> |