summaryrefslogtreecommitdiff
path: root/lang/micropython/patches
diff options
context:
space:
mode:
authoragc <agc>2016-01-18 07:54:50 +0000
committeragc <agc>2016-01-18 07:54:50 +0000
commitfb4a21e435caa3e27d0b48fa0e5330d7397f9b86 (patch)
tree0bb8eb0173c8d0f5b7f24e28e1c881af05aced50 /lang/micropython/patches
parent8aaba92898b6eb98297782ae0fa3fe8165cc6ff2 (diff)
downloadpkgsrc-fb4a21e435caa3e27d0b48fa0e5330d7397f9b86.tar.gz
Add micropython-1.5.2, a python 3.4 implementation, to the Packages Collection.
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.
Diffstat (limited to 'lang/micropython/patches')
-rw-r--r--lang/micropython/patches/patch-Makefile54
-rw-r--r--lang/micropython/patches/patch-mpconfigport.h16
2 files changed, 70 insertions, 0 deletions
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>