From 838c1fde159893b8fd59fac25318c3982831d739 Mon Sep 17 00:00:00 2001 From: Rafael Ieda Date: Fri, 24 Oct 2025 23:24:33 -0300 Subject: [PATCH] t4kcommon: fix build with cmake4 Co-authored-by: Michael Daniels --- pkgs/by-name/t4/t4kcommon/linebreak-fix.patch | 17 +++++++++++++++++ pkgs/by-name/t4/t4kcommon/package.nix | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/by-name/t4/t4kcommon/linebreak-fix.patch diff --git a/pkgs/by-name/t4/t4kcommon/linebreak-fix.patch b/pkgs/by-name/t4/t4kcommon/linebreak-fix.patch new file mode 100644 index 000000000000..a13cdd4a917e --- /dev/null +++ b/pkgs/by-name/t4/t4kcommon/linebreak-fix.patch @@ -0,0 +1,17 @@ +--- a/src/linebreak/CMakeLists.txt ++++ b/src/linebreak/CMakeLists.txt +@@ -72,12 +72,12 @@ + ${LINEBREAK_BINARY_DIR} + ${LINEBREAK_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}) +- ++add_library(linebreak STATIC ${LINEBREAK_SOURCES} ${LINEBREAK_HEADERS}) + if (ICONV_FOUND) + include_directories(${ICONV_INCLUDE_DIR}) + target_link_libraries(linebreak ${ICONV_LIBRARY}) + endif (ICONV_FOUND) +-add_library(linebreak STATIC ${LINEBREAK_SOURCES} ${LINEBREAK_HEADERS}) ++ + + #project_source_group("${GROUP_CODE}" LINEBREAK_SOURCES LINEBREAK_HEADERS) + diff --git a/pkgs/by-name/t4/t4kcommon/package.nix b/pkgs/by-name/t4/t4kcommon/package.nix index 956002f5a0e7..f59e0309260d 100644 --- a/pkgs/by-name/t4/t4kcommon/package.nix +++ b/pkgs/by-name/t4/t4kcommon/package.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { url = "https://salsa.debian.org/tux4kids-pkg-team/t4kcommon/raw/f7073fa384f5a725139f54844e59b57338b69dc7/debian/patches/libpng16.patch"; hash = "sha256-auQ8VvOyvLE1PD2dfeHZJV+MzIt1OtUa7OcOqsXTAYI="; }) + # Fix "Cannot specify link libraries for target "linebreak" which is not built by this project." + ./linebreak-fix.patch ]; # Workaround build failure on -fno-common toolchains like upstream @@ -55,6 +57,11 @@ stdenv.mkDerivation rec { libxml2 ]; + postPatch = '' + substituteInPlace {src/,./}CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 2.6)" "cmake_minimum_required(VERSION 3.10)" + ''; + meta = with lib; { description = "Library of code shared between tuxmath and tuxtype"; homepage = "https://github.com/tux4kids/t4kcommon";