-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
clementine, qjson, liblastfm: fix build failure with cmake 4 #452435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)" \ | ||
| "" | ||
|
Comment on lines
+116
to
+129
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Damn! This is a lot... Kudos for going to these lengths. With multiple 3rd-party deps i did accept the cmake flag as a shortcut in the past, but this is certainly a way XD |
||
| ''; | ||
|
|
||
| preConfigure = '' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,14 @@ stdenv.mkDerivation { | |
| }) | ||
| ]; | ||
|
|
||
| # CMake 2.8.6 is deprecated and no longer supported by CMake > 4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| # 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; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,19 @@ stdenv.mkDerivation rec { | |
| sha256 = "1f4wnxzx0qdmxzc7hqk28m0sva7z9p9xmxm6aifvjlp0ha6pmfxs"; | ||
| }; | ||
|
|
||
| # CMake 2.8.8 is deprecated and no longer supported by CMake > 4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am surprised this even still builds... Upstream claims build failures e.g. in flavio/qjson@1105e53... That said, upstream does not have a fix for cmake 4 yet, so a substitute seems to make sense. |
||
| # 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; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream did some cmake cleanup in clementine-player/Clementine@fe3599c, but did not actually bump the
cmake_minimum_required, so an update won't fix and there is no commits to fetch.clementine-player/Clementine#7402 does technically exist, but the upstream CI failing across the board is concerning. It may still make sense to link it, but
substituteInPlacereally does seem like it is the best way.