From patchwork Tue Feb 19 09:22:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 1193 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C8C3D16C63; Tue, 19 Feb 2019 09:23:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6655616C0F for ; Tue, 19 Feb 2019 09:23:19 +0000 (GMT) Received: from localhost ([127.0.0.1]:44834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw1cU-00007g-Dh for patchwork@mira.cbaines.net; Tue, 19 Feb 2019 04:23:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw1cM-00006f-5E for guix-patches@gnu.org; Tue, 19 Feb 2019 04:23:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw1cH-0004IN-Gq for guix-patches@gnu.org; Tue, 19 Feb 2019 04:23:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gw1cF-0004Hq-B6 for guix-patches@gnu.org; Tue, 19 Feb 2019 04:23:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gw1cF-0005uC-32 for guix-patches@gnu.org; Tue, 19 Feb 2019 04:23:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34571] [PATCH] Add micropython Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Feb 2019 09:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34571 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34571@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155056816422660 (code B ref -1); Tue, 19 Feb 2019 09:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Feb 2019 09:22:44 +0000 Received: from localhost ([127.0.0.1]:53886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gw1bu-0005tO-LM for submit@debbugs.gnu.org; Tue, 19 Feb 2019 04:22:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gw1bs-0005tB-F3 for submit@debbugs.gnu.org; Tue, 19 Feb 2019 04:22:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:52130) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gw1bf-00048H-J6 for submit@debbugs.gnu.org; Tue, 19 Feb 2019 04:22:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw1be-0008G5-GP for guix-patches@gnu.org; Tue, 19 Feb 2019 04:22:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw1bc-00047C-7A for guix-patches@gnu.org; Tue, 19 Feb 2019 04:22:26 -0500 Received: from flashner.co.il ([178.62.234.194]:44122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw1ba-00046S-6y for guix-patches@gnu.org; Tue, 19 Feb 2019 04:22:22 -0500 Received: from localhost (unknown [188.120.128.87]) by flashner.co.il (Postfix) with ESMTPSA id 9E66340047 for ; Tue, 19 Feb 2019 09:22:17 +0000 (UTC) Date: Tue, 19 Feb 2019 11:22:16 +0200 From: Efraim Flashner Message-ID: <20190219092216.GA32103@macbook41> MIME-Version: 1.0 Content-Disposition: inline X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 User-Agent: Mutt/1.11.2 (2019-01-07) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches I was looking around to see if there was an alternate perl implementation and I ended up packaging micropython. I have no preference between it being in python.scm or embedded.scm diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1c4ea720f..e5beac2ec 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -459,3 +459,49 @@ instead of @command{python3}."))) (define-public python-wrapper (wrap-python3 python)) (define-public python-minimal-wrapper (wrap-python3 python-minimal)) + +(define-public micropython + (package + (name "micropython") + (version "1.10") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/micropython/micropython/" + "releases/download/v" version + "/micropython-" version ".tar.gz")) + (sha256 + (base32 + "1g1zjip3rkx6bp16qi1bag72wivnbh56fcsl3nffanrx4j5f4z90")))) + (build-system gnu-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-before 'build 'preprare-build + (lambda _ + (chdir "ports/unix") + ;; see: https://github.com/micropython/micropython/pull/4246 + (substitute* "Makefile" + (("-Os") "-Os -ffp-contract=off")) + #t)) + (delete 'configure)) ; no configure + #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) + "V=1") + #:test-target "test")) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python-minimal-wrapper))) + (inputs + `(("libffi" ,libffi))) + (home-page "https://micropython.org/") + (synopsis "Python implementation for microcontrollers and constrained systems") + (description "MicroPython is a lean and efficient implementation of the +Python 3 programming language that includes a small subset of the Python +standard library and is optimised to run on microcontrollers and in constrained +environments. MicroPython is packed full of advanced features such as an +interactive prompt, arbitrary precision integers, closures, list comprehension, +generators, exception handling and more. Still it is compact enough to fit and +run within just 256k of code space and 16k of RAM. MicroPython aims to be as +compatible with normal Python as possible to allow you to transfer code with +ease from the desktop to a microcontroller or embedded system.") + (license license:expat)))