这是indexloc提供的服务,不要输入任何密码
Skip to content

addpkg(main/python-cmake): 4.0.3 #25434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/python-cmake/build.sh
Original file line number Diff line number Diff line change
@@ -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
}
38 changes: 38 additions & 0 deletions packages/python-cmake/termux.patch
Original file line number Diff line number Diff line change
@@ -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",