14
0
forked from pool/micropython
Files
micropython/micropython.spec

72 lines
2.0 KiB
RPMSpec

#
# spec file for package micropython
#
# Copyright (c) 2021 SUSE LLC
#
# 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/
#
Name: micropython
Version: 1.13
Release: 0
Summary: Implementation of Python 3 with very low memory footprint
License: MIT
Group: Development/Languages/Python
Url: https://micropython.org/
Source: https://micropython.org/resources/source/%{name}-%{version}.tar.xz
BuildRequires: readline-devel
BuildRequires: pkgconfig(libffi)
BuildRequires: python3
BuildRequires: python
BuildRequires: openssl
Recommends: micropython-lib
ExcludeArch: %{ix86} %{arm}
%description
A lean and efficient Python implementation for microcontrollers and constrained systems
%prep
%setup -q
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
pushd mpy-cross
%make_build
popd
pushd ports/unix
%make_build micropython
popd
%install
install -d %{buildroot}%{_bindir}
install -t %{buildroot}%{_bindir} ports/unix/micropython
%ifnarch aarch64
# aarch64: 2 tests failed: float_parse float_parse_doubleprec
# https://github.com/micropython/micropython/issues/4176
%check
pushd ports/unix
export MICROPY_CPYTHON3=python3
make PYTHON=%{__python3} V=1 test
popd
%endif
%files
%defattr(-,root,root)
%doc LICENSE
%{_bindir}/micropython
%changelog