graphite2: Fix build with cmake 4.0 or later

This commit is contained in:
Alexander von Gluck IV
2025-08-26 09:28:50 -05:00
parent e1feba80e1
commit a078143149
2 changed files with 132 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ complex non-Roman writing systems."
HOMEPAGE="http://graphite.sil.org/"
COPYRIGHT="2010-2018 SIL International"
LICENSE="GNU LGPL v2.1"
REVISION="3"
REVISION="4"
SOURCE_URI="https://github.com/silnrsi/graphite/releases/download/$portVersion/graphite2-$portVersion.tgz"
CHECKSUM_SHA256="f99d1c13aa5fa296898a181dff9b82fb25f6cc0933dbaa7a475d8109bd54209d"
PATCHES="graphite2-$portVersion.patchset"

View File

@@ -42,3 +42,134 @@ index 389cf5a..d26edf9 100644
--
2.19.1
From 9c1058e4a851f29ae82a80a4e3578b620c2ea03d Mon Sep 17 00:00:00 2001
From: 2876225417 <2876225417@qq.com>
Date: Thu, 19 Jun 2025 15:59:11 +0800
Subject: [PATCH] Fix(tests): Add missing <cstdint> for modern compilers
---
tests/featuremap/featuremaptest.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/featuremap/featuremaptest.cpp b/tests/featuremap/featuremaptest.cpp
index 5eb240c8..c919dc1e 100644
--- a/tests/featuremap/featuremaptest.cpp
+++ b/tests/featuremap/featuremaptest.cpp
@@ -9,6 +9,10 @@
#include <string>
#include <vector>
+#include <cstdint>
+
+
+
#include <graphite2/Font.h>
#include "inc/Endian.h"
--
2.19.1
From bdcefa044ed5828588a24dad28db6764f96d1a87 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <alex@terarocket.io>
Date: Tue, 26 Aug 2025 09:24:28 -0500
Subject: [PATCH] CMake: Raise required version to 3.5
Modified patch of original by Heiko Becker
CMake >= 4.0.0 removed compatibility with versions < 3.5 and errors
out with such versions passed to cmake_minimum_required().
Furthermore at least 3.1 was already required, because that's the
version, which introduced CXX_STANDARD{,_REQUIRED}.
Also remove the FATAL_ERROR part, which has been ignored since 2.6. and
CMP0012 is now implicitly assumed to be NEW already.
---
CMakeLists.txt | 3 +--
gr2fonttest/CMakeLists.txt | 2 +-
src/CMakeLists.txt | 3 +--
tests/bittwiddling/CMakeLists.txt | 2 +-
tests/json/CMakeLists.txt | 2 +-
tests/sparsetest/CMakeLists.txt | 2 +-
tests/utftest/CMakeLists.txt | 2 +-
7 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 496712d..5b1f90e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
-cmake_policy(SET CMP0012 NEW)
+cmake_minimum_required(VERSION 3.5.0)
include(TestBigEndian)
find_package(PythonInterp 3.6)
project(graphite2)
diff --git a/gr2fonttest/CMakeLists.txt b/gr2fonttest/CMakeLists.txt
index f995dd3..5e1ea26 100644
--- a/gr2fonttest/CMakeLists.txt
+++ b/gr2fonttest/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5.0)
project(gr2fonttest)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b6ac26b..dd4fffa 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,9 +19,8 @@
# Suite 500, Boston, MA 02110-1335, USA or visit their web page on the
# internet at http://www.fsf.org/licenses/lgpl.html.
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5.0)
project(graphite2_core)
-cmake_policy(SET CMP0012 NEW)
INCLUDE(CheckCXXSourceCompiles)
set(GRAPHITE_API_CURRENT 3)
diff --git a/tests/bittwiddling/CMakeLists.txt b/tests/bittwiddling/CMakeLists.txt
index 372b4ac..a7cd01d 100644
--- a/tests/bittwiddling/CMakeLists.txt
+++ b/tests/bittwiddling/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5.0)
project(bits)
include(Graphite)
include_directories(${graphite2_core_SOURCE_DIR})
diff --git a/tests/json/CMakeLists.txt b/tests/json/CMakeLists.txt
index ae33427..cad0aae 100644
--- a/tests/json/CMakeLists.txt
+++ b/tests/json/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5.0)
project(jsontest)
include(Graphite)
include_directories(${graphite2_core_SOURCE_DIR})
diff --git a/tests/sparsetest/CMakeLists.txt b/tests/sparsetest/CMakeLists.txt
index 3bfdc0c..8c1583e 100644
--- a/tests/sparsetest/CMakeLists.txt
+++ b/tests/sparsetest/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5.0)
project(sparsetest)
include(Graphite)
include_directories(${graphite2_core_SOURCE_DIR})
diff --git a/tests/utftest/CMakeLists.txt b/tests/utftest/CMakeLists.txt
index dc50ca4..94f8eb5 100644
--- a/tests/utftest/CMakeLists.txt
+++ b/tests/utftest/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5.0)
project(utftest)
include(Graphite)
include_directories(${graphite2_core_SOURCE_DIR})
--
2.51.0