diff --git a/packages/python-cmake/build.sh b/packages/python-cmake/build.sh new file mode 100644 index 000000000000000..423be96cfa088ab --- /dev/null +++ b/packages/python-cmake/build.sh @@ -0,0 +1,20 @@ +TERMUX_PKG_HOMEPAGE=https://cmake-python-distributions.readthedocs.io/ +TERMUX_PKG_DESCRIPTION="Python wrapper for CMake" +TERMUX_PKG_LICENSE="Apache-2.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="4.0.3" +TERMUX_PKG_SRCURL="https://github.com/scikit-build/cmake-python-distributions/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz" +TERMUX_PKG_SHA256=ecb64be29518930f7f21c47bdcf9eaa9b0cbd6cab23bdc755766d5408a138ec0 +TERMUX_PKG_DEPENDS="cmake, cmake-curses-gui, python, python-pip" +TERMUX_PKG_SETUP_PYTHON=true +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_AUTO_UPDATE=true + +termux_step_configure() { + termux_setup_cmake + # prevent any downloading or compiling of CMake source code, + # but allow the normal installation of all other files + mkdir -p empty + echo 'cmake_minimum_required(VERSION 4.0)' > CMakeLists.txt + echo 'install(DIRECTORY empty DESTINATION "${CMAKE_INSTALL_PREFIX}")' >> CMakeLists.txt +} diff --git a/packages/python-cmake/termux.patch b/packages/python-cmake/termux.patch new file mode 100644 index 000000000000000..d655e866b04456b --- /dev/null +++ b/packages/python-cmake/termux.patch @@ -0,0 +1,38 @@ +Redirects all paths to the normally-bundled cmake +to the paths of the cmake package this package depends on. + +--- a/src/cmake/__init__.py ++++ b/src/cmake/__init__.py +@@ -25,15 +25,7 @@ def __dir__() -> list[str]: + return __all__ + + +-cmake_executable_path = None +-cmake_files = distribution("cmake").files +-assert cmake_files is not None, "This is the cmake package so it must be installed and have files" +-for script in cmake_files: +- if str(script).startswith("cmake/data/bin/cmake"): +- resolved_script = Path(script.locate()).resolve(strict=True) +- cmake_executable_path = resolved_script.parents[1] +- break +-CMAKE_DATA = str(cmake_executable_path) if cmake_executable_path else None ++CMAKE_DATA = "@TERMUX_PREFIX@" + + assert CMAKE_DATA is not None + assert os.path.exists(CMAKE_DATA) +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -38,13 +38,6 @@ Source = "https://github.com/scikit-build/cmake-python-distributions" + "Mailing list" = "https://groups.google.com/forum/#!forum/scikit-build" + "Bug Tracker" = "https://github.com/scikit-build/cmake-python-distributions/issues" + +-[project.scripts] +-ccmake = "cmake:ccmake" +-cmake = "cmake:cmake" +-cpack = "cmake:cpack" +-ctest = "cmake:ctest" +- +- + [dependency-groups] + test = [ + "coverage>=4.2",