Subject: [alpine-aports] [PATCH] testing/micropython: Added subpackage micropython-cross

From: Marian Buschsieweke <[email-masked]>
Date: Thu, 3 Aug 2017 16:08:43 +0200

micropython-cross provides mpy-cross, which allows compiling python
code to micropython bytecode. This is particularly useful to
unburden MCUs from the task to compile python scripts.
---
 testing/micropython/APKBUILD | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/testing/micropython/APKBUILD b/testing/micropython/APKBUILD
index cd003b4e4a..1306af73b7 100644
--- a/testing/micropython/APKBUILD
+++ b/testing/micropython/APKBUILD
@@ -2,14 +2,14 @@
 # Maintainer: Marian <[email-masked]>
 pkgname=micropython
 pkgver=1.9.1
-pkgrel=0
+pkgrel=1
 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 python2"
-subpackages=""
+subpackages="$pkgname-cross"
 source="${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz
         0000-unix-mpconfigport.patch
 	python3.patch
@@ -37,6 +37,13 @@ package() {
 	install -m755 unix/micropython "${pkgdir}/usr/bin/micropython"
 }
 
+cross() {
+	pkgdesc="Compile micropython code to bytecode, which can be transfered to MCUs"
+	cd "$builddir"
+	mkdir -p "${subpkgdir}/usr/bin"
+	install -m755 mpy-cross/mpy-cross "${subpkgdir}/usr/bin/mpy-cross"
+}
+
 sha512sums="bc0eeb1e6d821034b7157613f2d421df304f2959e9fd62d2886641eba8d74575787861c9ff46fc3bcb9c14c6ad1f698043231801207f946af9b5d302bb253c63  micropython-1.9.1.tar.gz
 a9f922627db7cb59f56798f850c024382adffa1d1b5ccc27597ae34a9be53983a573e6dab64db4376ab24733624ad2005e67d96265517fb303d5b56f1b2654ea  0000-unix-mpconfigport.patch
 66ca172a6e9f4866e733e6c9303882dbb5f5729ffc685e0ba200010bacb8d5014527efd82da4c2ab62266e0816917758ae8e6089fb575ec31c3dc4441909343f  python3.patch"
-- 
2.13.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 3 Aug 2017 16:39:20 +0200

On Thu,  3 Aug 2017 16:08:43 +0200

> unburden MCUs from the task to compile python scripts.

I rebased it against current master and pushed.

Thanks!

-nc

---