Mon Jan 18 07:54:51 2016 UTC ()
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.


(agc)
diff -r1.425 -r1.426 pkgsrc/lang/Makefile
diff -r0 -r1.1 pkgsrc/lang/micropython/DESCR
diff -r0 -r1.1 pkgsrc/lang/micropython/Makefile
diff -r0 -r1.1 pkgsrc/lang/micropython/PLIST
diff -r0 -r1.1 pkgsrc/lang/micropython/distinfo
diff -r0 -r1.1 pkgsrc/lang/micropython/patches/patch-Makefile
diff -r0 -r1.1 pkgsrc/lang/micropython/patches/patch-mpconfigport.h

cvs diff -r1.425 -r1.426 pkgsrc/lang/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/Makefile 2015/12/30 15:08:24 1.425
+++ pkgsrc/lang/Makefile 2016/01/18 07:54:50 1.426
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.425 2015/12/30 15:08:24 taca Exp $ 1# $NetBSD: Makefile,v 1.426 2016/01/18 07:54:50 agc Exp $
2# 2#
3 3
4COMMENT= Programming languages 4COMMENT= Programming languages
5 5
6SUBDIR+= Cg-compiler 6SUBDIR+= Cg-compiler
7SUBDIR+= LuaJIT 7SUBDIR+= LuaJIT
8SUBDIR+= LuaJIT2 8SUBDIR+= LuaJIT2
9SUBDIR+= STk 9SUBDIR+= STk
10SUBDIR+= a60 10SUBDIR+= a60
11SUBDIR+= abcl 11SUBDIR+= abcl
12SUBDIR+= algol68g 12SUBDIR+= algol68g
13SUBDIR+= asn1c 13SUBDIR+= asn1c
14SUBDIR+= awka 14SUBDIR+= awka
@@ -111,26 +111,27 @@ SUBDIR+= ksi @@ -111,26 +111,27 @@ SUBDIR+= ksi
111SUBDIR+= libLLVM 111SUBDIR+= libLLVM
112SUBDIR+= libLLVM34 112SUBDIR+= libLLVM34
113SUBDIR+= librep 113SUBDIR+= librep
114SUBDIR+= libtcl-nothread 114SUBDIR+= libtcl-nothread
115SUBDIR+= likepython 115SUBDIR+= likepython
116#SUBDIR+= lua # only contains Makefile fragments 116#SUBDIR+= lua # only contains Makefile fragments
117SUBDIR+= lua51 117SUBDIR+= lua51
118SUBDIR+= lua52 118SUBDIR+= lua52
119SUBDIR+= lua53 119SUBDIR+= lua53
120SUBDIR+= lush 120SUBDIR+= lush
121SUBDIR+= maude 121SUBDIR+= maude
122SUBDIR+= mawk 122SUBDIR+= mawk
123SUBDIR+= mercury 123SUBDIR+= mercury
 124SUBDIR+= micropython
124SUBDIR+= minischeme 125SUBDIR+= minischeme
125SUBDIR+= mit-scheme-bin 126SUBDIR+= mit-scheme-bin
126SUBDIR+= mono 127SUBDIR+= mono
127SUBDIR+= mono-basic 128SUBDIR+= mono-basic
128SUBDIR+= mono2 129SUBDIR+= mono2
129SUBDIR+= moscow_ml 130SUBDIR+= moscow_ml
130SUBDIR+= mpd 131SUBDIR+= mpd
131SUBDIR+= nawk 132SUBDIR+= nawk
132SUBDIR+= newlisp 133SUBDIR+= newlisp
133SUBDIR+= newsqueak 134SUBDIR+= newsqueak
134SUBDIR+= nhc98 135SUBDIR+= nhc98
135SUBDIR+= nodejs 136SUBDIR+= nodejs
136SUBDIR+= nodejs4 137SUBDIR+= nodejs4

File Added: pkgsrc/lang/micropython/DESCR
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.

File Added: pkgsrc/lang/micropython/Makefile
# $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"

File Added: pkgsrc/lang/micropython/PLIST
@comment $NetBSD: PLIST,v 1.1 2016/01/18 07:54:51 agc Exp $
bin/micropython
bin/pip-micropython

File Added: pkgsrc/lang/micropython/distinfo
$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

File Added: pkgsrc/lang/micropython/patches/Attic/patch-Makefile
$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)"

File Added: pkgsrc/lang/micropython/patches/Attic/patch-mpconfigport.h
$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>