Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

13
lang/micropython/DESCR Normal file
View File

@@ -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.

28
lang/micropython/Makefile Normal file
View File

@@ -0,0 +1,28 @@
# $NetBSD: Makefile,v 1.2 2016/03/22 19:01:17 joerg 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
DIST_SUBDIR= ${PKGNAME_NOREV}
BUILD_DIRS= unix
USE_TOOLS+= gmake pkg-config
AUTO_MKDIRS= yes
MAKE_FLAGS+= PYTHON=${PYTHONBIN}
REPLACE_PYTHON+= tools/make-frozen.py
PYTHON_FOR_BUILD_ONLY= yes
.include "../../devel/libffi/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../mk/bsd.pkg.mk"

3
lang/micropython/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1 2016/01/18 07:54:51 agc Exp $
bin/micropython
bin/pip-micropython

View File

@@ -0,0 +1,9 @@
$NetBSD: distinfo,v 1.3 2016/03/25 21:11:16 joerg 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

View File

@@ -0,0 +1,15 @@
$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); }

View File

@@ -0,0 +1,54 @@
$NetBSD: patch-unix_Makefile,v 1.1 2016/03/22 19:01:17 joerg Exp $
Invoke gmake properly
--- unix/Makefile.orig 2015-12-31 14:43:19.000000000 +0000
+++ unix/Makefile
@@ -149,14 +149,13 @@ test: $(PROG) ../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
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 @@ $(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)"

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-unix_mpconfigport.h,v 1.1 2016/03/22 19:01:17 joerg Exp $
Generalise for all BSDs
--- unix/mpconfigport.h.orig 2015-12-31 14:43:19.000000000 +0000
+++ unix/mpconfigport.h
@@ -261,7 +261,8 @@ void mp_hal_dupterm_tx_strn(const char *
// 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>