summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-06-09 10:46:52 +0100
committerSam James <sam@gentoo.org>2023-06-09 10:47:51 +0100
commit7074551d43f13d7401f1cb904505159acfa6c97d (patch)
tree142f3ed682cec61179bc85dcc5b86d38fb431276 /dev-util/cmake
parentdev-cpp/cppdap: new package, add 0_pre20230605 (diff)
downloadgentoo-7074551d43f13d7401f1cb904505159acfa6c97d.tar.gz
gentoo-7074551d43f13d7401f1cb904505159acfa6c97d.tar.bz2
gentoo-7074551d43f13d7401f1cb904505159acfa6c97d.zip
dev-util/cmake: add 3.27.0_rc1
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/cmake')
-rw-r--r--dev-util/cmake/Manifest2
-rw-r--r--dev-util/cmake/cmake-3.27.0_rc1.ebuild288
-rw-r--r--dev-util/cmake/cmake-9999.ebuild32
-rw-r--r--dev-util/cmake/files/cmake-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch35
-rw-r--r--dev-util/cmake/files/cmake-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch133
-rw-r--r--dev-util/cmake/files/cmake-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch31
-rw-r--r--dev-util/cmake/files/cmake-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch54
-rw-r--r--dev-util/cmake/files/cmake-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch63
-rw-r--r--dev-util/cmake/files/cmake-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch26
-rw-r--r--dev-util/cmake/metadata.xml3
10 files changed, 648 insertions, 19 deletions
diff --git a/dev-util/cmake/Manifest b/dev-util/cmake/Manifest
index 2de6263de254..8165c7ac7bc2 100644
--- a/dev-util/cmake/Manifest
+++ b/dev-util/cmake/Manifest
@@ -14,3 +14,5 @@ DIST cmake-3.26.4-SHA-256.txt 1646 BLAKE2B a92cecbe635cb7a01be338ca9554de5603124
DIST cmake-3.26.4-SHA-256.txt.asc 833 BLAKE2B c33f4d8cc1ba271a06b427e4bb5cb39e38f768c497aec6df07ffe9f7be997c5df88024e0de09902e6169cbad9020b20f024ef277cefc45b5cd172ed7a819e1bb SHA512 d3ddbe0c31a1093dfd4bed26dae7959e5682d367695fd4f6f021e327b8335d33fcf7b0259149f449be82da224ee74c276b135ac2860917535fb5a19b4f0f6334
DIST cmake-3.26.4-docs.tar.xz 507352 BLAKE2B 9d7e4bb2292d22f93c5435e30317cb0701dc9c6ad6b397fc9108050217917f48ded84b2d6094782e2e8a502e693a8e45c5c659e65db3857dbcac261910890861 SHA512 95ef908381501bd8189113a7a520e70d81dbb4e1f416cfe38cbf7005e76f3571b964496d33980975835ff02634f85e1eb170a575e0ea30bfa749043cad84c605
DIST cmake-3.26.4.tar.gz 10669686 BLAKE2B 34508c724e0d4967e010917f6fac6f426b0d835c38cd197b64e70a18febee1c3efff5f5edc5cd7c5080881bd5c1d77d03243b5dcf8b47f238fa4ac4e5996072f SHA512 fe817c8d5e247db3f0a9a58ee37c466a47220100d9e90711cd5d06c223cef87e41d1a756e75d1537e5f8cd010dcb8971cbeab4684b1ac12bcecf84bf7b720167
+DIST cmake-3.27.0-rc1.tar.gz 10973927 BLAKE2B 30d17208a061d2bfbb4e9ef6cdeb526c0c0cf6d86c93821d380ff25e7ae430f80dfcc8992d0687882489e3453d543ba11a45fc47ac15ef8180f6dab6d85c20f8 SHA512 02ea3ed06ccc339980235371de0b3c823f92cdd46bc4de3b0bb5788cd1265c292e70dd824d2fd3740ec67fa63a5e2a903a32735f6073d8843465e300ccef5e6d
+DIST cmake-3.27.0_rc1-docs.tar.xz 520664 BLAKE2B 332a6700af4a119c8859074d93d16a8a7109614abff6b8bcf90c9c3490f70a436f60ee627b8bb2b31a100916ea91c6d5fc63bc88c07acb1bed60c543e3fd3c7d SHA512 0c97f632bf69d079f2ce22fa5d283e5b6f031d238f2810c51dab311d6c41c63773ce9741744e3bcb1fbb2afede6b354b0fef12a55d1410248a48977cbfd0f15a
diff --git a/dev-util/cmake/cmake-3.27.0_rc1.ebuild b/dev-util/cmake/cmake-3.27.0_rc1.ebuild
new file mode 100644
index 000000000000..a80e655595b5
--- /dev/null
+++ b/dev-util/cmake/cmake-3.27.0_rc1.ebuild
@@ -0,0 +1,288 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-cmake-docs
+# Set to 1 if prebuilt, 0 if not
+# (the construct below is to allow overriding from env for script)
+: ${CMAKE_DOCS_PREBUILT:=1}
+
+CMAKE_DOCS_PREBUILT_DEV=sam
+#CMAKE_DOCS_VERSION=$(ver_cut 1-3)
+CMAKE_DOCS_VERSION=${PV}
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+# TODO RunCMake.LinkWhatYouUse fails consistently w/ ninja
+# ... but seems fine as of 3.22.3?
+# TODO ... but bootstrap sometimes(?) fails with ninja now. bug #834759.
+CMAKE_MAKEFILE_GENERATOR="emake"
+CMAKE_REMOVE_MODULES_LIST=( none )
+inherit bash-completion-r1 cmake elisp-common flag-o-matic multiprocessing \
+ toolchain-funcs virtualx xdg-utils
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="Cross platform Make"
+HOMEPAGE="https://cmake.org/"
+if [[ ${PV} == 9999 ]] ; then
+ CMAKE_DOCS_PREBUILT=0
+
+ EGIT_REPO_URI="https://gitlab.kitware.com/cmake/cmake.git"
+ inherit git-r3
+else
+ SRC_URI="https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}.tar.gz"
+
+ if [[ ${CMAKE_DOCS_PREBUILT} == 1 ]] ; then
+ SRC_URI+=" !doc? ( https://dev.gentoo.org/~${CMAKE_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${CMAKE_DOCS_VERSION}-docs.tar.xz )"
+ fi
+
+ if [[ ${PV} != *_rc* ]] ; then
+ VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://github.com/Kitware/CMake/releases/download/v$(ver_cut 1-3)/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v$(ver_cut 1-3)/${MY_P}-SHA-256.txt.asc
+ )"
+
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+
+ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-bradking )"
+ fi
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="CMake"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap emacs ncurses qt5 test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.10.0:=
+ >=net-misc/curl-7.21.5[ssl]
+ sys-libs/zlib
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ emacs? ( >=app-editors/emacs-23.1:* )
+ ncurses? ( sys-libs/ncurses:0= )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ )
+"
+DEPEND="${RDEPEND}"
+BDEPEND+="
+ doc? (
+ dev-python/requests
+ dev-python/sphinx
+ )
+ test? ( app-arch/libarchive[zstd] )
+"
+
+SITEFILE="50${PN}-gentoo.el"
+
+PATCHES=(
+ # Prefix
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch
+ # Misc
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch
+
+ # Upstream fixes (can usually be removed with a version bump)
+)
+
+cmake_src_bootstrap() {
+ # disable running of cmake in bootstrap command
+ sed -i \
+ -e '/"${cmake_bootstrap_dir}\/cmake"/s/^/#DONOTRUN /' \
+ bootstrap || die "sed failed"
+
+ # execinfo.h on Solaris isn't quite what it is on Darwin
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ sed -i -e 's/execinfo\.h/blablabla.h/' \
+ Source/kwsys/CMakeLists.txt || die
+ fi
+
+ # bootstrap script isn't exactly /bin/sh compatible
+ tc-env_build ${CONFIG_SHELL:-sh} ./bootstrap \
+ --prefix="${T}/cmakestrap/" \
+ --parallel=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ elif [[ ${PV} == *_rc* ]] || ! use verify-sig ; then
+ default
+ else
+ cd "${DISTDIR}" || die
+
+ # See https://mgorny.pl/articles/verify-sig-by-example.html#verifying-using-a-checksum-file-with-a-detached-signature
+ verify-sig_verify_detached ${MY_P}-SHA-256.txt{,.asc}
+ verify-sig_verify_unsigned_checksums ${MY_P}-SHA-256.txt sha256 ${MY_P}.tar.gz
+
+ cd "${WORKDIR}" || die
+
+ default
+ fi
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # Disable Xcode hooks, bug #652134
+ sed -i -e 's/cm\(\|Global\|Local\)XCode[^.]\+\.\(cxx\|h\)//' \
+ Source/CMakeLists.txt || die
+ sed -i -e '/define CMAKE_USE_XCODE/s/XCODE/NO_XCODE/' \
+ -e '/cmGlobalXCodeGenerator.h/d' \
+ Source/cmake.cxx || die
+
+ # Disable isysroot usage with GCC, we've properly instructed
+ # where things are via GCC configuration and ldwrapper
+ sed -i -e '/cmake_gnu_set_sysroot_flag/d' \
+ Modules/Platform/Apple-GNU-*.cmake || die
+ # Disable isysroot usage with clang as well
+ sed -i -e '/_SYSROOT_FLAG/d' \
+ Modules/Platform/Apple-Clang.cmake || die
+ # Don't set a POSIX standard, system headers don't like that, #757426
+ sed -i -e 's/^#if !defined(_WIN32) && !defined(__sun)/& \&\& !defined(__APPLE__)/' \
+ Source/cmLoadCommandCommand.cxx \
+ Source/cmStandardLexer.h \
+ Source/cmSystemTools.cxx \
+ Source/cmTimestamp.cxx
+ sed -i -e 's/^#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun)/& \&\& !defined(__APPLE__)/' \
+ Source/cmStandardLexer.h
+ fi
+
+ # Add gcc libs to the default link paths
+ sed -i \
+ -e "s|@GENTOO_PORTAGE_GCCLIBDIR@|${EPREFIX}/usr/${CHOST}/lib/|g" \
+ -e "$(usex prefix-guest "s|@GENTOO_HOST@||" "/@GENTOO_HOST@/d")" \
+ -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}/|g" \
+ Modules/Platform/{UnixPaths,Darwin}.cmake || die "sed failed"
+
+ if ! has_version -b \>=${CATEGORY}/${PN}-3.13 || ! cmake --version &>/dev/null ; then
+ CMAKE_BINARY="${S}/Bootstrap.cmk/cmake"
+ cmake_src_bootstrap
+ fi
+}
+
+src_configure() {
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ local mycmakeargs=(
+ -DCMAKE_USE_SYSTEM_LIBRARIES=ON
+ -DCMake_ENABLE_DEBUGGER=$(usex dap)
+ -DCMAKE_DOC_DIR=/share/doc/${PF}
+ -DCMAKE_MAN_DIR=/share/man
+ -DCMAKE_DATA_DIR=/share/${PN}
+ -DSPHINX_MAN=$(usex doc)
+ -DSPHINX_HTML=$(usex doc)
+ -DBUILD_CursesDialog="$(usex ncurses)"
+ -DBUILD_TESTING=$(usex test)
+ )
+ use qt5 && mycmakeargs+=( -DBUILD_QtDialog=ON )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ use emacs && elisp-compile Auxiliary/cmake-mode.el
+}
+
+src_test() {
+ # Fix OutDir and SelectLibraryConfigurations tests
+ # these are altered thanks to our eclass
+ sed -i -e 's:^#_cmake_modify_IGNORE ::g' \
+ "${S}"/Tests/{OutDir,CMakeOnly/SelectLibraryConfigurations}/CMakeLists.txt \
+ || die
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ # BootstrapTest: we actualy bootstrap it every time so why test it.
+ # BundleUtilities: bundle creation broken
+ # CMakeOnly.AllFindModules: pthread issues
+ # CTest.updatecvs: which fails to commit as root
+ # Fortran: requires fortran
+ # RunCMake.CompilerLauncher: also requires fortran
+ # RunCMake.CPack_RPM: breaks if app-arch/rpm is installed because
+ # debugedit binary is not in the expected location
+ # RunCMake.CPack_DEB: breaks if app-arch/dpkg is installed because
+ # it can't find a deb package that owns libc
+ # TestUpload, which requires network access
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ local myctestargs=(
+ --output-on-failure
+ -E "(BootstrapTest|BundleUtilities|CMakeOnly.AllFindModules|CompileOptions|CTest.UpdateCVS|Fortran|RunCMake.CompilerLauncher|RunCMake.CPack_(DEB|RPM)|TestUpload|RunCMake.CMP0125)" \
+ )
+
+ virtx cmake_src_test
+}
+
+src_install() {
+ cmake_src_install
+
+ # If USE=doc, there'll be newly generated docs which we install instead.
+ if ! use doc && [[ ${CMAKE_DOCS_PREBUILT} == 1 ]] ; then
+ doman "${WORKDIR}"/${PN}-${CMAKE_DOCS_VERSION}-docs/man*/*.[0-8]
+ fi
+
+ if use emacs; then
+ elisp-install ${PN} Auxiliary/cmake-mode.el Auxiliary/cmake-mode.elc
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ insinto /usr/share/vim/vimfiles/syntax
+ doins Auxiliary/vim/syntax/cmake.vim
+
+ insinto /usr/share/vim/vimfiles/indent
+ doins Auxiliary/vim/indent/cmake.vim
+
+ insinto /usr/share/vim/vimfiles/ftdetect
+ doins "${FILESDIR}/${PN}.vim"
+
+ dobashcomp Auxiliary/bash-completion/{${PN},ctest,cpack}
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+
+ if use qt5; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+
+ if use qt5; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-util/cmake/cmake-9999.ebuild b/dev-util/cmake/cmake-9999.ebuild
index 6b56560db350..a80e655595b5 100644
--- a/dev-util/cmake/cmake-9999.ebuild
+++ b/dev-util/cmake/cmake-9999.ebuild
@@ -48,7 +48,7 @@ else
https://github.com/Kitware/CMake/releases/download/v$(ver_cut 1-3)/${MY_P}-SHA-256.txt.asc
)"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-bradking )"
fi
@@ -60,7 +60,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="CMake"
SLOT="0"
-IUSE="${CMAKE_DOCS_USEFLAG} emacs ncurses qt5 test"
+IUSE="${CMAKE_DOCS_USEFLAG} dap emacs ncurses qt5 test"
RESTRICT="!test? ( test )"
RDEPEND="
@@ -72,6 +72,7 @@ RDEPEND="
>=net-misc/curl-7.21.5[ssl]
sys-libs/zlib
virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
emacs? ( >=app-editors/emacs-23.1:* )
ncurses? ( sys-libs/ncurses:0= )
qt5? (
@@ -93,23 +94,15 @@ SITEFILE="50${PN}-gentoo.el"
PATCHES=(
# Prefix
- "${FILESDIR}"/${PN}-3.16.0_rc4-darwin-bundle.patch
- "${FILESDIR}"/${PN}-3.14.0_rc3-prefix-dirs.patch
- "${FILESDIR}"/${PN}-3.19.1-darwin-gcc.patch
-
- # Handle gentoo packaging in find modules
- "${FILESDIR}"/${PN}-3.17.0_rc1-FindBLAS.patch
- # Next patch needs to be reworked
- #"${FILESDIR}"/${PN}-3.17.0_rc1-FindLAPACK.patch
- "${FILESDIR}"/${PN}-3.5.2-FindQt4.patch
-
- # Respect python eclasses
- "${FILESDIR}"/${PN}-2.8.10.2-FindPythonLibs.patch
- "${FILESDIR}"/${PN}-3.9.0_rc2-FindPythonInterp.patch
-
- "${FILESDIR}"/${PN}-3.18.0-filter_distcc_warning.patch # bug 691544
-
- # upstream fixes (can usually be removed with a version bump)
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch
+ # Misc
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch
+ "${FILESDIR}"/${PN}-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch
+
+ # Upstream fixes (can usually be removed with a version bump)
)
cmake_src_bootstrap() {
@@ -200,6 +193,7 @@ src_configure() {
local mycmakeargs=(
-DCMAKE_USE_SYSTEM_LIBRARIES=ON
+ -DCMake_ENABLE_DEBUGGER=$(usex dap)
-DCMAKE_DOC_DIR=/share/doc/${PF}
-DCMAKE_MAN_DIR=/share/man
-DCMAKE_DATA_DIR=/share/${PN}
diff --git a/dev-util/cmake/files/cmake-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch b/dev-util/cmake/files/cmake-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch
new file mode 100644
index 000000000000..ada6f7b8f5bc
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch
@@ -0,0 +1,35 @@
+From 2d155220920c8fd7ad5b4df2d5be923808ee841a Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 19 Nov 2019 12:28:53 +0100
+Subject: [PATCH 1/6] Don't use .so for modules on darwin/macos. Use .bundle
+ instead.
+
+Patch by Heiko Przybyl
+
+Forward-ported from 2.8.10 to 3.4.0-rc1
+Forward-ported from 3.4.0-rc1 to 3.16.0-rc4
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+--- a/Modules/Platform/Darwin.cmake
++++ b/Modules/Platform/Darwin.cmake
+@@ -42,7 +42,7 @@ set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+ set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+ set(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".tbd" ".so")
+ set(CMAKE_SHARED_MODULE_PREFIX "lib")
+-set(CMAKE_SHARED_MODULE_SUFFIX ".so")
++set(CMAKE_SHARED_MODULE_SUFFIX ".bundle")
+ set(CMAKE_APPLE_IMPORT_FILE_PREFIX "lib")
+ set(CMAKE_APPLE_IMPORT_FILE_SUFFIX ".tbd")
+ set(CMAKE_MODULE_EXISTS 1)
+@@ -66,7 +66,7 @@ foreach(lang C CXX OBJC OBJCXX)
+ endforeach()
+
+ set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
+-set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a")
++set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".bundle" ".a")
+
+ # hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
+ # (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
+--
+2.41.0
+
diff --git a/dev-util/cmake/files/cmake-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch b/dev-util/cmake/files/cmake-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch
new file mode 100644
index 000000000000..7ed6fb4b15b3
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch
@@ -0,0 +1,133 @@
+From aa8c0176389436e698e2f7e84097b4151b6477bf Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Fri, 1 Mar 2019 23:11:41 +0100
+Subject: [PATCH 2/6] Set some proper paths to make cmake find our tools.
+
+The ebuild now adds an extra / at the end of $EPREFIX so that it is
+never the empty string (so that CMAKE_SYSTEM_PREFIX_PATH remains
+correct)
+
+Original patch by Heiko Przybyl.
+Updated by Chris Reffett (cmake-2.8.8)
+Updated by Johannes Huber (cmake-2.8.9)
+Updated by Michael Palimaka (cmake-2.8.10)
+Updated by Chris Reffett (cmake-2.8.11)
+Updated by Michael Palimaka (cmake-3.0.0)
+Updated by Lars Wendler (cmake-3.9.0_rc2)
+Updated by Benda Xu (cmake-3.13.4)
+Updated by Lars Wendler (cmake-3.14.0_rc1)
+Updated by Lars Wendler (cmake-3.14.0_rc2)
+Updated by Lars Wendler (cmake-3.14.0_rc3)
+Updated by Jacob Floyd (cmake-3.19.2)
+--- a/Modules/Platform/Darwin.cmake
++++ b/Modules/Platform/Darwin.cmake
+@@ -138,9 +138,9 @@ set(CMAKE_LINK_LIBRARY_USING_WEAK_LIBRARY_SUPPORTED TRUE)
+ set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-force_load <LIB_ITEM>")
+ set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
+
+-# default to searching for frameworks first
++# default to searching for frameworks last
+ if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+- set(CMAKE_FIND_FRAMEWORK FIRST)
++ set(CMAKE_FIND_FRAMEWORK LAST)
+ endif()
+
+ # Older OS X linkers do not report their framework search path
+@@ -162,6 +162,9 @@ endif()
+
+ # set up the default search directories for frameworks
+ set(CMAKE_SYSTEM_FRAMEWORK_PATH
++ @GENTOO_PORTAGE_EPREFIX@MacOSX.sdk/System/Library/Frameworks
++ @GENTOO_PORTAGE_EPREFIX@Frameworks
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
+ ~/Library/Frameworks
+ )
+ if(_CMAKE_OSX_SYSROOT_PATH)
+@@ -219,13 +222,15 @@ if(CMAKE_OSX_SYSROOT)
+ endif()
+ endif()
+
+-# default to searching for application bundles first
++# default to searching for application bundles last
+ if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+- set(CMAKE_FIND_APPBUNDLE FIRST)
++ set(CMAKE_FIND_APPBUNDLE LAST)
+ endif()
+ # set up the default search directories for application bundles
+ set(_apps_paths)
+ foreach(_path
++ @GENTOO_PORTAGE_EPREFIX@Applications
++ @GENTOO_PORTAGE_EPREFIX@usr/bin
+ "~/Applications"
+ "/Applications"
+ "${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+
+--- a/Modules/Platform/UnixPaths.cmake
++++ b/Modules/Platform/UnixPaths.cmake
+@@ -30,7 +30,8 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+ # synchronized
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ # Standard
+- /usr/local /usr /
++ @GENTOO_PORTAGE_EPREFIX@usr/local @GENTOO_PORTAGE_EPREFIX@usr @GENTOO_PORTAGE_EPREFIX@
++ @GENTOO_HOST@/usr/local /usr /
+
+ # CMake install location
+ "${_CMAKE_INSTALL_DIR}"
+@@ -58,17 +59,33 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+
+ # List common include file locations not under the common prefixes.
+ list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+- # X11
+- /usr/include/X11
++ @GENTOO_PORTAGE_EPREFIX@usr/include
+ )
+
+ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+- # X11
+- /usr/lib/X11
++ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
++ @GENTOO_PORTAGE_GCCLIBDIR@
++ @GENTOO_PORTAGE_EPREFIX@usr/lib64
++ @GENTOO_PORTAGE_EPREFIX@usr/libx32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
++ @GENTOO_PORTAGE_EPREFIX@lib
++ )
++
++list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
++ @GENTOO_PORTAGE_EPREFIX@usr/bin
++ @GENTOO_PORTAGE_EPREFIX@bin
+ )
+
+ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
++ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
++ @GENTOO_PORTAGE_GCCLIBDIR@
++ @GENTOO_PORTAGE_EPREFIX@usr/lib64
++ @GENTOO_PORTAGE_EPREFIX@usr/libx32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
++ @GENTOO_PORTAGE_EPREFIX@lib
++ @GENTOO_HOST@/lib /usr/lib /usr/lib32 /usr/lib64 /usr/libx32
+ )
+
+ if(CMAKE_SYSROOT_COMPILE)
+@@ -81,11 +98,13 @@ endif()
+ # parsing the implicit directory information from compiler output.
+ set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}
+- "${_cmake_sysroot_compile}/usr/include"
++ @GENTOO_PORTAGE_EPREFIX@usr/include
++ @GENTOO_HOST@/usr/include
+ )
+ set(_CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}
+- "${_cmake_sysroot_compile}/usr/include"
++ @GENTOO_PORTAGE_EPREFIX@usr/include
++ @GENTOO_HOST@/usr/include
+ )
+ set(_CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES}
+--
+2.41.0
+
diff --git a/dev-util/cmake/files/cmake-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch b/dev-util/cmake/files/cmake-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch
new file mode 100644
index 000000000000..8e6e218b73b5
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch
@@ -0,0 +1,31 @@
+From 9bc75325cc38962ecdd4a3ebd67ce34ea8162a45 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Thu, 13 Feb 2020 13:12:45 +0100
+Subject: [PATCH 3/6] Prefer pkgconfig in FindBLAS
+
+--- a/Modules/FindBLAS.cmake
++++ b/Modules/FindBLAS.cmake
+@@ -7,6 +7,10 @@ FindBLAS
+
+ Find Basic Linear Algebra Subprograms (BLAS) library
+
++Version modified for Gentoo Linux.
++If a valid PkgConfig configuration is found, this overrides and cancels
++all further checks.
++
+ This module finds an installed Fortran library that implements the
+ `BLAS linear-algebra interface`_.
+
+@@ -276,6 +280,9 @@ function(_add_blas_target)
+ endif()
+ endfunction()
+
++# first, try PkgConfig
++set(BLA_PREFER_PKGCONFIG ON)
++
+ if(CMAKE_Fortran_COMPILER_LOADED)
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
+ else()
+--
+2.41.0
+
diff --git a/dev-util/cmake/files/cmake-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch b/dev-util/cmake/files/cmake-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch
new file mode 100644
index 000000000000..5f9560c4aaa9
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch
@@ -0,0 +1,54 @@
+From 30cf2aa7830a09b2bc4132eb3a3920fc0853b827 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 9 Jun 2023 09:57:18 +0100
+Subject: [PATCH 4/6] Ensure that the correct version of Qt is always used.
+
+With the introduction qt-4.8.6, Qt binaries were moved from /usr/bin to
+/usr/$(get_libdir)/qt4/bin, leaving behind in their place symlinks to qtchooser.
+
+There is no guarantee to which version of Qt these symlinks might point, so it
+is necessary to find the correct version explicitly.
+
+Once qmake is found, it is queried for the correct location of all other items.
+
+Bug: https://bugs.gentoo.org/547222
+
+[imported from cmake-3.5.2-FindQt4.patch.]
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -478,13 +478,23 @@ function(_QT4_FIND_QMAKE QMAKE_NAMES QMAKE_RESULT VERSION_RESULT)
+
+ get_filename_component(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
+
+- find_program(QT_QMAKE_EXECUTABLE NAMES ${QMAKE_NAME}
+- PATHS
+- ENV QTDIR
+- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]"
+- PATH_SUFFIXES bin
+- DOC "The qmake executable for the Qt installation to use"
+- )
++ if(CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo)
++ find_program(QT_QMAKE_EXECUTABLE NAMES ${QMAKE_NAME}
++ PATHS
++ $ENV{EPREFIX}/usr/${CMAKE_INSTALL_LIBDIR}/qt4/bin
++ $ENV{EPREFIX}/usr/bin
++ NO_DEFAULT_PATH
++ DOC "The qmake executable for the Qt installation to use"
++ )
++ else()
++ find_program(QT_QMAKE_EXECUTABLE NAMES ${QMAKE_NAME}
++ PATHS
++ ENV QTDIR
++ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]"
++ PATH_SUFFIXES bin
++ DOC "The qmake executable for the Qt installation to use"
++ )
++ endif()
+
+ set(major 0)
+ if (QT_QMAKE_EXECUTABLE)
+--
+2.41.0
+
diff --git a/dev-util/cmake/files/cmake-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch b/dev-util/cmake/files/cmake-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch
new file mode 100644
index 000000000000..b8c9c1fe50b1
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch
@@ -0,0 +1,63 @@
+From 91acf58e953fd6e609788e955d84eab9822d5aa4 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 9 Jun 2023 09:58:11 +0100
+Subject: [PATCH 5/6] Respect Gentoo's Python eclasses
+
+[imported from 2.8.10.2-FindPythonLibs.patch]
+[imported from 3.9.0_rc2-FindPythonInterp.patch]
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/Modules/FindPythonInterp.cmake
++++ b/Modules/FindPythonInterp.cmake
+@@ -91,6 +91,11 @@ if(PythonInterp_FIND_VERSION)
+ else()
+ set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
+ endif()
++
++if (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo)
++ set(_Python_NAMES python)
++endif()
++
+ find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
+
+ # Set up the versions we know about, in the order we will search. Always add
+@@ -115,12 +120,13 @@ unset(_PYTHON2_VERSIONS)
+ unset(_PYTHON3_VERSIONS)
+
+ # Search for newest python version if python executable isn't found
+-if(NOT PYTHON_EXECUTABLE)
++if(NOT PYTHON_EXECUTABLE AND NOT (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo))
+ foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
+ set(_Python_NAMES python${_CURRENT_VERSION})
+ if(CMAKE_HOST_WIN32)
+ list(APPEND _Python_NAMES python)
+ endif()
++
+ find_program(PYTHON_EXECUTABLE
+ NAMES ${_Python_NAMES}
+ PATHS
+--- a/Modules/FindPythonLibs.cmake
++++ b/Modules/FindPythonLibs.cmake
+@@ -130,6 +130,19 @@ if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
+ endif()
+ list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
+
++# Gentoo portage requires that you use exactly the given python version
++if (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo)
++ execute_process(COMMAND python -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
++ OUTPUT_VARIABLE _Gentoo_Python_VERSION)
++ list(FIND _Python_VERSIONS "${_Gentoo_Python_VERSION}" _Gentoo_Python_INDEX)
++ if (_Gentoo_Python_INDEX EQUAL -1)
++ # the current Gentoo python version is not compatible with what is requested
++ set(_Python_VERSIONS)
++ else ()
++ set(_Python_VERSIONS "${_Gentoo_Python_VERSION}")
++ endif ()
++endif()
++
+ unset(_PYTHON_FIND_OTHER_VERSIONS)
+ unset(_PYTHON1_VERSIONS)
+ unset(_PYTHON2_VERSIONS)
+--
+2.41.0
+
diff --git a/dev-util/cmake/files/cmake-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch b/dev-util/cmake/files/cmake-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch
new file mode 100644
index 000000000000..74d74b5f12f9
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch
@@ -0,0 +1,26 @@
+From f7ad7429b0b17c70b0309a5a8ee04d1afc434df0 Mon Sep 17 00:00:00 2001
+From: Felix W <felix.wischke@gmail.com>
+Date: Fri, 9 Jun 2023 09:59:41 +0100
+Subject: [PATCH 6/6] Filter out distcc warnings to avoid confusing CMake
+
+Forward-ported from 3.16.5 to 3.18.0
+
+Bug: https://bugs.gentoo.org/691544
+Bug: https://gitlab.kitware.com/cmake/cmake/-/issues/22573
+[imported from cmake 3.18.0-filter_distcc_warning.patch]
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/Source/Checks/cm_cxx_features.cmake
++++ b/Source/Checks/cm_cxx_features.cmake
+@@ -55,6 +55,8 @@ function(cm_check_cxx_feature name)
+ string(REGEX REPLACE "[^\n]*icpc: command line warning #10121: overriding [^\n]*" "" check_output "${check_output}")
+ # Filter out ld warnings.
+ string(REGEX REPLACE "[^\n]*ld: warning: [^\n]*" "" check_output "${check_output}")
++ # Filter out distcc.
++ string(REGEX REPLACE "[^\n]*distcc\\[[0-9]+\\][^\n]*[Ww]arning:[^\n]*" "" check_output "${check_output}")
+ # If using the feature causes warnings, treat it as broken/unavailable.
+ if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]")
+ set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
+--
+2.41.0
+
diff --git a/dev-util/cmake/metadata.xml b/dev-util/cmake/metadata.xml
index 058bbe2d7485..0d5f2ea4307c 100644
--- a/dev-util/cmake/metadata.xml
+++ b/dev-util/cmake/metadata.xml
@@ -9,6 +9,9 @@
<email>kde@gentoo.org</email>
<name>Gentoo KDE Project</name>
</maintainer>
+ <use>
+ <flag name="dap">Build debugger for CMake with Debug Adapter Protocol support via <pkg>dev-cpp/cppdap</pkg></flag>
+ </use>
<upstream>
<remote-id type="cpe">cpe:/a:cmake_project:cmake</remote-id>
</upstream>