14
0
Files
python-python-for-android/python-python-for-android.spec

135 lines
4.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-python-for-android
#
# Copyright (c) 2024 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/
#
%define version_with_zeros 2024.01.21
Name: python-python-for-android
Version: 2024.1.21
Release: 0
Summary: Android APK packager for Python scripts and apps
License: MIT
URL: https://github.com/kivy/python-for-android
- Update to v2023.02.10: * pydantic recipe has been updated. * scypt recipe has been updated. * --orientation option controls the allowed orientations (portrait, landscape, portrait-reverse, landscape-reverse). * --manifest-orientation option has been added to keep the android:screenOrientation personalisation functionality. * If --manifest-orientation is not set, and only (one of multiple) --orientation options are passed, the value for android:screenOrientationis guessed and synthesized from the --orientation option. * Introduced support for permission properties (maxSdkVersion and usesPermissionFlags) * Minimal and recommended Android NDK version is now 25b * MIN_TARGET_API has been updated to 30 and RECOMMENDED_TARGET_API in order to comply with Google Play Store requirements. * android.activity now offers Application.ActivityLifecycleCallbacks helpers. * secp256k1 Update "--host=" #2714 (RobertFlatt) * recipe.download_file: implement shallow git cloning #2682 (SomberNight) * Resize webview when keyboard is shown #2674 (dbnicholson) * Fixes libvpx build #2672 (misl6) * toml may not be available on systemwide python #2670 (misl6) * android/activity: Add Application.ActivityLifecycleCallbacks helpers #2669 (dbnicholson) * Bump minimal and recommended Android NDK version to 25b #2668 (misl6) * Include HOME in build environment #2582 (dbnicholson) - Add patch switch-to-build-from-pep517.patch: * Do not use pep517 methods, switch to build. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-for-android?expand=0&rev=12
2023-05-16 12:12:34 +00:00
Source: https://github.com/kivy/python-for-android/archive/refs/tags/v%{version_with_zeros}.tar.gz#/python-for-android-%{version}.tar.gz
Source1: python-python-for-android-rpmlintrc
# PATCH-FIX-OPENSUSE We don't need or want isolation when determining metadata
Patch0: no-isolation-for-metadata-build.patch
# PATCH-FIX-UPSTREAM gh#kivy/python-for-android#3003
Patch1: fix-mock-assertion.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Jinja2
Requires: python-appdirs
- Update to v2023.02.10: * pydantic recipe has been updated. * scypt recipe has been updated. * --orientation option controls the allowed orientations (portrait, landscape, portrait-reverse, landscape-reverse). * --manifest-orientation option has been added to keep the android:screenOrientation personalisation functionality. * If --manifest-orientation is not set, and only (one of multiple) --orientation options are passed, the value for android:screenOrientationis guessed and synthesized from the --orientation option. * Introduced support for permission properties (maxSdkVersion and usesPermissionFlags) * Minimal and recommended Android NDK version is now 25b * MIN_TARGET_API has been updated to 30 and RECOMMENDED_TARGET_API in order to comply with Google Play Store requirements. * android.activity now offers Application.ActivityLifecycleCallbacks helpers. * secp256k1 Update "--host=" #2714 (RobertFlatt) * recipe.download_file: implement shallow git cloning #2682 (SomberNight) * Resize webview when keyboard is shown #2674 (dbnicholson) * Fixes libvpx build #2672 (misl6) * toml may not be available on systemwide python #2670 (misl6) * android/activity: Add Application.ActivityLifecycleCallbacks helpers #2669 (dbnicholson) * Bump minimal and recommended Android NDK version to 25b #2668 (misl6) * Include HOME in build environment #2582 (dbnicholson) - Add patch switch-to-build-from-pep517.patch: * Do not use pep517 methods, switch to build. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-for-android?expand=0&rev=12
2023-05-16 12:12:34 +00:00
Requires: python-build
Requires: python-colorama >= 0.3.3
Requires: python-packaging
Requires: python-setuptools
Requires: python-sh >= 2
Requires: python-toml
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: cmake
Recommends: python-pip
Recommends: python-wheel
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Jinja2}
Accepting request 1008609 from home:yarunachalam:branches:devel:languages:python - Update to version v2022.09.04 Fixed bugs: Matplotlib failed to import properly on an APK from Buildozer and Kivy #2643 Closed issues: KeyError: Matplotlib with kivy android #2658 KeyError: Matplotlib #2659 Upgrade from NDK 19b to 23b causes problems with Pandas library #2654 Update Dockerfile for ARM #2653 Apple M2 chip doesn't generate apk: compiling error on liblzma #2652 aiohttp/_http_parser.pyx:46:0: '_headers.pxi' not found #2651 [Question] Pip SSL ? #2649 Colab gives me as error "No module named 'typing_extensions' ", even if before with the same compilation it worked #2648 [Question] Java Files #2646 Using foreground services will cause wired behaviour on Android 8 #2641 Can't apply patches with relative paths for local recipe #2623 Compile for x86 on MacOS #2215 splash always loading #1907 python-for-android.readthedocs.io has problems updating, apparently #1709 Webview apps not working on Android #1644 Merged pull requests: liblzma: Use p4a_install instead of install, as a file named INSTALL is already present. #2663 (misl6) Force --platform=linux/amd64 in Dockerfile #2660 (misl6) Remove six and enum34 dependency #2657 (misl6) Update supported Python versions #2656 (misl6) Fixes some E275 - assert is a keyword. #2647 (misl6) Updates matplotlib, fixes an issue related to shared libc++ #2645 (misl6) RTSP support for ffmpeg #2644 (alicakici1234) Fixes TypeError: str.join() takes exactly one argument (2 given) in hostpython3/__init__.py", line 69 #2642 (Furtif) Resolve absolute path to local recipes #2640 (dbnicholson) Merges master into develop after release 2022.07.20 #2639 (misl6) OBS-URL: https://build.opensuse.org/request/show/1008609 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-for-android?expand=0&rev=7
2022-10-06 23:02:17 +00:00
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module appdirs}
- Update to v2023.02.10: * pydantic recipe has been updated. * scypt recipe has been updated. * --orientation option controls the allowed orientations (portrait, landscape, portrait-reverse, landscape-reverse). * --manifest-orientation option has been added to keep the android:screenOrientation personalisation functionality. * If --manifest-orientation is not set, and only (one of multiple) --orientation options are passed, the value for android:screenOrientationis guessed and synthesized from the --orientation option. * Introduced support for permission properties (maxSdkVersion and usesPermissionFlags) * Minimal and recommended Android NDK version is now 25b * MIN_TARGET_API has been updated to 30 and RECOMMENDED_TARGET_API in order to comply with Google Play Store requirements. * android.activity now offers Application.ActivityLifecycleCallbacks helpers. * secp256k1 Update "--host=" #2714 (RobertFlatt) * recipe.download_file: implement shallow git cloning #2682 (SomberNight) * Resize webview when keyboard is shown #2674 (dbnicholson) * Fixes libvpx build #2672 (misl6) * toml may not be available on systemwide python #2670 (misl6) * android/activity: Add Application.ActivityLifecycleCallbacks helpers #2669 (dbnicholson) * Bump minimal and recommended Android NDK version to 25b #2668 (misl6) * Include HOME in build environment #2582 (dbnicholson) - Add patch switch-to-build-from-pep517.patch: * Do not use pep517 methods, switch to build. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-for-android?expand=0&rev=12
2023-05-16 12:12:34 +00:00
BuildRequires: %{python_module build}
BuildRequires: %{python_module colorama >= 0.3.3}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module sh >= 1.10}
BuildRequires: %{python_module toml}
BuildRequires: %{python_module wheel}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: ccache
Accepting request 1008609 from home:yarunachalam:branches:devel:languages:python - Update to version v2022.09.04 Fixed bugs: Matplotlib failed to import properly on an APK from Buildozer and Kivy #2643 Closed issues: KeyError: Matplotlib with kivy android #2658 KeyError: Matplotlib #2659 Upgrade from NDK 19b to 23b causes problems with Pandas library #2654 Update Dockerfile for ARM #2653 Apple M2 chip doesn't generate apk: compiling error on liblzma #2652 aiohttp/_http_parser.pyx:46:0: '_headers.pxi' not found #2651 [Question] Pip SSL ? #2649 Colab gives me as error "No module named 'typing_extensions' ", even if before with the same compilation it worked #2648 [Question] Java Files #2646 Using foreground services will cause wired behaviour on Android 8 #2641 Can't apply patches with relative paths for local recipe #2623 Compile for x86 on MacOS #2215 splash always loading #1907 python-for-android.readthedocs.io has problems updating, apparently #1709 Webview apps not working on Android #1644 Merged pull requests: liblzma: Use p4a_install instead of install, as a file named INSTALL is already present. #2663 (misl6) Force --platform=linux/amd64 in Dockerfile #2660 (misl6) Remove six and enum34 dependency #2657 (misl6) Update supported Python versions #2656 (misl6) Fixes some E275 - assert is a keyword. #2647 (misl6) Updates matplotlib, fixes an issue related to shared libc++ #2645 (misl6) RTSP support for ffmpeg #2644 (alicakici1234) Fixes TypeError: str.join() takes exactly one argument (2 given) in hostpython3/__init__.py", line 69 #2642 (Furtif) Resolve absolute path to local recipes #2640 (dbnicholson) Merges master into develop after release 2022.07.20 #2639 (misl6) OBS-URL: https://build.opensuse.org/request/show/1008609 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-for-android?expand=0&rev=7
2022-10-06 23:02:17 +00:00
BuildRequires: clang
BuildRequires: cmake
BuildRequires: dos2unix
BuildRequires: gcc-c++
BuildRequires: libtool
Accepting request 1008609 from home:yarunachalam:branches:devel:languages:python - Update to version v2022.09.04 Fixed bugs: Matplotlib failed to import properly on an APK from Buildozer and Kivy #2643 Closed issues: KeyError: Matplotlib with kivy android #2658 KeyError: Matplotlib #2659 Upgrade from NDK 19b to 23b causes problems with Pandas library #2654 Update Dockerfile for ARM #2653 Apple M2 chip doesn't generate apk: compiling error on liblzma #2652 aiohttp/_http_parser.pyx:46:0: '_headers.pxi' not found #2651 [Question] Pip SSL ? #2649 Colab gives me as error "No module named 'typing_extensions' ", even if before with the same compilation it worked #2648 [Question] Java Files #2646 Using foreground services will cause wired behaviour on Android 8 #2641 Can't apply patches with relative paths for local recipe #2623 Compile for x86 on MacOS #2215 splash always loading #1907 python-for-android.readthedocs.io has problems updating, apparently #1709 Webview apps not working on Android #1644 Merged pull requests: liblzma: Use p4a_install instead of install, as a file named INSTALL is already present. #2663 (misl6) Force --platform=linux/amd64 in Dockerfile #2660 (misl6) Remove six and enum34 dependency #2657 (misl6) Update supported Python versions #2656 (misl6) Fixes some E275 - assert is a keyword. #2647 (misl6) Updates matplotlib, fixes an issue related to shared libc++ #2645 (misl6) RTSP support for ffmpeg #2644 (alicakici1234) Fixes TypeError: str.join() takes exactly one argument (2 given) in hostpython3/__init__.py", line 69 #2642 (Furtif) Resolve absolute path to local recipes #2640 (dbnicholson) Merges master into develop after release 2022.07.20 #2639 (misl6) OBS-URL: https://build.opensuse.org/request/show/1008609 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-for-android?expand=0&rev=7
2022-10-06 23:02:17 +00:00
BuildRequires: lld
BuildRequires: unzip
# /SECTION
%python_subpackages
%description
Android APK packager for Python scripts and apps
%prep
%autosetup -p1 -n python-for-android-%{version_with_zeros}
sed -i "1{s:#!.*$:#!%{_bindir}/bash:}" pythonforandroid/bootstraps/common/build/gradlew
find pythonforandroid/bootstraps/common/build/src/ -type f | xargs dos2unix
find pythonforandroid/bootstraps/common/build/src/ -type f | xargs chmod a-x
chmod a+x pythonforandroid/bootstraps/common/build/build.py
touch tests/__init__.py tests/recipes/__init__.py
sed -i 's/from backports import tempfile/import tempfile/' tests/test_recipe.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/python-for-android
%python_clone -a %{buildroot}%{_bindir}/p4a
%{python_expand rm -r %{buildroot}%{$python_sitelib}/ci/ %{buildroot}%{$python_sitelib}/tests/
sed -i "1{s:#!.*$:#!%{_bindir}/python%{$python_bin_suffix}:}" \
%{buildroot}%{$python_sitelib}/pythonforandroid/tools/*link \
%{buildroot}%{$python_sitelib}/pythonforandroid/bootstraps/common/build/build.py \
%{buildroot}%{$python_sitelib}/pythonforandroid/toolchain.py
chmod a+x %{buildroot}%{$python_sitelib}/pythonforandroid/toolchain.py
%fdupes %{buildroot}%{$python_sitelib}
}
%check
export PYTHONPATH=${PWD}:${PWD}/tests/
# Five failures due to venv attempting download of pip, wheel, setuptools
skip_tests="test_get_dep_names_of_package or test_get_package_dependencies or test_venv or test_get_package_as_folder or test_extract_metainfo_files_from_package"
# Unable to download NDK
skip_tests="$skip_tests or (TestToolchainCL and test_create) or test_create_python_bundle"
# build_dir is somehow None
skip_tests="$skip_tests or (TestSDL2MixerRecipe and test_get_include_dirs)"
%pytest -rs tests -k "not ($skip_tests)"
%post
%python_install_alternative python-for-android p4a
%postun
%python_uninstall_alternative python-for-android
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/python-for-android
%python_alternative %{_bindir}/p4a
%{python_sitelib}/pythonforandroid
%{python_sitelib}/python_for_android-%{version}.dist-info
%changelog