aboutsummaryrefslogtreecommitdiffstats
path: root/testing/micropython/APKBUILD
blob: 83f10c50e3643612ad9dfe0cba8d87649c8d400b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Contributor: Marian <marian.buschsieweke@ovgu.de>
# Maintainer: Marian <marian.buschsieweke@ovgu.de>
pkgname=micropython
pkgver=1.11
pkgrel=0
pkgdesc="A lean and efficient Python implementation for MCUs and constrained systems"
url="https://www.micropython.org/"

# ../py/persistentcode.c:397:2: error: #error mp_raw_code_save_file not implemented for this platform
arch="all !s390x !x86 !armv7 !ppc64le !aarch64"

license="MIT"
makedepends="libffi-dev python3"
subpackages="$pkgname-cross"
source="${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz
	micropython-1.9.4-prevent-stripping.patch
	0000-unix-mpconfigport.patch
	python3.patch
	"

build() {
	make -C ports/unix PYTHON=python3
}

check() {
	# float rounding fails https://github.com/micropython/micropython/issues/4176
	case "$CARCH" in
		aarch64)
			rm tests/float/float_parse.py tests/float/float_parse_doubleprec.py
		;;
		ppc64le)
			rm tests/float/float_parse.py tests/float/float_parse_doubleprec.py tests/micropython/extreme_exc.py
		;;
	esac

	# ffi callback fails on kernel with PaX
	rm tests/unix/ffi_callback.py

	make -C ports/unix test PYTHON=python3
}

package() {
	mkdir -p "${pkgdir}/usr/bin"
	install -m755 ports/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="1d8a9e79690da3c92cf0a6bdc76d091321bf1ebc310d6f8dd11101a64861599b076cacb59489e3cf86f47cf4fe4331f16f6afd64a2f1cf0cbdf1ddb294b7623e  micropython-1.11.tar.gz
8f994394f42d7fed5fa35b62c01c37ebea3b487c029d659134a263ef8d65e1ec17bec755fdf57cde2f234969bc4f7f4ab30858562d7f8cdb2bc6cb819ba2ae0d  micropython-1.9.4-prevent-stripping.patch
4c1de6a6477453e846998565402c69d1dd716cf692a3bb55aa16b6991722a94d8364c05f0603b981a7dd9e9af577a3f46910a60d501513af547ebbf3ed574711  0000-unix-mpconfigport.patch
8dbdc52e09f70b5eea461257ebc00031ab9d2c91a9bdbd7522e4ffd1eddddcd0dab3a171361e776543abca827a2f5d6ad01b06c10c8635db861bf79bfa065338  python3.patch"