~alpine/aports

2

[alpine-aports] [PATCH] new aport: testing/micropython

Marian Buschsieweke
Details
Message ID
<20170802072403.2885-1-marian.buschsieweke@ovgu.de>
Sender timestamp
1501658643
DKIM signature
missing
Download raw message
Patch: +66 -0
A lean and efficient Python implementation for MCUs and constrained systems
http://www.micropython.org/
---
 testing/micropython/0000-unix-mpconfigport.patch | 22 ++++++++++++
 testing/micropython/APKBUILD                     | 44 ++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 testing/micropython/0000-unix-mpconfigport.patch
 create mode 100644 testing/micropython/APKBUILD

diff --git a/testing/micropython/0000-unix-mpconfigport.patch b/testing/micropython/0000-unix-mpconfigport.patch
new file mode 100644
index 0000000000..9025694ff2
--- /dev/null
+++ b/testing/micropython/0000-unix-mpconfigport.patch
@@ -0,0 +1,22 @@
+--- old/micropython-1.9.1/unix/mpconfigport.mk
+@@ -9,7 +9,7 @@
+ MICROPY_USE_READLINE = 1
+ 
+ # btree module using Berkeley DB 1.xx
+-MICROPY_PY_BTREE = 1
++MICROPY_PY_BTREE = 0
+ 
+ # _thread module using pthreads
+ MICROPY_PY_THREAD = 1
+@@ -24,8 +24,8 @@
+ MICROPY_PY_FFI = 1
+ 
+ # ussl module requires axtls
+-MICROPY_PY_USSL = 1
+-MICROPY_SSL_AXTLS = 1
++MICROPY_PY_USSL = 0
++MICROPY_SSL_AXTLS = 0
+ MICROPY_SSL_MBEDTLS = 0
+ 
+ # jni module requires JVM/JNI
diff --git a/testing/micropython/APKBUILD b/testing/micropython/APKBUILD
new file mode 100644
index 0000000000..fb7b141623
--- /dev/null
+++ b/testing/micropython/APKBUILD
@@ -0,0 +1,44 @@
+# Contributor: Marian <marian.buschsieweke@ovgu.de>
+# Maintainer: Marian <marian.buschsieweke@ovgu.de>
+pkgname=micropython
+pkgver=1.9.1
+pkgrel=0
+pkgdesc="A lean and efficient Python implementation for MCUs and constrained systems"
+url="http://www.micropython.org/"
+arch="all"
+license="MIT"
+depends=""
+makedepends="libffi-dev python3"
+subpackages=""
+source="${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz
+        0000-unix-mpconfigport.patch"
+builddir="${srcdir}/${pkgname}-${pkgver}/unix"
+
+prepare() {
+	cd "${srcdir}"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$builddir"
+	unset CFLAGS
+	make
+}
+
+check() {
+	cd "$builddir"
+	make test
+}
+
+package() {
+	cd "$builddir"
+	mkdir -p "${pkgdir}/usr/bin"
+	install -m755 micropython "${pkgdir}/usr/bin/micropython"
+}
+
+sha512sums="bc0eeb1e6d821034b7157613f2d421df304f2959e9fd62d2886641eba8d74575787861c9ff46fc3bcb9c14c6ad1f698043231801207f946af9b5d302bb253c63  micropython-1.9.1.tar.gz
+926515a76dc856192de79a7c35c390bd533a38a2c163812ce5a3739280ca33881791f3d199922edb2e577ec9ac16265dc4891ad96f6c6eb4e7cf9d5ae8044a32  0000-unix-mpconfigport.patch"
-- 
2.13.2



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20170803135204.67a821db@ncopa-desktop.copa.dup.pw>
In-Reply-To
<20170802072403.2885-1-marian.buschsieweke@ovgu.de> (view parent)
Sender timestamp
1501761124
DKIM signature
missing
Download raw message
On Wed,  2 Aug 2017 09:24:03 +0200
Marian Buschsieweke <marian.buschsieweke@ovgu.de> wrote:

> A lean and efficient Python implementation for MCUs and constrained systems
> http://www.micropython.org/
> ---
>  testing/micropython/0000-unix-mpconfigport.patch | 22 ++++++++++++
>  testing/micropython/APKBUILD                     | 44 ++++++++++++++++++++++++
>  2 files changed, 66 insertions(+)
>  create mode 100644 testing/micropython/0000-unix-mpconfigport.patch
>  create mode 100644 testing/micropython/APKBUILD

Thanks you for this. Please see comments below:


> +
> +prepare() {
> +	cd "${srcdir}"
> +	for i in $source; do
> +		case $i in
> +		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
> +		esac
> +	done
> +}

You don't need the prepare() function. Recent abuild will do that
automatically for you.

> +
> +build() {
> +	cd "$builddir"
> +	unset CFLAGS

Why is unsetting CFLAGS needed?

> +	make
> +}
> +
> +check() {
> +	cd "$builddir"
> +	make test
> +}
> +
> +package() {
> +	cd "$builddir"
> +	mkdir -p "${pkgdir}/usr/bin"
> +	install -m755 micropython "${pkgdir}/usr/bin/micropython"
> +}
> +

build fails due to missing pyhon:

Generating build/frozen.c
env: can't execute 'python': No such file or directory

When I add python2 to makedepends it fails during tests:

...
skip  unix/extra_coverage.py
FAIL  unix/ffi_callback.py
pass  unix/ffi_float.py
pass  unix/ffi_float2.py
597 tests performed (18223 individual testcases)
596 tests passed
40 tests skipped: builtin_help class_delattr_setattr cmd_parsetree btree1 framebuf1 framebuf16 framebuf4 uhashlib_sha1 urandom_extra ussl_basic vfs_basic vfs_fa
t_fileio1 vfs_fat_fileio2 vfs_fat_more vfs_fat_oldproto vfs_fat_ramdisk buffered_writer native_closure native_const_intbig native_misc schedule viper_addr viper
_args viper_binop_arith viper_binop_comp viper_binop_comp_imm viper_binop_multi_comp viper_cond viper_error viper_import viper_misc viper_misc_intbig viper_ptr1
6_load viper_ptr16_store viper_ptr32_load viper_ptr32_store viper_ptr8_load viper_ptr8_store viper_subscr extra_coverage
1 tests failed: ffi_callback
make: *** [Makefile:192: test] Error 1



> +sha512sums="bc0eeb1e6d821034b7157613f2d421df304f2959e9fd62d2886641eba8d74575787861c9ff46fc3bcb9c14c6ad1f698043231801207f946af9b5d302bb253c63  micropython-1.9.1.tar.gz
> +926515a76dc856192de79a7c35c390bd533a38a2c163812ce5a3739280ca33881791f3d199922edb2e577ec9ac16265dc4891ad96f6c6eb4e7cf9d5ae8044a32  0000-unix-mpconfigport.patch"



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20170803145204.40537137@ncopa-desktop.copa.dup.pw>
In-Reply-To
<20170803135204.67a821db@ncopa-desktop.copa.dup.pw> (view parent)
Sender timestamp
1501764724
DKIM signature
missing
Download raw message
On Thu, 3 Aug 2017 13:52:04 +0200
Natanael Copa <ncopa@alpinelinux.org> wrote:

> On Wed,  2 Aug 2017 09:24:03 +0200
> Marian Buschsieweke <marian.buschsieweke@ovgu.de> wrote:
> 
> > A lean and efficient Python implementation for MCUs and constrained systems
> > http://www.micropython.org/

Hi,

I pushed this and added a few cleanups and workaround the ffi_callback.

I also added python2 to makedepends, but it would be nice to patch
whatever needed so we dont need the python2 package. I did start with a
python3.patch but didn't complete it.

Would be nice if you could have a look at that.

Thanks!

-nc


> > ---
> >  testing/micropython/0000-unix-mpconfigport.patch | 22 ++++++++++++
> >  testing/micropython/APKBUILD                     | 44 ++++++++++++++++++++++++
> >  2 files changed, 66 insertions(+)
> >  create mode 100644 testing/micropython/0000-unix-mpconfigport.patch
> >  create mode 100644 testing/micropython/APKBUILD  
> 
> Thanks you for this. Please see comments below:
> 
> 
> > +
> > +prepare() {
> > +	cd "${srcdir}"
> > +	for i in $source; do
> > +		case $i in
> > +		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
> > +		esac
> > +	done
> > +}  
> 
> You don't need the prepare() function. Recent abuild will do that
> automatically for you.
> 
> > +
> > +build() {
> > +	cd "$builddir"
> > +	unset CFLAGS  
> 
> Why is unsetting CFLAGS needed?
> 
> > +	make
> > +}
> > +
> > +check() {
> > +	cd "$builddir"
> > +	make test
> > +}
> > +
> > +package() {
> > +	cd "$builddir"
> > +	mkdir -p "${pkgdir}/usr/bin"
> > +	install -m755 micropython "${pkgdir}/usr/bin/micropython"
> > +}
> > +  
> 
> build fails due to missing pyhon:
> 
> Generating build/frozen.c
> env: can't execute 'python': No such file or directory
> 
> When I add python2 to makedepends it fails during tests:
> 
> ...
> skip  unix/extra_coverage.py
> FAIL  unix/ffi_callback.py
> pass  unix/ffi_float.py
> pass  unix/ffi_float2.py
> 597 tests performed (18223 individual testcases)
> 596 tests passed
> 40 tests skipped: builtin_help class_delattr_setattr cmd_parsetree btree1 framebuf1 framebuf16 framebuf4 uhashlib_sha1 urandom_extra ussl_basic vfs_basic vfs_fa
> t_fileio1 vfs_fat_fileio2 vfs_fat_more vfs_fat_oldproto vfs_fat_ramdisk buffered_writer native_closure native_const_intbig native_misc schedule viper_addr viper
> _args viper_binop_arith viper_binop_comp viper_binop_comp_imm viper_binop_multi_comp viper_cond viper_error viper_import viper_misc viper_misc_intbig viper_ptr1
> 6_load viper_ptr16_store viper_ptr32_load viper_ptr32_store viper_ptr8_load viper_ptr8_store viper_subscr extra_coverage
> 1 tests failed: ffi_callback
> make: *** [Makefile:192: test] Error 1
> 
> 
> 
> > +sha512sums="bc0eeb1e6d821034b7157613f2d421df304f2959e9fd62d2886641eba8d74575787861c9ff46fc3bcb9c14c6ad1f698043231801207f946af9b5d302bb253c63  micropython-1.9.1.tar.gz
> > +926515a76dc856192de79a7c35c390bd533a38a2c163812ce5a3739280ca33881791f3d199922edb2e577ec9ac16265dc4891ad96f6c6eb4e7cf9d5ae8044a32  0000-unix-mpconfigport.patch"  
> 
> 
> 
> ---
> Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
> Help:         alpine-aports+help@lists.alpinelinux.org
> ---
> 



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---