diff --git a/packages/manim/build.sh b/packages/manim/build.sh index a313db0a91..73036d692e 100644 --- a/packages/manim/build.sh +++ b/packages/manim/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A community-maintained Python framework for creating mat TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Nguyen Khanh @nguynkhn" TERMUX_PKG_VERSION=0.18.1 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/ManimCommunity/manim/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=36ce308b92bbbe039ee8cf4fbad5a8ba0ec5f24c9cf2919fab0fc5df92be7655 TERMUX_PKG_DEPENDS="ffmpeg, libcairo, pango, xorgproto, python-numpy, python-pillow, pycairo, python-scipy, python-skia-pathops" diff --git a/packages/matplotlib/build.sh b/packages/matplotlib/build.sh index 0b18545fa4..14a0579972 100644 --- a/packages/matplotlib/build.sh +++ b/packages/matplotlib/build.sh @@ -14,9 +14,9 @@ LICENSE/LICENSE_SOLARIZED LICENSE/LICENSE_STIX LICENSE/LICENSE_YORICK" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="3.9.1" +TERMUX_PKG_VERSION="3.9.2" TERMUX_PKG_SRCURL=https://github.com/matplotlib/matplotlib/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=4fdf46dc325fdf4cbc61f7fa66de7b48287df0a71b3442b63ff0784041cae2e7 +TERMUX_PKG_SHA256=9c49b6683a34469e6d20864c7d5b975c4f29d7c60de1ce857980bead48769c3f TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_DEPENDS="freetype, libc++, patchelf, ninja, python, python-contourpy, python-numpy, python-pillow, python-pip" _NUMPY_VERSION=$(. $TERMUX_SCRIPTDIR/packages/python-numpy/build.sh; echo $TERMUX_PKG_VERSION) diff --git a/packages/python-contourpy/build.sh b/packages/python-contourpy/build.sh index 017f61e7df..d006f8bc5f 100644 --- a/packages/python-contourpy/build.sh +++ b/packages/python-contourpy/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://contourpy.readthedocs.io/ TERMUX_PKG_DESCRIPTION="Python library for calculating contours in 2D quadrilateral grids" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="1.2.1" +TERMUX_PKG_VERSION="1.3.0" TERMUX_PKG_SRCURL=git+https://github.com/contourpy/contourpy TERMUX_PKG_DEPENDS="python, python-numpy" TERMUX_PKG_PYTHON_COMMON_DEPS="wheel, meson-python, build" @@ -21,7 +21,7 @@ termux_step_configure() { cp -f $TERMUX_MESON_CROSSFILE $TERMUX_MESON_WHEEL_CROSSFILE sed -i 's|^\(\[binaries\]\)$|\1\npython = '\'$(command -v python)\''|g' \ $TERMUX_MESON_WHEEL_CROSSFILE - sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/core/include\''|g' \ + sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/_core/include\''|g' \ $TERMUX_MESON_WHEEL_CROSSFILE termux_step_configure_meson diff --git a/packages/python-contourpy/pyproject.toml.patch b/packages/python-contourpy/pyproject.toml.patch new file mode 100644 index 0000000000..49140b02bc --- /dev/null +++ b/packages/python-contourpy/pyproject.toml.patch @@ -0,0 +1,16 @@ +Fix the below error with newer meson versions: + ../src/meson.build:1:0: ERROR: Tried modify read only option 'vsenv' + +diff -u -r ../cache/tmp-checkout/pyproject.toml ./pyproject.toml +--- ../cache/tmp-checkout/pyproject.toml 2024-10-02 12:20:23.171351029 +0000 ++++ ./pyproject.toml 2024-10-02 12:21:00.516125872 +0000 +@@ -83,9 +83,6 @@ + ] + dist = [] + install = [] +-setup = [ +- "--vsenv", # Force use of MSVC on Windows, ignored on other platforms +-] + + + [tool.cibuildwheel] diff --git a/packages/python-numpy/build.sh b/packages/python-numpy/build.sh index 41a84ac655..14e1f6738c 100644 --- a/packages/python-numpy/build.sh +++ b/packages/python-numpy/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://numpy.org/ TERMUX_PKG_DESCRIPTION="The fundamental package for scientific computing with Python" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="1.26.5" +TERMUX_PKG_VERSION="2.1.1" TERMUX_PKG_SRCURL=git+https://github.com/numpy/numpy TERMUX_PKG_DEPENDS="libc++, libopenblas, python" TERMUX_PKG_AUTO_UPDATE=true @@ -32,7 +32,7 @@ termux_step_configure() { cp -f $TERMUX_MESON_CROSSFILE $TERMUX_MESON_WHEEL_CROSSFILE sed -i 's|^\(\[binaries\]\)$|\1\npython = '\'$(command -v python)\''|g' \ $TERMUX_MESON_WHEEL_CROSSFILE - sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/core/include\''|g' \ + sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/_core/include\''|g' \ $TERMUX_MESON_WHEEL_CROSSFILE local _longdouble_format="" diff --git a/packages/python-numpy/test.patch b/packages/python-numpy/test.patch index 460aa323e8..b6331cb596 100644 --- a/packages/python-numpy/test.patch +++ b/packages/python-numpy/test.patch @@ -1,6 +1,7 @@ ---- a/numpy/core/tests/test_mem_policy.py -+++ b/numpy/core/tests/test_mem_policy.py -@@ -18,6 +18,8 @@ +diff -u -r ../cache/tmp-checkout/numpy/_core/tests/test_mem_policy.py ./numpy/_core/tests/test_mem_policy.py +--- ../cache/tmp-checkout/numpy/_core/tests/test_mem_policy.py 2024-09-25 20:21:18.703117205 +0000 ++++ ./numpy/_core/tests/test_mem_policy.py 2024-09-25 20:24:40.984240601 +0000 +@@ -21,6 +21,8 @@ """ if sys.platform.startswith('cygwin'): pytest.skip('link fails on cygwin') @@ -8,4 +9,4 @@ + pytest.skip('link fails on Android') if IS_WASM: pytest.skip("Can't build module inside Wasm") - functions = [ + if IS_EDITABLE: diff --git a/packages/python-onnxruntime/build.sh b/packages/python-onnxruntime/build.sh index 60e209cb5d..4871829af7 100644 --- a/packages/python-onnxruntime/build.sh +++ b/packages/python-onnxruntime/build.sh @@ -2,8 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://onnxruntime.ai/ TERMUX_PKG_DESCRIPTION="Cross-platform, high performance ML inferencing and training accelerator" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="1.19.0" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_VERSION="1.19.2" TERMUX_PKG_SRCURL=git+https://github.com/microsoft/onnxruntime TERMUX_PKG_DEPENDS="abseil-cpp, libc++, protobuf, libre2, python" TERMUX_PKG_BUILD_DEPENDS="python-numpy" @@ -23,7 +22,7 @@ termux_step_pre_configure() { TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DPYTHON_EXECUTABLE=$(command -v python3)" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DONNX_CUSTOM_PROTOC_EXECUTABLE=$(command -v protoc)" - TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DPython_NumPy_INCLUDE_DIR=$TERMUX_PREFIX/lib/python$TERMUX_PYTHON_VERSION/site-packages/numpy/core/include" + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DPython_NumPy_INCLUDE_DIR=$TERMUX_PREFIX/lib/python$TERMUX_PYTHON_VERSION/site-packages/numpy/_core/include" local TERMUX_PKG_SRCDIR_SAVE="$TERMUX_PKG_SRCDIR" TERMUX_PKG_SRCDIR+="/cmake" diff --git a/packages/python-pyarrow/build.sh b/packages/python-pyarrow/build.sh index bf0226b911..bf510836e7 100644 --- a/packages/python-pyarrow/build.sh +++ b/packages/python-pyarrow/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="@termux" # Align the version with `libarrow-cpp` package. TERMUX_PKG_VERSION="17.0.0" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/apache/arrow/archive/refs/tags/apache-arrow-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=8379554d89f19f2c8db63620721cabade62541f47a4e706dfb0a401f05a713ef TERMUX_PKG_AUTO_UPDATE=true @@ -19,7 +19,7 @@ termux_step_pre_configure() { export PYARROW_CMAKE_OPTIONS=" -DCMAKE_PREFIX_PATH=$TERMUX_PREFIX/lib/cmake - -DNUMPY_INCLUDE_DIRS=$TERMUX_PYTHON_HOME/site-packages/numpy/core/include + -DNUMPY_INCLUDE_DIRS=$TERMUX_PYTHON_HOME/site-packages/numpy/_core/include " export PYARROW_WITH_DATASET=1 export PYARROW_WITH_HDFS=1 diff --git a/packages/python-scipy/build.sh b/packages/python-scipy/build.sh index dccf3ecae9..f8f04da352 100644 --- a/packages/python-scipy/build.sh +++ b/packages/python-scipy/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://scipy.org/ TERMUX_PKG_DESCRIPTION="Fundamental algorithms for scientific computing in Python" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="1.14.0" +TERMUX_PKG_VERSION="1.14.1" TERMUX_PKG_SRCURL=git+https://github.com/scipy/scipy TERMUX_PKG_DEPENDS="libc++, libopenblas, python, python-numpy" TERMUX_PKG_BUILD_DEPENDS="python-numpy-static" @@ -50,7 +50,7 @@ termux_step_configure() { cp -f $TERMUX_MESON_CROSSFILE $TERMUX_MESON_WHEEL_CROSSFILE sed -i 's|^\(\[binaries\]\)$|\1\npython = '\'$(command -v python)\''|g' \ $TERMUX_MESON_WHEEL_CROSSFILE - sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/core/include\''|g' \ + sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/_core/include\''|g' \ $TERMUX_MESON_WHEEL_CROSSFILE (unset PYTHONPATH && termux_step_configure_meson) diff --git a/packages/python-scipy/wrapper.py.in b/packages/python-scipy/wrapper.py.in index d7e35a22cc..272741bf41 100644 --- a/packages/python-scipy/wrapper.py.in +++ b/packages/python-scipy/wrapper.py.in @@ -4,26 +4,48 @@ 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() - # Remove `-Minform=inform`. It is added by meson automatically. - # Remove `-lflang` and `-lpgmath`. It exists in classic-flang but doesn't exist in flang-new. - # Replace `-Oz` to `-O2`. `-Oz` is not supported by flang-new. - # Replace `-module` to `-J`. See https://github.com/llvm/llvm-project/issues/66969 argv_new = [] - for arg in argv[1:]: - if arg in ["-Minform=inform", "-lflang", "-lpgmath"]: + 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) + main(sys.argv[1:]) diff --git a/x11-packages/inkscape/build.sh b/x11-packages/inkscape/build.sh index 2105630a9c..7a4d077f13 100644 --- a/x11-packages/inkscape/build.sh +++ b/x11-packages/inkscape/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Free and open source vector graphics editor" TERMUX_PKG_LICENSE="GPL-3.0-or-later" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="1.3.2" -TERMUX_PKG_REVISION=4 +TERMUX_PKG_REVISION=5 TERMUX_PKG_SRCURL=https://media.inkscape.org/dl/resources/file/inkscape-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=dbd1844dc443fe5e10d3e9a887144e5fb7223852fff191cfb5ef7adeab0e086b TERMUX_PKG_DEPENDS="boost, double-conversion, fontconfig, freetype, gdk-pixbuf, glib, gsl, gtk3, gtkmm3, harfbuzz, libatkmm-1.6, libc++, libcairo, libcairomm-1.0, libgc, libglibmm-2.4, libiconv, libjpeg-turbo, libpangomm-1.4, libpng, libsigc++-2.0, libsoup, libx11, libxml2, libxslt, littlecms, pango, poppler, potrace, readline, zlib" diff --git a/x11-packages/opencv/build.sh b/x11-packages/opencv/build.sh index 95c6851b33..485e24230e 100644 --- a/x11-packages/opencv/build.sh +++ b/x11-packages/opencv/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Open Source Computer Vision Library" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="4.10.0" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=( https://github.com/opencv/opencv/archive/${TERMUX_PKG_VERSION}/opencv-${TERMUX_PKG_VERSION}.tar.gz https://github.com/opencv/opencv_contrib/archive/${TERMUX_PKG_VERSION}/opencv_contrib-${TERMUX_PKG_VERSION}.tar.gz @@ -51,7 +51,7 @@ termux_step_pre_configure() { TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DPYTHON_DEFAULT_EXECUTABLE=python -DPYTHON3_INCLUDE_PATH=$TERMUX_PREFIX/include/python${TERMUX_PYTHON_VERSION} - -DPYTHON3_NUMPY_INCLUDE_DIRS=$TERMUX_PYTHON_HOME/site-packages/numpy/core/include + -DPYTHON3_NUMPY_INCLUDE_DIRS=$TERMUX_PYTHON_HOME/site-packages/numpy/_core/include " mv $TERMUX_PREFIX/lib/libprotobuf.so{,.tmp} diff --git a/x11-packages/python-torch/0001-cmake-python-find-Development-before-Development.Module.patch b/x11-packages/python-torch/0001-cmake-python-find-Development-before-Development.Module.patch new file mode 100644 index 0000000000..a1d6cfe8e3 --- /dev/null +++ b/x11-packages/python-torch/0001-cmake-python-find-Development-before-Development.Module.patch @@ -0,0 +1,12 @@ +Seems a bug of cmake. Finding `Development` before other components fixes this. + +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -854,6 +854,7 @@ + if(USE_NUMPY) + list(APPEND PYTHON_COMPONENTS NumPy) + endif() ++ find_package(Python COMPONENTS Development) + find_package(Python COMPONENTS Interpreter OPTIONAL_COMPONENTS ${PYTHON_COMPONENTS}) + else() + find_package(Python COMPONENTS Interpreter) diff --git a/x11-packages/python-torch/0001-do-not-error-on-cast-function-type-strict.patch b/x11-packages/python-torch/0001-do-not-error-on-cast-function-type-strict.patch deleted file mode 100644 index de8e86ac9b..0000000000 --- a/x11-packages/python-torch/0001-do-not-error-on-cast-function-type-strict.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -920,6 +920,7 @@ - append_cxx_flag_if_supported("-fno-trapping-math" CMAKE_CXX_FLAGS) - append_cxx_flag_if_supported("-Werror=format" CMAKE_CXX_FLAGS) - append_cxx_flag_if_supported("-Werror=cast-function-type" CMAKE_CXX_FLAGS) -+ append_cxx_flag_if_supported("-Wno-error=cast-function-type-strict" CMAKE_CXX_FLAGS) - else() - # skip unwanted includes from windows.h - add_compile_definitions(WIN32_LEAN_AND_MEAN) diff --git a/x11-packages/python-torch/0004-memalign.patch b/x11-packages/python-torch/0004-memalign.patch index 5e609f44c1..12a8c7d5fa 100644 --- a/x11-packages/python-torch/0004-memalign.patch +++ b/x11-packages/python-torch/0004-memalign.patch @@ -1,6 +1,19 @@ ---- a/torch/csrc/jit/python/script_init.cpp -+++ b/torch/csrc/jit/python/script_init.cpp -@@ -718,7 +718,7 @@ +diff -u -r ../cache/tmp-checkout/third_party/pocketfft/pocketfft_hdronly.h ./third_party/pocketfft/pocketfft_hdronly.h +--- ../cache/tmp-checkout/third_party/pocketfft/pocketfft_hdronly.h 2024-10-02 13:08:14.683993465 +0000 ++++ ./third_party/pocketfft/pocketfft_hdronly.h 2024-10-02 13:17:29.799680354 +0000 +@@ -152,7 +152,7 @@ + // the __MINGW32__ part in the conditional below works around the problem that + // the standard C++ library on Windows does not provide aligned_alloc() even + // though the MinGW compiler and MSVC may advertise C++17 compliance. +-#if (__cplusplus >= 201703L) && (!defined(__MINGW32__)) && (!defined(_MSC_VER)) ++#if (__cplusplus >= 201703L) && (!defined(__MINGW32__)) && (!defined(_MSC_VER)) && (!defined(__ANDROID__)) + inline void *aligned_alloc(size_t align, size_t size) + { + // aligned_alloc() requires that the requested size is a multiple of "align" +diff -u -r ../cache/tmp-checkout/torch/csrc/jit/python/script_init.cpp ./torch/csrc/jit/python/script_init.cpp +--- ../cache/tmp-checkout/torch/csrc/jit/python/script_init.cpp 2024-10-02 13:05:35.577599122 +0000 ++++ ./torch/csrc/jit/python/script_init.cpp 2024-10-02 13:16:36.541910940 +0000 +@@ -722,7 +722,7 @@ std::shared_ptr bytes_copy( static_cast(_aligned_malloc(size, kFlatbufferDataAlignmentBytes)), _aligned_free); @@ -9,14 +22,3 @@ void* p; ::posix_memalign(&p, kFlatbufferDataAlignmentBytes, size); TORCH_INTERNAL_ASSERT(p, "Could not allocate memory for flatbuffer"); ---- a/third_party/pocketfft/pocketfft_hdronly.h -+++ b/third_party/pocketfft/pocketfft_hdronly.h -@@ -149,7 +149,7 @@ - #endif - #endif - --#if __cplusplus >= 201703L -+#if (__cplusplus >= 201703L) && !defined(__ANDROID__) - inline void *aligned_alloc(size_t align, size_t size) - { - // aligned_alloc() requires that the requested size is a multiple of "align" diff --git a/x11-packages/python-torch/0006-fix-cross-compiling-for-FindAVX.patch b/x11-packages/python-torch/0006-fix-cross-compiling-for-FindAVX.patch deleted file mode 100644 index 9013897cda..0000000000 --- a/x11-packages/python-torch/0006-fix-cross-compiling-for-FindAVX.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/cmake/Modules/FindAVX.cmake.orig -+++ b/cmake/Modules/FindAVX.cmake -@@ -49,12 +49,14 @@ - SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) - FOREACH(__FLAG ${flags}) - IF(NOT ${lang}_${type}_FOUND) -+ IF(NOT CMAKE_CROSSCOMPILING) - SET(CMAKE_REQUIRED_FLAGS ${__FLAG}) - IF(lang STREQUAL "CXX") - CHECK_CXX_SOURCE_RUNS("${${type}_CODE}" ${lang}_HAS_${type}_${__FLAG_I}) - ELSE() - CHECK_C_SOURCE_RUNS("${${type}_CODE}" ${lang}_HAS_${type}_${__FLAG_I}) - ENDIF() -+ ENDIF() - IF(${lang}_HAS_${type}_${__FLAG_I}) - SET(${lang}_${type}_FOUND TRUE CACHE BOOL "${lang} ${type} support") - SET(${lang}_${type}_FLAGS "${__FLAG}" CACHE STRING "${lang} ${type} flags") diff --git a/x11-packages/python-torch/0007-enable-cxx17-by-default.patch b/x11-packages/python-torch/0007-enable-cxx17-by-default.patch deleted file mode 100644 index e2b939cc01..0000000000 --- a/x11-packages/python-torch/0007-enable-cxx17-by-default.patch +++ /dev/null @@ -1,13 +0,0 @@ -Enable C++17 by default, because torch needs at least C++17 to build since 2.1.0. - ---- a/third_party/onnx/CMakeLists.txt.orig -+++ b/third_party/onnx/CMakeLists.txt -@@ -58,7 +58,7 @@ - # Required to use /std:c++17 or higher on Windows - # For other platforms, set C++11 as standard for the whole project - if(NOT MSVC) -- set(CMAKE_CXX_STANDARD 11) -+ set(CMAKE_CXX_STANDARD 17) - else() - string(APPEND CMAKE_CXX_FLAGS " /std:c++17") - endif() diff --git a/x11-packages/python-torch/build.sh b/x11-packages/python-torch/build.sh index e29415cb18..555036eb23 100644 --- a/x11-packages/python-torch/build.sh +++ b/x11-packages/python-torch/build.sh @@ -2,8 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://pytorch.org/ TERMUX_PKG_DESCRIPTION="Tensors and Dynamic neural networks in Python" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION="2.1.2" -TERMUX_PKG_REVISION=6 +TERMUX_PKG_VERSION="2.4.1" TERMUX_PKG_SRCURL=git+https://github.com/pytorch/pytorch TERMUX_PKG_UPDATE_TAG_TYPE="latest-release-tag" TERMUX_PKG_DEPENDS="abseil-cpp, ffmpeg, fmt, libc++, libopenblas, libprotobuf, libzmq, opencv, python, python-numpy, python-pip" @@ -20,10 +19,8 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${TERMUX_PKG_SRCDIR}/torch -DCMAKE_PREFIX_PATH=${TERMUX_PYTHON_HOME}/site-packages --DNUMPY_INCLUDE_DIR=${TERMUX_PYTHON_HOME}/site-packages/numpy/core/include +-DNumPy_INCLUDE_DIR=${TERMUX_PYTHON_HOME}/site-packages/numpy/_core/include -DOpenBLAS_INCLUDE_DIR=${TERMUX_PREFIX}/include/openblas --DPYTHON_INCLUDE_DIR=${TERMUX_PREFIX}/include/python${TERMUX_PYTHON_VERSION} --DPYTHON_LIBRARY=${TERMUX_PREFIX}/lib/libpython${TERMUX_PYTHON_VERSION}.so -DNATIVE_BUILD_DIR=${TERMUX_PKG_HOSTBUILD_DIR} -DTORCH_BUILD_VERSION=${TERMUX_PKG_VERSION} -DONNX_USE_PROTOBUF_SHARED_LIBS=ON @@ -70,7 +67,7 @@ termux_step_pre_configure() { termux_setup_protobuf TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" - -DPYTHON_EXECUTABLE=$(command -v python3) + -DPython_EXECUTABLE=$(command -v python3) -DPROTOBUF_PROTOC_EXECUTABLE=$(command -v protoc) -DCAFFE2_CUSTOM_PROTOC_EXECUTABLE=$(command -v protoc) " diff --git a/x11-packages/python-torch/torch-csrc-autograd-python_function.cpp.patch b/x11-packages/python-torch/torch-csrc-autograd-python_function.cpp.patch new file mode 100644 index 0000000000..cd2a2462f6 --- /dev/null +++ b/x11-packages/python-torch/torch-csrc-autograd-python_function.cpp.patch @@ -0,0 +1,17 @@ +Fix 32-bit builds, which otherwise fail with: + + python_function.cpp:798:15: error: format specifies type 'long' but the argument has type 'int' [-Werror,-Wformat] + 796 | "save_for_backward can only save variables, but argument %ld is of " + +diff -u -r ../cache/tmp-checkout/torch/csrc/autograd/python_function.cpp ./torch/csrc/autograd/python_function.cpp +--- ../cache/tmp-checkout/torch/csrc/autograd/python_function.cpp 2024-10-03 18:00:30.204986580 +0000 ++++ ./torch/csrc/autograd/python_function.cpp 2024-10-04 15:06:58.912498321 +0000 +@@ -795,7 +795,7 @@ + throw torch::TypeError( + "save_for_backward can only save variables, but argument %ld is of " + "type %s", +- i, ++ (long) i, + Py_TYPE(obj)->tp_name); + } + } diff --git a/x11-packages/python-torchaudio/0001-do-not-try-to-import-torch-when-cross-compiling.patch b/x11-packages/python-torchaudio/0001-do-not-try-to-import-torch-when-cross-compiling.patch index b61c9c6662..05b1e7d19b 100644 --- a/x11-packages/python-torchaudio/0001-do-not-try-to-import-torch-when-cross-compiling.patch +++ b/x11-packages/python-torchaudio/0001-do-not-try-to-import-torch-when-cross-compiling.patch @@ -44,8 +44,9 @@ def _fetch_third_party_libraries(): ---- a/tools/setup_helpers/extension.py.orig -+++ b/tools/setup_helpers/extension.py +diff -u -r ../cache/tmp-checkout/tools/setup_helpers/extension.py ./tools/setup_helpers/extension.py +--- ../cache/tmp-checkout/tools/setup_helpers/extension.py 2024-10-03 18:27:06.446948017 +0000 ++++ ./tools/setup_helpers/extension.py 2024-10-04 12:28:00.563912841 +0000 @@ -4,10 +4,9 @@ import subprocess from pathlib import Path @@ -58,26 +59,31 @@ __all__ = [ "get_ext_modules", -@@ -39,9 +37,10 @@ +@@ -38,11 +37,13 @@ + _BUILD_RIR = _get_build("BUILD_RIR", True) _BUILD_RNNT = _get_build("BUILD_RNNT", True) - _BUILD_CTC_DECODER = _get_build("BUILD_CTC_DECODER", True) - _USE_FFMPEG = _get_build("USE_FFMPEG", False) + _USE_FFMPEG = _get_build("USE_FFMPEG", True) -_USE_ROCM = _get_build("USE_ROCM", torch.backends.cuda.is_built() and torch.version.hip is not None) -_USE_CUDA = _get_build("USE_CUDA", torch.backends.cuda.is_built() and torch.version.hip is None) --_USE_OPENMP = _get_build("USE_OPENMP", True) and "ATen parallel backend: OpenMP" in torch.__config__.parallel_info() +_USE_ROCM = _get_build("USE_ROCM", False) +_USE_CUDA = _get_build("USE_CUDA", False) + _BUILD_ALIGN = _get_build("BUILD_ALIGN", True) + _BUILD_CUDA_CTC_DECODER = _get_build("BUILD_CUDA_CTC_DECODER", _USE_CUDA) +-_USE_OPENMP = _get_build("USE_OPENMP", True) and "ATen parallel backend: OpenMP" in torch.__config__.parallel_info() +_USE_OPENMP = _get_build("USE_OPENMP", False) +_CMAKE_PREFIX_PATH = os.environ.get("TORCHAUDIO_CMAKE_PREFIX_PATH", "@TERMUX_PREFIX@") ++_CMAKE_MAKE_PROGRAM = subprocess.check_output(['which', 'ninja'], text=True).strip() _TORCH_CUDA_ARCH_LIST = os.environ.get("TORCH_CUDA_ARCH_LIST", None) -@@ -111,7 +109,7 @@ +@@ -124,8 +125,9 @@ cmake_args = [ f"-DCMAKE_BUILD_TYPE={cfg}", - f"-DCMAKE_PREFIX_PATH={torch.utils.cmake_prefix_path}", + f"-DCMAKE_PREFIX_PATH={_CMAKE_PREFIX_PATH}", f"-DCMAKE_INSTALL_PREFIX={extdir}", ++ f"-DCMAKE_MAKE_PROGRAM={_CMAKE_MAKE_PROGRAM}", "-DCMAKE_VERBOSE_MAKEFILE=ON", f"-DPython_INCLUDE_DIR={distutils.sysconfig.get_python_inc()}", + f"-DBUILD_CPP_TEST={'ON' if _BUILD_CPP_TEST else 'OFF'}", diff --git a/x11-packages/python-torchaudio/0002-fix-cross-compiling.patch b/x11-packages/python-torchaudio/0002-fix-cross-compiling.patch deleted file mode 100644 index 40dc4207be..0000000000 --- a/x11-packages/python-torchaudio/0002-fix-cross-compiling.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/third_party/bzip2/CMakeLists.txt.orig -+++ b/third_party/bzip2/CMakeLists.txt -@@ -40,7 +40,7 @@ - BUILD_BYPRODUCTS ${BZIP_LIBRARIES} - BUILD_IN_SOURCE 1 -- CONFIGURE_COMMAND "" -- BUILD_COMMAND make VERBOSE=1 "CFLAGS=-fPIC -fvisibility=hidden -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" -+ CONFIGURE_COMMAND bash -c "sed -i 's/all: libbz2.a bzip2 bzip2recover test/all: libbz2.a bzip2 bzip2recover/' Makefile" # Do not run test for bzip2 -+ BUILD_COMMAND make VERBOSE=1 "CFLAGS=$ENV{CFLAGS} -fPIC -fvisibility=hidden -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" "CC=$ENV{CC}" "AR=$ENV{AR}" "RANLIB=$ENV{RANLIB}" "LDFLAGS=$ENV{LDFLAGS}" - INSTALL_COMMAND make install PREFIX=${INSTALL_DIR} - DOWNLOAD_NO_PROGRESS ON - LOG_DOWNLOAD ON diff --git a/x11-packages/python-torchaudio/0003-fix-patch-for-sox.patch b/x11-packages/python-torchaudio/0003-fix-patch-for-sox.patch deleted file mode 100644 index 2363f19c9b..0000000000 --- a/x11-packages/python-torchaudio/0003-fix-patch-for-sox.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/third_party/patches/sox.patch.orig -+++ b/third_party/patches/sox.patch -@@ -15,3 +15,37 @@ - + return sox_false; - return ((st.st_mode & S_IFMT) == S_IFREG); - } -+ -+Do not #error, just define NO_REWIND_PIPE -+--- sox/src/formats.c -++++ sox/src/formats.c -+@@ -422,7 +426,7 @@ -+ /* To fix this #error, either simply remove the #error line and live without -+ * file-type detection with pipes, or add support for your compiler in the -+ * lines above. Test with cat monkey.wav | ./sox --info - */ -+- #error FIX NEEDED HERE -++ // #error FIX NEEDED HERE -+ #define NO_REWIND_PIPE -+ (void)fp; -+ #endif -+--- sox/CMakeLists.txt.orig -++++ sox/CMakeLists.txt -+@@ -76,7 +76,7 @@ -+ check_include_files("byteswap.h" HAVE_BYTESWAP_H) -+ check_include_files("inttypes.h" HAVE_INTTYPES_H) -+ check_include_files("fenv.h" HAVE_FENV_H) -+-check_include_files("glob.h" HAVE_GLOB_H) -++#check_include_files("glob.h" HAVE_GLOB_H) -+ check_include_files("io.h" HAVE_IO_H) -+ #check_include_files("ltdl.h" HAVE_LTDL_H) # no plug-ins as yet -+ check_include_files("stdint.h" HAVE_STDINT_H) -+--- sox/configure -++++ sox/configure -+@@ -13000,7 +13000,7 @@ -+ -+ fi -+ -+-for ac_header in fcntl.h unistd.h byteswap.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/utsname.h termios.h glob.h fenv.h -++for ac_header in fcntl.h unistd.h byteswap.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/utsname.h termios.h fenv.h -+ do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/x11-packages/python-torchaudio/0004-fix-patch-for-vorbis.patch b/x11-packages/python-torchaudio/0004-fix-patch-for-vorbis.patch deleted file mode 100644 index 3ef84aa4cf..0000000000 --- a/x11-packages/python-torchaudio/0004-fix-patch-for-vorbis.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/third_party/sox/CMakeLists.txt -+++ b/third_party/sox/CMakeLists.txt -@@ -92,7 +92,7 @@ - DOWNLOAD_DIR ${ARCHIVE_DIR} - URL https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.6.tar.gz - URL_HASH SHA256=6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb -- PATCH_COMMAND cp ${patch_dir}/config.guess ${patch_dir}/config.sub ${CMAKE_CURRENT_BINARY_DIR}/src/vorbis/ -+ PATCH_COMMAND patch -p1 < ${patch_dir}/vorbis.patch && cp ${patch_dir}/config.guess ${patch_dir}/config.sub ${CMAKE_CURRENT_BINARY_DIR}/src/vorbis/ - CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${envs} ${CMAKE_CURRENT_BINARY_DIR}/src/vorbis/configure ${COMMON_ARGS} --with-ogg - DOWNLOAD_NO_PROGRESS ON - LOG_DOWNLOAD ON ---- a/third_party/patches/vorbis.patch -+++ b/third_party/patches/vorbis.patch -@@ -0,0 +1,14 @@ -+--- vorbis/configure -++++ vorbis/configure -+@@ -12734,9 +12734,9 @@ -+ case $host in -+ *86-*-linux*) -+ DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char" -+- CFLAGS="-O3 -Wall -Wextra -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char" -++ CFLAGS="-O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char" -+ # PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static" -+- PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline" -++ PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline" -+ -+ # glibc < 2.1.3 has a serious FP bug in the math inline header -+ # that will cripple Vorbis. Look to see if the magic FP stack diff --git a/x11-packages/python-torchaudio/build.sh b/x11-packages/python-torchaudio/build.sh index 5b310679fc..cbee1935bf 100644 --- a/x11-packages/python-torchaudio/build.sh +++ b/x11-packages/python-torchaudio/build.sh @@ -2,8 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/pytorch/audio TERMUX_PKG_DESCRIPTION="Data manipulation and transformation for audio signal processing, powered by PyTorch" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=2.0.1 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_VERSION=2.4.1 TERMUX_PKG_SRCURL=git+https://github.com/pytorch/audio # FFMPEG TERMUX_PKG_DEPENDS="libc++, python, python-pip, python-torch" diff --git a/x11-packages/python-torchvision/build.sh b/x11-packages/python-torchvision/build.sh index d328553eda..3ecbebbab7 100644 --- a/x11-packages/python-torchvision/build.sh +++ b/x11-packages/python-torchvision/build.sh @@ -2,8 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/pytorch/vision TERMUX_PKG_DESCRIPTION="Datasets, Transforms and Models specific to Computer Vision" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.15.1 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_VERSION=0.19.1 TERMUX_PKG_SRCURL=git+https://github.com/pytorch/vision # ffmpeg TERMUX_PKG_DEPENDS="libc++, python, python-numpy, python-pillow, python-pip, python-torch, libjpeg-turbo, libpng, zlib" diff --git a/x11-packages/python-torchvision/setup.py.patch b/x11-packages/python-torchvision/setup.py.patch index 86f5c9ccbe..f8946a902a 100644 --- a/x11-packages/python-torchvision/setup.py.patch +++ b/x11-packages/python-torchvision/setup.py.patch @@ -1,5 +1,6 @@ ---- ./setup.py.orig -+++ ./setup.py +diff -u -r ../cache/tmp-checkout/setup.py ./setup.py +--- ../cache/tmp-checkout/setup.py 2024-10-03 18:27:11.540911181 +0000 ++++ ./setup.py 2024-10-04 12:09:20.737925352 +0000 @@ -6,10 +6,9 @@ import subprocess import sys @@ -12,7 +13,7 @@ def read(*names, **kwargs): -@@ -159,11 +158,6 @@ +@@ -163,11 +162,6 @@ is_rocm_pytorch = False @@ -24,7 +25,8 @@ if is_rocm_pytorch: from torch.utils.hipify import hipify_python -@@ -189,7 +183,7 @@ +@@ -190,8 +184,8 @@ + define_macros = [] - extra_compile_args = {"cxx": []} @@ -34,8 +36,27 @@ extension = CUDAExtension sources += source_cuda if not is_rocm_pytorch: -@@ -245,7 +245,7 @@ - image_macros += [("USE_PYTHON", None)] +@@ -204,8 +198,6 @@ + define_macros += [("WITH_HIP", None)] + nvcc_flags = [] + extra_compile_args["nvcc"] = nvcc_flags +- elif torch.backends.mps.is_available() or force_mps: +- sources += source_mps + + if sys.platform == "win32": + define_macros += [("torchvision_EXPORTS", None)] +@@ -221,9 +213,6 @@ + extra_compile_args["nvcc"] = [f for f in nvcc_flags if not ("-O" in f or "-g" in f)] + extra_compile_args["nvcc"].append("-O0") + extra_compile_args["nvcc"].append("-g") +- else: +- print("Compiling with debug mode OFF") +- extra_compile_args["cxx"].append("-g0") + + sources = [os.path.join(extensions_dir, s) for s in sources] + +@@ -254,7 +243,7 @@ + image_link_flags = [] # Locating libPNG - libpng = shutil.which("libpng-config") @@ -43,7 +64,7 @@ pngfix = shutil.which("pngfix") png_found = libpng is not None or pngfix is not None -@@ -308,11 +302,7 @@ +@@ -313,11 +302,7 @@ # Locating nvjpeg # Should be included in CUDA_HOME for CUDA >= 10.1, which is the minimum version we have in the CI @@ -56,8 +77,8 @@ use_nvjpeg = use_nvjpeg and nvjpeg_found if use_nvjpeg: -@@ -343,7 +333,7 @@ - ) +@@ -354,7 +339,7 @@ + ) # Locating ffmpeg - ffmpeg_exe = shutil.which("ffmpeg") @@ -65,7 +86,7 @@ has_ffmpeg = ffmpeg_exe is not None ffmpeg_version = None # FIXME: Building torchvision with ffmpeg on MacOS or with Python 3.9 -@@ -352,7 +342,7 @@ +@@ -363,7 +348,7 @@ # FIXME: https://github.com/pytorch/vision/issues/3367 if sys.platform != "linux" or (sys.version_info.major == 3 and sys.version_info.minor == 9): has_ffmpeg = False @@ -74,7 +95,7 @@ try: # This is to check if ffmpeg is installed properly. ffmpeg_version = subprocess.check_output(["ffmpeg", "-version"]) -@@ -444,13 +434,7 @@ +@@ -455,13 +440,7 @@ # CUDA_HOME should be set to the cuda root directory. # TORCHVISION_INCLUDE and TORCHVISION_LIBRARY should include the location to # video codec header files and libraries respectively. @@ -89,7 +110,7 @@ use_video_codec = use_video_codec and video_codec_found if ( -@@ -547,7 +531,6 @@ +@@ -560,7 +539,6 @@ ext_modules=get_extensions(), python_requires=">=3.8", cmdclass={