From 1dfb24cf6c47c49d77891b3de41cf5d315961ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 15 Oct 2025 16:02:20 -0700 Subject: [PATCH 1/3] liblastfm: fix build failure with cmake 4 - CMake 4 is no longer retro compatible with versions < 3.5 --- pkgs/development/libraries/liblastfm/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix index 7530d998e51e..5eba0b261380 100644 --- a/pkgs/development/libraries/liblastfm/default.nix +++ b/pkgs/development/libraries/liblastfm/default.nix @@ -30,6 +30,14 @@ stdenv.mkDerivation { }) ]; + # CMake 2.8.6 is deprecated and no longer supported by CMake > 4 + # https://github.com/NixOS/nixpkgs/issues/445447 + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "cmake_minimum_required(VERSION 2.8.6)" \ + "cmake_minimum_required(VERSION 3.10)" + ''; + nativeBuildInputs = [ pkg-config which @@ -41,9 +49,9 @@ stdenv.mkDerivation { qtbase ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString ( - stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11" - ) "-std=c++11"; + env.NIX_CFLAGS_COMPILE = + (lib.optionalString (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") "-std=c++11") + + (lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-dynamic-exception-spec"); dontWrapQtApps = true; From 07f6c622888edfada9b7c220316749be4c09a8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 15 Oct 2025 16:02:36 -0700 Subject: [PATCH 2/3] qjson: fix build failure with cmake 4 - CMake 4 is no longer retro compatible with versions < 3.5 - Policy CMP0053 may not be set to OLD behavior because this version of CMake no longer supports it. The policy was introduced in CMake version 3.1.0, and use of NEW behavior is now required. --- pkgs/development/libraries/qjson/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/libraries/qjson/default.nix b/pkgs/development/libraries/qjson/default.nix index 4edb927e2213..2ac2bb4ff56a 100644 --- a/pkgs/development/libraries/qjson/default.nix +++ b/pkgs/development/libraries/qjson/default.nix @@ -17,6 +17,19 @@ stdenv.mkDerivation rec { sha256 = "1f4wnxzx0qdmxzc7hqk28m0sva7z9p9xmxm6aifvjlp0ha6pmfxs"; }; + # CMake 2.8.8 is deprecated and no longer supported by CMake > 4 + # https://github.com/NixOS/nixpkgs/issues/445447 + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)" \ + "CMAKE_MINIMUM_REQUIRED(VERSION 3.10)" + substituteInPlace CMakeLists.txt --replace-fail \ + "cmake_policy(SET CMP0020 OLD)" \ + "" + ''; + + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-register"; + nativeBuildInputs = [ cmake ]; buildInputs = [ qtbase ]; dontWrapQtApps = true; From e5cb53f643429ce434a43b090b76c4677f34670c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 15 Oct 2025 16:25:06 -0700 Subject: [PATCH 3/3] clementine: fix build failure with cmake 4 - CMake 4 is no longer retro compatible with versions < 3.5 - Policy CMP0053 may not be set to OLD behavior because this version of CMake no longer supports it. The policy was introduced in CMake version 3.1.0, and use of NEW behavior is now required. --- pkgs/applications/audio/clementine/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/applications/audio/clementine/default.nix b/pkgs/applications/audio/clementine/default.nix index 2e886cb44a12..f259950ecb67 100644 --- a/pkgs/applications/audio/clementine/default.nix +++ b/pkgs/applications/audio/clementine/default.nix @@ -112,6 +112,21 @@ stdenv.mkDerivation (finalAttrs: { -e 's,-Wno-unused-private-field,,g' sed -i CMakeLists.txt \ -e 's,libprotobuf.a,protobuf,g' + + # CMake 3.0.0 is deprecated and no longer supported by CMake > 4 + # https://github.com/NixOS/nixpkgs/issues/445447 + substituteInPlace 3rdparty/{qsqlite,qtsingleapplication,qtiocompressor,qxt}/CMakeLists.txt \ + cmake/{ParseArguments.cmake,Translations.cmake} \ + tests/CMakeLists.txt gst/moodbar/CMakeLists.txt \ + --replace-fail \ + "cmake_minimum_required(VERSION 3.0.0)" \ + "cmake_minimum_required(VERSION 3.10)" + substituteInPlace 3rdparty/libmygpo-qt5/CMakeLists.txt --replace-fail \ + "cmake_minimum_required( VERSION 3.0.0 FATAL_ERROR )" \ + "cmake_minimum_required(VERSION 3.10)" + substituteInPlace CMakeLists.txt --replace-fail \ + "cmake_policy(SET CMP0053 OLD)" \ + "" ''; preConfigure = ''