Skip to content

Commit 3fa29e3

Browse files
committed
lmms: fix cmake 4 compatibility
1 parent f34c8dc commit 3fa29e3

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

pkgs/applications/audio/lmms/default.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,21 @@ mkDerivation rec {
7070
})
7171
];
7272

73-
cmakeFlags = [ "-DWANT_QT5=ON" ];
73+
prePatch = ''
74+
# Update CMake minimum required version and policies
75+
substituteInPlace CMakeLists.txt --replace 'CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)' 'CMAKE_MINIMUM_REQUIRED(VERSION 3.5)'
76+
substituteInPlace CMakeLists.txt --replace 'CMAKE_POLICY(SET CMP0026 OLD)' 'CMAKE_POLICY(SET CMP0026 NEW)'
77+
substituteInPlace CMakeLists.txt --replace 'CMAKE_POLICY(SET CMP0050 OLD)' 'CMAKE_POLICY(SET CMP0050 NEW)'
78+
substituteInPlace CMakeLists.txt --replace 'GET_TARGET_PROPERTY(BIN2RES bin2res LOCATION)' 'SET(BIN2RES $<TARGET_FILE:bin2res>)'
79+
'';
80+
81+
cmakeFlags = [
82+
"-DWANT_QT5=ON"
83+
]
84+
++ lib.optionals (lib.versionOlder version "11.4") [
85+
# Fix the build with CMake 4.
86+
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
87+
];
7488

7589
meta = with lib; {
7690
description = "DAW similar to FL Studio (music production software)";

0 commit comments

Comments
 (0)