Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] CMake: a bootstrap package to remove all possible circles with cmake
Date: Wed, 16 Aug 2023 16:35:06 +0200	[thread overview]
Message-ID: <20230816143506.DriQpRzdxwwmmNNtu-U4DgIlBQBCvoZgxTMiAzrQ5TQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44563@inbox.vuxu.org>

[-- 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
+	}
 }

  parent reply	other threads:[~2023-08-16 14:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 16:09 [PR PATCH] " 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 [this message]
2023-08-17  0:12 ` sgn
2023-08-17 11:26 ` sgn
2023-08-17 12:59 ` [PR PATCH] [Merged]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230816143506.DriQpRzdxwwmmNNtu-U4DgIlBQBCvoZgxTMiAzrQ5TQ@z \
    --to=sgn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).