Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake
@ 2023-06-22 16:09 sgn
  2023-06-22 16:12 ` [PR PATCH] [Updated] " sgn
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: sgn @ 2023-06-22 16:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 21473 bytes --]

From d2f31427f4af69479892ffe901b0aa2482e3488d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 1/2] New package: cmake-bootstrap-3.26.4

---
 common/build-style/cmake.sh                   |   1 +
 common/environment/build-style/cmake.sh       |   9 +-
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/linux-gate.patch  |  14 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  69 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 9 files changed, 260 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcd..6b71ea66a224 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da..e9f6766c008a 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,7 +1,10 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
-	fi
+	# Ideally, everything should be built with cmake,
+	# problematic package will be built with cmake-bootstrap explicitly.
+	case "$(printf ' %s' $pkgname $hostmakedepends; echo ' ')" in
+	*" cmake-bootstrap "*|*" cmake "*) ;;
+	*) hostmakedepends+=" cmake"
+	esac
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"
 	fi
diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 000000000000..7b6ce9c16962
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/linux-gate.patch b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
new file mode 100644
index 000000000000..2102feee211f
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
@@ -0,0 +1,14 @@
+https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
+diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
+index 0ba35b6b79..0cd49ab4ba 100644
+--- a/Modules/GetPrerequisites.cmake
++++ b/Modules/GetPrerequisites.cmake
+@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
+ 
+   if(gp_tool MATCHES "ldd$")
+     set(gp_cmd_args "")
+-    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
++    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
+     set(gp_regex_error "not found${eol_char}$")
+     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
+     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 000000000000..0329b5efd2f5
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 000000000000..4b41aea2450b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 000000000000..150f87dcaae5
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 000000000000..4bec57d2aa6d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,69 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.26.4
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest
+}
+
+post_install() {
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 000000000000..fa692de2a9c9
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From 4b1765ca1388ee8039ae543fd82bb6b26d444bba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 2/2] cmake: no longer replaces cmake-bootstrap

---
 srcpkgs/cmake-gui                      |  1 +
 srcpkgs/cmake-gui/patches              |  1 -
 srcpkgs/cmake-gui/template             | 40 --------------------
 srcpkgs/cmake-gui/update               |  1 -
 srcpkgs/cmake/patches/no-license.patch | 30 +++++++++++++++
 srcpkgs/cmake/template                 | 51 ++++++++++++--------------
 6 files changed, 54 insertions(+), 70 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 000000000000..b6868d450eb7
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b361..000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 612a72d91f41..000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=1
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d18..000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 000000000000..32a210ff2330
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 6a2fc292f2b4..d963543faa82 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,15 +1,16 @@
 # Template file for 'cmake'
 pkgname=cmake
 version=3.26.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools cmake-bootstrap"
 makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -17,42 +18,36 @@ license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
 checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
@ 2023-06-22 16:12 ` sgn
  2023-06-22 16:30 ` Duncaen
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-06-22 16:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 21780 bytes --]

From 7e6eed82c4d985090dd7012eba190454c8d06f16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 1/3] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/linux-gate.patch  |  14 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  69 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 7 files changed, 253 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 000000000000..7b6ce9c16962
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/linux-gate.patch b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
new file mode 100644
index 000000000000..2102feee211f
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
@@ -0,0 +1,14 @@
+https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
+diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
+index 0ba35b6b79..0cd49ab4ba 100644
+--- a/Modules/GetPrerequisites.cmake
++++ b/Modules/GetPrerequisites.cmake
+@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
+ 
+   if(gp_tool MATCHES "ldd$")
+     set(gp_cmd_args "")
+-    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
++    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
+     set(gp_regex_error "not found${eol_char}$")
+     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
+     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 000000000000..0329b5efd2f5
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 000000000000..4b41aea2450b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 000000000000..150f87dcaae5
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 000000000000..4bec57d2aa6d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,69 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.26.4
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest
+}
+
+post_install() {
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 000000000000..fa692de2a9c9
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From ee91ad90ca49940916dd44950a742910989980d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 2/3] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcd..6b71ea66a224 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da..e9f6766c008a 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,7 +1,10 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
-	fi
+	# Ideally, everything should be built with cmake,
+	# problematic package will be built with cmake-bootstrap explicitly.
+	case "$(printf ' %s' $pkgname $hostmakedepends; echo ' ')" in
+	*" cmake-bootstrap "*|*" cmake "*) ;;
+	*) hostmakedepends+=" cmake"
+	esac
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"
 	fi

From eaba65894abf58280ac32014ef649e2a2703e904 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 3/3] cmake: no longer replaces cmake-bootstrap

---
 srcpkgs/cmake-gui                      |  1 +
 srcpkgs/cmake-gui/patches              |  1 -
 srcpkgs/cmake-gui/template             | 40 --------------------
 srcpkgs/cmake-gui/update               |  1 -
 srcpkgs/cmake/patches/no-license.patch | 30 +++++++++++++++
 srcpkgs/cmake/template                 | 51 ++++++++++++--------------
 6 files changed, 54 insertions(+), 70 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 000000000000..b6868d450eb7
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b361..000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 612a72d91f41..000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=1
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d18..000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 000000000000..32a210ff2330
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 6a2fc292f2b4..d963543faa82 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,15 +1,16 @@
 # Template file for 'cmake'
 pkgname=cmake
 version=3.26.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools cmake-bootstrap"
 makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -17,42 +18,36 @@ license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
 checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
  2023-06-22 16:12 ` [PR PATCH] [Updated] " sgn
@ 2023-06-22 16:30 ` Duncaen
  2023-06-22 16:33 ` [PR REVIEW] " Duncaen
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Duncaen @ 2023-06-22 16:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/44563#issuecomment-1602976673

Comment:
Still not a fan of even more complex logic for dependencies in build styles.

Any reason to not make them conflict?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
  2023-06-22 16:12 ` [PR PATCH] [Updated] " sgn
  2023-06-22 16:30 ` Duncaen
@ 2023-06-22 16:33 ` Duncaen
  2023-06-29 15:38 ` sgn
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Duncaen @ 2023-06-22 16:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

New review comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/44563#discussion_r1238777575

Comment:
Is there actually a reason to check if cmake is already there? Pretty sure they will be deduplicated anyways and just checking for cmake-boostrap would avoid this subshell.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (2 preceding siblings ...)
  2023-06-22 16:33 ` [PR REVIEW] " Duncaen
@ 2023-06-29 15:38 ` sgn
  2023-06-29 15:38 ` sgn
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-06-29 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/44563#discussion_r1246812719

Comment:
Because I would like to allow special package to use `cmake` instead of `cmake-bootstrap`.
But it doesn't hurt to use `cmake-bootstrap` in all case I think

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (3 preceding siblings ...)
  2023-06-29 15:38 ` sgn
@ 2023-06-29 15:38 ` sgn
  2023-07-28 16:07 ` [PR PATCH] [Updated] " sgn
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-06-29 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/44563#issuecomment-1613430005

Comment:
> Any reason to not make them conflict?

Well, to allow them to co-exists, because why not.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (4 preceding siblings ...)
  2023-06-29 15:38 ` sgn
@ 2023-07-28 16:07 ` sgn
  2023-07-31  2:31 ` sgn
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-07-28 16:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 21547 bytes --]

From ebe9520259ac0353c408b9ce4b833a90771d8f1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 1/3] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/linux-gate.patch  |  14 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  69 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 7 files changed, 253 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 0000000000000..7b6ce9c16962b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/linux-gate.patch b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
new file mode 100644
index 0000000000000..2102feee211f2
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
@@ -0,0 +1,14 @@
+https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
+diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
+index 0ba35b6b79..0cd49ab4ba 100644
+--- a/Modules/GetPrerequisites.cmake
++++ b/Modules/GetPrerequisites.cmake
+@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
+ 
+   if(gp_tool MATCHES "ldd$")
+     set(gp_cmd_args "")
+-    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
++    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
+     set(gp_regex_error "not found${eol_char}$")
+     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
+     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 0000000000000..0329b5efd2f52
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 0000000000000..4b41aea2450b4
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 0000000000000..150f87dcaae5d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 0000000000000..4bec57d2aa6d9
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,69 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.26.4
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest
+}
+
+post_install() {
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 0000000000000..fa692de2a9c9a
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From c0fca76287832f185308edd46cc3d8fa3c797477 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 2/3] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcdc..6b71ea66a224a 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da1..5b6ac0476ed2c 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,5 +1,5 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
+	if [ "$pkgname" != cmake-bootstrap ]; then
 		hostmakedepends+=" cmake"
 	fi
 	if [ "${make_cmd:-ninja}" = ninja ]; then

From 11df0603648e1aea2811602f7f31d595c499de03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 3/3] cmake: no longer replaces cmake-bootstrap

---
 srcpkgs/cmake-gui                      |  1 +
 srcpkgs/cmake-gui/patches              |  1 -
 srcpkgs/cmake-gui/template             | 40 --------------------
 srcpkgs/cmake-gui/update               |  1 -
 srcpkgs/cmake/patches/no-license.patch | 30 +++++++++++++++
 srcpkgs/cmake/template                 | 51 ++++++++++++--------------
 6 files changed, 54 insertions(+), 70 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 0000000000000..b6868d450eb7b
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b3614..0000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 6aea8d3e7afb9..0000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=3
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d189..0000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 0000000000000..32a210ff23309
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 20da7a8678ea8..bdddd4c77ed94 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,15 +1,16 @@
 # Template file for 'cmake'
 pkgname=cmake
 version=3.26.4
-revision=3
+revision=4
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools cmake-bootstrap"
 makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -17,42 +18,36 @@ license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
 checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (5 preceding siblings ...)
  2023-07-28 16:07 ` [PR PATCH] [Updated] " sgn
@ 2023-07-31  2:31 ` sgn
  2023-08-16 13:04 ` sgn
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-07-31  2:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 21618 bytes --]

From 533926a97ddf323095e79b3873bae67a930f1ac9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 1/3] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/linux-gate.patch  |  14 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  69 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 7 files changed, 253 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 0000000000000..7b6ce9c16962b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/linux-gate.patch b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
new file mode 100644
index 0000000000000..2102feee211f2
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/linux-gate.patch
@@ -0,0 +1,14 @@
+https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
+diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
+index 0ba35b6b79..0cd49ab4ba 100644
+--- a/Modules/GetPrerequisites.cmake
++++ b/Modules/GetPrerequisites.cmake
+@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
+ 
+   if(gp_tool MATCHES "ldd$")
+     set(gp_cmd_args "")
+-    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
++    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
+     set(gp_regex_error "not found${eol_char}$")
+     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
+     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 0000000000000..0329b5efd2f52
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 0000000000000..4b41aea2450b4
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 0000000000000..150f87dcaae5d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 0000000000000..4bec57d2aa6d9
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,69 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.26.4
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest
+}
+
+post_install() {
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 0000000000000..fa692de2a9c9a
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From 0ee4cbe30be1d45c102a3a83f622009cec73cdbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 2/3] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcdc..6b71ea66a224a 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da1..d301133843648 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,6 +1,6 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
+	if [ "$pkgname" != cmake-bootstrap ]; then
+		hostmakedepends+=" cmake-bootstrap"
 	fi
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"

From ae07e856b04fed917524a88b7951f2c6a2709066 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 3/3] cmake: no longer replaces cmake-bootstrap

---
 srcpkgs/cmake-gui                      |  1 +
 srcpkgs/cmake-gui/patches              |  1 -
 srcpkgs/cmake-gui/template             | 40 --------------------
 srcpkgs/cmake-gui/update               |  1 -
 srcpkgs/cmake/patches/no-license.patch | 30 +++++++++++++++
 srcpkgs/cmake/template                 | 51 ++++++++++++--------------
 6 files changed, 54 insertions(+), 70 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 0000000000000..b6868d450eb7b
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b3614..0000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 6aea8d3e7afb9..0000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=3
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d189..0000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 0000000000000..32a210ff23309
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 20da7a8678ea8..bdddd4c77ed94 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,15 +1,16 @@
 # Template file for 'cmake'
 pkgname=cmake
 version=3.26.4
-revision=3
+revision=4
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools cmake-bootstrap"
 makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
@@ -17,42 +18,36 @@ license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
 checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (6 preceding siblings ...)
  2023-07-31  2:31 ` sgn
@ 2023-08-16 13:04 ` sgn
  2023-08-16 14:35 ` sgn
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-08-16 13:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 27244 bytes --]

From e517b21457e20811edb562f62d020fbeb910cbd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 16 Aug 2023 14:31:37 +0700
Subject: [PATCH 1/4] New package: cppdap-1.58.0+a

---
 srcpkgs/cppdap-devel               |  1 +
 srcpkgs/cppdap/patches/gtest.patch | 32 ++++++++++++++++++++++++
 srcpkgs/cppdap/template            | 39 ++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+)
 create mode 120000 srcpkgs/cppdap-devel
 create mode 100644 srcpkgs/cppdap/patches/gtest.patch
 create mode 100644 srcpkgs/cppdap/template

diff --git a/srcpkgs/cppdap-devel b/srcpkgs/cppdap-devel
new file mode 120000
index 0000000000000..e38f4d0887117
--- /dev/null
+++ b/srcpkgs/cppdap-devel
@@ -0,0 +1 @@
+cppdap
\ No newline at end of file
diff --git a/srcpkgs/cppdap/patches/gtest.patch b/srcpkgs/cppdap/patches/gtest.patch
new file mode 100644
index 0000000000000..231bf4e5f3879
--- /dev/null
+++ b/srcpkgs/cppdap/patches/gtest.patch
@@ -0,0 +1,32 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,13 +59,6 @@ set_if_not_defined(CPPDAP_GOOGLETEST_DIR
+ ###########################################################
+ # Submodules
+ ###########################################################
+-if(CPPDAP_BUILD_TESTS)
+-    if(NOT EXISTS ${CPPDAP_GOOGLETEST_DIR}/.git)
+-        message(WARNING "third_party/googletest submodule missing.")
+-        message(WARNING "Run: `git submodule update --init` to build tests.")
+-        set(CPPDAP_BUILD_TESTS OFF)
+-    endif()
+-endif(CPPDAP_BUILD_TESTS)
+ 
+ ###########################################################
+ # JSON library
+@@ -289,7 +282,6 @@ if(CPPDAP_BUILD_TESTS)
+         ${CPPDAP_SRC_DIR}/traits_test.cpp
+         ${CPPDAP_SRC_DIR}/typeinfo_test.cpp
+         ${CPPDAP_SRC_DIR}/variant_test.cpp
+-        ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc
+     )
+ 
+     set(DAP_TEST_INCLUDE_DIR
+@@ -312,6 +304,7 @@ if(CPPDAP_BUILD_TESTS)
+ 
+     cppdap_set_target_options(cppdap-unittests)
+     target_link_libraries(cppdap-unittests PRIVATE cppdap)
++    target_link_libraries(cppdap-unittests PRIVATE gtest_main gtest)
+ endif(CPPDAP_BUILD_TESTS)
+ 
+ # fuzzer
diff --git a/srcpkgs/cppdap/template b/srcpkgs/cppdap/template
new file mode 100644
index 0000000000000..ea294ccdb851a
--- /dev/null
+++ b/srcpkgs/cppdap/template
@@ -0,0 +1,39 @@
+# Template file for 'cppdap'
+#
+# As much as I know about Google, their library's ABI ain't stable.
+# Rebuild all revdeps on update
+pkgname=cppdap
+version=1.58.0+a
+revision=1
+build_style=cmake
+configure_args="-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=On
+ -DCPPDAP_BUILD_TESTS=On -DBUILD_SHARED_LIBS=On"
+makedepends="json-c++ gtest-devel"
+short_desc="C++ library for the Debug Adapter Protocol"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Apache-2.0"
+homepage="https://github.com/google/cppdap"
+distfiles="https://github.com/google/cppdap/archive/refs/tags/dap-${version/+/-}.tar.gz"
+checksum=5d35ca5db78570b6bef698e3365f79bd82a4f78e8393546387f78d7bdb2a2a08
+
+post_patch() {
+	vsed -i -e "/project.*VERSION/s/VERSION [0-9.]* /VERSION ${version%+*} /" \
+		-e "/add_library/s/ STATIC / /" \
+		CMakeLists.txt
+}
+
+do_check() {
+	cd build
+	./cppdap-unittests
+}
+
+cppdap-devel_package() {
+	short_desc+=" - development files"
+	depends="${sourcepkg}>=${version}_${revision} json-c++"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		# vmove "usr/lib/*.a"
+		# vmove "usr/lib/*.so"
+	}
+}

From f41c6e9e5dad701a09e47fcbcb7a1694d06bd537 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 2/4] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  70 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 6 files changed, 240 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 0000000000000..7b6ce9c16962b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 0000000000000..0329b5efd2f52
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 0000000000000..4b41aea2450b4
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 0000000000000..150f87dcaae5d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 0000000000000..bc9583a3d3d92
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,70 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.27.2
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest -E ExternalProject -E UpdateGIT
+}
+
+post_install() {
+	rm -f ${DESTDIR}/usr/libexec/xbps-src/bin/cpack
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 0000000000000..fa692de2a9c9a
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From 9b5e3cac848805476d9084ff3ca80dcc3aa3b836 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 3/4] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcdc..6b71ea66a224a 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da1..d301133843648 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,6 +1,6 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
+	if [ "$pkgname" != cmake-bootstrap ]; then
+		hostmakedepends+=" cmake-bootstrap"
 	fi
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"

From 59de1e2226618bffd9e88fda1482bfc795763aff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 4/4] cmake: update to 3.27.2.

---
 srcpkgs/cmake-gui                         |  1 +
 srcpkgs/cmake-gui/patches                 |  1 -
 srcpkgs/cmake-gui/template                | 40 ----------------
 srcpkgs/cmake-gui/update                  |  1 -
 srcpkgs/cmake/patches/linux-gate.patch    | 14 ------
 srcpkgs/cmake/patches/nlohmann_json.patch | 25 ++++++++++
 srcpkgs/cmake/patches/no-license.patch    | 30 ++++++++++++
 srcpkgs/cmake/template                    | 57 +++++++++++------------
 8 files changed, 82 insertions(+), 87 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 delete mode 100644 srcpkgs/cmake/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake/patches/nlohmann_json.patch
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 0000000000000..b6868d450eb7b
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b3614..0000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 6aea8d3e7afb9..0000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=3
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d189..0000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/linux-gate.patch b/srcpkgs/cmake/patches/linux-gate.patch
deleted file mode 100644
index 2102feee211f2..0000000000000
--- a/srcpkgs/cmake/patches/linux-gate.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
-diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
-index 0ba35b6b79..0cd49ab4ba 100644
---- a/Modules/GetPrerequisites.cmake
-+++ b/Modules/GetPrerequisites.cmake
-@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
- 
-   if(gp_tool MATCHES "ldd$")
-     set(gp_cmd_args "")
--    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
-+    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
-     set(gp_regex_error "not found${eol_char}$")
-     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
-     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake/patches/nlohmann_json.patch b/srcpkgs/cmake/patches/nlohmann_json.patch
new file mode 100644
index 0000000000000..9746ca4c9d0e8
--- /dev/null
+++ b/srcpkgs/cmake/patches/nlohmann_json.patch
@@ -0,0 +1,25 @@
+diff --git a/Tests/CMakeLib/testDebuggerNamedPipe.cxx b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+index d2b0728b02..ec9170646b 100644
+--- a/Tests/CMakeLib/testDebuggerNamedPipe.cxx
++++ b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+@@ -180,13 +180,13 @@ int runTest(int argc, char* argv[])
+   auto debuggerResponse = debuggerResponseStream.str();
+ 
+   std::vector<std::string> expectedResponses = {
+-    R"("event" : "initialized".*"type" : "event")",
+-    R"("command" : "launch".*"success" : true.*"type" : "response")",
+-    R"("command" : "configurationDone".*"success" : true.*"type" : "response")",
+-    R"("reason" : "started".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("reason" : "exited".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("exitCode" : 0.*"event" : "exited".*"type" : "event")",
+-    R"("command" : "disconnect".*"success" : true.*"type" : "response")"
++    R"("event" *: *"initialized".*"type" *: *"event")",
++    R"("command" *: *"launch".*"success" *: *true.*"type" *: *"response")",
++    R"("command" *: *"configurationDone".*"success" *: *true.*"type" *: *"response")",
++    R"("reason" *: *"started".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("reason" *: *"exited".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("exitCode" *: *0.*"event" *: *"exited".*"type" *: *"event")",
++    R"("command" *: *"disconnect".*"success" *: *true.*"type" *: *"response")"
+   };
+ 
+   for (auto& regexString : expectedResponses) {
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 0000000000000..32a210ff23309
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 20da7a8678ea8..3517bb2cc6787 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,58 +1,53 @@
 # Template file for 'cmake'
 pkgname=cmake
-version=3.26.4
-revision=3
+version=3.27.2
+revision=1
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
-makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools"
+makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel cppdap-devel
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (7 preceding siblings ...)
  2023-08-16 13:04 ` sgn
@ 2023-08-16 14:35 ` sgn
  2023-08-17  0:12 ` sgn
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-08-16 14:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 27595 bytes --]

From ecf21d963c7057ce14fdbdeace8fcaffe280c344 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 16 Aug 2023 14:31:37 +0700
Subject: [PATCH 1/4] New package: cppdap-1.58.0+a

---
 common/shlibs                      |  1 +
 srcpkgs/cppdap-devel               |  1 +
 srcpkgs/cppdap/patches/gtest.patch | 32 ++++++++++++++++++++++++
 srcpkgs/cppdap/template            | 39 ++++++++++++++++++++++++++++++
 4 files changed, 73 insertions(+)
 create mode 120000 srcpkgs/cppdap-devel
 create mode 100644 srcpkgs/cppdap/patches/gtest.patch
 create mode 100644 srcpkgs/cppdap/template

diff --git a/common/shlibs b/common/shlibs
index 4477d4c879782..eab94bb9b16d9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4326,3 +4326,4 @@ libmimalloc.so.2 mimalloc-2.1.2_1
 lib2geom.so.1.3.0 lib2geom-1.3_1
 libdbi.so.1 libdbi-0.9.0_1
 libchafa.so.0 libchafa-1.12.5_1
+libcppdap.so cppdap-1.58.0+a_1
diff --git a/srcpkgs/cppdap-devel b/srcpkgs/cppdap-devel
new file mode 120000
index 0000000000000..e38f4d0887117
--- /dev/null
+++ b/srcpkgs/cppdap-devel
@@ -0,0 +1 @@
+cppdap
\ No newline at end of file
diff --git a/srcpkgs/cppdap/patches/gtest.patch b/srcpkgs/cppdap/patches/gtest.patch
new file mode 100644
index 0000000000000..231bf4e5f3879
--- /dev/null
+++ b/srcpkgs/cppdap/patches/gtest.patch
@@ -0,0 +1,32 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,13 +59,6 @@ set_if_not_defined(CPPDAP_GOOGLETEST_DIR
+ ###########################################################
+ # Submodules
+ ###########################################################
+-if(CPPDAP_BUILD_TESTS)
+-    if(NOT EXISTS ${CPPDAP_GOOGLETEST_DIR}/.git)
+-        message(WARNING "third_party/googletest submodule missing.")
+-        message(WARNING "Run: `git submodule update --init` to build tests.")
+-        set(CPPDAP_BUILD_TESTS OFF)
+-    endif()
+-endif(CPPDAP_BUILD_TESTS)
+ 
+ ###########################################################
+ # JSON library
+@@ -289,7 +282,6 @@ if(CPPDAP_BUILD_TESTS)
+         ${CPPDAP_SRC_DIR}/traits_test.cpp
+         ${CPPDAP_SRC_DIR}/typeinfo_test.cpp
+         ${CPPDAP_SRC_DIR}/variant_test.cpp
+-        ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc
+     )
+ 
+     set(DAP_TEST_INCLUDE_DIR
+@@ -312,6 +304,7 @@ if(CPPDAP_BUILD_TESTS)
+ 
+     cppdap_set_target_options(cppdap-unittests)
+     target_link_libraries(cppdap-unittests PRIVATE cppdap)
++    target_link_libraries(cppdap-unittests PRIVATE gtest_main gtest)
+ endif(CPPDAP_BUILD_TESTS)
+ 
+ # fuzzer
diff --git a/srcpkgs/cppdap/template b/srcpkgs/cppdap/template
new file mode 100644
index 0000000000000..ea294ccdb851a
--- /dev/null
+++ b/srcpkgs/cppdap/template
@@ -0,0 +1,39 @@
+# Template file for 'cppdap'
+#
+# As much as I know about Google, their library's ABI ain't stable.
+# Rebuild all revdeps on update
+pkgname=cppdap
+version=1.58.0+a
+revision=1
+build_style=cmake
+configure_args="-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=On
+ -DCPPDAP_BUILD_TESTS=On -DBUILD_SHARED_LIBS=On"
+makedepends="json-c++ gtest-devel"
+short_desc="C++ library for the Debug Adapter Protocol"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Apache-2.0"
+homepage="https://github.com/google/cppdap"
+distfiles="https://github.com/google/cppdap/archive/refs/tags/dap-${version/+/-}.tar.gz"
+checksum=5d35ca5db78570b6bef698e3365f79bd82a4f78e8393546387f78d7bdb2a2a08
+
+post_patch() {
+	vsed -i -e "/project.*VERSION/s/VERSION [0-9.]* /VERSION ${version%+*} /" \
+		-e "/add_library/s/ STATIC / /" \
+		CMakeLists.txt
+}
+
+do_check() {
+	cd build
+	./cppdap-unittests
+}
+
+cppdap-devel_package() {
+	short_desc+=" - development files"
+	depends="${sourcepkg}>=${version}_${revision} json-c++"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		# vmove "usr/lib/*.a"
+		# vmove "usr/lib/*.so"
+	}
+}

From df7add3510e71dff6145cee0c9a1c5e310492a81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 2/4] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  70 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 6 files changed, 240 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 0000000000000..7b6ce9c16962b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 0000000000000..0329b5efd2f52
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 0000000000000..4b41aea2450b4
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 0000000000000..150f87dcaae5d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 0000000000000..bc9583a3d3d92
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,70 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.27.2
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest -E ExternalProject -E UpdateGIT
+}
+
+post_install() {
+	rm -f ${DESTDIR}/usr/libexec/xbps-src/bin/cpack
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 0000000000000..fa692de2a9c9a
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From a5d507d414500732bfd825e0cefcb18dfbef1088 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 3/4] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcdc..6b71ea66a224a 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da1..d301133843648 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,6 +1,6 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
+	if [ "$pkgname" != cmake-bootstrap ]; then
+		hostmakedepends+=" cmake-bootstrap"
 	fi
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"

From 53e0f42073bc469dcd295e1216501f95cdf410aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 4/4] cmake: update to 3.27.2.

---
 srcpkgs/cmake-gui                         |  1 +
 srcpkgs/cmake-gui/patches                 |  1 -
 srcpkgs/cmake-gui/template                | 40 ----------------
 srcpkgs/cmake-gui/update                  |  1 -
 srcpkgs/cmake/patches/linux-gate.patch    | 14 ------
 srcpkgs/cmake/patches/nlohmann_json.patch | 25 ++++++++++
 srcpkgs/cmake/patches/no-license.patch    | 30 ++++++++++++
 srcpkgs/cmake/template                    | 57 +++++++++++------------
 8 files changed, 82 insertions(+), 87 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 delete mode 100644 srcpkgs/cmake/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake/patches/nlohmann_json.patch
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 0000000000000..b6868d450eb7b
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b3614..0000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 6aea8d3e7afb9..0000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=3
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d189..0000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/linux-gate.patch b/srcpkgs/cmake/patches/linux-gate.patch
deleted file mode 100644
index 2102feee211f2..0000000000000
--- a/srcpkgs/cmake/patches/linux-gate.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
-diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
-index 0ba35b6b79..0cd49ab4ba 100644
---- a/Modules/GetPrerequisites.cmake
-+++ b/Modules/GetPrerequisites.cmake
-@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
- 
-   if(gp_tool MATCHES "ldd$")
-     set(gp_cmd_args "")
--    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
-+    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
-     set(gp_regex_error "not found${eol_char}$")
-     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
-     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake/patches/nlohmann_json.patch b/srcpkgs/cmake/patches/nlohmann_json.patch
new file mode 100644
index 0000000000000..9746ca4c9d0e8
--- /dev/null
+++ b/srcpkgs/cmake/patches/nlohmann_json.patch
@@ -0,0 +1,25 @@
+diff --git a/Tests/CMakeLib/testDebuggerNamedPipe.cxx b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+index d2b0728b02..ec9170646b 100644
+--- a/Tests/CMakeLib/testDebuggerNamedPipe.cxx
++++ b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+@@ -180,13 +180,13 @@ int runTest(int argc, char* argv[])
+   auto debuggerResponse = debuggerResponseStream.str();
+ 
+   std::vector<std::string> expectedResponses = {
+-    R"("event" : "initialized".*"type" : "event")",
+-    R"("command" : "launch".*"success" : true.*"type" : "response")",
+-    R"("command" : "configurationDone".*"success" : true.*"type" : "response")",
+-    R"("reason" : "started".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("reason" : "exited".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("exitCode" : 0.*"event" : "exited".*"type" : "event")",
+-    R"("command" : "disconnect".*"success" : true.*"type" : "response")"
++    R"("event" *: *"initialized".*"type" *: *"event")",
++    R"("command" *: *"launch".*"success" *: *true.*"type" *: *"response")",
++    R"("command" *: *"configurationDone".*"success" *: *true.*"type" *: *"response")",
++    R"("reason" *: *"started".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("reason" *: *"exited".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("exitCode" *: *0.*"event" *: *"exited".*"type" *: *"event")",
++    R"("command" *: *"disconnect".*"success" *: *true.*"type" *: *"response")"
+   };
+ 
+   for (auto& regexString : expectedResponses) {
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 0000000000000..32a210ff23309
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 20da7a8678ea8..3517bb2cc6787 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,58 +1,53 @@
 # Template file for 'cmake'
 pkgname=cmake
-version=3.26.4
-revision=3
+version=3.27.2
+revision=1
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
-makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools"
+makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel cppdap-devel
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (8 preceding siblings ...)
  2023-08-16 14:35 ` sgn
@ 2023-08-17  0:12 ` sgn
  2023-08-17 11:26 ` sgn
  2023-08-17 12:59 ` [PR PATCH] [Merged]: " sgn
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-08-17  0:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 27602 bytes --]

From 28a4ddcdcb2ee46729f7102e6438b31b2a951778 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 16 Aug 2023 14:31:37 +0700
Subject: [PATCH 1/4] New package: cppdap-1.58.0+a

---
 common/shlibs                      |  1 +
 srcpkgs/cppdap-devel               |  1 +
 srcpkgs/cppdap/patches/gtest.patch | 32 ++++++++++++++++++++++++
 srcpkgs/cppdap/template            | 39 ++++++++++++++++++++++++++++++
 4 files changed, 73 insertions(+)
 create mode 120000 srcpkgs/cppdap-devel
 create mode 100644 srcpkgs/cppdap/patches/gtest.patch
 create mode 100644 srcpkgs/cppdap/template

diff --git a/common/shlibs b/common/shlibs
index 4477d4c879782..eab94bb9b16d9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4326,3 +4326,4 @@ libmimalloc.so.2 mimalloc-2.1.2_1
 lib2geom.so.1.3.0 lib2geom-1.3_1
 libdbi.so.1 libdbi-0.9.0_1
 libchafa.so.0 libchafa-1.12.5_1
+libcppdap.so cppdap-1.58.0+a_1
diff --git a/srcpkgs/cppdap-devel b/srcpkgs/cppdap-devel
new file mode 120000
index 0000000000000..e38f4d0887117
--- /dev/null
+++ b/srcpkgs/cppdap-devel
@@ -0,0 +1 @@
+cppdap
\ No newline at end of file
diff --git a/srcpkgs/cppdap/patches/gtest.patch b/srcpkgs/cppdap/patches/gtest.patch
new file mode 100644
index 0000000000000..231bf4e5f3879
--- /dev/null
+++ b/srcpkgs/cppdap/patches/gtest.patch
@@ -0,0 +1,32 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,13 +59,6 @@ set_if_not_defined(CPPDAP_GOOGLETEST_DIR
+ ###########################################################
+ # Submodules
+ ###########################################################
+-if(CPPDAP_BUILD_TESTS)
+-    if(NOT EXISTS ${CPPDAP_GOOGLETEST_DIR}/.git)
+-        message(WARNING "third_party/googletest submodule missing.")
+-        message(WARNING "Run: `git submodule update --init` to build tests.")
+-        set(CPPDAP_BUILD_TESTS OFF)
+-    endif()
+-endif(CPPDAP_BUILD_TESTS)
+ 
+ ###########################################################
+ # JSON library
+@@ -289,7 +282,6 @@ if(CPPDAP_BUILD_TESTS)
+         ${CPPDAP_SRC_DIR}/traits_test.cpp
+         ${CPPDAP_SRC_DIR}/typeinfo_test.cpp
+         ${CPPDAP_SRC_DIR}/variant_test.cpp
+-        ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc
+     )
+ 
+     set(DAP_TEST_INCLUDE_DIR
+@@ -312,6 +304,7 @@ if(CPPDAP_BUILD_TESTS)
+ 
+     cppdap_set_target_options(cppdap-unittests)
+     target_link_libraries(cppdap-unittests PRIVATE cppdap)
++    target_link_libraries(cppdap-unittests PRIVATE gtest_main gtest)
+ endif(CPPDAP_BUILD_TESTS)
+ 
+ # fuzzer
diff --git a/srcpkgs/cppdap/template b/srcpkgs/cppdap/template
new file mode 100644
index 0000000000000..ea294ccdb851a
--- /dev/null
+++ b/srcpkgs/cppdap/template
@@ -0,0 +1,39 @@
+# Template file for 'cppdap'
+#
+# As much as I know about Google, their library's ABI ain't stable.
+# Rebuild all revdeps on update
+pkgname=cppdap
+version=1.58.0+a
+revision=1
+build_style=cmake
+configure_args="-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=On
+ -DCPPDAP_BUILD_TESTS=On -DBUILD_SHARED_LIBS=On"
+makedepends="json-c++ gtest-devel"
+short_desc="C++ library for the Debug Adapter Protocol"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Apache-2.0"
+homepage="https://github.com/google/cppdap"
+distfiles="https://github.com/google/cppdap/archive/refs/tags/dap-${version/+/-}.tar.gz"
+checksum=5d35ca5db78570b6bef698e3365f79bd82a4f78e8393546387f78d7bdb2a2a08
+
+post_patch() {
+	vsed -i -e "/project.*VERSION/s/VERSION [0-9.]* /VERSION ${version%+*} /" \
+		-e "/add_library/s/ STATIC / /" \
+		CMakeLists.txt
+}
+
+do_check() {
+	cd build
+	./cppdap-unittests
+}
+
+cppdap-devel_package() {
+	short_desc+=" - development files"
+	depends="${sourcepkg}>=${version}_${revision} json-c++"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		# vmove "usr/lib/*.a"
+		# vmove "usr/lib/*.so"
+	}
+}

From 8c52e077141a9ae463c0c9328775f1394af6e625 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 2/4] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  13 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  15 +++
 .../patches/no-run-cmake-bootstrap.patch      |  13 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 127 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  70 ++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 6 files changed, 240 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 0000000000000..7b6ce9c16962b
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+index dcdc7f1b96..37e13b6c5c 100644
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -11,7 +11,7 @@ project(Minimal NONE)
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 0000000000000..0329b5efd2f52
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,15 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
+@@ -33,9 +33,9 @@
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 0000000000000..4b41aea2450b4
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,13 @@
+We will run cmake ourselves with our flags
+Index: cmake-3.20.3/bootstrap
+===================================================================
+--- cmake-3.20.3.orig/bootstrap
++++ cmake-3.20.3/bootstrap
+@@ -1968,6 +1968,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 0000000000000..150f87dcaae5d
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,127 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..793e52ad9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index 82f9b0b70..445fca05f 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
+index 027de5c58..1d3e27cd0 100644
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
+index 3121fbe4c..122422b0e 100644
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC"
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt
+index 9f532ad48..63eb93926 100644
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
+index ad3d43382..b31321e3f 100644
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+diff --git a/Utilities/cmnghttp2/CMakeLists.txt b/Utilities/cmnghttp2/CMakeLists.txt
+index 6d0c76ff3..2b46fdf6c 100644
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRIVATE
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt
+index ecbace6f2..d947b3f3a 100644
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+diff --git a/Utilities/cmzstd/CMakeLists.txt b/Utilities/cmzstd/CMakeLists.txt
+index 981e3d501..78b073b17 100644
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 0000000000000..c46583a70f742
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,70 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.27.2
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest -E "ExternalProject|UpdateGIT|CMP0150"
+}
+
+post_install() {
+	rm -f ${DESTDIR}/usr/libexec/xbps-src/bin/cpack
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 0000000000000..fa692de2a9c9a
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From 2d06a93e9445bc2486605a57b3a1adaf51061e4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 3/4] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcdc..6b71ea66a224a 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da1..d301133843648 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,6 +1,6 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
+	if [ "$pkgname" != cmake-bootstrap ]; then
+		hostmakedepends+=" cmake-bootstrap"
 	fi
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"

From ce11fba37211ba59d105cc6fd7aca8372f06c186 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 4/4] cmake: update to 3.27.2.

---
 srcpkgs/cmake-gui                         |  1 +
 srcpkgs/cmake-gui/patches                 |  1 -
 srcpkgs/cmake-gui/template                | 40 ----------------
 srcpkgs/cmake-gui/update                  |  1 -
 srcpkgs/cmake/patches/linux-gate.patch    | 14 ------
 srcpkgs/cmake/patches/nlohmann_json.patch | 25 ++++++++++
 srcpkgs/cmake/patches/no-license.patch    | 30 ++++++++++++
 srcpkgs/cmake/template                    | 57 +++++++++++------------
 8 files changed, 82 insertions(+), 87 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 delete mode 100644 srcpkgs/cmake/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake/patches/nlohmann_json.patch
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 0000000000000..b6868d450eb7b
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b3614..0000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 6aea8d3e7afb9..0000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=3
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d189..0000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/linux-gate.patch b/srcpkgs/cmake/patches/linux-gate.patch
deleted file mode 100644
index 2102feee211f2..0000000000000
--- a/srcpkgs/cmake/patches/linux-gate.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
-diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
-index 0ba35b6b79..0cd49ab4ba 100644
---- a/Modules/GetPrerequisites.cmake
-+++ b/Modules/GetPrerequisites.cmake
-@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
- 
-   if(gp_tool MATCHES "ldd$")
-     set(gp_cmd_args "")
--    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
-+    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
-     set(gp_regex_error "not found${eol_char}$")
-     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
-     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake/patches/nlohmann_json.patch b/srcpkgs/cmake/patches/nlohmann_json.patch
new file mode 100644
index 0000000000000..9746ca4c9d0e8
--- /dev/null
+++ b/srcpkgs/cmake/patches/nlohmann_json.patch
@@ -0,0 +1,25 @@
+diff --git a/Tests/CMakeLib/testDebuggerNamedPipe.cxx b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+index d2b0728b02..ec9170646b 100644
+--- a/Tests/CMakeLib/testDebuggerNamedPipe.cxx
++++ b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+@@ -180,13 +180,13 @@ int runTest(int argc, char* argv[])
+   auto debuggerResponse = debuggerResponseStream.str();
+ 
+   std::vector<std::string> expectedResponses = {
+-    R"("event" : "initialized".*"type" : "event")",
+-    R"("command" : "launch".*"success" : true.*"type" : "response")",
+-    R"("command" : "configurationDone".*"success" : true.*"type" : "response")",
+-    R"("reason" : "started".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("reason" : "exited".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("exitCode" : 0.*"event" : "exited".*"type" : "event")",
+-    R"("command" : "disconnect".*"success" : true.*"type" : "response")"
++    R"("event" *: *"initialized".*"type" *: *"event")",
++    R"("command" *: *"launch".*"success" *: *true.*"type" *: *"response")",
++    R"("command" *: *"configurationDone".*"success" *: *true.*"type" *: *"response")",
++    R"("reason" *: *"started".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("reason" *: *"exited".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("exitCode" *: *0.*"event" *: *"exited".*"type" *: *"event")",
++    R"("command" *: *"disconnect".*"success" *: *true.*"type" *: *"response")"
+   };
+ 
+   for (auto& regexString : expectedResponses) {
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 0000000000000..32a210ff23309
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c1d50cab4..c4c2f7ce8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
+index 2b8eedd4e..c3fb1b9ce 100644
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 20da7a8678ea8..3517bb2cc6787 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,58 +1,53 @@
 # Template file for 'cmake'
 pkgname=cmake
-version=3.26.4
-revision=3
+version=3.27.2
+revision=1
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
-makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools"
+makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel cppdap-devel
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (9 preceding siblings ...)
  2023-08-17  0:12 ` sgn
@ 2023-08-17 11:26 ` sgn
  2023-08-17 12:59 ` [PR PATCH] [Merged]: " sgn
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-08-17 11:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-split-bootstrap-path
https://github.com/void-linux/void-packages/pull/44563

CMake: a bootstrap package to remove all possible circles with cmake
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44563.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-split-bootstrap-path-44563.patch --]
[-- Type: text/x-diff, Size: 30246 bytes --]

From c3cb74d290c40c92b4a76ae0e60bb5d9168f217e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 17 Aug 2023 18:26:13 +0700
Subject: [PATCH 1/4] New package: cppdap-1.58.0+a

---
 common/shlibs                                 |  1 +
 srcpkgs/cppdap-devel                          |  1 +
 srcpkgs/cppdap/patches/gtest.patch            | 32 +++++++++++++++
 .../cppdap/patches/no-freeaddrinfo-null.patch | 26 +++++++++++++
 srcpkgs/cppdap/template                       | 39 +++++++++++++++++++
 5 files changed, 99 insertions(+)
 create mode 120000 srcpkgs/cppdap-devel
 create mode 100644 srcpkgs/cppdap/patches/gtest.patch
 create mode 100644 srcpkgs/cppdap/patches/no-freeaddrinfo-null.patch
 create mode 100644 srcpkgs/cppdap/template

diff --git a/common/shlibs b/common/shlibs
index 4477d4c879782..eab94bb9b16d9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4326,3 +4326,4 @@ libmimalloc.so.2 mimalloc-2.1.2_1
 lib2geom.so.1.3.0 lib2geom-1.3_1
 libdbi.so.1 libdbi-0.9.0_1
 libchafa.so.0 libchafa-1.12.5_1
+libcppdap.so cppdap-1.58.0+a_1
diff --git a/srcpkgs/cppdap-devel b/srcpkgs/cppdap-devel
new file mode 120000
index 0000000000000..e38f4d0887117
--- /dev/null
+++ b/srcpkgs/cppdap-devel
@@ -0,0 +1 @@
+cppdap
\ No newline at end of file
diff --git a/srcpkgs/cppdap/patches/gtest.patch b/srcpkgs/cppdap/patches/gtest.patch
new file mode 100644
index 0000000000000..231bf4e5f3879
--- /dev/null
+++ b/srcpkgs/cppdap/patches/gtest.patch
@@ -0,0 +1,32 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,13 +59,6 @@ set_if_not_defined(CPPDAP_GOOGLETEST_DIR
+ ###########################################################
+ # Submodules
+ ###########################################################
+-if(CPPDAP_BUILD_TESTS)
+-    if(NOT EXISTS ${CPPDAP_GOOGLETEST_DIR}/.git)
+-        message(WARNING "third_party/googletest submodule missing.")
+-        message(WARNING "Run: `git submodule update --init` to build tests.")
+-        set(CPPDAP_BUILD_TESTS OFF)
+-    endif()
+-endif(CPPDAP_BUILD_TESTS)
+ 
+ ###########################################################
+ # JSON library
+@@ -289,7 +282,6 @@ if(CPPDAP_BUILD_TESTS)
+         ${CPPDAP_SRC_DIR}/traits_test.cpp
+         ${CPPDAP_SRC_DIR}/typeinfo_test.cpp
+         ${CPPDAP_SRC_DIR}/variant_test.cpp
+-        ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc
+     )
+ 
+     set(DAP_TEST_INCLUDE_DIR
+@@ -312,6 +304,7 @@ if(CPPDAP_BUILD_TESTS)
+ 
+     cppdap_set_target_options(cppdap-unittests)
+     target_link_libraries(cppdap-unittests PRIVATE cppdap)
++    target_link_libraries(cppdap-unittests PRIVATE gtest_main gtest)
+ endif(CPPDAP_BUILD_TESTS)
+ 
+ # fuzzer
diff --git a/srcpkgs/cppdap/patches/no-freeaddrinfo-null.patch b/srcpkgs/cppdap/patches/no-freeaddrinfo-null.patch
new file mode 100644
index 0000000000000..426b64d145466
--- /dev/null
+++ b/srcpkgs/cppdap/patches/no-freeaddrinfo-null.patch
@@ -0,0 +1,26 @@
+ src/socket.cpp | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/socket.cpp b/src/socket.cpp
+index 1211310..e9402d3 100644
+--- a/src/socket.cpp
++++ b/src/socket.cpp
+@@ -108,7 +108,6 @@ class dap::Socket::Shared : public dap::ReaderWriter {
+       return out;
+     }
+ 
+-    freeaddrinfo(info);
+     term();
+     return nullptr;
+   }
+@@ -117,7 +116,9 @@ class dap::Socket::Shared : public dap::ReaderWriter {
+   Shared(addrinfo* info, SOCKET socket) : info(info), s(socket) {}
+ 
+   ~Shared() {
+-    freeaddrinfo(info);
++    if (info) {
++        freeaddrinfo(info);
++    }
+     close();
+     term();
+   }
diff --git a/srcpkgs/cppdap/template b/srcpkgs/cppdap/template
new file mode 100644
index 0000000000000..ea294ccdb851a
--- /dev/null
+++ b/srcpkgs/cppdap/template
@@ -0,0 +1,39 @@
+# Template file for 'cppdap'
+#
+# As much as I know about Google, their library's ABI ain't stable.
+# Rebuild all revdeps on update
+pkgname=cppdap
+version=1.58.0+a
+revision=1
+build_style=cmake
+configure_args="-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=On
+ -DCPPDAP_BUILD_TESTS=On -DBUILD_SHARED_LIBS=On"
+makedepends="json-c++ gtest-devel"
+short_desc="C++ library for the Debug Adapter Protocol"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Apache-2.0"
+homepage="https://github.com/google/cppdap"
+distfiles="https://github.com/google/cppdap/archive/refs/tags/dap-${version/+/-}.tar.gz"
+checksum=5d35ca5db78570b6bef698e3365f79bd82a4f78e8393546387f78d7bdb2a2a08
+
+post_patch() {
+	vsed -i -e "/project.*VERSION/s/VERSION [0-9.]* /VERSION ${version%+*} /" \
+		-e "/add_library/s/ STATIC / /" \
+		CMakeLists.txt
+}
+
+do_check() {
+	cd build
+	./cppdap-unittests
+}
+
+cppdap-devel_package() {
+	short_desc+=" - development files"
+	depends="${sourcepkg}>=${version}_${revision} json-c++"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		# vmove "usr/lib/*.a"
+		# vmove "usr/lib/*.so"
+	}
+}

From 116aa0f49b06252fe892e06e55bd14502771f666 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:06:20 +0700
Subject: [PATCH 2/4] New package: cmake-bootstrap-3.26.4

---
 .../patches/ignore-crape-compiler-test.patch  |  11 ++
 .../cmake-bootstrap/patches/musl-test.patch   |  25 ++++
 .../patches/no-run-cmake-bootstrap.patch      |  11 ++
 .../cmake-bootstrap/patches/not-needed.patch  | 107 ++++++++++++++++++
 srcpkgs/cmake-bootstrap/template              |  70 ++++++++++++
 srcpkgs/cmake-bootstrap/update                |   2 +
 6 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/musl-test.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
 create mode 100644 srcpkgs/cmake-bootstrap/patches/not-needed.patch
 create mode 100644 srcpkgs/cmake-bootstrap/template
 create mode 100644 srcpkgs/cmake-bootstrap/update

diff --git a/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
new file mode 100644
index 0000000000000..cf098a8f88748
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/ignore-crape-compiler-test.patch
@@ -0,0 +1,11 @@
+--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
++++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+@@ -8,7 +8,7 @@
+ set(targets
+   aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+   aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+-  craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
++  craype-Fortran-Cray-8.7
+   craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+   craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+   craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
diff --git a/srcpkgs/cmake-bootstrap/patches/musl-test.patch b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
new file mode 100644
index 0000000000000..41161fa81e082
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/musl-test.patch
@@ -0,0 +1,25 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake
+@@ -15,9 +15,9 @@ set(_check
+   [[librunpath_parent_unresolved\.so]]
+   [[librunpath_unresolved\.so]]
+   )
+-check_contents(deps/udeps1.txt "^${_check}$")
+-check_contents(deps/udeps2.txt "^${_check}$")
+-check_contents(deps/udeps3.txt "^${_check}$")
++check_contents(deps/udeps1.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps2.txt "^(libc.so;)?${_check}$")
++check_contents(deps/udeps3.txt "^(libc.so;)?${_check}$")
+ set(_check
+   "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+   )
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
+@@ -65,7 +65,6 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "
+ 
+   if(NOT CMake_COMPILER_FORCES_NEW_DTAGS)
+     run_install_test(linux)
+-    run_install_test(linux-parent-rpath-propagation)
+     run_install_test(file-filter)
+   endif()
+   run_install_test(linux-unresolved)
diff --git a/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
new file mode 100644
index 0000000000000..0e550bce7b90e
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/no-run-cmake-bootstrap.patch
@@ -0,0 +1,11 @@
+We will run cmake ourselves with our flags
+--- a/bootstrap
++++ b/bootstrap
+@@ -2076,6 +2076,7 @@ export CFLAGS
+ export CXXFLAGS
+ export LDFLAGS
+ 
++exit 0
+ # Run bootstrap CMake to configure real CMake
+ cmake_options="-DCMAKE_BOOTSTRAP=1"
+ if test -n "${cmake_verbose}"; then
diff --git a/srcpkgs/cmake-bootstrap/patches/not-needed.patch b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
new file mode 100644
index 0000000000000..4c73eb9766d2c
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/patches/not-needed.patch
@@ -0,0 +1,107 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,12 +522,9 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+-    DIRECTORY Help Modules Templates
++    DIRECTORY Modules Templates
+     DESTINATION ${CMAKE_DATA_DIR}
+     FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+     DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+@@ -543,9 +540,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+     REGEX "Help/(dev|guide)($|/)" EXCLUDE
+     )
+ 
+-  # Install auxiliary files integrating with other tools.
+-  add_subdirectory(Auxiliary)
+-
+   # Optionally sign installed binaries.
+   if(CMake_INSTALL_SIGNTOOL)
+     configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -1579,8 +1579,6 @@ target_link_libraries(curltest cmcurl)
+ if(BUILD_TESTING AND CMAKE_CURL_TEST_URL)
+   add_test(curl curltest ${CMAKE_CURL_TEST_URL})
+ endif()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmcurl)
+ #-----------------------------------------------------------------------------
+ 
+ if(0) # This code not needed for building within CMake.
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -2077,5 +2077,3 @@ add_subdirectory(cat)
+ add_subdirectory(tar)
+ add_subdirectory(cpio)
+ ENDIF()
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibarchive)
+--- a/Utilities/cmliblzma/CMakeLists.txt
++++ b/Utilities/cmliblzma/CMakeLists.txt
+@@ -185,5 +185,3 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GN
+   # Disable the old GNU compiler optimizer.
+   SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
+ ENDIF()
+-
+-INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)
+--- a/Utilities/cmlibrhash/CMakeLists.txt
++++ b/Utilities/cmlibrhash/CMakeLists.txt
+@@ -36,5 +36,3 @@ include_directories(
+   )
+ 
+ add_library(cmlibrhash ${librhash_sources})
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash)
+--- a/Utilities/cmlibuv/CMakeLists.txt
++++ b/Utilities/cmlibuv/CMakeLists.txt
+@@ -364,5 +364,3 @@ include_directories(
+ add_library(cmlibuv STATIC ${uv_sources})
+ target_link_libraries(cmlibuv ${uv_libraries})
+ set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
+--- a/Utilities/cmnghttp2/CMakeLists.txt
++++ b/Utilities/cmnghttp2/CMakeLists.txt
+@@ -49,5 +49,3 @@ target_include_directories(cmnghttp2 PRI
+   ${CMAKE_CURRENT_BINARY_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/lib/includes
+   )
+-
+-install(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmnghttp2)
+--- a/Utilities/cmzlib/CMakeLists.txt
++++ b/Utilities/cmzlib/CMakeLists.txt
+@@ -24,5 +24,3 @@ add_library(cmzlib
+   uncompr.c
+   zutil.c
+   )
+-
+-install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
+--- a/Utilities/cmzstd/CMakeLists.txt
++++ b/Utilities/cmzstd/CMakeLists.txt
+@@ -46,5 +46,3 @@ add_library(cmzstd STATIC
+ 
+ # BMI2 instructions are not supported in older environments.
+ set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
+-
+-install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)
diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template
new file mode 100644
index 0000000000000..c46583a70f742
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/template
@@ -0,0 +1,70 @@
+# Template file for 'cmake-bootstrap'
+pkgname=cmake-bootstrap
+version=3.27.2
+revision=1
+build_style=cmake
+configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
+ -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
+ -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
+ -DCMAKE_USE_SYSTEM_LIBRARIES=OFF
+ -DKWSYS_LFS_WORKS=1"
+short_desc="CMake for xbps-src"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, ICU"
+homepage="https://www.cmake.org"
+distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
+repository="bootstrap"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
+fi
+
+pre_configure() {
+	local f
+	rm -rf build
+	mkdir build
+	cd build
+	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
+	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
+	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
+	../bootstrap --system-libs --generator=Ninja \
+		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
+	# Make sure build directory is clean
+	for f in *; do
+		if [ "$f" != Bootstrap.cmk ]; then
+			return 1
+		fi
+	done
+	cd ${wrksrc}
+	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
+}
+
+do_check() {
+	mkdir -p /tmp/fake-bin
+	ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
+	PATH=$PATH:/tmp/fake-bin
+	cd build
+	./bin/ctest -E "ExternalProject|UpdateGIT|CMP0150"
+}
+
+post_install() {
+	rm -f ${DESTDIR}/usr/libexec/xbps-src/bin/cpack
+	# We installs license manually because cmake forgets some of them.
+	test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
+	{
+		cat Copyright.txt
+		printf '%s\n' '' =============================== "FreeBSD ELF library"
+		sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
+		for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
+		do
+			printf '%s\n' '' =============================== "$_lib"
+			for _file in COPYING LICENSE NOTICE; do
+				if [ -f "Utilities/cm${_lib}/${_file}" ]; then
+					cat "Utilities/cm${_lib}/${_file}"
+				fi
+			done
+		done
+	}>license
+	vlicense license
+}
diff --git a/srcpkgs/cmake-bootstrap/update b/srcpkgs/cmake-bootstrap/update
new file mode 100644
index 0000000000000..fa692de2a9c9a
--- /dev/null
+++ b/srcpkgs/cmake-bootstrap/update
@@ -0,0 +1,2 @@
+site='https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json'
+pkgname=cmake

From e72c1c20b47367a08a5b883b8941aca53e92c781 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 22 Jun 2023 23:11:58 +0700
Subject: [PATCH 3/4] build-style/cmake: support build with cmake-bootstrap

---
 common/build-style/cmake.sh             | 1 +
 common/environment/build-style/cmake.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 43750ad20dcdc..6b71ea66a224a 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -72,6 +72,7 @@ _EOF
 	cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
 
 	export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
+	PATH="$PATH:/usr/libexec/xbps-src/bin"
 	# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
 	CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
 		cmake ${cmake_args} ${configure_args} \
diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh
index 19b8f35a01da1..d301133843648 100644
--- a/common/environment/build-style/cmake.sh
+++ b/common/environment/build-style/cmake.sh
@@ -1,6 +1,6 @@
 if [ "$CHROOT_READY" ]; then
-	if [ "$pkgname" != cmake ]; then
-		hostmakedepends+=" cmake"
+	if [ "$pkgname" != cmake-bootstrap ]; then
+		hostmakedepends+=" cmake-bootstrap"
 	fi
 	if [ "${make_cmd:-ninja}" = ninja ]; then
 		hostmakedepends+=" ninja"

From e9801fff98c9172d5ed783e3ce27bd01a5b36710 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 17 Aug 2023 18:25:47 +0700
Subject: [PATCH 4/4] cmake: update to 3.27.2.

---
 srcpkgs/cmake-gui                             |  1 +
 srcpkgs/cmake-gui/patches                     |  1 -
 srcpkgs/cmake-gui/template                    | 40 -------------
 srcpkgs/cmake-gui/update                      |  1 -
 .../patches/ignore-crape-compiler-test.patch  |  4 +-
 srcpkgs/cmake/patches/linux-gate.patch        | 14 -----
 srcpkgs/cmake/patches/musl-test.patch         | 16 +++++-
 srcpkgs/cmake/patches/nlohmann_json.patch     | 23 ++++++++
 srcpkgs/cmake/patches/no-license.patch        | 26 +++++++++
 .../patches/no-run-cmake-bootstrap.patch      |  8 +--
 srcpkgs/cmake/template                        | 57 +++++++++----------
 11 files changed, 93 insertions(+), 98 deletions(-)
 create mode 120000 srcpkgs/cmake-gui
 delete mode 120000 srcpkgs/cmake-gui/patches
 delete mode 100644 srcpkgs/cmake-gui/template
 delete mode 120000 srcpkgs/cmake-gui/update
 delete mode 100644 srcpkgs/cmake/patches/linux-gate.patch
 create mode 100644 srcpkgs/cmake/patches/nlohmann_json.patch
 create mode 100644 srcpkgs/cmake/patches/no-license.patch

diff --git a/srcpkgs/cmake-gui b/srcpkgs/cmake-gui
new file mode 120000
index 0000000000000..b6868d450eb7b
--- /dev/null
+++ b/srcpkgs/cmake-gui
@@ -0,0 +1 @@
+cmake
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/patches b/srcpkgs/cmake-gui/patches
deleted file mode 120000
index 6f3ac554b3614..0000000000000
--- a/srcpkgs/cmake-gui/patches
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/patches
\ No newline at end of file
diff --git a/srcpkgs/cmake-gui/template b/srcpkgs/cmake-gui/template
deleted file mode 100644
index 6aea8d3e7afb9..0000000000000
--- a/srcpkgs/cmake-gui/template
+++ /dev/null
@@ -1,40 +0,0 @@
-# Template file for 'cmake-gui'
-pkgname=cmake-gui
-version=3.26.4
-revision=3
-build_style=cmake
-configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
- -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
- -DBUILD_QtDialog=ON -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="qt6-base python3-Sphinx qt6-tools"
-makedepends="jsoncpp-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel qt6-base-devel rhash-devel qt6-tools-devel"
-depends="desktop-file-utils shared-mime-info cmake>=${version}"
-checkdepends="pax pkg-config git"
-short_desc="Cross-platform, open-source build system - Qt GUI"
-maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://www.cmake.org"
-distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-
-do_check() {
-	cd build
-	./bin/ctest
-}
-
-do_install() {
-	# We are only interested in cmake-gui.
-	vbin build/bin/cmake-gui
-	vman build/Utilities/Sphinx/man/cmake-gui.1
-
-	for res in 32 64 128 ; do
-		vinstall Source/QtDialog/CMakeSetup${res}.png 0644 \
-			usr/share/icons/hicolor/${res}x${res}/apps/
-	done
-
-	vinstall Source/QtDialog/cmakecache.xml 0644 usr/share/mime
-	vinstall Source/QtDialog/cmake-gui.desktop 0644 usr/share/applications
-
-	vlicense Copyright.txt
-}
diff --git a/srcpkgs/cmake-gui/update b/srcpkgs/cmake-gui/update
deleted file mode 120000
index c7f49c6a2d189..0000000000000
--- a/srcpkgs/cmake-gui/update
+++ /dev/null
@@ -1 +0,0 @@
-../cmake/update
\ No newline at end of file
diff --git a/srcpkgs/cmake/patches/ignore-crape-compiler-test.patch b/srcpkgs/cmake/patches/ignore-crape-compiler-test.patch
index 7b6ce9c16962b..cf098a8f88748 100644
--- a/srcpkgs/cmake/patches/ignore-crape-compiler-test.patch
+++ b/srcpkgs/cmake/patches/ignore-crape-compiler-test.patch
@@ -1,8 +1,6 @@
-diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
-index dcdc7f1b96..37e13b6c5c 100644
 --- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
 +++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
-@@ -11,7 +11,7 @@ project(Minimal NONE)
+@@ -8,7 +8,7 @@
  set(targets
    aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
    aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
diff --git a/srcpkgs/cmake/patches/linux-gate.patch b/srcpkgs/cmake/patches/linux-gate.patch
deleted file mode 100644
index 2102feee211f2..0000000000000
--- a/srcpkgs/cmake/patches/linux-gate.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8229
-diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
-index 0ba35b6b79..0cd49ab4ba 100644
---- a/Modules/GetPrerequisites.cmake
-+++ b/Modules/GetPrerequisites.cmake
-@@ -730,7 +730,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
- 
-   if(gp_tool MATCHES "ldd$")
-     set(gp_cmd_args "")
--    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$")
-+    set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$")
-     set(gp_regex_error "not found${eol_char}$")
-     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
-     set(gp_regex_cmp_count 1)
diff --git a/srcpkgs/cmake/patches/musl-test.patch b/srcpkgs/cmake/patches/musl-test.patch
index 0329b5efd2f52..41161fa81e082 100644
--- a/srcpkgs/cmake/patches/musl-test.patch
+++ b/srcpkgs/cmake/patches/musl-test.patch
@@ -1,6 +1,6 @@
---- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake.orig	2020-12-05 13:27:21.098078774 +0700
-+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake	2020-12-05 13:29:19.931553018 +0700
-@@ -33,9 +33,9 @@
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake
+@@ -15,9 +15,9 @@ set(_check
    [[librunpath_parent_unresolved\.so]]
    [[librunpath_unresolved\.so]]
    )
@@ -13,3 +13,13 @@
  set(_check
    "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
    )
+--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
++++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
+@@ -65,7 +65,6 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "
+ 
+   if(NOT CMake_COMPILER_FORCES_NEW_DTAGS)
+     run_install_test(linux)
+-    run_install_test(linux-parent-rpath-propagation)
+     run_install_test(file-filter)
+   endif()
+   run_install_test(linux-unresolved)
diff --git a/srcpkgs/cmake/patches/nlohmann_json.patch b/srcpkgs/cmake/patches/nlohmann_json.patch
new file mode 100644
index 0000000000000..005c0c3ca0c9a
--- /dev/null
+++ b/srcpkgs/cmake/patches/nlohmann_json.patch
@@ -0,0 +1,23 @@
+--- a/Tests/CMakeLib/testDebuggerNamedPipe.cxx
++++ b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+@@ -180,13 +180,13 @@ int runTest(int argc, char* argv[])
+   auto debuggerResponse = debuggerResponseStream.str();
+ 
+   std::vector<std::string> expectedResponses = {
+-    R"("event" : "initialized".*"type" : "event")",
+-    R"("command" : "launch".*"success" : true.*"type" : "response")",
+-    R"("command" : "configurationDone".*"success" : true.*"type" : "response")",
+-    R"("reason" : "started".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("reason" : "exited".*"threadId" : 1.*"event" : "thread".*"type" : "event")",
+-    R"("exitCode" : 0.*"event" : "exited".*"type" : "event")",
+-    R"("command" : "disconnect".*"success" : true.*"type" : "response")"
++    R"("event" *: *"initialized".*"type" *: *"event")",
++    R"("command" *: *"launch".*"success" *: *true.*"type" *: *"response")",
++    R"("command" *: *"configurationDone".*"success" *: *true.*"type" *: *"response")",
++    R"("reason" *: *"started".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("reason" *: *"exited".*"threadId" *: *1.*"event" *: *"thread".*"type" *: *"event")",
++    R"("exitCode" *: *0.*"event" *: *"exited".*"type" *: *"event")",
++    R"("command" *: *"disconnect".*"success" *: *true.*"type" *: *"response")"
+   };
+ 
+   for (auto& regexString : expectedResponses) {
diff --git a/srcpkgs/cmake/patches/no-license.patch b/srcpkgs/cmake/patches/no-license.patch
new file mode 100644
index 0000000000000..87e31e21aeb96
--- /dev/null
+++ b/srcpkgs/cmake/patches/no-license.patch
@@ -0,0 +1,26 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,9 +522,6 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+-  # Install license file as it requires.
+-  install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
+-
+   # Install script directories.
+   install(
+     DIRECTORY Help Modules Templates
+--- a/Source/kwsys/CMakeLists.txt
++++ b/Source/kwsys/CMakeLists.txt
+@@ -615,11 +615,6 @@ if(KWSYS_INSTALL_DOC_DIR)
+       COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME}
+       )
+   endif()
+-
+-  # Install the license under the documentation directory.
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt
+-    DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE}
+-    ${KWSYS_INSTALL_LICENSE_OPTIONS})
+ endif()
+ 
+ #-----------------------------------------------------------------------------
diff --git a/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch
index 4b41aea2450b4..0e550bce7b90e 100644
--- a/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch
+++ b/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch
@@ -1,9 +1,7 @@
 We will run cmake ourselves with our flags
-Index: cmake-3.20.3/bootstrap
-===================================================================
---- cmake-3.20.3.orig/bootstrap
-+++ cmake-3.20.3/bootstrap
-@@ -1968,6 +1968,7 @@ export CFLAGS
+--- a/bootstrap
++++ b/bootstrap
+@@ -2076,6 +2076,7 @@ export CFLAGS
  export CXXFLAGS
  export LDFLAGS
  
diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template
index 20da7a8678ea8..3517bb2cc6787 100644
--- a/srcpkgs/cmake/template
+++ b/srcpkgs/cmake/template
@@ -1,58 +1,53 @@
 # Template file for 'cmake'
 pkgname=cmake
-version=3.26.4
-revision=3
+version=3.27.2
+revision=1
 build_style=cmake
 configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake
  -DSPHINX_MAN=1 -DCMAKE_MAN_DIR=/share/man
+ -DBUILD_CursesDialog=ON -DBUILD_QtDialog=ON
  -DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=1
  -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1"
-hostmakedepends="gcc-fortran python3-Sphinx"
-makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel
- ncurses-devel rhash-devel jsoncpp-devel"
+hostmakedepends="gcc-fortran python3-Sphinx qt6-base qt6-tools"
+makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel cppdap-devel
+ ncurses-devel rhash-devel jsoncpp-devel qt6-base-devel qt6-tools-devel"
 checkdepends="pax pkg-config git"
 short_desc="Cross-platform, open-source build system"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="BSD-3-Clause, ICU"
 homepage="https://www.cmake.org"
 distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz"
-checksum=313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208
-replaces="cmake-bootstrap>=0"
+checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
 fi
 
-pre_configure() {
-	local f
-	mkdir -p build
-	cd build
-	CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
-	CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
-	LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
-	../bootstrap --no-system-libs \
-		--generator=Ninja \
-		${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
-	# Make sure build directory is clean
-	for f in *; do
-		if [ "$f" != Bootstrap.cmk ]; then
-			return 1
-		fi
-	done
-	cd ${wrksrc}
-	PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
-}
-
 do_check() {
 	cd build
 	./bin/ctest
 }
 
 post_install() {
-	rm -rf ${DESTDIR}/usr/share/doc/cmake
+	# No license would be installed
+	# or something were bundled without our knowledge
+	test ! -d ${DESTDIR}/usr/share/doc
 	sed -n -e '/Copyright/,/authorization[.]/p' \
-		Source/CursesDialog/form/fld_arg.c >fld.LICENSE
-	vlicense fld.LICENSE
+		Source/CursesDialog/form/fld_arg.c >fld.license
+	vlicense fld.license
+	sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h >elf.license
+	vlicense elf.license
 	vlicense Copyright.txt
-	vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt
+}
+
+cmake-gui_package() {
+	depends="desktop-file-utils shared-mime-info cmake>=${version}"
+	pkg_install() {
+		vmove usr/bin/cmake-gui
+		vmove usr/share/man/man1/cmake-gui.1
+
+		vmove usr/share/applications
+		vmove usr/share/icons
+		vmove usr/share/mime
+	}
 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Merged]: CMake: a bootstrap package to remove all possible circles with cmake
  2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
                   ` (10 preceding siblings ...)
  2023-08-17 11:26 ` sgn
@ 2023-08-17 12:59 ` sgn
  11 siblings, 0 replies; 13+ messages in thread
From: sgn @ 2023-08-17 12:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

There's a merged pull request on the void-packages repository

CMake: a bootstrap package to remove all possible circles with cmake
https://github.com/void-linux/void-packages/pull/44563

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-08-17 12:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-22 16:09 [PR PATCH] CMake: a bootstrap package to remove all possible circles with cmake sgn
2023-06-22 16:12 ` [PR PATCH] [Updated] " sgn
2023-06-22 16:30 ` Duncaen
2023-06-22 16:33 ` [PR REVIEW] " Duncaen
2023-06-29 15:38 ` sgn
2023-06-29 15:38 ` sgn
2023-07-28 16:07 ` [PR PATCH] [Updated] " sgn
2023-07-31  2:31 ` sgn
2023-08-16 13:04 ` sgn
2023-08-16 14:35 ` sgn
2023-08-17  0:12 ` sgn
2023-08-17 11:26 ` sgn
2023-08-17 12:59 ` [PR PATCH] [Merged]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).