From 50433c5c8f0e78438f7ad4bb4fecc35461076daf Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Tue, 14 Oct 2025 14:39:42 +0800 Subject: [PATCH 1/3] antlr4_9.runtime.cpp: fix build --- .../parsing/antlr/4.9.runtime.cpp.cmake.patch | 20 +++++++++++++++++++ pkgs/development/tools/parsing/antlr/4.nix | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/development/tools/parsing/antlr/4.9.runtime.cpp.cmake.patch diff --git a/pkgs/development/tools/parsing/antlr/4.9.runtime.cpp.cmake.patch b/pkgs/development/tools/parsing/antlr/4.9.runtime.cpp.cmake.patch new file mode 100644 index 000000000000..979e224756e6 --- /dev/null +++ b/pkgs/development/tools/parsing/antlr/4.9.runtime.cpp.cmake.patch @@ -0,0 +1,20 @@ +diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt +index e549f113f..c84f591c2 100644 +--- a/runtime/Cpp/CMakeLists.txt ++++ b/runtime/Cpp/CMakeLists.txt +@@ -28,15 +28,10 @@ project(LIBANTLR4) + if(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR + CMAKE_VERSION VERSION_GREATER "3.0.0") + CMAKE_POLICY(SET CMP0026 NEW) +- CMAKE_POLICY(SET CMP0054 OLD) +- CMAKE_POLICY(SET CMP0045 OLD) +- CMAKE_POLICY(SET CMP0042 OLD) + endif() + + if(CMAKE_VERSION VERSION_EQUAL "3.3.0" OR + CMAKE_VERSION VERSION_GREATER "3.3.0") +- CMAKE_POLICY(SET CMP0059 OLD) +- CMAKE_POLICY(SET CMP0054 OLD) + endif() + + if(CMAKE_SYSTEM_NAME MATCHES "Linux") diff --git a/pkgs/development/tools/parsing/antlr/4.nix b/pkgs/development/tools/parsing/antlr/4.nix index c30d235c4f8e..02fd86abde21 100644 --- a/pkgs/development/tools/parsing/antlr/4.nix +++ b/pkgs/development/tools/parsing/antlr/4.nix @@ -194,9 +194,11 @@ in extraCppBuildInputs = [ utf8cpp ] ++ lib.optional stdenv.hostPlatform.isLinux libuuid; extraCppCmakeFlags = [ (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-I${lib.getDev utf8cpp}/include/utf8cpp") + (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5") ]; extraPatches = [ ./utf8cpp.patch + ./4.9.runtime.cpp.cmake.patch ]; }).antlr; From e6201c941b79002367f87dcbbc07d9f7fb162839 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Tue, 14 Oct 2025 14:42:11 +0800 Subject: [PATCH 2/3] antlr4_10.runtime.cpp: fix build --- .../antlr/4.10.runtime.cpp.cmake.patch | 20 +++++++++++++++++++ pkgs/development/tools/parsing/antlr/4.nix | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/tools/parsing/antlr/4.10.runtime.cpp.cmake.patch diff --git a/pkgs/development/tools/parsing/antlr/4.10.runtime.cpp.cmake.patch b/pkgs/development/tools/parsing/antlr/4.10.runtime.cpp.cmake.patch new file mode 100644 index 000000000000..9dcb2aeb7833 --- /dev/null +++ b/pkgs/development/tools/parsing/antlr/4.10.runtime.cpp.cmake.patch @@ -0,0 +1,20 @@ +diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt +index 302cd4a78..336a37bf0 100644 +--- a/runtime/Cpp/CMakeLists.txt ++++ b/runtime/Cpp/CMakeLists.txt +@@ -30,15 +30,10 @@ project(LIBANTLR4) + if(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR + CMAKE_VERSION VERSION_GREATER "3.0.0") + CMAKE_POLICY(SET CMP0026 NEW) +- CMAKE_POLICY(SET CMP0054 OLD) +- CMAKE_POLICY(SET CMP0045 OLD) +- CMAKE_POLICY(SET CMP0042 OLD) + endif() + + if(CMAKE_VERSION VERSION_EQUAL "3.3.0" OR + CMAKE_VERSION VERSION_GREATER "3.3.0") +- CMAKE_POLICY(SET CMP0059 OLD) +- CMAKE_POLICY(SET CMP0054 OLD) + endif() + + if(CMAKE_SYSTEM_NAME MATCHES "Linux") diff --git a/pkgs/development/tools/parsing/antlr/4.nix b/pkgs/development/tools/parsing/antlr/4.nix index 02fd86abde21..a3519c641534 100644 --- a/pkgs/development/tools/parsing/antlr/4.nix +++ b/pkgs/development/tools/parsing/antlr/4.nix @@ -184,6 +184,9 @@ in (lib.cmakeBool "ANTLR4_INSTALL" true) (lib.cmakeBool "ANTLR_BUILD_CPP_TESTS" false) ]; + extraPatches = [ + ./4.10.runtime.cpp.cmake.patch + ]; }).antlr; antlr4_9 = From 8ee65f821acf1853024e36722fe3cdcaa7b16b29 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Tue, 14 Oct 2025 14:43:46 +0800 Subject: [PATCH 3/3] antlr4_11.runtime.cpp: fix build --- .../antlr/4.11.runtime.cpp.cmake.patch | 20 +++++++++++++++++++ pkgs/development/tools/parsing/antlr/4.nix | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch diff --git a/pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch b/pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch new file mode 100644 index 000000000000..6c40a1bf9633 --- /dev/null +++ b/pkgs/development/tools/parsing/antlr/4.11.runtime.cpp.cmake.patch @@ -0,0 +1,20 @@ +diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt +index df621b11d..c20b92170 100644 +--- a/runtime/Cpp/CMakeLists.txt ++++ b/runtime/Cpp/CMakeLists.txt +@@ -39,15 +39,10 @@ project(LIBANTLR4) + if(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR + CMAKE_VERSION VERSION_GREATER "3.0.0") + CMAKE_POLICY(SET CMP0026 NEW) +- CMAKE_POLICY(SET CMP0054 OLD) +- CMAKE_POLICY(SET CMP0045 OLD) +- CMAKE_POLICY(SET CMP0042 OLD) + endif() + + if(CMAKE_VERSION VERSION_EQUAL "3.3.0" OR + CMAKE_VERSION VERSION_GREATER "3.3.0") +- CMAKE_POLICY(SET CMP0059 OLD) +- CMAKE_POLICY(SET CMP0054 OLD) + endif() + + if(APPLE) diff --git a/pkgs/development/tools/parsing/antlr/4.nix b/pkgs/development/tools/parsing/antlr/4.nix index a3519c641534..6398c8eed341 100644 --- a/pkgs/development/tools/parsing/antlr/4.nix +++ b/pkgs/development/tools/parsing/antlr/4.nix @@ -172,6 +172,9 @@ in # not available in a sandboxed build. (lib.cmakeBool "ANTLR_BUILD_CPP_TESTS" false) ]; + extraPatches = [ + ./4.11.runtime.cpp.cmake.patch + ]; }).antlr; antlr4_10 =