From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:51238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw2mu-0003yK-Be for guix-patches@gnu.org; Tue, 19 Feb 2019 05:38:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw2mq-00033U-0R for guix-patches@gnu.org; Tue, 19 Feb 2019 05:38:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gw2mo-000332-C8 for guix-patches@gnu.org; Tue, 19 Feb 2019 05:38:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gw2mo-0007eR-3n for guix-patches@gnu.org; Tue, 19 Feb 2019 05:38:02 -0500 Subject: [bug#34571] [PATCH] Add micropython Resent-Message-ID: Date: Tue, 19 Feb 2019 12:37:04 +0200 From: Efraim Flashner Message-ID: <20190219103704.GC32103@macbook41> References: <20190219092216.GA32103@macbook41> <20190219104640.631a3ba8@scratchpost.org> <20190219101059.GB32103@macbook41> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0QFb0wBpEddLcDHQ" Content-Disposition: inline In-Reply-To: <20190219101059.GB32103@macbook41> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 34571@debbugs.gnu.org --0QFb0wBpEddLcDHQ Content-Type: multipart/mixed; boundary="FFoLq8A0u+X9iRU8" Content-Disposition: inline --FFoLq8A0u+X9iRU8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 19, 2019 at 12:10:59PM +0200, Efraim Flashner wrote: > On Tue, Feb 19, 2019 at 10:46:40AM +0100, Danny Milosavljevic wrote: > > Hi Erfraim, > >=20 > > On Tue, 19 Feb 2019 11:22:16 +0200 > > Efraim Flashner wrote: > >=20 > > > 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 > >=20 > > Heh :) > >=20 > > There's a bundled version of FreeRTOS in ./ports/cc3200 which is GPLv2 > > with a modification. > >=20 > > In this case, I suggest to delete FreeRTOS since we don't use it > > anyway--and if we ever wanted to, we'd not use the bundled version. > > So in a sense I suggest to unbundle it. > >=20 > > We could also just add GPLv2 with exception to the license list, > > but in this case I wouldn't--since it doesn't really apply to the > > installed version and we don't use it anyhow. >=20 > I'll go ahead and remove it. >=20 > >=20 > > Also, there's a bundled copy of libffi in lib. Usually, I delete > > it to make sure it's not picked up by accident. > >=20 > Looking at the .gitmodules=C2=B9 it looks like there's a number of bundled > librarires in the lib folder. With all of them removed it no longer > builds. Looks like I need to take another look at it. >=20 > I also switched python-minimal-wrapper -> python-wrapper >=20 > =C2=B9 https://github.com/micropython/micropython/blob/v1.10/.gitmodules >=20 I have a new version attached --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --FFoLq8A0u+X9iRU8 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-Add-micropython.patch" Content-Transfer-Encoding: quoted-printable =46rom a8cc300d4d2ae55554ac29a840357b775105ed29 Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Tue, 19 Feb 2019 11:20:02 +0200 Subject: [PATCH] gnu: Add micropython. * gnu/packages/python.scm (micropython): New variable. --- gnu/packages/python.scm | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1c4ea720f..25f2ffa73 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -459,3 +459,65 @@ instead of @command{python3}."))) =20 (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")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "ports/cc3200/FreeRTOS") + (with-directory-excursion "lib" + ;; TODO: Unbundle axtls and berkley-db-1.xx + (for-each delete-file-recursively + '("libffi" "lwip" "stm32lib" "nrfx"))) + #t)))) + (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=3Doff")) + #t)) + (replace 'install-license-files + ;; We don't build in the root directory so the file isn't found. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dest (string-append out "/share/doc/" ,name "-" ,vers= ion "/"))) + (install-file "../../LICENSE" dest)) + #t)) + (delete 'configure)) ; no configure + #:make-flags (list (string-append "PREFIX=3D" (assoc-ref %outputs "= out")) + "V=3D1") + #:test-target "test")) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python-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 constr= ained +environments. MicroPython is packed full of advanced features such as an +interactive prompt, arbitrary precision integers, closures, list comprehen= sion, +generators, exception handling and more. Still it is compact enough to fi= t 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 wi= th +ease from the desktop to a microcontroller or embedded system.") + (license license:expat))) --=20 2.20.1 --FFoLq8A0u+X9iRU8-- --0QFb0wBpEddLcDHQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlxr3E8ACgkQQarn3Mo9 g1GdEg/+JF9F9pVczfhyaiM3bZcnBhgGE+iQTkoucq1Y6cc4jpHDzBzU2XyDYZwo pbEf6UO91eKErViKYUNIEAMYSAP98qGHmqS7WrGQRy/cErmLKFxU92K+/xUaEnhr 8othwDRGozeZIbuxKAxmX1pJovJRY4G1JaUH10inEItpC1C+j8R3ag8jkQGHMTto woR1zOTu2UKCCLN7M6PPsEeP/Wu4E7pUJ5Il9p+L2/t5BvE3Y/OJrPMadu0JtsQJ dz5rm0q9LmxIsVfXSXAXuaLb1eCSAOuPOP/VxqKHAmr68wJYG63tqEZLmS7ZAyIL rFT7TJP4W8p/djYXC4IdOc01RMofe5WISRmvcyu0lN0UqQPxrf6IeGMCApyEBmOf bGrEEFyrtLx+a7lPUxE1KCWiubav8KUTXIpIcrd9n+TjQSu1NJpwU1OnhpkPmcIg FVgfIHcqAmvYdhxhWCTCZ8wyqD5csHd6xwTP4re/AGdhq4sVZifx0mx+TIMervOe pRz2Fc02q1B6u4TLU35h0ouIYh4rPny/o1hRTRU4u5vS1hymtyqX4OqZnN86otwZ xuSZ3ghsMa0JLlbhNYlN0BZ7FOA6eLhbgBMdkrgxzw+FudJbCWuS5haDS4J/+uOl juhJ+hSs01Mzkp1D9Nm84osByVrwiz/2nYdCEUys9Jwf5JJikAY= =/H5s -----END PGP SIGNATURE----- --0QFb0wBpEddLcDHQ--