diff options
author | wenLiangcan | 2015-08-25 16:42:34 +0800 |
---|---|---|
committer | wenLiangcan | 2015-08-25 16:42:34 +0800 |
commit | dc4b8a575e33001d65ec75eafd4b1a0df69c1709 (patch) | |
tree | 650d376796c52112994cdffb888e5c2d08bd377d | |
download | aur-dc4b8a575e33001d65ec75eafd4b1a0df69c1709.tar.gz |
micropython-lib-git 20150823-1.
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 51 |
2 files changed, 69 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ea8f3d1ab14d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = micropython-lib-git + pkgdesc = Core Python libraries ported to MicroPythona + pkgver = 20150823 + pkgrel = 1 + url = http://micropython.org/ + arch = i686 + arch = x86_64 + license = MIT + makedepends = git + makedepends = python + provides = micropython-lib + conflicts = micropython-lib + options = !emptydirs + source = git://github.com/micropython/micropython-lib.git + md5sums = SKIP + +pkgname = micropython-lib-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c1d1b0f14750 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: wenLiangcan <boxeed at gmail dot com> +# Contributor: Kyle Keen <keenerd@gmail.com> + +pkgname=micropython-lib-git +pkgver=20150823 +pkgrel=1 +pkgdesc="Core Python libraries ported to MicroPythona" +arch=('i686' 'x86_64') +url="http://micropython.org/" +license=('MIT') +depends=() +makedepends=('git' 'python') +conflicts=('micropython-lib') +provides=('micropython-lib') +options=('!emptydirs') +source=('git://github.com/micropython/micropython-lib.git') +md5sums=('SKIP') + +pkgver() { + cd "${srcdir}/micropython-lib" + git log -1 --format='%cd' --date=short | tr -d -- '-' +} + +build() { + cd "$srcdir/micropython-lib" + make +} + +package() { + cd "$srcdir/micropython-lib" + for _d in $(find -mindepth 1 -maxdepth 1 -type d); do + if grep -qr 'import metadata' ./$_d/*; then + error "Skipping $_d (bad import)" + continue + fi + if [[ ! -f $_d/setup.py ]]; then + error "Skipping $_d (no setup)" + continue + fi + msg "Installing $_d" + cd $_d + python3 setup.py install --prefix=/usr --root="${pkgdir}" --install-lib='/usr/lib/micropython' + cd .. + done + + # micropython doesn't support pyc + find "${pkgdir}" -name '*.pyc' -delete + + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} + |