clementine, qjson, liblastfm: fix build failure with cmake 4 (#452435)

This commit is contained in:
Vladimír Čunát
2025-10-19 09:41:26 +00:00
committed by GitHub
3 changed files with 39 additions and 3 deletions
@@ -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 = ''
@@ -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;
@@ -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;