` instead.
-+ """,
-+ upload_docs="`setup.py upload_docs` is not supported",
-+ easy_install="`setup.py easy_install` is not supported",
-+ clean="""
-+ `setup.py clean` is not supported, use one of the following instead:
-+
-+ - `git clean -xdf` (cleans all files)
-+ - `git clean -Xdf` (cleans all versioned files, doesn't touch
-+ files that aren't checked into the git repo)
-+ """,
-+ check="`setup.py check` is not supported",
-+ register="`setup.py register` is not supported",
-+ bdist_dumb="`setup.py bdist_dumb` is not supported",
-+ bdist="`setup.py bdist` is not supported",
-+ flake8="`setup.py flake8` is not supported, use flake8 standalone",
-+ build_sphinx="`setup.py build_sphinx` is not supported, see doc/README.md",
-+ )
-+ bad_commands['nosetests'] = bad_commands['test']
-+ for command in ('upload_docs', 'easy_install', 'bdist', 'bdist_dumb',
-+ 'register', 'check', 'install_data', 'install_headers',
-+ 'install_lib', 'install_scripts', ):
-+ bad_commands[command] = "`setup.py %s` is not supported" % command
-+
-+ for command in bad_commands.keys():
-+ if command in args:
-+ print(textwrap.dedent(bad_commands[command]) +
-+ "\nAdd `--force` to your command to use it anyway if you "
-+ "must (unsupported).\n")
-+ sys.exit(1)
-+
-+ # Commands that do more than print info, but also don't need Cython and
-+ # template parsing.
-+ other_commands = ['egg_info', 'install_egg_info', 'rotate']
-+ for command in other_commands:
-+ if command in args:
-+ return False
-+
-+ # If we got here, we didn't detect what setup.py command was given
-+ warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
-+ "generating Cython sources and expanding templates".format(
-+ ' '.join(sys.argv[1:])))
-+ return True
-+
-+def check_setuppy_command():
-+ run_build = parse_setuppy_commands()
-+ if run_build:
-+ try:
-+ pkgname = 'numpy'
-+ import numpy
-+ pkgname = 'pybind11'
-+ import pybind11
-+ except ImportError as exc: # We do not have our build deps installed
-+ print(textwrap.dedent(
-+ """Error: '%s' must be installed before running the build.
-+ """
-+ % (pkgname,)))
-+ sys.exit(1)
-+
-+ return run_build
-+
-+def configuration(parent_package='', top_path=None):
-+ from numpy.distutils.system_info import get_info, NotFoundError
-+ from numpy.distutils.misc_util import Configuration
-+
-+ lapack_opt = get_info('lapack_opt')
-+
-+ if not lapack_opt:
-+ if sys.platform == "darwin":
-+ msg = ('No BLAS/LAPACK libraries found. '
-+ 'Note: Accelerate is no longer supported.')
-+ else:
-+ msg = 'No BLAS/LAPACK libraries found.'
-+ msg += ("\n"
-+ "To build Scipy from sources, BLAS & LAPACK libraries "
-+ "need to be installed.\n"
-+ "See site.cfg.example in the Scipy source directory and\n"
-+ "https://docs.scipy.org/doc/scipy/dev/contributor/building.html "
-+ "for details.")
-+ raise NotFoundError(msg)
-+
-+ config = Configuration(None, parent_package, top_path)
-+ config.set_options(ignore_setup_xxx_py=True,
-+ assume_default_configuration=True,
-+ delegate_options_to_subpackages=True,
-+ quiet=True)
-+
-+ config.add_subpackage('scipy')
-+ config.add_data_files(('scipy', '*.txt'))
-+
-+ config.get_version('scipy/version.py')
-+
-+ return config
-+
-+
-+def setup_package():
-+ # In maintenance branch, change np_maxversion to N+3 if numpy is at N
-+ # Update here, in pyproject.toml, and in scipy/__init__.py
-+ # Rationale: SciPy builds without deprecation warnings with N; deprecations
-+ # in N+1 will turn into errors in N+3
-+ # For Python versions, if releases is (e.g.) <=3.9.x, set bound to 3.10
-+ np_minversion = '1.21.6'
-+ np_maxversion = '1.28.0'
-+ python_minversion = '3.9'
-+ python_maxversion = '3.13'
-+ if IS_RELEASE_BRANCH:
-+ req_np = 'numpy>={},<{}'.format(np_minversion, np_maxversion)
-+ req_py = '>={},<{}'.format(python_minversion, python_maxversion)
-+ else:
-+ req_np = 'numpy>={}'.format(np_minversion)
-+ req_py = '>={}'.format(python_minversion)
-+
-+ # Rewrite the version file every time
-+ write_version_py('.')
-+
-+ cmdclass = {'sdist': sdist_checked}
-+
-+ metadata = dict(
-+ name='scipy',
-+ maintainer="SciPy Developers",
-+ maintainer_email="scipy-dev@python.org",
-+ description=DOCLINES[0],
-+ long_description="\n".join(DOCLINES[2:]),
-+ url="https://www.scipy.org",
-+ download_url="https://github.com/scipy/scipy/releases",
-+ project_urls={
-+ "Bug Tracker": "https://github.com/scipy/scipy/issues",
-+ "Documentation": "https://docs.scipy.org/doc/scipy/reference/",
-+ "Source Code": "https://github.com/scipy/scipy",
-+ },
-+ license='BSD',
-+ cmdclass=cmdclass,
-+ classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
-+ platforms=["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
-+ install_requires=[req_np],
-+ python_requires=req_py,
-+ zip_safe=False,
-+ )
-+
-+ if "--force" in sys.argv:
-+ run_build = True
-+ sys.argv.remove('--force')
-+ else:
-+ # Raise errors for unsupported commands, improve help output, etc.
-+ run_build = check_setuppy_command()
-+
-+ # Disable OSX Accelerate, it has too old LAPACK
-+ os.environ['ACCELERATE'] = 'None'
-+
-+ # This import is here because it needs to be done before importing setup()
-+ # from numpy.distutils, but after the MANIFEST removing and sdist import
-+ # higher up in this file.
-+ from setuptools import setup
-+
-+ if run_build:
-+ from numpy.distutils.core import setup
-+
-+ # Customize extension building
-+ cmdclass['build_ext'] = get_build_ext_override()
-+ cmdclass['build_clib'] = get_build_clib_override()
-+
-+ if not 'sdist' in sys.argv:
-+ # Generate Cython sources, unless we're creating an sdist
-+ # Cython is a build dependency, and shipping generated .c files
-+ # can cause problems (see gh-14199)
-+ generate_cython()
-+
-+ metadata['configuration'] = configuration
-+ else:
-+ # Don't import numpy here - non-build actions are required to succeed
-+ # without NumPy for example when pip is used to install Scipy when
-+ # NumPy is not yet present in the system.
-+
-+ # Version number is added to metadata inside configuration() if build
-+ # is run.
-+ metadata['version'] = get_version_info('.')[0]
-+
-+ setup(**metadata)
-+
-+
-+if __name__ == '__main__':
-+ setup_package()
diff --git a/pythonforandroid/recipes/scipy/wrapper.py b/pythonforandroid/recipes/scipy/wrapper.py
new file mode 100644
index 0000000000..ca0e60d22e
--- /dev/null
+++ b/pythonforandroid/recipes/scipy/wrapper.py
@@ -0,0 +1,62 @@
+#!/usr/bin/python3
+
+# Taken from https://github.com/termux/termux-packages/blob/master/packages/python-scipy/wrapper.py.in
+
+import os
+import subprocess
+import sys
+import typing
+
+"""
+This wrapper is used to ignore or replace some unsupported flags for flang-new.
+
+It will operate as follows:
+
+1. Ignore `-Minform=inform` and `-fdiagnostics-color`.
+ They are added by meson automatically, but are not supported by flang-new yet.
+2. Remove `-lflang` and `-lpgmath`.
+ It exists in classic-flang but doesn't exist in flang-new.
+3. Replace `-Oz` to `-O2`.
+ `-Oz` is not supported by flang-new.
+4. Replace `-module` to `-J`.
+ See https://github.com/llvm/llvm-project/issues/66969
+5. Ignore `-MD`, `-MQ file` and `-MF file`.
+ They generates files used by GNU make but we're using ninja.
+6. Ignore `-fvisibility=hidden`.
+ It is not supported by flang-new, and ignoring it will not break the functionality,
+ as scipy also uses version script for shared libraries.
+"""
+
+COMPLIER_PATH = "@COMPILER@"
+
+
+def main(argv: typing.List[str]):
+ cwd = os.getcwd()
+ argv_new = []
+ i = 0
+ while i < len(argv):
+ arg = argv[i]
+ if arg in [
+ "-Minform=inform",
+ "-lflang",
+ "-lpgmath",
+ "-MD",
+ "-fvisibility=hidden",
+ ] or arg.startswith("-fdiagnostics-color"):
+ pass
+ elif arg == "-Oz":
+ argv_new.append("-O2")
+ elif arg == "-module":
+ argv_new.append("-J")
+ elif arg in ["-MQ", "-MF"]:
+ i += 1
+ else:
+ argv_new.append(arg)
+ i += 1
+
+ args = [COMPLIER_PATH] + argv_new
+ subprocess.check_call(args, env=os.environ, cwd=cwd, text=True)
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/pythonforandroid/recipes/sdl2/__init__.py b/pythonforandroid/recipes/sdl2/__init__.py
index cd0185c717..d1a5fdc8b3 100644
--- a/pythonforandroid/recipes/sdl2/__init__.py
+++ b/pythonforandroid/recipes/sdl2/__init__.py
@@ -6,9 +6,9 @@
class LibSDL2Recipe(BootstrapNDKRecipe):
- version = "2.28.5"
+ version = "2.30.11"
url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL2-{version}.tar.gz"
- md5sum = 'a344eb827a03045c9b399e99af4af13d'
+ md5sum = 'bea190b480f6df249db29eb3bacfe41e'
conflicts = ['sdl3']
diff --git a/pythonforandroid/recommendations.py b/pythonforandroid/recommendations.py
index 269a57fcf8..5584815d57 100644
--- a/pythonforandroid/recommendations.py
+++ b/pythonforandroid/recommendations.py
@@ -13,7 +13,7 @@
MAX_NDK_VERSION = 25
# DO NOT CHANGE LINE FORMAT: buildozer parses the existence of a RECOMMENDED_NDK_VERSION
-RECOMMENDED_NDK_VERSION = "25b"
+RECOMMENDED_NDK_VERSION = "27c"
NDK_DOWNLOAD_URL = "https://developer.android.com/ndk/downloads/"
diff --git a/tests/recipes/test_pandas.py b/tests/recipes/test_pandas.py
index b8366863fe..9a028d49b2 100644
--- a/tests/recipes/test_pandas.py
+++ b/tests/recipes/test_pandas.py
@@ -35,7 +35,7 @@ def test_get_recipe_env(
self.ctx.recipe_build_order
)
numpy_includes = join(
- self.ctx.get_python_install_dir(self.arch.arch), "numpy/core/include",
+ self.ctx.get_python_install_dir(self.arch.arch), "numpy/_core/include",
)
env = self.recipe.get_recipe_env(self.arch)
self.assertIn(numpy_includes, env["NUMPY_INCLUDES"])
diff --git a/tests/test_recipe.py b/tests/test_recipe.py
index b02a874e84..7d94f97f89 100644
--- a/tests/test_recipe.py
+++ b/tests/test_recipe.py
@@ -93,6 +93,8 @@ def test_download_if_necessary(self):
"""
# download should happen as the environment variable is not set
recipe = DummyRecipe()
+ recipe.ctx = Context()
+ recipe.ctx._ndk_api = float('inf')
with mock.patch.object(Recipe, 'download') as m_download:
recipe.download_if_necessary()
assert m_download.call_args_list == [mock.call()]
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy