b1e484c
%global debug_package %{nil}
b1e484c
ef3a11f
# NLR code is incompatible with Link Time Optimizations
ef3a11f
# https://github.com/micropython/micropython/issues/8421
ef3a11f
%global _lto_cflags %nil
ef3a11f
ef3a11f
# Add -Wformat as it's required along with -Wformat-security
ef3a11f
# set by redhat-rpm-config
ef3a11f
%global _warning_options %_warning_options -Wformat
b1e484c
b1e484c
Name:           micropython
016cc16
Version:        1.19.1
03bfd83
Release:        3%{?dist}
b1e484c
Summary:        Implementation of Python 3 with very low memory footprint
f9c1937
f9c1937
# micorpython itself is MIT
f9c1937
# axtls and berkeley-db are BSD
f9c1937
License:        MIT and BSD
f9c1937
b1e484c
URL:            http://micropython.org/
b1e484c
Source0:        https://github.com/micropython/micropython/archive/v%{version}.tar.gz
b1e484c
20b4c23
%global axtls_commit 531cab9c278c947d268bd4c94ecab9153a961b43
20b4c23
Source1:       https://github.com/micropython/axtls/archive/%{axtls_commit}/axtls-%{axtls_commit}.tar.gz
f9c1937
481e33b
%global berkley_commit 35aaec4418ad78628a3b935885dd189d41ce779b
f9c1937
Source2:       https://github.com/pfalcon/berkeley-db-1.xx/archive/%{berkley_commit}/berkeley-db-1.xx-%{berkley_commit}.tar.gz
03bfd83
Patch0:        micropython-c99.patch
f9c1937
cdb89cc
# Other arches need active porting
4c13cf3
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
4c13cf3
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
4c13cf3
ExclusiveArch:  %{arm} x86_64
4c13cf3
%else
007ea5d
ExclusiveArch:  %{arm} %{ix86} x86_64
4c13cf3
%endif
cdb89cc
20b4c23
BuildRequires:  make
da4686e
BuildRequires:  gcc
b1e484c
BuildRequires:  python3-devel
b1e484c
BuildRequires:  libffi-devel
b1e484c
BuildRequires:  readline-devel
b1e484c
BuildRequires:  execstack
1dd3998
BuildRequires:  openssl-devel
b1e484c
c1afadf
# Part of the tests runs MicroPython and CPython and compares the results.
20b4c23
# MicroPython is ~3.4, but the testing framework supports newer Pythons as well.
c1afadf
# We use the latest working CPython version in those test, setting the
c1afadf
# MICROPY_CPYTHON3 environment variable.
20b4c23
# Normal %%{pytohn3} is used anywhere else.
c1afadf
# There is no runtime dependency on this CPython (or any other).
20b4c23
%global cpython_version_tests 3.9
c1afadf
BuildRequires:  %{_bindir}/python%{cpython_version_tests}
c1afadf
20b4c23
Provides:       bundled(axtls) = 2.1.5
f9c1937
Provides:       bundled(libdb) = 1.85
f9c1937
b1e484c
%description
b1e484c
Implementation of Python 3 with very low memory footprint
b1e484c
b1e484c
%prep
e318ff5
%autosetup -p1 -n %{name}-%{version}
b1e484c
f9c1937
# git submodules
f9c1937
rmdir lib/axtls
f9c1937
tar -xf %{SOURCE1}
f9c1937
mv axtls-%{axtls_commit} lib/axtls
f9c1937
f9c1937
head -n 28 lib/axtls/axtlswrap/Makefile > LICENSE.axtls
f9c1937
f9c1937
rmdir lib/berkeley-db-1.xx
f9c1937
tar -xf %{SOURCE2}
f9c1937
mv berkeley-db-1.xx-%{berkley_commit} lib/berkeley-db-1.xx
f9c1937
f9c1937
head -n 32 lib/berkeley-db-1.xx/db/db.c > LICENSE.libdb
f9c1937
02a71a2
# Fix shebangs
02a71a2
files=$(grep -rl '#!/usr/bin/env python')
006e55c
%py3_shebang_fix $files
02a71a2
b1e484c
# Removing pre-built binary; not required for build
481e33b
rm ports/cc3200/bootmgr/relocator/relocator.bin
b1e484c
c08dcf3
%build
c08dcf3
# Build the cross-compiler
c08dcf3
%make_build -C mpy-cross
2462089
c08dcf3
# Build the unbundled submodules
c08dcf3
%make_build -C ports/unix axtls V=1
2462089
c08dcf3
# Build the interpreter
20b4c23
%make_build -C ports/unix PYTHON=%{python3} V=1
b1e484c
481e33b
execstack -c ports/unix/micropython
b1e484c
b1e484c
%check
481e33b
pushd ports/unix
c1afadf
export MICROPY_CPYTHON3=python%{cpython_version_tests}
20b4c23
make PYTHON=%{python3} V=1 test
b1e484c
popd
b1e484c
b1e484c
%install
b1e484c
mkdir -p %{buildroot}%{_bindir}
481e33b
install -pm 755 ports/unix/micropython %{buildroot}%{_bindir}
b1e484c
b1e484c
%files
b1e484c
%doc README.md
f9c1937
%license LICENSE LICENSE.axtls LICENSE.libdb
b1e484c
%{_bindir}/micropython
b1e484c
b1e484c
%changelog
03bfd83
* Mon Dec 12 2022 Florian Weimer <fweimer@redhat.com> - 1.19.1-3
03bfd83
- Port to C99
03bfd83
83ab374
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.1-2
83ab374
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
83ab374
016cc16
* Fri Jun 17 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.19.1-1
016cc16
- Update to 1.19.1
016cc16
- Fixes: rhbz#2097936
016cc16
ef3a11f
* Fri Mar 04 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.18-1
ef3a11f
- Update to 1.18
ef3a11f
- Disable Link Time Optimizations
ef3a11f
- Fixes: rhbz#2046737, rhbz#2041651
ef3a11f
a647c9a
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.17-3
a647c9a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
a647c9a
9ff9fa3
* Sat Jan 08 2022 Miro Hrončok <mhroncok@redhat.com> - 1.17-2
9ff9fa3
- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34
9ff9fa3
20b4c23
* Fri Sep 03 2021 Miro Hrončok <mhroncok@redhat.com> - 1.17-1
20b4c23
- Update to 1.17
20b4c23
- Fixes: rhbz#2000869
20b4c23
f3501db
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.16-2
f3501db
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
f3501db
513aa59
* Thu Jun 24 2021 Tomas Hrnciar <thrnciar@redhat.com> - 1.16-1
513aa59
- Update to 1.16
513aa59
1167919
* Thu May 06 2021 Miro Hrončok <mhroncok@redhat.com> - 1.15-1
1167919
- Update to 1.15
1167919
- Fixes rhbz#1950805
1167919
- Fix build on 32bit architectures
1167919
- Fixes rhbz#1922142
1167919
c12db7b
* Fri Mar 19 2021 Charalampos Stratakis <cstratak@redhat.com> - 1.14-1
c12db7b
- Update to 1.14 (#1924346)
c12db7b
17b1290
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-2
17b1290
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
17b1290
3bfceea
* Mon Sep 07 2020 Tomas Hrnciar <thrnciar@redhat.com> - 1.13-1
8444346
- Update to 1.13 (#1874689)
8444346
475adef
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-2
475adef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
475adef
c08dcf3
* Wed Apr 15 2020 Charalampos Stratakis <cstratak@redhat.com> - 1.12-1
c08dcf3
- Update to 1.12 (#1785781)
c08dcf3
5c08fb7
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-3
5c08fb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
5c08fb7
c2008f4
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-2
c2008f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
c2008f4
4323ef4
* Wed Jul 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.11-1
4323ef4
- Update to 1.11 (#1714903)
4323ef4
2462089
* Sun Feb 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10-1
2462089
- Update to 1.10 (#1669547)
2462089
aa07b0e
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.4-3
aa07b0e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
aa07b0e
007ea5d
* Sun Jan 13 2019 Miro Hrončok <mhroncok@redhat.com> - 1.9.4-2
007ea5d
- Enable i686, fix a FTBFS (#1556924)
007ea5d
c1afadf
* Wed Aug 01 2018 Miro Hrončok <mhroncok@redhat.com> - 1.9.4-1
c1afadf
- Update to 1.9.4 (#1577187)
c1afadf
- Use CPython 3.6 in tests that compare results due to PEP479 (#1604827)
c1afadf
ab2af3a
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.3-6
ab2af3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
ab2af3a
59de598
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.9.3-5
59de598
- Rebuilt for Python 3.7
59de598
02a71a2
* Thu Mar 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.9.3-4
02a71a2
- Get rid of python2 build dependency
a37660f
- Temporarily disable i686, investigate later
02a71a2
f0be32a
* Thu Mar 15 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.9.3-3
f0be32a
- Update Python 2 dependency declarations to new packaging standards
f0be32a
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
f0be32a
0e1aff0
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.3-2
0e1aff0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0e1aff0
481e33b
* Wed Nov 01 2017 Miro Hrončok <mhroncok@redhat.com> - 1.9.3-1
481e33b
- Update to 1.9.3 (#1508424)
481e33b
f9c1937
* Tue Sep 12 2017 Miro Hrončok <mhroncok@redhat.com> - 1.9.2-1
f9c1937
- Update to 1.9.2 (#1332739) and fix FTBFS (#1423943)
f9c1937
- Add 2 git submodules to sources, add bundled provides
f9c1937
- Changed license tag to include BSD (becasue of those submodules)
f9c1937
b764684
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-5
b764684
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
b764684
3d4d5b3
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-4
3d4d5b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3d4d5b3
7ee386b
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-3
7ee386b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7ee386b
cdb89cc
* Sat Aug 13 2016 Peter Robinson <pbrobinson@fedoraproject.org> 1.8.1-2
cdb89cc
- Add ExclusiveArch, other arches need active porting
cdb89cc
c70af0b
* Wed Jun 06 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.8.1-1
c70af0b
- Update to 1.8.1
c70af0b
f2a6140
* Wed May 04 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.8-1
c70af0b
- Update to 1.8
f2a6140
ad99281
* Tue Apr 19 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.7-1
c70af0b
- Update to 1.7
ad99281
b1e484c
* Tue Apr 05 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.6-3
b1e484c
- Remove license-encumbered bits in stmhal/
b1e484c
b1e484c
* Tue Apr 05 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.6-2
b1e484c
- Remove cc3200/bootmgr/relocator/relocator.bin
b1e484c
- Fix license macro
b1e484c
b1e484c
* Tue Apr 05 2016 John Dulaney <jdulaney@fedoraproject.org> - 1.6-1
b1e484c
- Update to 1.6
b1e484c
b1e484c
* Tue May 20 2014 Matej Stuchlik <mstuchli@redhat.com> - 1.2-1
b1e484c
- Initial spec