From 285ad3ec2b029f5666f661d5771e4c5fd4736046 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Thu, 28 May 2015 15:34:43 +0200 Subject: [PATCH] micropython: update to 1.4.3 - use our {C,LD}FLAGS - do not strip - add patch to make sure the binary contains a proper version number - install license - misc tweaks Close #1608. --- .../patches/micropython-no-git.patch | 33 +++++++++++++++++++ srcpkgs/micropython/template | 26 ++++++++++----- 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/micropython/patches/micropython-no-git.patch diff --git a/srcpkgs/micropython/patches/micropython-no-git.patch b/srcpkgs/micropython/patches/micropython-no-git.patch new file mode 100644 index 00000000000..73f2e0fa1bd --- /dev/null +++ b/srcpkgs/micropython/patches/micropython-no-git.patch @@ -0,0 +1,33 @@ +diff --git py/makeversionhdr.py py/makeversionhdr.py +index e37496d..7d81ecb 100644 +--- py/makeversionhdr.py ++++ py/makeversionhdr.py +@@ -5,26 +5,10 @@ from __future__ import print_function + import sys + import os + import datetime +-import subprocess + + def make_version_header(filename): +- # Note: git describe doesn't work if no tag is available +- try: +- git_tag = subprocess.check_output(["git", "describe", "--dirty", "--always"], universal_newlines=True).strip() +- except subprocess.CalledProcessError: +- git_tag = "" +- try: +- git_hash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], stderr=subprocess.STDOUT, universal_newlines=True).strip() +- except subprocess.CalledProcessError: +- git_hash = "unknown" +- +- try: +- # Check if there are any modified files. +- subprocess.check_call(["git", "diff", "--no-ext-diff", "--quiet", "--exit-code"], stderr=subprocess.STDOUT) +- # Check if there are any staged files. +- subprocess.check_call(["git", "diff-index", "--cached", "--quiet", "HEAD", "--"], stderr=subprocess.STDOUT) +- except subprocess.CalledProcessError: +- git_hash += "-dirty" ++ git_tag = "v1.4.3" ++ git_hash = "d7b7d5f" + + # Try to extract MicroPython version from git tag + if git_tag.startswith("v"): diff --git a/srcpkgs/micropython/template b/srcpkgs/micropython/template index de77e7cc8da..2a969ca3518 100644 --- a/srcpkgs/micropython/template +++ b/srcpkgs/micropython/template @@ -1,19 +1,27 @@ # Template file for 'micropython' pkgname=micropython -version=1.3.10 +version=1.4.3 revision=1 -build_style=gnu-makefile -make_build_args="-C unix" -hostmakedepends="pkg-config python" +build_wrksrc=unix +hostmakedepends="pkg-config python3.4" makedepends="libffi-devel readline-devel" -short_desc="Python for embedded systems" +short_desc="Implementation of Python 3.x for microcontrollers" maintainer="necrophcodr " license="MIT" homepage="http://micropython.org/" distfiles="http://github.com/micropython/micropython/archive/v${version}.tar.gz" -checksum=42ff1b08cb30f5450285b7b1a1aec4c944ddf3840c4cb36faac51b5e79c8dc5c +checksum=09ac1f38fb881bb1942e1a17cf519f692ed78d732403d96586ae76c9c597fa63 -do_install() { - vbin unix/micropython - vbin tools/pip-micropython +pre_configure() { + sed -i 's|-Werror||;/^COPT =/d' Makefile +} +do_build() { + make ${makejobs} V=1 PYTHON=python3.4 \ + CC=$CC CFLAGS_EXTRA="$CPPFLAGS $CFLAGS" \ + LDFLAGS_EXTRA="$LDFLAGS" STRIP=echo +} +do_install() { + vbin micropython + vbin ../tools/pip-micropython + vlicense ../LICENSE }