From 65e94121d81e290003ec09ca964062d959bfcbed Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Sat, 29 Mar 2025 23:19:04 +0100 Subject: [PATCH 01/54] cmake: Remove obsolete patch Cygwin patch does not apply anymore, it was done for a very old cmake 3.2.2 --- pkgs/by-name/cm/cmake/004-cygwin.diff | 274 -------------------------- pkgs/by-name/cm/cmake/package.nix | 1 - 2 files changed, 275 deletions(-) delete mode 100644 pkgs/by-name/cm/cmake/004-cygwin.diff diff --git a/pkgs/by-name/cm/cmake/004-cygwin.diff b/pkgs/by-name/cm/cmake/004-cygwin.diff deleted file mode 100644 index 982aba17e874..000000000000 --- a/pkgs/by-name/cm/cmake/004-cygwin.diff +++ /dev/null @@ -1,274 +0,0 @@ ---- cmake-3.2.2/Source/cmFileCommand.cxx 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Source/ccmFileCommand.cxx 2015-06-10 11:02:27.345598700 +0200 -@@ -1179,7 +1179,7 @@ - MatchProperties CollectMatchProperties(const char* file) - { - // Match rules are case-insensitive on some platforms. --#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__) -+#if defined(_WIN32) || defined(__APPLE__) - std::string lower = cmSystemTools::LowerCase(file); - const char* file_to_match = lower.c_str(); - #else ---- cmake-3.2.2/Source/cmInstallCommand.cxx 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Source/cmInstallCommand.cxx 2015-06-10 11:04:19.257935200 +0200 -@@ -1138,7 +1138,7 @@ - { - literal_args += " REGEX \""; - // Match rules are case-insensitive on some platforms. --#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__) -+#if defined(_WIN32) || defined(__APPLE__) - std::string regex = cmSystemTools::LowerCase(args[i]); - #else - std::string regex = args[i]; ---- cmake-3.2.2/Source/kwsys/Glob.cxx 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Source/kwsys/Glob.cxx 2015-06-10 11:05:51.602674000 +0200 -@@ -37,7 +37,7 @@ - #include - namespace KWSYS_NAMESPACE - { --#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__) -+#if defined(_WIN32) || defined(__APPLE__) - // On Windows and apple, no difference between lower and upper case - # define KWSYS_GLOB_CASE_INDEPENDENT - #endif ---- cmake-3.2.2/Source/kwsys/SystemInformation.cxx 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Source/kwsys/SystemInformation.cxx 2015-06-10 11:13:00.308303500 +0200 -@@ -911,7 +911,7 @@ - // Hide implementation details in an anonymous namespace. - namespace { - // ***************************************************************************** --#if defined(__linux) || defined(__APPLE__) -+#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) - int LoadLines( - FILE *file, - kwsys_stl::vector &lines) -@@ -947,7 +947,7 @@ - return nRead; - } - --# if defined(__linux) -+# if defined(__linux) || defined(__CYGWIN__) - // ***************************************************************************** - int LoadLines( - const char *fileName, -@@ -986,7 +986,7 @@ - } - #endif - --#if defined(__linux) -+#if defined(__linux) || defined(__CYGWIN__) - // **************************************************************************** - template - int GetFieldsFromFile( -@@ -3132,7 +3132,6 @@ - pos = buffer.find("processor\t",pos+1); - } - --#ifdef __linux - // Find the largest physical id. - int maxId = -1; - kwsys_stl::string idc = -@@ -3165,14 +3164,6 @@ - atoi(this->ExtractValueFromCpuInfoFile(buffer,"ncpus active").c_str()); - } - --#else // __CYGWIN__ -- // does not have "physical id" entries, neither "cpu cores" -- // this has to be fixed for hyper-threading. -- kwsys_stl::string cpucount = -- this->ExtractValueFromCpuInfoFile(buffer,"cpu count"); -- this->NumberOfPhysicalCPU= -- this->NumberOfLogicalCPU = atoi(cpucount.c_str()); --#endif - // gotta have one, and if this is 0 then we get a / by 0n - // better to have a bad answer than a crash - if(this->NumberOfPhysicalCPU <= 0) -@@ -3370,7 +3361,7 @@ - GlobalMemoryStatusEx(&statex); - return statex.ullTotalPhys/1024; - # endif --#elif defined(__linux) -+#elif defined(__linux) || defined(__CYGWIN__) - SystemInformation::LongLong memTotal=0; - int ierr=GetFieldFromFile("/proc/meminfo","MemTotal:",memTotal); - if (ierr) -@@ -3501,7 +3492,7 @@ - GlobalMemoryStatusEx(&statex); - return (statex.ullTotalPhys - statex.ullAvailPhys)/1024; - # endif --#elif defined(__linux) -+#elif defined(__linux) || defined(__CYGWIN__) - const char *names[3]={"MemTotal:","MemFree:",NULL}; - SystemInformation::LongLong values[2]={SystemInformation::LongLong(0)}; - int ierr=GetFieldsFromFile("/proc/meminfo",names,values); -@@ -3560,7 +3551,7 @@ - return -2; - } - return pmc.WorkingSetSize/1024; --#elif defined(__linux) -+#elif defined(__linux) || defined(__CYGWIN__) - SystemInformation::LongLong memUsed=0; - int ierr=GetFieldFromFile("/proc/self/status","VmRSS:",memUsed); - if (ierr) -@@ -3612,7 +3603,7 @@ - { - #if defined(_WIN32) - return GetCurrentProcessId(); --#elif defined(__linux) || defined(__APPLE__) -+#elif defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) - return getpid(); - #else - return -1; ---- cmake-3.2.2/Source/kwsys/SystemTools.cxx 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Source/kwsys/SystemTools.cxx 2015-06-10 11:21:58.980443200 +0200 -@@ -93,19 +93,12 @@ - # if defined(_MSC_VER) && _MSC_VER >= 1800 - # define KWSYS_WINDOWS_DEPRECATED_GetVersionEx - # endif --#elif defined (__CYGWIN__) --# include --# undef _WIN32 - #endif - - #if !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H - extern char **environ; - #endif - --#ifdef __CYGWIN__ --# include --#endif -- - // getpwnam doesn't exist on Windows and Cray Xt3/Catamount - // same for TIOCGWINSZ - #if defined(_WIN32) || defined (__LIBCATAMOUNT__) -@@ -1148,15 +1141,7 @@ - { - return false; - } --#if defined(__CYGWIN__) -- // Convert filename to native windows path if possible. -- char winpath[MAX_PATH]; -- if(SystemTools::PathCygwinToWin32(filename.c_str(), winpath)) -- { -- return (GetFileAttributesA(winpath) != INVALID_FILE_ATTRIBUTES); -- } -- return access(filename.c_str(), R_OK) == 0; --#elif defined(_WIN32) -+#if defined(_WIN32) - return (GetFileAttributesW( - SystemTools::ConvertToWindowsExtendedPath(filename).c_str()) - != INVALID_FILE_ATTRIBUTES); -@@ -1190,28 +1175,6 @@ - } - - //---------------------------------------------------------------------------- --#ifdef __CYGWIN__ --bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path) --{ -- SystemToolsTranslationMap::iterator i = -- SystemTools::Cyg2Win32Map->find(path); -- -- if (i != SystemTools::Cyg2Win32Map->end()) -- { -- strncpy(win32_path, i->second.c_str(), MAX_PATH); -- } -- else -- { -- if(cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, win32_path, MAX_PATH) != 0) -- { -- win32_path[0] = 0; -- } -- SystemToolsTranslationMap::value_type entry(path, win32_path); -- SystemTools::Cyg2Win32Map->insert(entry); -- } -- return win32_path[0] != 0; --} --#endif - - bool SystemTools::Touch(const kwsys_stl::string& filename, bool create) - { -@@ -4307,7 +4270,7 @@ - - bool SystemTools::FileIsFullPath(const char* in_name, size_t len) - { --#if defined(_WIN32) || defined(__CYGWIN__) -+#if defined(_WIN32) - // On Windows, the name must be at least two characters long. - if(len < 2) - { -@@ -5078,9 +5041,6 @@ - static unsigned int SystemToolsManagerCount; - SystemToolsTranslationMap *SystemTools::TranslationMap; - SystemToolsTranslationMap *SystemTools::LongPathMap; --#ifdef __CYGWIN__ --SystemToolsTranslationMap *SystemTools::Cyg2Win32Map; --#endif - - // SystemToolsManager manages the SystemTools singleton. - // SystemToolsManager should be included in any translation unit -@@ -5126,9 +5086,6 @@ - // Allocate the translation map first. - SystemTools::TranslationMap = new SystemToolsTranslationMap; - SystemTools::LongPathMap = new SystemToolsTranslationMap; --#ifdef __CYGWIN__ -- SystemTools::Cyg2Win32Map = new SystemToolsTranslationMap; --#endif - - // Add some special translation paths for unix. These are not added - // for windows because drive letters need to be maintained. Also, -@@ -5183,9 +5140,6 @@ - { - delete SystemTools::TranslationMap; - delete SystemTools::LongPathMap; --#ifdef __CYGWIN__ -- delete SystemTools::Cyg2Win32Map; --#endif - } - - ---- cmake-3.2.2/Source/kwsys/SystemTools.hxx.in 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Source/kwsys/SystemTools.hxx.in 2015-06-10 11:24:24.271286600 +0200 -@@ -298,15 +298,6 @@ - static bool FileExists(const kwsys_stl::string& filename); - - /** -- * Converts Cygwin path to Win32 path. Uses dictionary container for -- * caching and calls to cygwin_conv_to_win32_path from Cygwin dll -- * for actual translation. Returns true on success, else false. -- */ --#ifdef __CYGWIN__ -- static bool PathCygwinToWin32(const char *path, char *win32_path); --#endif -- -- /** - * Return file length - */ - static unsigned long FileLength(const kwsys_stl::string& filename); -@@ -942,9 +933,6 @@ - */ - static SystemToolsTranslationMap *TranslationMap; - static SystemToolsTranslationMap *LongPathMap; --#ifdef __CYGWIN__ -- static SystemToolsTranslationMap *Cyg2Win32Map; --#endif - friend class SystemToolsManager; - }; - ---- cmake-3.2.2/Modules/FindCurses.cmake 2015-04-13 19:09:00.000000000 +0200 -+++ cmake-3.2.2/Modules/FindCurses.cmake 2015-06-10 12:10:19.682030300 +0200 -@@ -60,15 +60,6 @@ - if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES)) - set(CURSES_USE_NCURSES TRUE) - endif() --# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html --# cygwin ncurses stopped providing curses.h symlinks see above --# message. Cygwin is an ncurses package, so force ncurses on --# cygwin if the curses.h is missing --if(CYGWIN) -- if(NOT EXISTS /usr/include/curses.h) -- set(CURSES_USE_NCURSES TRUE) -- endif() --endif() - - - # Not sure the logic is correct here. diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index 32b00795f366..4fac4e38712a 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -62,7 +62,6 @@ stdenv.mkDerivation (finalAttrs: { # Don't search in non-Nix locations such as /usr, but do search in our libc. ./001-search-path.diff ] - ++ lib.optional stdenv.hostPlatform.isCygwin ./004-cygwin.diff # On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG. ++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff # On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path. From fc90fab71c01869f750af345633123d1022d7fe5 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Mon, 31 Mar 2025 20:06:29 +0200 Subject: [PATCH 02/54] xcbuild: Fix build errors after cmake 4 upgrade The fix is required for cmake 4+ to fix this build error: > Compatibility with CMake < 3.5 has been removed from CMake. As xcbuild repo is archived, there is no any other way to fix it upstream. --- pkgs/by-name/xc/xcbuild/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/xc/xcbuild/package.nix b/pkgs/by-name/xc/xcbuild/package.nix index 04ed9832a6ab..e9daa2ee4b7f 100644 --- a/pkgs/by-name/xc/xcbuild/package.nix +++ b/pkgs/by-name/xc/xcbuild/package.nix @@ -123,6 +123,12 @@ stdenv.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = "-Wno-error"; + # CMake 4 dropped support of versions lower than 3.5, and versions + # lower than 3.10 are deprecated. + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") + ]; + nativeBuildInputs = [ cmake makeBinaryWrapper From c4044316e70f5d38c23df08ae2a15c9a6d8daa73 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 19:59:37 +0100 Subject: [PATCH 03/54] double-conversion: backport patches for CMake 4 --- pkgs/by-name/do/double-conversion/package.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/by-name/do/double-conversion/package.nix b/pkgs/by-name/do/double-conversion/package.nix index 11e87a0546c0..a377165483f0 100644 --- a/pkgs/by-name/do/double-conversion/package.nix +++ b/pkgs/by-name/do/double-conversion/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, cmake, enableStatic ? stdenv.hostPlatform.isStatic, }: @@ -17,6 +18,20 @@ stdenv.mkDerivation rec { sha256 = "sha256-M80H+azCzQYa4/gBLWv5GNNhEuHsH7LbJ/ajwmACnrM="; }; + patches = [ + # Fix the build with CMake 4. + (fetchpatch { + name = "double-conversion-fix-cmake-4-1.patch"; + url = "https://github.com/google/double-conversion/commit/101e1ba89dc41ceb75090831da97c43a76cd2906.patch"; + hash = "sha256-VRmuNXdzt/I+gWbz5mwWkx5IGn8Vsl9WkdwRsuwZdkU="; + }) + (fetchpatch { + name = "double-conversion-fix-cmake-4-2.patch"; + url = "https://github.com/google/double-conversion/commit/0604b4c18815aadcf7f4b78dfa6bfcb91a634ed7.patch"; + hash = "sha256-cJBp1ou1O/bMQ/7kvcX52dWbUdhmPfQ9aWmEhQdyhis="; + }) + ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableStatic) "-DBUILD_SHARED_LIBS=ON"; From 7f0fef9f3af3931014408f5ad3f289ea01803c1f Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 19:59:37 +0100 Subject: [PATCH 04/54] zeromq: backport patches for CMake 4 --- pkgs/by-name/ze/zeromq/package.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ze/zeromq/package.nix b/pkgs/by-name/ze/zeromq/package.nix index 918099c8b624..cc6869e87bc9 100644 --- a/pkgs/by-name/ze/zeromq/package.nix +++ b/pkgs/by-name/ze/zeromq/package.nix @@ -30,14 +30,26 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-q2h5y0Asad+fGB9haO4Vg7a1ffO2JSb7czzlhmT3VmI="; }; - # Use proper STREQUAL instead of EQUAL to compare strings - # See: https://github.com/zeromq/libzmq/pull/4711 patches = [ + # Use proper STREQUAL instead of EQUAL to compare strings + # See: https://github.com/zeromq/libzmq/pull/4711 (fetchpatch { url = "https://github.com/zeromq/libzmq/pull/4711/commits/55bd6b3df06734730d3012c17bc26681e25b549d.patch"; hash = "sha256-/FVah+s7f1hWXv3MXkYfIiV1XAiMVDa0tmt4BQmSgmY="; name = "cacheline_undefined.patch"; }) + + # Fix the build with CMake 4. + (fetchpatch { + name = "zeromq-fix-cmake-4-1.patch"; + url = "https://github.com/zeromq/libzmq/commit/34f7fa22022bed9e0e390ed3580a1c83ac4a2834.patch"; + hash = "sha256-oauAZV6pThplcn2v9mQxhxlUhYgpbly0JBLYik+zoJE="; + }) + (fetchpatch { + name = "zeromq-fix-cmake-4-2.patch"; + url = "https://github.com/zeromq/libzmq/commit/b91a6201307b72beb522300366aad763d19b1456.patch"; + hash = "sha256-FKvZi7pTUx+wLUR8Suf+pRFg8I5OHpJ93gEmTxUrmO4="; + }) ]; strictDeps = true; From dd7212fb9870e6a8549fe9883e14c7bdc1c553ec Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 00:36:21 +0100 Subject: [PATCH 05/54] libtiff: backport patches for CMake 4 --- pkgs/by-name/li/libtiff/package.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/by-name/li/libtiff/package.nix b/pkgs/by-name/li/libtiff/package.nix index 77c4ab63d1bf..129c793aa4b7 100644 --- a/pkgs/by-name/li/libtiff/package.nix +++ b/pkgs/by-name/li/libtiff/package.nix @@ -75,6 +75,23 @@ stdenv.mkDerivation (finalAttrs: { url = "https://gitlab.com/libtiff/libtiff/-/commit/ed141286a37f6e5ddafb5069347ff5d587e7a4e0.patch"; hash = "sha256-DIsk8trbHMMTrj6jP5Ae8ciRjHV4CPHdWCN+VbeFnFo="; }) + + # Fix the build with CMake 4. + (fetchpatch { + name = "libtiff-cmake-4-1.patch"; + url = "https://gitlab.com/libtiff/libtiff/-/commit/d1279f0f9c8fee724c380523a7a6cf60c690521d.patch"; + hash = "sha256-7EwfgG8zYwyNPIpyCYq8PSbf1TBmo4N36e96GB3wWPo="; + }) + (fetchpatch { + name = "libtiff-cmake-4-2.patch"; + url = "https://gitlab.com/libtiff/libtiff/-/commit/2b6b70183d048b8f32e6b95e9aa82ed2e46ddf1f.patch"; + hash = "sha256-fGhlm2PYxjXAyMdM8vyvgcDzzJw8YTHWFRunr+RZnOU="; + }) + (fetchpatch { + name = "libtiff-cmake-4-3.patch"; + url = "https://gitlab.com/libtiff/libtiff/-/commit/ff5997ea1206df2ebbbf5e30611c8a84f649a333.patch"; + hash = "sha256-G2Q8EKOzNLh028kPYAKmoEzAbDu0tGNpnxkd3pMT96U="; + }) ]; postPatch = '' From f9a2bc625eecaa1e97e340a60dd60f489b9f2d6e Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 06/54] x265: backport patches for CMake 4 --- pkgs/by-name/x2/x265/package.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkgs/by-name/x2/x265/package.nix b/pkgs/by-name/x2/x265/package.nix index a7b00775e138..1dbf1ad936c8 100644 --- a/pkgs/by-name/x2/x265/package.nix +++ b/pkgs/by-name/x2/x265/package.nix @@ -5,6 +5,7 @@ fetchurl, cmake, nasm, + fetchpatch, fetchpatch2, # NUMA support enabled by default on NUMA platforms: @@ -58,6 +59,26 @@ stdenv.mkDerivation rec { # fix compilation with gcc15 # https://bitbucket.org/multicoreware/x265_git/pull-requests/36 ./gcc15-fixes.patch + + # Fix the build with CMake 4. + (fetchpatch { + name = "x265-fix-cmake-4-1.patch"; + url = "https://bitbucket.org/multicoreware/x265_git/commits/b354c009a60bcd6d7fc04014e200a1ee9c45c167/raw"; + stripLen = 1; + hash = "sha256-kS+hYZb5dnIlNoZ8ABmNkLkPx+NqCPy+DonXktBzJAE="; + }) + (fetchpatch { + name = "x265-fix-cmake-4-2.patch"; + url = "https://bitbucket.org/multicoreware/x265_git/commits/51ae8e922bcc4586ad4710812072289af91492a8/raw"; + stripLen = 1; + hash = "sha256-ZrpyfSnijUgdyVscW73K48iEXa9k85ftNaQdr0HWSYg="; + }) + (fetchpatch { + name = "x265-fix-cmake-4-3.patch"; + url = "https://bitbucket.org/multicoreware/x265_git/commits/78e5ac35c13c5cbccc5933083edceb0d3eaeaa21/raw"; + stripLen = 1; + hash = "sha256-qEihgUKGEdthbKz67s+/hS/qdpzl+3tEB3gx2tarax4="; + }) ] # TODO: remove after update to version 4.2 ++ lib.optionals (stdenv.hostPlatform.isAarch32 && stdenv.hostPlatform.isLinux) [ From 3aea3ebccbe0d307df0f7325d40678fe1e3bf35b Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 07/54] srt: backport patch for CMake 4 --- pkgs/by-name/sr/srt/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sr/srt/package.nix b/pkgs/by-name/sr/srt/package.nix index d18eb371675b..f406fa154543 100644 --- a/pkgs/by-name/sr/srt/package.nix +++ b/pkgs/by-name/sr/srt/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, openssl, windows, @@ -27,7 +28,15 @@ stdenv.mkDerivation rec { windows.pthreads ]; - patches = lib.optionals stdenv.hostPlatform.isMinGW [ + patches = [ + # Fix the build with CMake 4. + (fetchpatch { + name = "srt-fix-cmake-4.patch"; + url = "https://github.com/Haivision/srt/commit/0def1b1a1094fc57752f241250e9a1aed71bbffd.patch"; + hash = "sha256-dnBGNut+I9trkQzr81Wo36O2Pt7d2gsjA1buJBegPMM="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ ./no-msvc-compat-headers.patch ]; From 5a81bed4a01acefd6c4fea7f94d772af6e3aa44a Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 08/54] libuchardet: backport patch for CMake 4 --- pkgs/by-name/li/libuchardet/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/libuchardet/package.nix b/pkgs/by-name/li/libuchardet/package.nix index 321a1d042576..b2645715dced 100644 --- a/pkgs/by-name/li/libuchardet/package.nix +++ b/pkgs/by-name/li/libuchardet/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, cmake, }: @@ -21,6 +22,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-6Xpgz8AKHBR6Z0sJe7FCKr2fp4otnOPz/cwueKNKxfA="; }; + patches = [ + # Fix the build with CMake 4. + (fetchpatch { + name = "uchardet-cmake-4.patch"; + url = "https://gitlab.freedesktop.org/uchardet/uchardet/-/commit/6e163c978a7c13a6d3ff64a1e3dd4ba81d2d9e09.patch"; + hash = "sha256-WXIQEoIpT7b5vELAfQJFEt2hiYrlnGCjV7ILCmd9kqY="; + }) + ]; + nativeBuildInputs = [ cmake ]; doCheck = !stdenv.hostPlatform.isi686; # tests fail on i686 From 1f4843f2e6c8bda566717f2d7deb4378e9f902f5 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 09/54] libid3tag: backport patch for CMake 4 --- pkgs/by-name/li/libid3tag/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/libid3tag/package.nix b/pkgs/by-name/li/libid3tag/package.nix index e287ee6cdcd2..18b8779ad7d3 100644 --- a/pkgs/by-name/li/libid3tag/package.nix +++ b/pkgs/by-name/li/libid3tag/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitea, + fetchpatch, cmake, gperf, zlib, @@ -24,6 +25,15 @@ stdenv.mkDerivation rec { hash = "sha256-6/49rk7pmIpJRj32WmxC171NtdIOaMNhX8RD7o6Jbzs="; }; + patches = [ + # Fix the build with CMake 4. + (fetchpatch { + name = "libid3tag-fix-cmake-4.patch"; + url = "https://codeberg.org/tenacityteam/libid3tag/commit/eee94b22508a066f7b9bc1ae05d2d85982e73959.patch"; + hash = "sha256-OAdMapNr8qpvXZqNOZ3LUHQ1H79zD1rvzrVksqmz6dU="; + }) + ]; + postPatch = '' substituteInPlace packaging/id3tag.pc.in \ --replace-fail "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "@CMAKE_INSTALL_FULL_LIBDIR@" From 4510dbc6cc7570c7fa0217ccd17643fc2334567b Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 03:11:28 +0100 Subject: [PATCH 10/54] libipt: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libipt/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/li/libipt/package.nix b/pkgs/by-name/li/libipt/package.nix index 33e01b9d7a83..022f765c0954 100644 --- a/pkgs/by-name/li/libipt/package.nix +++ b/pkgs/by-name/li/libipt/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, freebsd, }: @@ -17,6 +18,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-rO2Mf2/BfKlPh1wHe0qTuyQAyqpSB/j3Q+JWpNDyNm0="; }; + patches = [ + (fetchpatch { + name = "libipt-fix-cmake-4.patch"; + url = "https://github.com/intel/libipt/commit/fa7d42de25be526da532284cc8b771fdeb384f81.patch"; + hash = "sha256-/jTyoGyKw29Nu27bAXmStpjOdTeGdQYpEX2rb29vSSQ="; + }) + ]; + nativeBuildInputs = [ cmake ]; buildInputs = lib.optional stdenv.hostPlatform.isFreeBSD freebsd.libstdthreads; From 3e03b8e865900a97b550bdb55a42a9d4a448c311 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 03:46:43 +0100 Subject: [PATCH 11/54] libspatialaudio: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libspatialaudio/package.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libspatialaudio/package.nix b/pkgs/by-name/li/libspatialaudio/package.nix index ef7275e2076e..d3ff33fb2eab 100644 --- a/pkgs/by-name/li/libspatialaudio/package.nix +++ b/pkgs/by-name/li/libspatialaudio/package.nix @@ -3,6 +3,7 @@ stdenv, cmake, fetchFromGitHub, + fetchpatch, libmysofa, zlib, }: @@ -18,6 +19,16 @@ stdenv.mkDerivation rec { hash = "sha256-sPnQPD41AceXM4uGqWXMYhuQv0TUkA6TZP8ChxUFIoI="; }; + # Fix the build with CMake 4. + # + # See: + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.1)' \ + 'cmake_minimum_required(VERSION 3.5)' + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ libmysofa @@ -33,7 +44,7 @@ stdenv.mkDerivation rec { description = "Ambisonic encoding / decoding and binauralization library in C++"; homepage = "https://github.com/videolabs/libspatialaudio"; license = licenses.lgpl21Plus; - platforms = platforms.linux; + platforms = platforms.all; maintainers = with maintainers; [ krav ]; }; } From b0655cb82b668ae9e8ab4ee16c032a8ff4fe3c59 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 03:54:53 +0100 Subject: [PATCH 12/54] usrsctp: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/us/usrsctp/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/us/usrsctp/package.nix b/pkgs/by-name/us/usrsctp/package.nix index 9d5e72f1f2c6..5d3ee93d9670 100644 --- a/pkgs/by-name/us/usrsctp/package.nix +++ b/pkgs/by-name/us/usrsctp/package.nix @@ -28,6 +28,12 @@ stdenv.mkDerivation rec { url = "https://github.com/sctplab/usrsctp/commit/ac559d2a95277e5e0827e9ee5a1d3b1b50e0822a.patch"; hash = "sha256-QBlzH37Xwwnn1y8pM941Zesz18p2EazfeD0lCU8n6nI="; }) + + (fetchpatch { + name = "usrsctp-fix-cmake-4.patch"; + url = "https://github.com/sctplab/usrsctp/commit/7569d2ce1e8658534369ad9726ca62139211db84.patch"; + hash = "sha256-Hxp1SGwmpm6UK//KFLQoOmmI0a1QpSNaTaEEUbC8jbg="; + }) ]; nativeBuildInputs = [ cmake ]; From c7dfc5993d55fea1af95796d0e5200164487ffb6 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:04:10 +0100 Subject: [PATCH 13/54] taglib_1: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/ta/taglib_1/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/ta/taglib_1/package.nix b/pkgs/by-name/ta/taglib_1/package.nix index 865ee774ddee..219cb617f7c7 100644 --- a/pkgs/by-name/ta/taglib_1/package.nix +++ b/pkgs/by-name/ta/taglib_1/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, zlib, testers, @@ -18,6 +19,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-QX0EpHGT36UsgIfRf5iALnwxe0jjLpZvCTbk8vSMFF4="; }; + patches = [ + (fetchpatch { + name = "taglib-fix-cmake-4.patch"; + url = "https://github.com/taglib/taglib/commit/967aaf7af2f4aa2e9fed0edb2cbaca98b737eebe.patch"; + hash = "sha256-GeowBwspGAmrjALaIgEgSR9uUuClKAkS/cwZ2FHltl4="; + }) + ]; + strictDeps = true; nativeBuildInputs = [ cmake ]; From db7fb49d9b595acae017e1360d42cc5d4bca8c97 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 11 Sep 2025 01:15:20 +0100 Subject: [PATCH 14/54] gflags: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/gf/gflags/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/gf/gflags/package.nix b/pkgs/by-name/gf/gflags/package.nix index b01b862804e3..331aa6087332 100644 --- a/pkgs/by-name/gf/gflags/package.nix +++ b/pkgs/by-name/gf/gflags/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, enableShared ? !stdenv.hostPlatform.isStatic, }: @@ -17,6 +18,15 @@ stdenv.mkDerivation rec { sha256 = "147i3md3nxkjlrccqg4mq1kyzc7yrhvqv5902iibc7znkvzdvlp0"; }; + patches = [ + # Fix the build with CMake 4. + (fetchpatch { + name = "gflags-fix-cmake-4.patch"; + url = "https://github.com/gflags/gflags/commit/70c01a642f08734b7bddc9687884844ca117e080.patch"; + hash = "sha256-TYdroBbF27Wvvm/rOahBEvhezuKCcxbtgh/ZhpA5ESo="; + }) + ]; + nativeBuildInputs = [ cmake ]; # This isn't used by the build and breaks the CMake build on case-insensitive filesystems (e.g., on Darwin) From 2ffd7d91fc8ddc7a5ae39755d56308a94aa0baac Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:23:30 +0100 Subject: [PATCH 15/54] freeglut: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/fr/freeglut/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/fr/freeglut/package.nix b/pkgs/by-name/fr/freeglut/package.nix index 5a1ef392ff06..e112d25a82fe 100644 --- a/pkgs/by-name/fr/freeglut/package.nix +++ b/pkgs/by-name/fr/freeglut/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, libICE, libXext, libXi, @@ -22,6 +23,14 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-nD1NZRb7+gKA7ck8d2mPtzA+RDwaqvN9Jp4yiKbD6lI="; }; + patches = [ + (fetchpatch { + name = "freeglut-fix-cmake-4.patch"; + url = "https://github.com/freeglut/freeglut/commit/2294389397912c9a6505a88221abb7dca0a4fb79.patch"; + hash = "sha256-buNhlVUbDekklnar6KFWN/GUKE+jMEqTGrY3LY0LwVs="; + }) + ]; + outputs = [ "out" "dev" From aeb739143fcf715bb714cfda8d78475a38fff6fe Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:24:58 +0100 Subject: [PATCH 16/54] libebml: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libebml/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/li/libebml/package.nix b/pkgs/by-name/li/libebml/package.nix index e6bd5d29bca2..54b01be9dfc8 100644 --- a/pkgs/by-name/li/libebml/package.nix +++ b/pkgs/by-name/li/libebml/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, pkg-config, }: @@ -17,6 +18,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-PIVBePTWceMgiENdaL9lvXIL/RQIrtg7l0OG2tO0SU8="; }; + patches = [ + (fetchpatch { + name = "libebml-fix-cmake-4.patch"; + url = "https://github.com/Matroska-Org/libebml/commit/6725c5f0169981cb0bd2ee124fbf0d8ca30b762d.patch"; + hash = "sha256-q62EWnJmQzBtra1xL0N7rC4RARJZQ/HAVyorzvB7XFY="; + }) + ]; + nativeBuildInputs = [ cmake pkg-config From 44349dfbb5f7da67df10e423eb73dcdfedc86aee Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:30:43 +0100 Subject: [PATCH 17/54] libmatroska: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libmatroska/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/li/libmatroska/package.nix b/pkgs/by-name/li/libmatroska/package.nix index 8de6786dfa64..70d8eff99a4d 100644 --- a/pkgs/by-name/li/libmatroska/package.nix +++ b/pkgs/by-name/li/libmatroska/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, libebml, nix-update-script, @@ -27,6 +28,14 @@ stdenv.mkDerivation rec { hash = "sha256-hfu3Q1lIyMlWFWUM2Pu70Hie0rlQmua7Kq8kSIWnfHE="; }; + patches = [ + (fetchpatch { + name = "libmatroska-fix-cmake-4.patch"; + url = "https://github.com/Matroska-Org/libmatroska/commit/dc80e194e93e6f0e25c8ad3e015d83aca2a99e10.patch"; + hash = "sha256-2dKRJ6z5rOrLJ5agvXQ6k8TPi5rTMA3H1wCO2F5tBbc="; + }) + ]; + nativeBuildInputs = [ cmake pkg-config From 29ed5a10f8272980be6c4b47f8f12df52b03c3cd Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:33:44 +0100 Subject: [PATCH 18/54] multimarkdown: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/mu/multimarkdown/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/mu/multimarkdown/package.nix b/pkgs/by-name/mu/multimarkdown/package.nix index b69eb9fc27d1..30a3e7d1485f 100644 --- a/pkgs/by-name/mu/multimarkdown/package.nix +++ b/pkgs/by-name/mu/multimarkdown/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, perl, pkg-config, @@ -18,6 +19,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-b6yCn0NFpONI7WwfjDOc0d2nCKMIiUXi+rsnytiNc0Q="; }; + patches = [ + (fetchpatch { + name = "multimarkdown-fix-cmake-4.patch"; + url = "https://github.com/fletcher/MultiMarkdown-6/commit/655c0908155758e7c94858af2fb99dc992709075.patch"; + hash = "sha256-d1b5NcBQDVnbmTvVnPyiTS8aSx/VGgRLHD0nSs+JksI="; + }) + ]; + postPatch = '' patchShebangs tools/enumsToPerl.pl ''; From 02bdd47f2288251623c21473b4095717faf39edb Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 17:45:25 +0100 Subject: [PATCH 19/54] libvncserver: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libvncserver/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/li/libvncserver/package.nix b/pkgs/by-name/li/libvncserver/package.nix index 85e83d0b0460..b4c94caccdbb 100644 --- a/pkgs/by-name/li/libvncserver/package.nix +++ b/pkgs/by-name/li/libvncserver/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, libjpeg, openssl, @@ -34,6 +35,12 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # fix generated pkg-config files ./pkgconfig.patch + + (fetchpatch { + name = "libvncserver-fix-cmake-4.patch"; + url = "https://github.com/LibVNC/libvncserver/commit/e64fa928170f22a2e21b5bbd6d46c8f8e7dd7a96.patch"; + hash = "sha256-AAZ3H34+nLqQggb/sNSx2gIGK96m4zatHX3wpyjNLOA="; + }) ]; nativeBuildInputs = [ From 4abaab1bae5b41a6668092030be81a18db77a949 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 17:29:44 +0100 Subject: [PATCH 20/54] libappimage: backport patches for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libappimage/package.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/by-name/li/libappimage/package.nix b/pkgs/by-name/li/libappimage/package.nix index 9e63c725c93b..0356c862aa65 100644 --- a/pkgs/by-name/li/libappimage/package.nix +++ b/pkgs/by-name/li/libappimage/package.nix @@ -37,6 +37,23 @@ stdenv.mkDerivation rec { url = "https://github.com/AppImageCommunity/libappimage/commit/1e0515b23b90588ce406669134feca56ddcbbe43.patch"; hash = "sha256-WIMvXNqC1stgPiBTRpXHWq3edIRnQomtRSW2qO52TRo="; }) + + # we really just want this for cmake 4 compatibility + (fetchpatch { + name = "libappimage-use-system-gtest.patch"; + url = "https://github.com/AppImageCommunity/libappimage/commit/7b83b7247fd2d86c330e09f534c9cec1b03f649f.patch"; + excludes = [ + "ci/*" + "lib/gtest" + "tests/*" + ]; + hash = "sha256-H+ph5TfKJPFcAzw2c7pzmqvB9R50HtZP/DbroOxLTVU="; + }) + (fetchpatch { + name = "libappimage-fix-cmake-4.patch"; + url = "https://github.com/AppImageCommunity/libappimage/commit/e5f6ea562611d534dc8e899a12ddf15c50e820be.patch"; + hash = "sha256-P6fPoiqVX3TrKGrU2EXIMBpQLGl7xNcy41Iq7vRM+n8="; + }) ]; postPatch = '' From f5f1d0dc69be2651d569f7006333a1045b6654a4 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 17 Sep 2025 00:35:39 +0100 Subject: [PATCH 21/54] kdePackages.sddm.unwrapped: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/applications/display-managers/sddm/unwrapped.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/display-managers/sddm/unwrapped.nix b/pkgs/applications/display-managers/sddm/unwrapped.nix index 15378ed16949..e3b2389f2f10 100644 --- a/pkgs/applications/display-managers/sddm/unwrapped.nix +++ b/pkgs/applications/display-managers/sddm/unwrapped.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, cmake, pkg-config, qttools, @@ -39,6 +40,12 @@ stdenv.mkDerivation (finalAttrs: { ./greeter-path.patch ./sddm-ignore-config-mtime.patch ./sddm-default-session.patch + + (fetchpatch { + name = "sddm-fix-cmake-4.patch"; + url = "https://github.com/sddm/sddm/commit/228778c2b4b7e26db1e1d69fe484ed75c5791c3a.patch"; + hash = "sha256-Okt9LeZBhTDhP7NKBexWAZhkK6N6j9dFkAEgpidSnzE="; + }) ]; postPatch = '' From 166e159ad71ec36e67d86e53cf17e7f54ad1ff70 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 17 Sep 2025 03:30:05 +0100 Subject: [PATCH 22/54] libjxl: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libjxl/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/li/libjxl/package.nix b/pkgs/by-name/li/libjxl/package.nix index b1154d5bc69b..af5041e2ca5b 100644 --- a/pkgs/by-name/li/libjxl/package.nix +++ b/pkgs/by-name/li/libjxl/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, brotli, cmake, giflib, @@ -139,6 +140,17 @@ stdenv.mkDerivation rec { rm -rf third_party/!(sjpeg)/ shopt -u extglob + # Fix the build with CMake 4. + # + # See: + # + # * + # * + substituteInPlace third_party/sjpeg/CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 2.8.7)' \ + 'cmake_minimum_required(VERSION 3.5...3.10)' + substituteInPlace plugins/gdk-pixbuf/jxl.thumbnailer \ --replace '/usr/bin/gdk-pixbuf-thumbnailer' "$out/libexec/gdk-pixbuf-thumbnailer-jxl" substituteInPlace CMakeLists.txt \ From e9b67e2e9d8420692098070891bd9014c093ceef Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 18 Sep 2025 00:07:06 +0100 Subject: [PATCH 23/54] blasfeo: backport patch for CMake 4 Co-authored-by: Guilhem Saurel --- pkgs/by-name/bl/blasfeo/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/bl/blasfeo/package.nix b/pkgs/by-name/bl/blasfeo/package.nix index 8053b628b59f..1355e51da77e 100644 --- a/pkgs/by-name/bl/blasfeo/package.nix +++ b/pkgs/by-name/bl/blasfeo/package.nix @@ -1,6 +1,7 @@ { cmake, fetchFromGitHub, + fetchpatch, lib, stdenv, withTarget ? "GENERIC", @@ -17,6 +18,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-p1pxqJ38h6RKXMg1t+2RHlfmRKPuM18pbUarUx/w9lw="; }; + patches = [ + (fetchpatch { + name = "blasfeo-fix-cmake-4.patch"; + url = "https://github.com/giaf/blasfeo/commit/75078e2b6153d1c8bc5329e83a82d4d4d3eefd76.patch"; + hash = "sha256-bH5xUKAjNFCO9rRc655BcMiUesNFFln+iEPC5JHcQAU="; + }) + ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ "-DTARGET=${withTarget}" ]; From ba146221fec42177b5f713b40e232ba74a484d8a Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 18 Sep 2025 00:09:28 +0100 Subject: [PATCH 24/54] console-bridge: backport patch for CMake 4 Co-authored-by: Guilhem Saurel --- pkgs/by-name/co/console-bridge/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/co/console-bridge/package.nix b/pkgs/by-name/co/console-bridge/package.nix index 384f305977c9..653843bdb94e 100644 --- a/pkgs/by-name/co/console-bridge/package.nix +++ b/pkgs/by-name/co/console-bridge/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, validatePkgConfig, }: @@ -17,6 +18,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-M3GocT0hodw3Sc2NHcFDiPVZ1XN7BqIUuYLW8OaXMqM="; }; + patches = [ + (fetchpatch { + name = "console-bridge-fix-cmake-4.patch"; + url = "https://github.com/ros/console_bridge/commit/81ec67f6daf3cd19ef506e00f02efb1645597b9c.patch"; + hash = "sha256-qSYnqjD+63lWBdtrXbTawt1OpiAO9uvT7R5KmfpUmwQ="; + }) + ]; + nativeBuildInputs = [ cmake validatePkgConfig From f6a2efdec8940f808581610f25d87243b5966e05 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 18 Sep 2025 00:23:16 +0100 Subject: [PATCH 25/54] qpoases: backport patch for CMake 4 Co-authored-by: Guilhem Saurel --- pkgs/by-name/qp/qpoases/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/qp/qpoases/package.nix b/pkgs/by-name/qp/qpoases/package.nix index b77c8cc5fac8..07356f081843 100644 --- a/pkgs/by-name/qp/qpoases/package.nix +++ b/pkgs/by-name/qp/qpoases/package.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, + fetchpatch, nix-update-script, cmake, @@ -21,6 +22,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-L6uBRXaPJZinIRTm+x+wnXmlVkSlWm4XMB5yX/wxg2A="; }; + patches = [ + (fetchpatch { + name = "qpoases-fix-cmake-4.patch"; + url = "https://github.com/coin-or/qpOASES/commit/35b762ba3fee2e009d9e99650c68514da05585c5.patch"; + hash = "sha256-I6l+ah1j45VEMokZqX6DYVmE55uWlVi0rx2B+HQv5Ik="; + }) + ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ From da4e2b7aece3c1b1628797683493b1707ecffd1a Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 18 Sep 2025 00:30:17 +0100 Subject: [PATCH 26/54] scalapack: backport patch for CMake 4 Co-authored-by: Guilhem Saurel --- pkgs/by-name/sc/scalapack/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/sc/scalapack/package.nix b/pkgs/by-name/sc/scalapack/package.nix index aee2fc557426..c66dc0bc2839 100644 --- a/pkgs/by-name/sc/scalapack/package.nix +++ b/pkgs/by-name/sc/scalapack/package.nix @@ -33,6 +33,12 @@ stdenv.mkDerivation rec { url = "https://github.com/Reference-ScaLAPACK/scalapack/commit/76cc1ed3032e9a4158a4513c9047c3746b269f04.patch"; hash = "sha256-kmllLa9GUeTrHRYeS0yIk9I8LwaIoEytdyQGRuinn3A="; }) + + (fetchpatch { + name = "scalapack-fix-cmake-4.patch"; + url = "https://github.com/Reference-ScaLAPACK/scalapack/commit/c3d6b22b0032fd2b8772d99c2239c18473e197a7.patch"; + hash = "sha256-935KtaqPO2cghbD9Z8YMxGGOQJo1D1LqTje6/IL4bGI="; + }) ]; # Required to activate ILP64. From 01b240b18528da5b1c5cadb3dad9b6988bd6b2a2 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 18 Sep 2025 00:34:55 +0100 Subject: [PATCH 27/54] crc32c: backport patch for CMake 4 Co-authored-by: Guilhem Saurel --- pkgs/by-name/cr/crc32c/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/cr/crc32c/package.nix b/pkgs/by-name/cr/crc32c/package.nix index fa2dd97b7a14..1272343184e5 100644 --- a/pkgs/by-name/cr/crc32c/package.nix +++ b/pkgs/by-name/cr/crc32c/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, cmake, gflags, staticOnly ? stdenv.hostPlatform.isStatic, @@ -19,6 +20,15 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + (fetchpatch { + name = "crc32c-fix-cmake-4.patch"; + url = "https://github.com/google/crc32c/commit/2bbb3be42e20a0e6c0f7b39dc07dc863d9ffbc07.patch"; + excludes = [ "third_party/*" ]; + hash = "sha256-XYH0Mwvmf8RkXscVo6pAejTbRmVl9tY+lpp1sqbNXa0="; + }) + ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ gflags ]; From 6800fda4e83bcc813f118d2bb7018f455b1752c5 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 18 Sep 2025 00:45:02 +0100 Subject: [PATCH 28/54] lib3mf: backport patch for CMake 4 Co-authored-by: Guilhem Saurel --- pkgs/by-name/li/lib3mf/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/li/lib3mf/package.nix b/pkgs/by-name/li/lib3mf/package.nix index cc23872e70b6..4189dc1d2ca0 100644 --- a/pkgs/by-name/li/lib3mf/package.nix +++ b/pkgs/by-name/li/lib3mf/package.nix @@ -40,6 +40,11 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/3MFConsortium/lib3mf/pull/421/commits/6d7b5709a4a1cf9bd55ae8b4ae999c9ca014f62c.patch?full_index=1"; hash = "sha256-rGOyXZUZglRNMu1/oVhgSpRdi0pUa/wn5SFHCS9jVOY="; }) + (fetchpatch { + name = "lib3mf-fix-cmake-4.patch"; + url = "https://github.com/3MFConsortium/lib3mf/commit/01325a73de25d2ad49e992b5b6294beb32298c92.patch"; + hash = "sha256-8vv2ydnDgvSKkGjpmk5ng1BGKK0okTMOeAoGwlKcziY="; + }) ]; nativeBuildInputs = [ From 497d8576cf24bee7c652868f70e9a45c004636bd Mon Sep 17 00:00:00 2001 From: Emily Date: Fri, 19 Sep 2025 03:22:11 +0100 Subject: [PATCH 29/54] cfitsio: backport patch for CMake 4 Co-authored-by: K900 --- pkgs/by-name/cf/cfitsio/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/cf/cfitsio/package.nix b/pkgs/by-name/cf/cfitsio/package.nix index 215a9989b37c..7d97bb020849 100644 --- a/pkgs/by-name/cf/cfitsio/package.nix +++ b/pkgs/by-name/cf/cfitsio/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, gitUpdater, cmake, bzip2, @@ -29,6 +30,12 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./cfitsio-pc-cmake.patch + + (fetchpatch { + name = "cfitsio-fix-cmake-4.patch"; + url = "https://github.com/HEASARC/cfitsio/commit/101e0880fca41e2223df7eec56d9e84e90b9ed56.patch"; + hash = "sha256-rufuqOBfE7ItTYwsGdu9G4BXSz4vZd52XmJi09kqrCM="; + }) ]; nativeBuildInputs = [ From d65ad56f1baa831f3c6c50cebbbb10f828ca1794 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 19:59:37 +0100 Subject: [PATCH 30/54] woff2: fix build with CMake 4 --- pkgs/by-name/wo/woff2/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/wo/woff2/package.nix b/pkgs/by-name/wo/woff2/package.nix index b6d15a53a520..bc9e6ec00e6f 100644 --- a/pkgs/by-name/wo/woff2/package.nix +++ b/pkgs/by-name/wo/woff2/package.nix @@ -44,6 +44,14 @@ stdenv.mkDerivation rec { postPatch = '' # without this binaries only get built if shared libs are disable sed 's@^if (NOT BUILD_SHARED_LIBS)$@if (TRUE)@g' -i CMakeLists.txt + + # Fix the build with CMake 4. + # + # See: + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 2.8.6)' \ + 'cmake_minimum_required(VERSION 3.10)' ''; meta = with lib; { From 82de3ea0a00e13e3b01cc3cfa19c8aec7a9237e2 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 19:59:37 +0100 Subject: [PATCH 31/54] graphite2: fix build with CMake 4 --- .../libraries/silgraphite/graphite2.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix index 8e56d3b70dd4..5a25cb3571d7 100644 --- a/pkgs/development/libraries/silgraphite/graphite2.nix +++ b/pkgs/development/libraries/silgraphite/graphite2.nix @@ -53,6 +53,22 @@ stdenv.mkDerivation (finalAttrs: { # headers are located in the dev output: substituteInPlace CMakeLists.txt \ --replace-fail ' ''${CMAKE_INSTALL_PREFIX}/include' " ${placeholder "dev"}/include" + + # Fix the build with CMake 4. + # + # See: + badCmakeFiles=( + CMakeLists.txt + src/CMakeLists.txt + tests/{bittwiddling,json,sparsetest,utftest}/CMakeLists.txt + gr2fonttest/CMakeLists.txt + ) + for file in "''${badCmakeFiles[@]}"; do + substituteInPlace "$file" \ + --replace-fail \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)' \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)' + done ''; cmakeFlags = lib.optionals static [ From 5bebee097da64c5a260bdd1e108d7739dfb27f49 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 01:24:09 +0100 Subject: [PATCH 32/54] soxr: fix build with CMake 4 --- pkgs/by-name/so/soxr/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/so/soxr/package.nix b/pkgs/by-name/so/soxr/package.nix index 156650a09ef1..88563e32ec21 100644 --- a/pkgs/by-name/so/soxr/package.nix +++ b/pkgs/by-name/so/soxr/package.nix @@ -32,6 +32,14 @@ stdenv.mkDerivation rec { "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include" ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required (VERSION 3.1 FATAL_ERROR)' \ + 'cmake_minimum_required (VERSION 3.10 FATAL_ERROR)' + ''; + meta = with lib; { description = "Audio resampling library"; homepage = "https://soxr.sourceforge.net"; From 34c4f1cc20f82a938e3d2e8053c178463db71b8d Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 33/54] qhull: fix build with CMake 4 --- pkgs/by-name/qh/qhull/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/qh/qhull/package.nix b/pkgs/by-name/qh/qhull/package.nix index 84777ff28cdc..a315ea25dec8 100644 --- a/pkgs/by-name/qh/qhull/package.nix +++ b/pkgs/by-name/qh/qhull/package.nix @@ -19,6 +19,18 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + # Fix the build with CMake 4. + # + # Remove on the next version bump. + # + # See: + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.0)' \ + 'cmake_minimum_required(VERSION 3.5...4.0)' + ''; + meta = with lib; { homepage = "http://www.qhull.org/"; description = "Compute the convex hull, Delaunay triangulation, Voronoi diagram and more"; From 781543fce4299a9d89193995438a4f52f99d3ade Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 34/54] aften: fix build with CMake 4 --- pkgs/by-name/af/aften/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/af/aften/package.nix b/pkgs/by-name/af/aften/package.nix index b0960550c857..f95f018bc21e 100644 --- a/pkgs/by-name/af/aften/package.nix +++ b/pkgs/by-name/af/aften/package.nix @@ -23,6 +23,14 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DSHARED=ON" ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 2.4)' \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 3.10)' + ''; + meta = { description = "Audio encoder which generates compressed audio streams based on ATSC A/52 specification"; homepage = "https://aften.sourceforge.net/"; From 46dd6d3b7263def00e084fa48ac1bbfb47a4a0da Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 35/54] cjson: fix build with CMake 4 --- pkgs/by-name/cj/cjson/package.nix | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/cj/cjson/package.nix b/pkgs/by-name/cj/cjson/package.nix index b04408ec499b..c1fa9f4c55cd 100644 --- a/pkgs/by-name/cj/cjson/package.nix +++ b/pkgs/by-name/cj/cjson/package.nix @@ -22,11 +22,24 @@ stdenv.mkDerivation rec { lib.cmakeBool "ENABLE_CUSTOM_COMPILER_FLAGS" false ); - # cJSON actually uses C99 standard, not C89 - # https://github.com/DaveGamble/cJSON/issues/275 - postPatch = '' - substituteInPlace CMakeLists.txt --replace -std=c89 -std=c99 - ''; + postPatch = + # cJSON actually uses C99 standard, not C89 + # https://github.com/DaveGamble/cJSON/issues/275 + '' + substituteInPlace CMakeLists.txt --replace -std=c89 -std=c99 + '' + # Fix the build with CMake 4. + # + # See: + # * + # * + # * + + '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.0)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; meta = with lib; { homepage = "https://github.com/DaveGamble/cJSON"; From 486aec9c1e854bfa85cc74ba0b0f8d217b1ae5ac Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 36/54] zopfli: fix build with CMake 4 --- pkgs/by-name/zo/zopfli/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/zo/zopfli/package.nix b/pkgs/by-name/zo/zopfli/package.nix index 903061699dd4..e7091c16281c 100644 --- a/pkgs/by-name/zo/zopfli/package.nix +++ b/pkgs/by-name/zo/zopfli/package.nix @@ -29,6 +29,16 @@ stdenv.mkDerivation rec { "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ]; + # Fix the build with CMake 4. + # + # See: + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 2.8.11)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; + postInstall = '' install -Dm444 -t $out/share/doc/zopfli ../README* cp $src/src/zopfli/*.h $dev/include/ From 7001e44a3bb3b11b3f0e9f23b6287f6a6c4afd02 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 11 Sep 2025 03:54:29 +0100 Subject: [PATCH 37/54] cpptoml: fix build with CMake 4 --- pkgs/by-name/cp/cpptoml/package.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/by-name/cp/cpptoml/package.nix b/pkgs/by-name/cp/cpptoml/package.nix index 9cc05daed374..825a8b61b67f 100644 --- a/pkgs/by-name/cp/cpptoml/package.nix +++ b/pkgs/by-name/cp/cpptoml/package.nix @@ -34,6 +34,19 @@ stdenv.mkDerivation { "-DCPPTOML_BUILD_EXAMPLES=OFF" ]; + # Fix the build with CMake 4. + # + # See: + # + # * + # * + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.1.0)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; + meta = with lib; { description = "C++ TOML configuration library"; homepage = "https://github.com/skystrife/cpptoml"; From 2979eed6de72c0ee08aa156f3732f8017952ee50 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH 38/54] vid-stab: fix build with CMake 4 --- pkgs/development/libraries/vid-stab/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/vid-stab/default.nix b/pkgs/development/libraries/vid-stab/default.nix index d1fe0035641e..66550f31c4eb 100644 --- a/pkgs/development/libraries/vid-stab/default.nix +++ b/pkgs/development/libraries/vid-stab/default.nix @@ -21,6 +21,14 @@ stdenv.mkDerivation { propagatedBuildInputs = lib.optionals stdenv.cc.isClang [ openmp ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required (VERSION 2.8.5)' \ + 'cmake_minimum_required (VERSION 3.10)' + ''; + meta = with lib; { description = "Video stabilization library"; homepage = "http://public.hronopik.de/vid.stab/"; From 6c5697be90125b7a03f00ee75855500f065701a4 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 03:28:11 +0100 Subject: [PATCH 39/54] encfs: fix build with CMake 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deprecated upstream; won’t be fixed there. Co-authored-by: K900 --- pkgs/tools/filesystems/encfs/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/tools/filesystems/encfs/default.nix b/pkgs/tools/filesystems/encfs/default.nix index dcc80c0acca7..7d43131ea403 100644 --- a/pkgs/tools/filesystems/encfs/default.nix +++ b/pkgs/tools/filesystems/encfs/default.nix @@ -10,6 +10,7 @@ fuse, openssl, tinyxml2, + gtest, }: stdenv.mkDerivation rec { @@ -36,6 +37,7 @@ stdenv.mkDerivation rec { fuse openssl tinyxml2 + gtest ]; nativeBuildInputs = [ cmake @@ -49,6 +51,12 @@ stdenv.mkDerivation rec { "-DUSE_INTERNAL_TINYXML=OFF" "-DBUILD_SHARED_LIBS=ON" "-DINSTALL_LIBENCFS=ON" + + # Fix the build with CMake 4. + # + # Upstream is deprecated, so it won’t be fixed there. We should + # probably phase this package out. + "-DCMAKE_POLICY_VERSION_MINIMUM=3.10" ]; meta = with lib; { From b1a62f956da6b55268866d415e65586bfbde904e Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 03:57:46 +0100 Subject: [PATCH 40/54] ldacbt: fix build with CMake 4 Co-authored-by: K900 --- pkgs/by-name/ld/ldacbt/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/ld/ldacbt/package.nix b/pkgs/by-name/ld/ldacbt/package.nix index f92c1f564af8..0de3e7468a4b 100644 --- a/pkgs/by-name/ld/ldacbt/package.nix +++ b/pkgs/by-name/ld/ldacbt/package.nix @@ -31,6 +31,16 @@ stdenv.mkDerivation rec { "-DINSTALL_INCLUDEDIR=${placeholder "dev"}/include" ]; + # Fix the build with CMake 4. + # + # See: + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.0)' \ + 'cmake_minimum_required(VERSION 3.0...3.10)' + ''; + meta = with lib; { description = "AOSP libldac dispatcher"; homepage = "https://github.com/EHfive/ldacBT"; From 9f77ea85a7d20603f6cfae860184dd5ea81019a5 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 03:59:50 +0100 Subject: [PATCH 41/54] xdg-utils-cxx: fix build with CMake 4 Co-authored-by: K900 --- pkgs/by-name/xd/xdg-utils-cxx/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/xd/xdg-utils-cxx/package.nix b/pkgs/by-name/xd/xdg-utils-cxx/package.nix index d5c9e7c9aff8..459ff18a9707 100644 --- a/pkgs/by-name/xd/xdg-utils-cxx/package.nix +++ b/pkgs/by-name/xd/xdg-utils-cxx/package.nix @@ -19,6 +19,14 @@ stdenv.mkDerivation rec { cmake ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.0)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; + meta = with lib; { description = "Implementation of the FreeDesktop specifications to be used in c++ projects"; homepage = "https://github.com/azubieta/xdg-utils-cxx"; From c32cb5177811edd5097c4e84559339727b4bcfe1 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:20:56 +0100 Subject: [PATCH 42/54] ebook_tools: fix build with CMake 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure how to feel about Okular depending on this library that hasn’t been touched since 2012 for EPUB support. Co-authored-by: K900 --- pkgs/by-name/eb/ebook_tools/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/eb/ebook_tools/package.nix b/pkgs/by-name/eb/ebook_tools/package.nix index 8f09811d83fb..63941366f0ca 100644 --- a/pkgs/by-name/eb/ebook_tools/package.nix +++ b/pkgs/by-name/eb/ebook_tools/package.nix @@ -17,6 +17,16 @@ stdenv.mkDerivation rec { sha256 = "1bi7wsz3p5slb43kj7lgb3r6lb91lvb6ldi556k4y50ix6b5khyb"; }; + # Fix the build with CMake 4. + # + # See: + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 2.4.0)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; + nativeBuildInputs = [ cmake pkg-config From ff731f2d16ad56e65a29181615a82471671c236d Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:26:12 +0100 Subject: [PATCH 43/54] olm: fix build with CMake 4 Oh no, not this package again. Co-authored-by: K900 --- pkgs/by-name/ol/olm/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/ol/olm/package.nix b/pkgs/by-name/ol/olm/package.nix index c52415b43dc5..e1eece806206 100644 --- a/pkgs/by-name/ol/olm/package.nix +++ b/pkgs/by-name/ol/olm/package.nix @@ -25,6 +25,11 @@ stdenv.mkDerivation rec { substituteInPlace olm.pc.in \ --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.4)' \ + 'cmake_minimum_required(VERSION 3.10)' '' # Clang 19 has become more strict about assigning to const variables # Patch from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281497 From 46a129b0a92ac80b38d6f5872ff0fe3d8ea3bb49 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:28:51 +0100 Subject: [PATCH 44/54] libebur128: fix build with CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libebur128/package.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/by-name/li/libebur128/package.nix b/pkgs/by-name/li/libebur128/package.nix index c99256063037..283d0dd432d3 100644 --- a/pkgs/by-name/li/libebur128/package.nix +++ b/pkgs/by-name/li/libebur128/package.nix @@ -28,6 +28,20 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace ebur128/libebur128.pc.cmake \ --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + '' + # Fix the build with CMake 4. + # + # See: + # + # * + # * + + '' + for file in CMakeLists.txt test/CMakeLists.txt; do + substituteInPlace "$file" \ + --replace-fail \ + 'cmake_minimum_required(VERSION 2.8.12' \ + 'cmake_minimum_required(VERSION 3.10' + done ''; meta = with lib; { From 5b77b6dbbaa68c9b0a335e62d8823994748b9bbd Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 04:35:14 +0100 Subject: [PATCH 45/54] uavs3d: fix build with CMake 4 Co-authored-by: K900 --- pkgs/by-name/ua/uavs3d/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/ua/uavs3d/package.nix b/pkgs/by-name/ua/uavs3d/package.nix index a0b619896548..085eed38d3ed 100644 --- a/pkgs/by-name/ua/uavs3d/package.nix +++ b/pkgs/by-name/ua/uavs3d/package.nix @@ -32,6 +32,14 @@ stdenv.mkDerivation (finalAttrs: { cmake ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 3.1)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; + passthru = { updateScript = unstableGitUpdater { }; tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; }; From 6be9bf1bd8f2595f3658b53e43fdff9078eff015 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 16:19:12 +0100 Subject: [PATCH 46/54] librdf_raptor2: fix build with CMake 4 Co-authored-by: K900 --- pkgs/development/libraries/librdf/raptor2.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/librdf/raptor2.nix b/pkgs/development/libraries/librdf/raptor2.nix index baad5320b250..a8d63d13125a 100644 --- a/pkgs/development/libraries/librdf/raptor2.nix +++ b/pkgs/development/libraries/librdf/raptor2.nix @@ -54,6 +54,16 @@ stdenv.mkDerivation rec { libxslt ]; + # Fix the build with CMake 4. + # + # See: + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)' \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 3.10)' + ''; + meta = { description = "RDF Parser Toolkit"; mainProgram = "rapper"; From 07ce73515f3af61a22a7837ba515583b1915d218 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Sep 2025 17:19:15 +0100 Subject: [PATCH 47/54] hotdoc: fix build with CMake 4 Co-authored-by: K900 --- pkgs/development/tools/hotdoc/default.nix | 21 +++--- .../tools/hotdoc/fix-cmake-4.patch | 69 +++++++++++++++++++ 2 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/tools/hotdoc/fix-cmake-4.patch diff --git a/pkgs/development/tools/hotdoc/default.nix b/pkgs/development/tools/hotdoc/default.nix index 63393afbb5e7..505182bc06aa 100644 --- a/pkgs/development/tools/hotdoc/default.nix +++ b/pkgs/development/tools/hotdoc/default.nix @@ -112,14 +112,19 @@ buildPythonApplication rec { "test_index" ]; - # Hardcode libclang paths - postPatch = '' - substituteInPlace hotdoc/extensions/c/c_extension.py \ - --replace "shutil.which('llvm-config')" 'True' \ - --replace "subprocess.check_output(['llvm-config', '--version']).strip().decode()" '"${lib.versions.major llvmPackages.libclang.version}"' \ - --replace "subprocess.check_output(['llvm-config', '--prefix']).strip().decode()" '"${lib.getLib llvmPackages.libclang}"' \ - --replace "subprocess.check_output(['llvm-config', '--libdir']).strip().decode()" '"${lib.getLib llvmPackages.libclang}/lib"' - ''; + postPatch = + # Hardcode libclang paths + '' + substituteInPlace hotdoc/extensions/c/c_extension.py \ + --replace "shutil.which('llvm-config')" 'True' \ + --replace "subprocess.check_output(['llvm-config', '--version']).strip().decode()" '"${lib.versions.major llvmPackages.libclang.version}"' \ + --replace "subprocess.check_output(['llvm-config', '--prefix']).strip().decode()" '"${lib.getLib llvmPackages.libclang}"' \ + --replace "subprocess.check_output(['llvm-config', '--libdir']).strip().decode()" '"${lib.getLib llvmPackages.libclang}/lib"' + '' + # + + '' + patch -p1 -d cmark -i ${./fix-cmake-4.patch} + ''; # Make pytest run from a temp dir to have it pick up installed package for cmark preCheck = '' diff --git a/pkgs/development/tools/hotdoc/fix-cmake-4.patch b/pkgs/development/tools/hotdoc/fix-cmake-4.patch new file mode 100644 index 000000000000..d9617793f481 --- /dev/null +++ b/pkgs/development/tools/hotdoc/fix-cmake-4.patch @@ -0,0 +1,69 @@ +From 60cac435fb801b3efce4f85643ac42cef5b22805 Mon Sep 17 00:00:00 2001 +From: Saleem Abdulrasool +Date: Sun, 22 Dec 2019 11:32:37 -0800 +Subject: [PATCH 1/2] build: chmod -x CMakeLists.txt (NFC) + +Remove the unnecessary execute permission on CMakeLists.txt. +--- + CMakeLists.txt | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + mode change 100755 => 100644 CMakeLists.txt + +diff --git a/CMakeLists.txt b/CMakeLists.txt +old mode 100755 +new mode 100644 + +From e922e337bf405b043788dd5febf9957e19d11300 Mon Sep 17 00:00:00 2001 +From: Chris Mayo +Date: Wed, 13 Aug 2025 19:27:03 +0100 +Subject: [PATCH 2/2] CMake 4 compatibility + +All CMake versions older than 3.10 are deprecated. +--- + CMakeLists.txt | 17 ++--------------- + extensions/CMakeLists.txt | 2 +- + 2 files changed, 3 insertions(+), 16 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ff97419f8..83d44f0a3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,12 +1,6 @@ +-cmake_minimum_required(VERSION 2.8.9) ++cmake_minimum_required(VERSION 3.10) + +-# prevent ugly developer warnings because version is set directly, not through project() +-# it should be redone properly by using VERSION in project() if on CMake 3.x +-if(CMAKE_MAJOR_VERSION GREATER 2) +- cmake_policy(SET CMP0048 OLD) +-endif() +- +-project(cmark) ++project(cmark VERSION 0.28.3) + + include("FindAsan.cmake") + +@@ -14,13 +8,6 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + message(FATAL_ERROR "Do not build in-source.\nPlease remove CMakeCache.txt and the CMakeFiles/ directory.\nThen: mkdir build ; cd build ; cmake .. ; make") + endif() + +-set(PROJECT_NAME "cmark") +- +-set(PROJECT_VERSION_MAJOR 0) +-set(PROJECT_VERSION_MINOR 28) +-set(PROJECT_VERSION_PATCH 3) +-set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} ) +- + option(CMARK_TESTS "Build cmark tests and enable testing" ON) + option(CMARK_STATIC "Build static libcmark library" ON) + option(CMARK_SHARED "Build shared libcmark library" ON) +diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt +index e62d1550f..b6a1556e9 100644 +--- a/extensions/CMakeLists.txt ++++ b/extensions/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.8) ++cmake_minimum_required(VERSION 3.10) + set(LIBRARY "cmarkextensions") + set(LIBRARY_SOURCES + core-extensions.c From e6d9ea32822d3bfb35f9b611f2b168ad1fdd9783 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 17 Sep 2025 03:08:58 +0100 Subject: [PATCH 48/54] libcue: fix build with CMake 4 Co-authored-by: K900 --- pkgs/by-name/li/libcue/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/li/libcue/package.nix b/pkgs/by-name/li/libcue/package.nix index b2daf4d239be..f3d92b40afc2 100644 --- a/pkgs/by-name/li/libcue/package.nix +++ b/pkgs/by-name/li/libcue/package.nix @@ -24,6 +24,14 @@ stdenv.mkDerivation rec { flex ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)' \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)' + ''; + doCheck = true; meta = with lib; { From 1c5d485ef2583be5fedda8a1b68737ad483663c8 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 17 Sep 2025 03:57:54 +0100 Subject: [PATCH 49/54] lzfse: fix build with CMake 4 --- pkgs/by-name/lz/lzfse/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/lz/lzfse/package.nix b/pkgs/by-name/lz/lzfse/package.nix index ce89b500accd..9facc49afec3 100644 --- a/pkgs/by-name/lz/lzfse/package.nix +++ b/pkgs/by-name/lz/lzfse/package.nix @@ -18,6 +18,14 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; + # Fix the build with CMake 4. + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'cmake_minimum_required(VERSION 2.8.6)' \ + 'cmake_minimum_required(VERSION 3.10)' + ''; + meta = { homepage = "https://github.com/lzfse/lzfse"; description = "Reference C implementation of the LZFSE compressor"; From 77b73f80712534cf6bb8d2c1c907e1157692f0d1 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Sun, 30 Mar 2025 12:47:15 +0200 Subject: [PATCH 50/54] cmake: 3.31.7 -> 4.1.1 - Update cmake to the latest 4.1.1 release: https://cmake.org/cmake/help/latest/release/4.1.html - FindCurl patch has already been merged: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9900 - Darwin `-rpath` patch is replaced by the binary paths patch - Fix previous patches for a newer source code --- .../cmake/000-nixpkgs-cmake-prefix-path.diff | 10 +-- pkgs/by-name/cm/cmake/001-search-path.diff | 10 +-- .../006-darwin-always-set-runtime-c-flag.diff | 14 ----- .../cm/cmake/007-darwin-bsd-ps-abspath.diff | 20 +++--- ...ore-target-properties-from-pkg-config.diff | 32 ---------- .../cm/cmake/darwin-binary-paths.patch | 61 +++++++++++++++++++ pkgs/by-name/cm/cmake/package.nix | 16 ++--- 7 files changed, 91 insertions(+), 72 deletions(-) delete mode 100644 pkgs/by-name/cm/cmake/006-darwin-always-set-runtime-c-flag.diff delete mode 100644 pkgs/by-name/cm/cmake/008-FindCURL-Add-more-target-properties-from-pkg-config.diff create mode 100644 pkgs/by-name/cm/cmake/darwin-binary-paths.patch diff --git a/pkgs/by-name/cm/cmake/000-nixpkgs-cmake-prefix-path.diff b/pkgs/by-name/cm/cmake/000-nixpkgs-cmake-prefix-path.diff index 4ebdcced055c..8a572fc08320 100644 --- a/pkgs/by-name/cm/cmake/000-nixpkgs-cmake-prefix-path.diff +++ b/pkgs/by-name/cm/cmake/000-nixpkgs-cmake-prefix-path.diff @@ -1,8 +1,8 @@ diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx -index 8840cdcb..c34b7ee9 100644 +index b8d4765692..902c1e5290 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx -@@ -280,6 +280,11 @@ void cmFindBase::FillCMakeEnvironmentPath() +@@ -312,6 +312,11 @@ void cmFindBase::FillCMakeEnvironmentPath() // Add CMAKE_*_PATH environment variables std::string var = cmStrCat("CMAKE_", this->CMakePathName, "_PATH"); paths.AddEnvPrefixPath("CMAKE_PREFIX_PATH"); @@ -15,14 +15,14 @@ index 8840cdcb..c34b7ee9 100644 if (this->CMakePathName == "PROGRAM") { diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx -index 9b51b1ad..6acc676c 100644 +index 6201894fd1..9533862a2b 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx -@@ -2039,6 +2039,7 @@ void cmFindPackageCommand::FillPrefixesCMakeEnvironment() +@@ -2467,6 +2467,7 @@ void cmFindPackageCommand::FillPrefixesCMakeEnvironment() // And now the general CMake environment variables paths.AddEnvPath("CMAKE_PREFIX_PATH"); + paths.AddEnvPath("NIXPKGS_CMAKE_PREFIX_PATH"); - if (this->DebugMode) { + if (this->DebugModeEnabled()) { debugBuffer = cmStrCat(debugBuffer, "CMAKE_PREFIX_PATH env variable " diff --git a/pkgs/by-name/cm/cmake/001-search-path.diff b/pkgs/by-name/cm/cmake/001-search-path.diff index 04ab0847a707..a19681d0d751 100644 --- a/pkgs/by-name/cm/cmake/001-search-path.diff +++ b/pkgs/by-name/cm/cmake/001-search-path.diff @@ -1,8 +1,8 @@ diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake -index b9381c3d7d..5e944640b5 100644 +index e95da44ea4..660fb647f2 100644 --- a/Modules/Platform/UnixPaths.cmake +++ b/Modules/Platform/UnixPaths.cmake -@@ -26,9 +26,6 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH) +@@ -29,9 +29,6 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH) # please make sure to keep Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst # synchronized list(APPEND CMAKE_SYSTEM_PREFIX_PATH @@ -12,7 +12,7 @@ index b9381c3d7d..5e944640b5 100644 # CMake install location "${_CMAKE_INSTALL_DIR}" ) -@@ -47,48 +44,49 @@ endif() +@@ -51,48 +48,49 @@ _cmake_record_install_prefix() # Non "standard" but common install prefixes list(APPEND CMAKE_SYSTEM_PREFIX_PATH @@ -81,10 +81,10 @@ index b9381c3d7d..5e944640b5 100644 # Reminder when adding new locations computed from environment variables # please make sure to keep Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake -index b9e2f17979..ab517cd4a7 100644 +index c56dfaf9ac..403133273c 100644 --- a/Modules/Platform/WindowsPaths.cmake +++ b/Modules/Platform/WindowsPaths.cmake -@@ -70,7 +70,7 @@ endif() +@@ -71,7 +71,7 @@ _cmake_record_install_prefix() if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") # MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set) diff --git a/pkgs/by-name/cm/cmake/006-darwin-always-set-runtime-c-flag.diff b/pkgs/by-name/cm/cmake/006-darwin-always-set-runtime-c-flag.diff deleted file mode 100644 index dc10e6b34231..000000000000 --- a/pkgs/by-name/cm/cmake/006-darwin-always-set-runtime-c-flag.diff +++ /dev/null @@ -1,14 +0,0 @@ -Revert of commit 1af23c4de2c7d58c06171d70b37794b5c860d5f4. ---- b/Modules/Platform/Darwin.cmake -+++ a/Modules/Platform/Darwin.cmake -@@ -47,9 +47,7 @@ - set(CMAKE_SHARED_MODULE_SUFFIX ".so") - set(CMAKE_MODULE_EXISTS 1) - set(CMAKE_DL_LIBS "") -+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") --if(NOT "${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5") -- set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") --endif() - - foreach(lang C CXX OBJC OBJCXX) - set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") diff --git a/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff b/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff index d61019207436..50ebc7c81dfd 100644 --- a/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff +++ b/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff @@ -1,7 +1,8 @@ -diff -ur a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c ---- a/Source/kwsys/ProcessUNIX.c 2024-04-11 07:12:19.000000000 -0700 -+++ b/Source/kwsys/ProcessUNIX.c 2024-05-15 10:41:00.286160616 -0700 -@@ -2501,20 +2501,20 @@ +diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c +index ce6bb7b9cf..9ffc32f039 100644 +--- a/Source/kwsys/ProcessUNIX.c ++++ b/Source/kwsys/ProcessUNIX.c +@@ -2501,20 +2501,20 @@ static pid_t kwsysProcessFork(kwsysProcess* cp, have two integers to store: the pid and then the ppid. */ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__) @@ -27,15 +28,16 @@ diff -ur a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c # define KWSYSPE_PS_FORMAT "%d %d %*[^\n]\n" #endif -diff -ur a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx ---- a/Source/kwsys/SystemInformation.cxx 2024-04-11 07:12:19.000000000 -0700 -+++ b/Source/kwsys/SystemInformation.cxx 2024-05-15 10:40:00.901059278 -0700 -@@ -3884,7 +3884,7 @@ +diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx +index aca032459e..093c9aac0c 100644 +--- a/Source/kwsys/SystemInformation.cxx ++++ b/Source/kwsys/SystemInformation.cxx +@@ -3850,7 +3850,7 @@ long long SystemInformationImplementation::GetProcMemoryUsed() long long memUsed = 0; pid_t pid = getpid(); std::ostringstream oss; - oss << "ps -o rss= -p " << pid; + oss << "@ps@ -o rss= -p " << pid; FILE* file = popen(oss.str().c_str(), "r"); - if (file == nullptr) { + if (!file) { return -1; diff --git a/pkgs/by-name/cm/cmake/008-FindCURL-Add-more-target-properties-from-pkg-config.diff b/pkgs/by-name/cm/cmake/008-FindCURL-Add-more-target-properties-from-pkg-config.diff deleted file mode 100644 index 8dfc354a9c20..000000000000 --- a/pkgs/by-name/cm/cmake/008-FindCURL-Add-more-target-properties-from-pkg-config.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake -index 5ce8a9046b..f7361308b7 100644 ---- a/Modules/FindCURL.cmake -+++ b/Modules/FindCURL.cmake -@@ -239,9 +239,24 @@ if(CURL_FOUND) - IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}") - endif() - -- if(CURL_USE_STATIC_LIBS AND MSVC) -- set_target_properties(CURL::libcurl PROPERTIES -- INTERFACE_LINK_LIBRARIES "normaliz.lib;ws2_32.lib;wldap32.lib") -+ if(PC_CURL_FOUND) -+ if(PC_CURL_LINK_LIBRARIES) -+ set_property(TARGET CURL::libcurl PROPERTY -+ INTERFACE_LINK_LIBRARIES "${PC_CURL_LINK_LIBRARIES}") -+ endif() -+ if(PC_CURL_LDFLAGS_OTHER) -+ set_property(TARGET CURL::libcurl PROPERTY -+ INTERFACE_LINK_OPTIONS "${PC_CURL_LDFLAGS_OTHER}") -+ endif() -+ if(PC_CURL_CFLAGS_OTHER) -+ set_property(TARGET CURL::libcurl PROPERTY -+ INTERFACE_COMPILE_OPTIONS "${PC_CURL_CFLAGS_OTHER}") -+ endif() -+ else() -+ if(CURL_USE_STATIC_LIBS AND MSVC) -+ set_target_properties(CURL::libcurl PROPERTIES -+ INTERFACE_LINK_LIBRARIES "normaliz.lib;ws2_32.lib;wldap32.lib") -+ endif() - endif() - - endif() diff --git a/pkgs/by-name/cm/cmake/darwin-binary-paths.patch b/pkgs/by-name/cm/cmake/darwin-binary-paths.patch new file mode 100644 index 000000000000..b4e84bef22e6 --- /dev/null +++ b/pkgs/by-name/cm/cmake/darwin-binary-paths.patch @@ -0,0 +1,61 @@ +diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake +index 196ab18b0b..31dd4346b1 100644 +--- a/Modules/Platform/Darwin-Initialize.cmake ++++ b/Modules/Platform/Darwin-Initialize.cmake +@@ -16,7 +16,7 @@ + endif() + + if(NOT CMAKE_CROSSCOMPILING) +- execute_process(COMMAND sw_vers -productVersion ++ execute_process(COMMAND @sw_vers@ -productVersion + OUTPUT_VARIABLE _CMAKE_HOST_OSX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() +diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx +index c65587edbe..0a7cc380c3 100644 +--- a/Source/kwsys/SystemInformation.cxx ++++ b/Source/kwsys/SystemInformation.cxx +@@ -3833,7 +3833,7 @@ + } + char const* names[3] = { "Pages wired down:", "Pages active:", nullptr }; + long long values[2] = { 0 }; +- int ierr = GetFieldsFromCommand("vm_stat", names, values); ++ int ierr = GetFieldsFromCommand("@vm_stat@", names, values); + if (ierr) { + return -1; + } +@@ -5586,7 +5586,7 @@ + { + #ifdef __APPLE__ + std::vector args; +- args.push_back("sw_vers"); ++ args.push_back("@sw_vers@"); + args.push_back(arg); + args.push_back(nullptr); + ver = this->RunProcess(args); +diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt +index 15a1e2c0c3..33bb304cf7 100644 +--- a/Tests/CMakeLists.txt ++++ b/Tests/CMakeLists.txt +@@ -1958,7 +1958,7 @@ + if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5) + if(NOT CMake_TEST_XCTest_DEPLOYMENT_TARGET) + execute_process( +- COMMAND sw_vers -productVersion ++ COMMAND @sw_vers@ -productVersion + OUTPUT_VARIABLE OSX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt +index ddc975c202..8ff651fd90 100644 +--- a/Utilities/cmcurl/CMakeLists.txt ++++ b/Utilities/cmcurl/CMakeLists.txt +@@ -127,7 +127,7 @@ + set(OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) + else() + execute_process( +- COMMAND sw_vers -productVersion ++ COMMAND @sw_vers@ -productVersion + OUTPUT_VARIABLE OSX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index 4fac4e38712a..b9e1ab0dfdd4 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -18,6 +18,7 @@ texinfo, xz, zlib, + darwin, isBootstrap ? null, isMinimalBuild ? ( if isBootstrap != null then @@ -48,11 +49,11 @@ stdenv.mkDerivation (finalAttrs: { + lib.optionalString isMinimalBuild "-minimal" + lib.optionalString cursesUI "-cursesUI" + lib.optionalString qt5UI "-qt5UI"; - version = "3.31.7"; + version = "4.1.1"; src = fetchurl { url = "https://cmake.org/files/v${lib.versions.majorMinor finalAttrs.version}/cmake-${finalAttrs.version}.tar.gz"; - hash = "sha256-ptLrHr65kTDf5j71o0DD/bEUMczj18oUhSTBJZJM6mg="; + hash = "sha256-sp9vGXM6oiS3djUHoQikJ+1Ixojh+vIrKcROHDBUkoI="; }; patches = [ @@ -62,8 +63,12 @@ stdenv.mkDerivation (finalAttrs: { # Don't search in non-Nix locations such as /usr, but do search in our libc. ./001-search-path.diff ] - # On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG. - ++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (replaceVars ./darwin-binary-paths.patch { + sw_vers = lib.getExe' darwin.DarwinTools "sw_vers"; + vm_stat = lib.getExe' darwin.system_cmds "vm_stat"; + }) + ] # On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path. ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) ( replaceVars ./007-darwin-bsd-ps-abspath.diff { @@ -71,9 +76,6 @@ stdenv.mkDerivation (finalAttrs: { } ) ++ [ - # Backport of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9900 - # Needed to correctly link curl in pkgsStatic. - ./008-FindCURL-Add-more-target-properties-from-pkg-config.diff # Backport of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11134 # Fixes build against curl 8.16 and later ./009-cmCTestCurl-Avoid-using-undocumented-type-for-CURLOPT_PROXYTYPE-values.diff From 6230af7de6d27c835618ea985cff64330f371715 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 05:46:35 +0100 Subject: [PATCH 51/54] cmake: remove obsolete LLVM feature check workaround This was fixed upstream in CMake 3.30.0 by . --- pkgs/by-name/cm/cmake/package.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index b9e1ab0dfdd4..2eefa0c35d83 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -181,12 +181,6 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_CursesDialog" cursesUI) ]; - # `pkgsCross.musl64.cmake.override { stdenv = pkgsCross.musl64.llvmPackages_16.libcxxStdenv; }` - # fails with `The C++ compiler does not support C++11 (e.g. std::unique_ptr).` - # The cause is a compiler warning `warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]` - # interfering with the feature check. - env.NIX_CFLAGS_COMPILE = "-Wno-unused-command-line-argument"; - # make install attempts to use the just-built cmake preInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' sed -i 's|bin/cmake|${buildPackages.cmakeMinimal}/bin/cmake|g' Makefile From cbca4728ca5bd095badecc4519d1a9ff338619b2 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 05:46:35 +0100 Subject: [PATCH 52/54] cmake: remove obsolete Large File Support flags This was addressed upstream and the linked issue was closed. --- pkgs/by-name/cm/cmake/package.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index 2eefa0c35d83..01cf2265ee65 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -158,11 +158,6 @@ stdenv.mkDerivation (finalAttrs: { "--sphinx-info" "--sphinx-man" ] - # Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568 - ++ lib.optionals stdenv.hostPlatform.is32bit [ - "CFLAGS=-D_FILE_OFFSET_BITS=64" - "CXXFLAGS=-D_FILE_OFFSET_BITS=64" - ] ++ [ "--" # We should set the proper `CMAKE_SYSTEM_NAME`. From f8cbf5c164f000188ac1180bb12b7b6fa5518a17 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 05:46:35 +0100 Subject: [PATCH 53/54] cmake: remove obsolete `-Wno-elaborated-enum-base` This was introduced for LLVM 11 in 982f7228ffd01450338384a81b31f6527d674574, but the package builds fine with LLVM 21 without i. --- pkgs/by-name/cm/cmake/package.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index 01cf2265ee65..a980f7623ddd 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -137,7 +137,6 @@ stdenv.mkDerivation (finalAttrs: { configurePlatforms = [ ]; configureFlags = [ - "CXXFLAGS=-Wno-elaborated-enum-base" "--docdir=share/doc/${finalAttrs.pname}-${finalAttrs.version}" ] ++ ( From 3a2fd9a3e2d9e6409ec8ff4d15904f56e1c37500 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 11 Sep 2025 20:15:06 +0100 Subject: [PATCH 54/54] cmake: drop sequence numbers from patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These aren’t that helpful, since most of the patches don’t have a strict ordering and a lot of them have been dropped anyway. --- ...n-bsd-ps-abspath.diff => darwin-bsd-ps-abspath.patch} | 0 ...CURLOPT_PROXYTYPE-values.diff => fix-curl-8.16.patch} | 0 ...-prefix-path.diff => nixpkgs-cmake-prefix-path.patch} | 0 pkgs/by-name/cm/cmake/package.nix | 9 ++++----- .../cm/cmake/{001-search-path.diff => search-path.patch} | 0 5 files changed, 4 insertions(+), 5 deletions(-) rename pkgs/by-name/cm/cmake/{007-darwin-bsd-ps-abspath.diff => darwin-bsd-ps-abspath.patch} (100%) rename pkgs/by-name/cm/cmake/{009-cmCTestCurl-Avoid-using-undocumented-type-for-CURLOPT_PROXYTYPE-values.diff => fix-curl-8.16.patch} (100%) rename pkgs/by-name/cm/cmake/{000-nixpkgs-cmake-prefix-path.diff => nixpkgs-cmake-prefix-path.patch} (100%) rename pkgs/by-name/cm/cmake/{001-search-path.diff => search-path.patch} (100%) diff --git a/pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff b/pkgs/by-name/cm/cmake/darwin-bsd-ps-abspath.patch similarity index 100% rename from pkgs/by-name/cm/cmake/007-darwin-bsd-ps-abspath.diff rename to pkgs/by-name/cm/cmake/darwin-bsd-ps-abspath.patch diff --git a/pkgs/by-name/cm/cmake/009-cmCTestCurl-Avoid-using-undocumented-type-for-CURLOPT_PROXYTYPE-values.diff b/pkgs/by-name/cm/cmake/fix-curl-8.16.patch similarity index 100% rename from pkgs/by-name/cm/cmake/009-cmCTestCurl-Avoid-using-undocumented-type-for-CURLOPT_PROXYTYPE-values.diff rename to pkgs/by-name/cm/cmake/fix-curl-8.16.patch diff --git a/pkgs/by-name/cm/cmake/000-nixpkgs-cmake-prefix-path.diff b/pkgs/by-name/cm/cmake/nixpkgs-cmake-prefix-path.patch similarity index 100% rename from pkgs/by-name/cm/cmake/000-nixpkgs-cmake-prefix-path.diff rename to pkgs/by-name/cm/cmake/nixpkgs-cmake-prefix-path.patch diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index a980f7623ddd..9880ae6f3d5f 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -59,9 +59,9 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Add NIXPKGS_CMAKE_PREFIX_PATH to cmake which is like CMAKE_PREFIX_PATH # except it is not searched for programs - ./000-nixpkgs-cmake-prefix-path.diff + ./nixpkgs-cmake-prefix-path.patch # Don't search in non-Nix locations such as /usr, but do search in our libc. - ./001-search-path.diff + ./search-path.patch ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ (replaceVars ./darwin-binary-paths.patch { @@ -71,14 +71,13 @@ stdenv.mkDerivation (finalAttrs: { ] # On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path. ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) ( - replaceVars ./007-darwin-bsd-ps-abspath.diff { + replaceVars ./darwin-bsd-ps-abspath.patch { ps = lib.getExe ps; } ) ++ [ # Backport of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11134 - # Fixes build against curl 8.16 and later - ./009-cmCTestCurl-Avoid-using-undocumented-type-for-CURLOPT_PROXYTYPE-values.diff + ./fix-curl-8.16.patch ]; outputs = [ diff --git a/pkgs/by-name/cm/cmake/001-search-path.diff b/pkgs/by-name/cm/cmake/search-path.patch similarity index 100% rename from pkgs/by-name/cm/cmake/001-search-path.diff rename to pkgs/by-name/cm/cmake/search-path.patch