2021-02-02 22:43:49 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package micropython
|
|
|
|
|
#
|
2025-02-06 07:58:50 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2021-02-02 22:43:49 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
2021-04-17 13:27:37 +00:00
|
|
|
|
2025-02-06 07:58:50 +00:00
|
|
|
%define pythons python3
|
2025-02-07 19:04:09 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2025-02-06 07:58:50 +00:00
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
Name: micropython
|
- Update to 1.25.0
* Add ROMFS support (see also "mpremote romfs" cmd with "query", "build", and "deploy" sub-commands)
ROMFS defines a read-only, memory-mappable, extensible filesystem that can contain arbitrary resources,
including precompiled mpy files, and allows executing bytecode directly from the filesystem.
This makes importing significantly faster and use a lot less memory.
* Inline assembler now supports 32-bit RISC-V assembly code via the newly implemented @micropython.asm_rv32 decorator.
* Datagram TLS (DTLS) is now supported by the tls module and enabled on the alif, mimxrt, renesas-ra, rp2, stm32 and unix ports.
* mpremote command-line tool now supports recursive remove via the new "rm -r"
* mpremote now supports relative URLs in the package.json for installing from the local filesystem
* "mpremote mount" has optimised readline support
* full support for tuples and start/end arguments in str.startswith() and str.endswith() methods
* vfs.mount() with no arguments now returns a list of mounted filesystems
* marshal module has been added with dumps() and loads() functions
* MicroPython native linker mpy_ld.py now includes support for linking in static libraries automatically
* native modules now support 32-bit RISC-V code
* force _FILE_OFFSET_BITS=64 to fix 32-bit file ABI
* enable VfsRom on standard and coverage variants
* use the bare metal mbedTLS config in the coverage buiid
* add recursive mutex support
* main: add coverage test for mounting ROMFS filesystem at startup
- Drop fix_re_sub_test_on_python3.13.patch as not needed anymore
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/micropython?expand=0&rev=40
2025-04-16 12:11:06 +00:00
|
|
|
Version: 1.25.0
|
2021-02-02 22:43:49 +00:00
|
|
|
Release: 0
|
|
|
|
|
Summary: Implementation of Python 3 with very low memory footprint
|
|
|
|
|
License: MIT
|
2021-04-17 13:27:37 +00:00
|
|
|
URL: https://micropython.org/
|
2025-05-26 11:55:32 +00:00
|
|
|
Source: %{name}-%{version}.tar.xz
|
2021-04-17 13:27:37 +00:00
|
|
|
BuildRequires: openssl
|
2022-07-02 16:28:48 +00:00
|
|
|
BuildRequires: pkgconfig
|
2021-04-17 13:27:37 +00:00
|
|
|
BuildRequires: python3
|
2021-02-02 22:43:49 +00:00
|
|
|
BuildRequires: readline-devel
|
|
|
|
|
BuildRequires: pkgconfig(libffi)
|
2025-02-06 07:58:50 +00:00
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
Recommends: micropython-lib
|
2021-05-07 12:31:20 +00:00
|
|
|
ExcludeArch: %{ix86} %{arm} ppc64 ppc64le
|
2021-02-02 22:43:49 +00:00
|
|
|
|
2025-02-06 07:58:50 +00:00
|
|
|
%package -n mpremote
|
|
|
|
|
Summary: MicroPython remote control
|
|
|
|
|
BuildArch: noarch
|
2025-02-07 19:04:09 +00:00
|
|
|
BuildRequires: %{python_module hatch-requirements-txt}
|
|
|
|
|
BuildRequires: %{python_module hatchling}
|
2025-02-06 07:58:50 +00:00
|
|
|
Requires: python3-pyserial >= 3.3
|
|
|
|
|
BuildRequires: %{python_module base >= 3.6}
|
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
|
BuildRequires: %{python_module wheel}
|
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
|
2025-02-18 11:49:19 +00:00
|
|
|
%package -n mpy-tools
|
|
|
|
|
Summary: Tools for creating and handling precompiled .mpy files for MicroPython
|
|
|
|
|
Provides: mpy-cross
|
|
|
|
|
Provides: mpy-tool
|
|
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
%description
|
|
|
|
|
A lean and efficient Python implementation for microcontrollers and constrained systems
|
|
|
|
|
|
2025-02-06 07:58:50 +00:00
|
|
|
%description -n mpremote
|
|
|
|
|
This CLI tool provides an integrated set of utilities to remotely interact with
|
|
|
|
|
and automate a MicroPython device over a serial connection.
|
|
|
|
|
|
2025-02-18 11:49:19 +00:00
|
|
|
%description -n mpy-tools
|
|
|
|
|
MicroPython tools like the mpy-cross compiler for compiling.py files to .mpy files.
|
|
|
|
|
Also mpy-tool for inspecting .mpy files.
|
|
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
%prep
|
2021-08-02 17:46:05 +00:00
|
|
|
%autosetup -p1
|
|
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
sed -i -e "s:/usr/lib/micropython:%{_prefix}/lib/micropython:g" "ports/unix/main.c"
|
|
|
|
|
|
|
|
|
|
%define make_flags V=1 MICROPY_PY_BTREE=0 MICROPY_PY_USSL=0
|
|
|
|
|
|
|
|
|
|
%build
|
2025-02-18 11:49:19 +00:00
|
|
|
# micropython
|
2024-01-15 14:58:26 +00:00
|
|
|
export CFLAGS="%optflags -Wno-dangling-pointer"
|
2021-04-17 13:27:37 +00:00
|
|
|
%make_build -C mpy-cross
|
2023-04-28 07:11:48 +00:00
|
|
|
%make_build -C ports/unix STRIP=true
|
2025-02-06 07:58:50 +00:00
|
|
|
pushd tools/mpremote
|
|
|
|
|
# inject version info as there is no git checkout to get tags from
|
|
|
|
|
echo "VERSION = '%{version}'" > version.py
|
|
|
|
|
sed -i -e 's/source = "vcs"/path = "version.py"/' pyproject.toml
|
|
|
|
|
# remove useless shebang lines
|
|
|
|
|
sed -i -e 's_#!/usr/bin/env python3__' mpremote/{__main__,transport,transport_serial}.py
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
popd
|
2021-02-02 22:43:49 +00:00
|
|
|
|
|
|
|
|
%install
|
2025-02-18 11:49:19 +00:00
|
|
|
# micropython
|
2021-02-02 22:43:49 +00:00
|
|
|
install -d %{buildroot}%{_bindir}
|
2023-04-28 07:11:48 +00:00
|
|
|
install -t %{buildroot}%{_bindir} ports/unix/build-standard/micropython
|
2025-02-18 11:49:19 +00:00
|
|
|
|
|
|
|
|
# mpremote
|
2025-02-06 07:58:50 +00:00
|
|
|
pushd tools/mpremote
|
|
|
|
|
%pyproject_install
|
|
|
|
|
popd
|
2025-02-10 17:38:34 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
# remove pycache to get rid of rpmlint "W: python-bytecode-inconsistent-mtime" warnings
|
|
|
|
|
%python_expand rm -rf %{buildroot}%{$python_sitelib}/mpremote/__pycache__
|
2021-02-02 22:43:49 +00:00
|
|
|
|
2025-02-18 11:49:19 +00:00
|
|
|
# mpy-tools
|
|
|
|
|
install -m755 -D -v mpy-cross/build/mpy-cross %{buildroot}%{_bindir}/mpy-cross
|
|
|
|
|
install -m755 -D -v tools/mpy-tool.py %{buildroot}%{_bindir}/mpy-tool
|
|
|
|
|
%python3_fix_shebang
|
|
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
%check
|
2022-10-12 10:49:10 +00:00
|
|
|
%ifnarch x86_64
|
|
|
|
|
# 2 tests fail: float_parse float_parse_doubleprec
|
|
|
|
|
# https://github.com/micropython/micropython/pull/6024
|
|
|
|
|
rm -f tests/float/float_parse.py
|
|
|
|
|
rm -f tests/float/float_parse_doubleprec.py
|
|
|
|
|
%endif
|
2025-02-07 19:04:09 +00:00
|
|
|
export MICROPY_CPYTHON3=python%python_version
|
|
|
|
|
make -C ports/unix PYTHON=%{_bindir}/python%python_version V=1 test
|
2021-02-02 22:43:49 +00:00
|
|
|
|
|
|
|
|
%files
|
2021-04-17 13:27:37 +00:00
|
|
|
%license LICENSE
|
|
|
|
|
%doc docs/unix/*
|
2021-02-02 22:43:49 +00:00
|
|
|
%{_bindir}/micropython
|
|
|
|
|
|
2025-02-10 17:38:34 +00:00
|
|
|
%files -n mpremote
|
2025-02-06 07:58:50 +00:00
|
|
|
%license tools/mpremote/LICENSE
|
|
|
|
|
%doc tools/mpremote/README.md
|
2025-02-10 17:38:34 +00:00
|
|
|
%{_prefix}/lib/python%{python_version}/site-packages/mpremote
|
|
|
|
|
%{_prefix}/lib/python%{python_version}/site-packages/mpremote-%{version}.dist-info
|
2025-02-06 07:58:50 +00:00
|
|
|
%{_bindir}/mpremote
|
|
|
|
|
|
2025-02-18 11:49:19 +00:00
|
|
|
%files -n mpy-tools
|
|
|
|
|
%doc mpy-cross/README.md
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{_bindir}/mpy-cross
|
|
|
|
|
%{_bindir}/mpy-tool
|
|
|
|
|
|
2021-02-02 22:43:49 +00:00
|
|
|
%changelog
|