Unverified Commit 68d475d4 authored by Grimmauld's avatar Grimmauld Committed by GitHub
Browse files

lomiri.*: Fix CMake 4 compat (#450821)

parents 21a754e8 6ef09c00
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -2,10 +2,12 @@
  stdenv,
  lib,
  fetchFromGitLab,
  fetchpatch2,
  gitUpdater,
  testers,
  boost186,
  cmake,
  ctestCheckHook,
  dbus,
  doxygen,
  graphviz,
@@ -35,6 +37,16 @@ stdenv.mkDerivation (finalAttrs: {
    "examples"
  ];

  patches = [
    # Provide more information when there's an issue in AsyncExecutionLoadTest.RepeatedlyInvokingAnAsyncFunctionWorks
    # Remove when version > 5.0.5
    (fetchpatch2 {
      name = "0001-dbus-cpp-tests-async_execution_load_test-Print-received-error-on-DBus-method-failure.name";
      url = "https://gitlab.com/ubports/development/core/lib-cpp/dbus-cpp/-/commit/8390ce83153c2ae29f21afd2bf5e79e88c59e6d9.diff";
      hash = "sha256-js2nXT7eG9dcX+yoFMNRVlamQxsbJclmKTX6/5RxxM4=";
    })
  ];

  postPatch = ''
    substituteInPlace doc/CMakeLists.txt \
      --replace-fail 'DESTINATION share/''${CMAKE_PROJECT_NAME}/doc' 'DESTINATION ''${CMAKE_INSTALL_DOCDIR}'
@@ -71,6 +83,7 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  nativeCheckInputs = [
    ctestCheckHook
    dbus
  ];

@@ -87,6 +100,12 @@ stdenv.mkDerivation (finalAttrs: {
  # DBus, parallelism messes with communication
  enableParallelChecking = false;

  disabledTests = [
    # Possible memory corruption in Executor.TimeoutsAreHandledCorrectly
    # https://gitlab.com/ubports/development/core/lib-cpp/dbus-cpp/-/issues/10
    "executor_test"
  ];

  preFixup = ''
    moveToOutput libexec/examples $examples
  '';
+11 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchFromGitLab,
  fetchpatch2,
  testers,
  gitUpdater,
  cmake,
@@ -30,6 +31,16 @@ stdenv.mkDerivation (finalAttrs: {
    "dev"
  ];

  patches = [
    # Fix compat with CMake 4
    # Remove when version > 3.0.2
    (fetchpatch2 {
      name = "0001-process-cpp-Bump-cmake_minimum_required-to-version-3.10.patch";
      url = "https://gitlab.com/ubports/development/core/lib-cpp/process-cpp/-/commit/c374b62cb79d668505c1c8dc55edddc938a573ba.diff";
      hash = "sha256-2H6f+EAR7p4mb0ReNl8LaosPVF/CNRm+PiYV7tkOQ/w=";
    })
  ];

  postPatch = ''
    substituteInPlace data/process-cpp.pc.in \
      --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \
+2 −12
Original line number Diff line number Diff line
@@ -14,25 +14,15 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "properties-cpp";
  version = "0.0.3";
  version = "0.0.4";

  src = fetchFromGitLab {
    owner = "ubports";
    repo = "development/core/lib-cpp/properties-cpp";
    rev = finalAttrs.version;
    hash = "sha256-C/BDEuKNMQHOjATO5aWBptjIlgfv6ykzjFAsHb6uP3Q=";
    hash = "sha256-rxv2SPTXubaIBlDZixBZ88wqM7pxY03dVhRVImcDZtA=";
  };

  postPatch = ''
    # GTest needs C++17
    # Remove when https://gitlab.com/ubports/development/core/lib-cpp/properties-cpp/-/merge_requests/3 merged & in release
    substituteInPlace CMakeLists.txt \
      --replace-fail 'std=c++14' 'std=c++17'
  ''
  + lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
    sed -i "/add_subdirectory(tests)/d" CMakeLists.txt
  '';

  strictDeps = true;

  nativeBuildInputs = [
+25 −1
Original line number Diff line number Diff line
@@ -37,6 +37,15 @@ let
        rev = "3179d35694a28267a0b6273fc9b5bdce3b6b1235";
        hash = "sha256-XvqqDXaFclWK/XpIxOqAXQ9gcc/dTljl841CN0KrlyA=";
      };

      # CMake 4 compat
      postPatch = ''
        substituteInPlace CMakeLists.txt \
          --replace-fail 'cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)' 'cmake_minimum_required(VERSION 3.10 FATAL_ERROR)'

        substituteInPlace td/generate/tl-parser/CMakeLists.txt \
          --replace-fail 'cmake_minimum_required(VERSION 3.0 FATAL_ERROR)' 'cmake_minimum_required(VERSION 3.10 FATAL_ERROR)'
      '';
    }
  );
in
@@ -59,6 +68,19 @@ stdenv.mkDerivation (finalAttrs: {
      hash = "sha256-zxxFvoj6jluGPCA9GQsxuYYweaSOVrkD01hZwCtq52U=";
    })

    # Fix CMake 4 compatibility
    # Remove when version > 1.21
    (fetchpatch {
      name = "0002-teleports-CMakeLists.txt-Support-building-with-CMake-4.patch";
      url = "https://gitlab.com/ubports/development/apps/teleports/-/commit/ffb4e745889a473a208a86a29b7e439129930b01.patch";
      hash = "sha256-EdcCHH/0Zq8wcF6UPyvy16wntDeSqTV9LWQat91LNRo=";
    })
    (fetchpatch {
      name = "0003-teleports-libs-qtdlib-CMakeLists.txt-Support-building-with-CMake-4.patch";
      url = "https://gitlab.com/ubports/development/apps/teleports/-/commit/fe7f0cb304ddaefae9f97917d3edc89de5f21b1f.patch";
      hash = "sha256-yIc/l6iHb5qWI0QZOx8Hhd0lgEYyPozL+AjrmF2L89k=";
    })

    # Remove when https://gitlab.com/ubports/development/apps/teleports/-/merge_requests/586 merged & in release
    ./1001-app-CMakeLists.txt-Drop-explicit-dependency-on-rlottie.patch
  ];
@@ -101,7 +123,7 @@ stdenv.mkDerivation (finalAttrs: {
    quazip
    quickflux
    rlottie
    tdlib-1811
    finalAttrs.passthru.tdlib
  ];

  postInstall = ''
@@ -115,6 +137,8 @@ stdenv.mkDerivation (finalAttrs: {
  '';

  passthru = {
    tdlib = tdlib-1811;

    updateScript = gitUpdater { rev-prefix = "v"; };
    tests.vm = nixosTests.teleports;
  };
+37 −0
Original line number Diff line number Diff line
From 3dea0cc91b579de5e2c9db811f2e9e34079d3733 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Mon, 1 Sep 2025 13:22:26 +0200
Subject: [PATCH] {CMakeLists.txt,cmake/GtkDocScanGObjWrapper.cmake}: Bump
 cmake_minimum_required() to version 3.10.

---
 CMakeLists.txt                    | 2 +-
 cmake/GtkDocScanGObjWrapper.cmake | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fbff8a..e7b863e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.10)
 project(geonames VERSION 0.3.1 LANGUAGES C)
 
 include(GNUInstallDirs)
diff --git a/cmake/GtkDocScanGObjWrapper.cmake b/cmake/GtkDocScanGObjWrapper.cmake
index b187ebb..b026ed0 100644
--- a/cmake/GtkDocScanGObjWrapper.cmake
+++ b/cmake/GtkDocScanGObjWrapper.cmake
@@ -20,7 +20,7 @@
 
 # This is needed for find_package(PkgConfig) to work correctly --
 # CMAKE_MINIMUM_REQUIRED_VERSION needs to be defined.
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.10)
 
 if(NOT APPLE)
     # We use pkg-config to find glib et al
-- 
GitLab
Loading