summaryrefslogtreecommitdiff
path: root/dev-build/cmake
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 16:47:34 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 16:47:34 -0500
commitdda948891d3731927b821ce31f9d9a2d03ba20c5 (patch)
tree99cd40be4cbb0606260da212cd81b8ab2db9da9b /dev-build/cmake
parenta3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7 (diff)
downloadbaldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.tar.gz
baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.tar.xz
baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.zip
Adding metadata
Diffstat (limited to 'dev-build/cmake')
-rw-r--r--dev-build/cmake/Manifest19
-rw-r--r--dev-build/cmake/cmake-4.1.4.ebuild334
-rw-r--r--dev-build/cmake/cmake-4.1.5.ebuild334
-rw-r--r--dev-build/cmake/cmake-4.2.4.ebuild333
-rw-r--r--dev-build/cmake/cmake-4.3.1.ebuild333
-rw-r--r--dev-build/cmake/cmake-4.3.2.ebuild333
-rw-r--r--dev-build/cmake/cmake-4.3.3.ebuild333
-rw-r--r--dev-build/cmake/cmake-9999.ebuild333
-rw-r--r--dev-build/cmake/files/50cmake-gentoo.el4
-rw-r--r--dev-build/cmake/files/cmake-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch35
-rw-r--r--dev-build/cmake/files/cmake-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch133
-rw-r--r--dev-build/cmake/files/cmake-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch54
-rw-r--r--dev-build/cmake/files/cmake-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch63
-rw-r--r--dev-build/cmake/files/cmake-3.30.3-cudahostld.patch23
-rw-r--r--dev-build/cmake/files/cmake-3.31.6-Prefer-pkgconfig-in-FindBLAS.patch28
-rw-r--r--dev-build/cmake/files/cmake.vim3
-rw-r--r--dev-build/cmake/metadata.xml20
17 files changed, 2715 insertions, 0 deletions
diff --git a/dev-build/cmake/Manifest b/dev-build/cmake/Manifest
new file mode 100644
index 000000000000..9ee401c8d604
--- /dev/null
+++ b/dev-build/cmake/Manifest
@@ -0,0 +1,19 @@
+DIST cmake-4.0.0_rc1-docs.tar.xz 577536 BLAKE2B 74a742ffef8e1af1652746e1c177d4198155145a039635e6a0ea40af463f3a2d45b6c6ce7d3a9b1fee24f0c1cfd1c3aa95c27669ca3c6281d54e701fc0ece202 SHA512 74c20067d3b82493024b2f2711b55b93998ce3b5f35ab5a154f33a8268a35a29d01127c55ce6b85b80ff252d15284ed1065e1338422124f6722a4190a984637c
+DIST cmake-4.1.4-SHA-256.txt 2015 BLAKE2B 6e8b2f7c769fbf7b5dbdec081edd8c9169f80fb9b16119b5ace3e5596a14394abe8287f45c537dc2ded972e521745c909d9b33e242c1d8fe34abda9791cec71d SHA512 c806bc17dbad51b5bd90354bf3df31232bd39f7a8dee30205807cc7e2ba63eaddc1138f8512c860e86d21cc7075f58cda85f4f9f3f9001810a243e6ebef0261c
+DIST cmake-4.1.4-SHA-256.txt.asc 833 BLAKE2B e2685feadb1565a5d14eea89eb5e505dd3988a10f3539d40d44411f425db7baba7fea7cabe894a706e86f58ff8c7332ed26a56711113d099ab27f874177036c3 SHA512 b316dec0ed3f5df1d03b8fdd17afa997df5da723072c4958fe728d4abf5156b36c9e79e0344735a20d31d4a2366aa22b4ae23f334b831ce67ed6bf23183631da
+DIST cmake-4.1.4.tar.gz 12051840 BLAKE2B 0d43042b70b1fe27bb1e1eeb2bda1b24923887cb0fdaca2fff11771c980b7a9b24637559315f58c53066a53aa40dd3e2127de8cf4fd7eb0d25844e27a7a08f17 SHA512 c8a5eb269f98f70db1f52675822e1b371864fa86037ed4f1714f77abaf5c7b3fae307bfc4392add29c2c600b502d8876d7d1bb260e331ee6607cb02356a7e8a8
+DIST cmake-4.1.5-SHA-256.txt 2015 BLAKE2B 1859a418346eb7409e661e4addb72c62adca9c781fb0568083437b8861031b6b732c6a84ceb509f1b894dfe8c024eb0a51fba41f201b2d301c306b13717b43ce SHA512 07b34031e95bd74275ce73f86b8731432885065f9869d1b12424318bdc557ad90871bfaa73087cd4a2880e84c52977c16f0e52887b551437c8041a2a01ba78c7
+DIST cmake-4.1.5-SHA-256.txt.asc 833 BLAKE2B 789375e7d65bdabd4fde8fae0b06bef4bed99689565deb834b447daf6aff9b7836a04db198ebd0c6d88aaa51e224f01c6a78757d42e3a06cd15dfe9d31297232 SHA512 f3e989f0ac81b08297665620efb926774d387bb9ea607a61ec7e1a040332ef0e9174eeab8f28d176e34ef278e0f627a27d9d70d4935a765d3f6f535ab242a2a4
+DIST cmake-4.1.5.tar.gz 12048837 BLAKE2B c62c615a480edfd60c694003e26f70a6d2365d0c7a934eabf3e29c44decab0ce91ee35a1c8a900ee57de86e4222a2fd7575561ce2029e310c145607fd8ce46a8 SHA512 25c585a07b20dab2cb483616b6de03f6338add3a320f28321c46efd4b9b2d41fa3fc3e71991ea75fb20a64dddd2b858f9828a64d860f4b9095288dedc6d429b2
+DIST cmake-4.2.4-SHA-256.txt 2015 BLAKE2B 2f53c1aaedbb9e7421312ecf843f35f7538ad72e6bf4dd41271d8cef6eeab0375d45969c09ff255e0587562276711d77f334e670441a08892ad6bf3ce8e0ed16 SHA512 778023fbd242da7de84d8c3a312466022160cc58206fe9945e97b570fc8011db188c2996d6a47f6b6092345b123197c9d083af56b7002acffb4465c08aab601f
+DIST cmake-4.2.4-SHA-256.txt.asc 833 BLAKE2B 63ad10bdfba3408d2c23c33130519b6404c2e796d0d84cdb46b0bf18567954ef35768ba69343adabfea701fdad73db308ae751c4bffe9679d834f78b1eb0ab5a SHA512 11819ed1c70938f8980597d2a62c89f393efd2e6ca4e2e4b472fc7e78ad89a7f59c3a92cec03ee2baeb551fcbe6a720edeab7790a300e6339b71a9e5efb607d1
+DIST cmake-4.2.4.tar.gz 12348311 BLAKE2B 367f75fb2493caf2c137ffe04857843e4a94ea01b7ac1c3128e18ab550a97db83eda49f2d8e1600dbcf81a528330bb7517ab3a82ab32cbc0936054cda8b07c09 SHA512 255838f89ef5dd01936bbc13252d099e41d99a681e4279d305e3a3b0ddd85597e7e0334b87052d4766a77e7d5ef189dd77259a194e27d1a6f19a0d0a0e8e7d76
+DIST cmake-4.3.1-SHA-256.txt 2015 BLAKE2B f642be0fe25f036e3200587d38b013258b41d3abd9794376611b1bc9b176485bde415e6587f3776f028b9e7f82b6901a6d01cd31aab8a83887edf08555d79161 SHA512 dce1e1a3701962f0e3b7e69ef004d52093a070affba3f4d8dea428e0118562c7c27cd90883fbff0b039ff7fb2e3dbb1986e4827ecad4f10b0685728acd3bbaca
+DIST cmake-4.3.1-SHA-256.txt.asc 833 BLAKE2B 2b8d29633dfb27affcad468258a1d4b529380c4e3a94e5fb25034f3f77bc6f77ade58314e3f5a81e605bbe15077d549f692658605d2fa8a76c0d77d47c2b4305 SHA512 cf8a9ac2e0c9f37d07fc69556933eae56dd8fdc03838060908f1fa64ce4e9d9cede8f46c4a8b73829c3384ad50db804daff3ac6d6af8f5d9c17fa03c961211b4
+DIST cmake-4.3.1.tar.gz 12966559 BLAKE2B 5685a52e9dacc69e267c0616564c8198424ce2a471822d05c63834fed8fe1931e0c9123a4f8f7ab86bb9954d29b2cff0d927d66d1748b8f3fd92a1d0fb8fc1c5 SHA512 010744f82b5448e589a8cbcaa45aea43280e529cafc1897ff311f5c21598c71ee4e822ef7fd679cdf0e49c4d22941f83a3fe21ffde08b2e39bbb92fb94d83ba3
+DIST cmake-4.3.2-SHA-256.txt 2015 BLAKE2B d8dec4928b25922b7d94bf577cefe9f2998f802fc36285df2589aa55de56d035d2c9cc62bb91e556886c92d80ee74fa09e80379702d921b04b70f5979d87b21d SHA512 04ccb8f71544d0923ebe636acd777621dbd7a899bcf782974139131e68e3ad871fba77096917ba3dd1c34b3220c7c63f703c83f9ab1ead821cf5c09fef4ae5cc
+DIST cmake-4.3.2-SHA-256.txt.asc 833 BLAKE2B 5957e0be571c42ebfee57dcb933dfeea78e8103fa364f18dcd65c8ae182538e7054c9fed7446684888f9ede2bcaa8c617c9003e8d1775194f9dc001b8cb82542 SHA512 3e86faa633989affa1e301e045092350750be2943e166c4f29778aee162bc80c9f716da5e806133f4a7fb1cf1d4bcca0d1955764933a473b30e5888be781f17e
+DIST cmake-4.3.2.tar.gz 12968608 BLAKE2B 58e48f7dd618b8732da960fdb3373618dded50d6d57af30f590c2ee77f657744e998b526b3e8f08463e0d9ff7514d14e3e96ad42284fcea0971ed1b52a0a16cf SHA512 ee78390be3907f4ce398e41ece9067952a25c2cba2edd9cb17f12827466d5bf2476ad8a2bba5df95b3d7950bb5122cb1754d005b6544e43901949869adf8c74a
+DIST cmake-4.3.3-SHA-256.txt 2015 BLAKE2B a73f3dfd4a95a353e95cf75c8fe68343020b3936f78da4c1579d49f4bf51360d952193aaf744accd820f9da22e180cfd1f13b029bf13deda293e74306869377f SHA512 23c9851300aa16881cd32d22df69db4189ac2288cc3cdb6cc9534c7de5f2abc0d1d5e53f2b1bdbfce81c4901cb7ea5857019598edd53f95ad0f6554028c65720
+DIST cmake-4.3.3-SHA-256.txt.asc 833 BLAKE2B ff69825df8b777894ef200a418f2b6f1d1cf534d040c54f5b2399aa9a63069d70bb72deeb118245484c00da9a471c8c93a2ea7da26cfe5a3aee3ce23609473e1 SHA512 f1a018f80aa42c62836bd3aeb1a3866d11815041b26adcc3e0f2f0bba482f7564b426a805c3ccf02ff3ad375382ad1a47f0df327c736d2c0428c1573eede33a4
+DIST cmake-4.3.3.tar.gz 12971567 BLAKE2B 30de7da05576d0cc44d67320a2d6fa250c44f5262f73a9e7c3a568cb7f9bda9aee578486911e6dfe2881c55ac618fb7c4443755aec4a105ac54ac304d005a4af SHA512 7f6af59cc53ea412311d54aeb52ad6981c46c53bac1ce0d3bf5944e85952534888267ea952596ad612e2b582f6897a818566963c85b88099f698df0803fe29d9
diff --git a/dev-build/cmake/cmake-4.1.4.ebuild b/dev-build/cmake/cmake-4.1.4.ebuild
new file mode 100644
index 000000000000..5f815951e2e4
--- /dev/null
+++ b/dev-build/cmake/cmake-4.1.4.ebuild
@@ -0,0 +1,334 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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.31.6-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/cmake-4.1.5.ebuild b/dev-build/cmake/cmake-4.1.5.ebuild
new file mode 100644
index 000000000000..a3917f21387d
--- /dev/null
+++ b/dev-build/cmake/cmake-4.1.5.ebuild
@@ -0,0 +1,334 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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.31.6-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/cmake-4.2.4.ebuild b/dev-build/cmake/cmake-4.2.4.ebuild
new file mode 100644
index 000000000000..0bf58953c507
--- /dev/null
+++ b/dev-build/cmake/cmake-4.2.4.ebuild
@@ -0,0 +1,333 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/cmake-4.3.1.ebuild b/dev-build/cmake/cmake-4.3.1.ebuild
new file mode 100644
index 000000000000..c2fda1de8122
--- /dev/null
+++ b/dev-build/cmake/cmake-4.3.1.ebuild
@@ -0,0 +1,333 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/cmake-4.3.2.ebuild b/dev-build/cmake/cmake-4.3.2.ebuild
new file mode 100644
index 000000000000..c2fda1de8122
--- /dev/null
+++ b/dev-build/cmake/cmake-4.3.2.ebuild
@@ -0,0 +1,333 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/cmake-4.3.3.ebuild b/dev-build/cmake/cmake-4.3.3.ebuild
new file mode 100644
index 000000000000..0bf58953c507
--- /dev/null
+++ b/dev-build/cmake/cmake-4.3.3.ebuild
@@ -0,0 +1,333 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/cmake-9999.ebuild b/dev-build/cmake/cmake-9999.ebuild
new file mode 100644
index 000000000000..c2fda1de8122
--- /dev/null
+++ b/dev-build/cmake/cmake-9999.ebuild
@@ -0,0 +1,333 @@
+# Copyright 1999-2026 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=4.0.0_rc1
+#CMAKE_DOCS_VERSION=${PV}
+#CMAKE_DOCS_VERSION=$(ver_cut 1-2).0
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+CMAKE_DOCS_USEFLAG="+doc"
+
+CMAKE_QA_COMPAT_SKIP=1 # bug #964514; cmake itself is the last pkg we worry about
+
+# 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=()
+inherit bash-completion-r1 cmake flag-o-matic multiprocessing \
+ toolchain-funcs 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
+
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradking.asc
+ inherit verify-sig
+
+ SRC_URI+=" verify-sig? (
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt
+ https://cmake.org/files/v$(ver_cut 1-2)/${MY_P}-SHA-256.txt.asc
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt
+ https://github.com/Kitware/CMake/releases/download/v${PV/_/-}/${MY_P}-SHA-256.txt.asc
+ )"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+ fi
+
+ BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-bradking-20250904 )"
+fi
+
+[[ ${CMAKE_DOCS_PREBUILT} == 1 ]] && CMAKE_DOCS_USEFLAG="doc"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="${CMAKE_DOCS_USEFLAG} dap gui ncurses test"
+RESTRICT="!test? ( test )"
+
+# >= 1.51.0-r1 for ppc32 workaround (bug #941738)
+RDEPEND="
+ >=app-arch/libarchive-3.3.3:=
+ app-crypt/rhash:0=
+ >=dev-libs/expat-2.0.1
+ >=dev-libs/jsoncpp-1.9.2-r2:0=
+ >=dev-libs/libuv-1.51.0-r1:=
+ >=net-misc/curl-7.21.5[ssl]
+ virtual/zlib:=
+ virtual/pkgconfig
+ dap? ( dev-cpp/cppdap )
+ gui? ( dev-qt/qtbase:6[gui,widgets] )
+ ncurses? ( sys-libs/ncurses:= )
+"
+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-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
+ # Cuda
+ "${FILESDIR}/${PN}-3.30.3-cudahostld.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=$(get_makeopts_jobs "$(get_nproc)") \
+ || die "Bootstrap failed"
+}
+
+pkg_pretend() {
+ if [[ -z ${EPREFIX} ]] ; then
+ local file
+ local errant_files=()
+
+ # See bug #599684 and bug #753581 (at least)
+ for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do
+ if [[ -e ${file} ]]; then
+ errant_files+=( "${file}" )
+ fi
+ done
+
+ # If errant files exist
+ if [[ ${#errant_files[@]} -gt 0 ]]; then
+ eerror "Errant files found!"
+ eerror "The presence of these files is known to confuse CMake's"
+ eerror "library path logic. Please (re)move these files:"
+
+ for file in "${errant_files[@]}"; do
+ eerror " mv ${file} ${file}.bak"
+ done
+
+ die "Stray files found in /etc/, see above message"
+ fi
+ fi
+}
+
+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 system integration, bug #933744
+ sed -i -e 's/__APPLE__/__DISABLED__/' \
+ Source/cmFindProgramCommand.cxx \
+ Source/CPack/cmCPackGeneratorFactory.cxx || die
+ sed -i -e 's/__MAC_OS_X_VERSION_MIN_REQUIRED/__DISABLED__/' \
+ Source/cmMachO.cxx || die
+ sed -i -e 's:CPack/cmCPack\(Bundle\|DragNDrop\|PKG\|ProductBuild\)Generator.cxx::' \
+ Source/CMakeLists.txt || 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"
+
+ ## in theory we could handle these flags in src_configure, as we do in many other packages. But we *must*
+ ## handle them as part of bootstrapping, sadly.
+
+ # Fix linking on Solaris
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lsocket -lnsl
+
+ # ODR warnings, bug #858335
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20740
+ filter-lto
+
+ # 4.0.0_rc1 is missing this, fails to configure
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/26712
+ touch .clang-tidy Utilities/.clang-tidy || die
+
+ 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() {
+ 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)
+ -DBUILD_QtDialog=$(usex gui)
+ )
+
+ use gui && mycmakeargs+=( -DCMake_QT_MAJOR_VERSION=6 )
+
+ cmake_src_configure
+}
+
+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
+
+ unset CLICOLOR CLICOLOR_FORCE CMAKE_COMPILER_COLOR_DIAGNOSTICS CMAKE_COLOR_DIAGNOSTICS
+
+ pushd "${BUILD_DIR}" > /dev/null || die
+
+ # Excluded tests:
+ local CMAKE_SKIP_TESTS=(
+ # BootstrapTest: we actually bootstrap it every time so why test it?
+ "BootstrapTest"
+ # BundleUtilities: bundle creation broken
+ "BundleUtilities"
+ # CMakeOnly.AllFindModules: pthread issues
+ "CMakeOnly.AllFindModules"
+ # TODO
+ "CompileOptions"
+ # CTest.updatecvs: which fails to commit as root
+ "CTest.UpdateCVS"
+ # Fortran: requires fortran
+ "Fortran"
+ # RunCMake.CompilerLauncher: also requires fortran
+ "RunCMake.CompilerLauncher"
+ # 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
+ # RunCMake.CPack_TGZ: requires 64-bit time_t (bug #967480)
+ "RunCMake.CPack_(DEB|RPM|TGZ)"
+ # TestUpload, which requires network access
+ "TestUpload"
+ # RunCMake.CMP0125, known failure reported upstream (bug #829414)
+ "RunCMake.CMP0125"
+ )
+
+ local -x QT_QPA_PLATFORM=offscreen
+
+ 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
+
+ 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() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
+
+pkg_postrm() {
+ if use gui; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+ fi
+}
diff --git a/dev-build/cmake/files/50cmake-gentoo.el b/dev-build/cmake/files/50cmake-gentoo.el
new file mode 100644
index 000000000000..e4a1a6d47cbc
--- /dev/null
+++ b/dev-build/cmake/files/50cmake-gentoo.el
@@ -0,0 +1,4 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'cmake-mode "cmake-mode" "Major mode for editing CMake files." t)
+(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
+(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode))
diff --git a/dev-build/cmake/files/cmake-3.27.0_rc1-0001-Don-t-use-.so-for-modules-on-darwin-macos.-Use-.bund.patch b/dev-build/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-build/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-build/cmake/files/cmake-3.27.0_rc1-0002-Set-some-proper-paths-to-make-cmake-find-our-tools.patch b/dev-build/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-build/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-build/cmake/files/cmake-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch b/dev-build/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-build/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-build/cmake/files/cmake-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch b/dev-build/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-build/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-build/cmake/files/cmake-3.30.3-cudahostld.patch b/dev-build/cmake/files/cmake-3.30.3-cudahostld.patch
new file mode 100644
index 000000000000..f8b29730ea9f
--- /dev/null
+++ b/dev-build/cmake/files/cmake-3.30.3-cudahostld.patch
@@ -0,0 +1,23 @@
+From 0648f8f75c5f7044cca0f96d26e3ef6ed9440b3d Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Mon, 26 Aug 2024 17:04:04 +0200
+Subject: [PATCH] allow custom CMAKE_CUDA_LINK_LAUNCHER
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake b/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake
+index 3aa10a2..a58c3ec 100644
+--- a/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake
++++ b/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake
+@@ -77,6 +77,11 @@ macro(cmake_nvcc_parse_implicit_info lang lang_var_)
+ if(_nvcc_link_line)
+ if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CMAKE_${lang}_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
++ elseif(DEFINED ENV{CUDAHOSTLD})
++ set(CMAKE_${lang}_HOST_LINK_LAUNCHER "$ENV{CUDAHOSTLD}")
++ string(APPEND _nvcc_log " env link launcher name: [${CMAKE_${lang}_HOST_LINK_LAUNCHER}]\n")
++ elseif(DEFINED CMAKE_CUDA_HOST_LINK_LAUNCHER)
++ string(APPEND _nvcc_log " set link launcher name: [${CMAKE_${lang}_HOST_LINK_LAUNCHER}]\n")
+ else()
+ #extract the compiler that is being used for linking
+ separate_arguments(_nvcc_link_line_args UNIX_COMMAND "${_nvcc_link_line}")
diff --git a/dev-build/cmake/files/cmake-3.31.6-Prefer-pkgconfig-in-FindBLAS.patch b/dev-build/cmake/files/cmake-3.31.6-Prefer-pkgconfig-in-FindBLAS.patch
new file mode 100644
index 000000000000..0f8611771828
--- /dev/null
+++ b/dev-build/cmake/files/cmake-3.31.6-Prefer-pkgconfig-in-FindBLAS.patch
@@ -0,0 +1,28 @@
+diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
+index 6d60c9d86a..b6664dfe26 100644
+--- a/Modules/FindBLAS.cmake
++++ b/Modules/FindBLAS.cmake
+@@ -7,6 +7,11 @@ 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. The upstream behavior can be restored by defining
++GENTOO_REMOVE_CMAKE_BLAS_HACK
++
+ This module finds an installed Fortran library that implements the
+ `BLAS linear-algebra interface`_.
+
+@@ -281,6 +286,11 @@ function(_add_blas_target)
+ endif()
+ endfunction()
+
++# first, try PkgConfig
++if(NOT DEFINED GENTOO_REMOVE_CMAKE_BLAS_HACK)
++ set(BLA_PREFER_PKGCONFIG ON)
++endif()
++
+ if(CMAKE_Fortran_COMPILER_LOADED)
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
+ else()
diff --git a/dev-build/cmake/files/cmake.vim b/dev-build/cmake/files/cmake.vim
new file mode 100644
index 000000000000..5cecd7d05b64
--- /dev/null
+++ b/dev-build/cmake/files/cmake.vim
@@ -0,0 +1,3 @@
+autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in runtime! indent/cmake.vim
+autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in setf cmake
+autocmd BufRead,BufNewFile *.ctest,*.ctest.in setf cmake
diff --git a/dev-build/cmake/metadata.xml b/dev-build/cmake/metadata.xml
new file mode 100644
index 000000000000..b57818589d99
--- /dev/null
+++ b/dev-build/cmake/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <maintainer type="project">
+ <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>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>