Skip to content

Commit 69351b8

Browse files
authored
clementine, qjson, liblastfm: fix build failure with cmake 4 (#452435)
2 parents ec7f0f4 + e5cb53f commit 69351b8

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

pkgs/applications/audio/clementine/default.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ stdenv.mkDerivation (finalAttrs: {
112112
-e 's,-Wno-unused-private-field,,g'
113113
sed -i CMakeLists.txt \
114114
-e 's,libprotobuf.a,protobuf,g'
115+
116+
# CMake 3.0.0 is deprecated and no longer supported by CMake > 4
117+
# https://github.com/NixOS/nixpkgs/issues/445447
118+
substituteInPlace 3rdparty/{qsqlite,qtsingleapplication,qtiocompressor,qxt}/CMakeLists.txt \
119+
cmake/{ParseArguments.cmake,Translations.cmake} \
120+
tests/CMakeLists.txt gst/moodbar/CMakeLists.txt \
121+
--replace-fail \
122+
"cmake_minimum_required(VERSION 3.0.0)" \
123+
"cmake_minimum_required(VERSION 3.10)"
124+
substituteInPlace 3rdparty/libmygpo-qt5/CMakeLists.txt --replace-fail \
125+
"cmake_minimum_required( VERSION 3.0.0 FATAL_ERROR )" \
126+
"cmake_minimum_required(VERSION 3.10)"
127+
substituteInPlace CMakeLists.txt --replace-fail \
128+
"cmake_policy(SET CMP0053 OLD)" \
129+
""
115130
'';
116131

117132
preConfigure = ''

pkgs/development/libraries/liblastfm/default.nix

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ stdenv.mkDerivation {
3030
})
3131
];
3232

33+
# CMake 2.8.6 is deprecated and no longer supported by CMake > 4
34+
# https://github.com/NixOS/nixpkgs/issues/445447
35+
postPatch = ''
36+
substituteInPlace CMakeLists.txt --replace-fail \
37+
"cmake_minimum_required(VERSION 2.8.6)" \
38+
"cmake_minimum_required(VERSION 3.10)"
39+
'';
40+
3341
nativeBuildInputs = [
3442
pkg-config
3543
which
@@ -41,9 +49,9 @@ stdenv.mkDerivation {
4149
qtbase
4250
];
4351

44-
env.NIX_CFLAGS_COMPILE = lib.optionalString (
45-
stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11"
46-
) "-std=c++11";
52+
env.NIX_CFLAGS_COMPILE =
53+
(lib.optionalString (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") "-std=c++11")
54+
+ (lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-dynamic-exception-spec");
4755

4856
dontWrapQtApps = true;
4957

pkgs/development/libraries/qjson/default.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ stdenv.mkDerivation rec {
1717
sha256 = "1f4wnxzx0qdmxzc7hqk28m0sva7z9p9xmxm6aifvjlp0ha6pmfxs";
1818
};
1919

20+
# CMake 2.8.8 is deprecated and no longer supported by CMake > 4
21+
# https://github.com/NixOS/nixpkgs/issues/445447
22+
postPatch = ''
23+
substituteInPlace CMakeLists.txt --replace-fail \
24+
"CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)" \
25+
"CMAKE_MINIMUM_REQUIRED(VERSION 3.10)"
26+
substituteInPlace CMakeLists.txt --replace-fail \
27+
"cmake_policy(SET CMP0020 OLD)" \
28+
""
29+
'';
30+
31+
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-register";
32+
2033
nativeBuildInputs = [ cmake ];
2134
buildInputs = [ qtbase ];
2235
dontWrapQtApps = true;

0 commit comments

Comments
 (0)