From cc777d7ee4ab8dcdf0d9738ab7b03423d381ac50 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 8 Jan 2026 02:18:37 -0500 Subject: [PATCH] new blfs: media-gfx/graphite2-1.3.14 --- media-gfx/graphite2-1.3.14.PKGBUILD | 59 ++++++++++ ...phite2-1.3.14-fix-cmake-files-libdir.patch | 13 +++ ...phite2-1.3.14-fix-nodefaultlibs-deux.patch | 105 ++++++++++++++++++ .../graphite2-1.3.14-fix-nodefaultlibs.patch | 26 +++++ .../graphite2-1.3.14-gcc15.patch | 29 +++++ .../graphite2-1.3.14-no-libtool-file.patch | 68 ++++++++++++ ...2-1.3.14_p20210810-cmake-findpython3.patch | 95 ++++++++++++++++ ....3.14_p20210810-cmake-minreqver-3.16.patch | 96 ++++++++++++++++ .../graphite2-1.3.14_p20210810-cmake4.patch | 93 ++++++++++++++++ .../graphite2-1.3.5-fix-gcc-linking.patch | 17 +++ 10 files changed, 601 insertions(+) create mode 100644 media-gfx/graphite2-1.3.14.PKGBUILD create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-cmake-files-libdir.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs-deux.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14-gcc15.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14-no-libtool-file.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-findpython3.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-minreqver-3.16.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake4.patch create mode 100644 media-gfx/graphite2-1.3.14/graphite2-1.3.5-fix-gcc-linking.patch diff --git a/media-gfx/graphite2-1.3.14.PKGBUILD b/media-gfx/graphite2-1.3.14.PKGBUILD new file mode 100644 index 0000000..8e2ac40 --- /dev/null +++ b/media-gfx/graphite2-1.3.14.PKGBUILD @@ -0,0 +1,59 @@ +pkgname=graphite2 +pkgver=1.3.14 +arch=('x86_64') +homepage="https://graphite.sil.org/" +pkgdesc="a \"smart font\" system to handle the complexities of lesser-known languages of the world" +license=('LGPL-2.1-or-later OR MPL-2.0 OR GPL-2.0-or-later') +depends=('gcc' 'glibc') +_patches=("graphite2-1.3.14-fix-cmake-files-libdir.patch" + "graphite2-1.3.14-no-libtool-file.patch" + "graphite2-1.3.14-fix-nodefaultlibs-deux.patch" + "graphite2-1.3.14-fix-nodefaultlibs.patch" + "graphite2-1.3.5-fix-gcc-linking.patch" + "graphite2-1.3.14-gcc15.patch" + "graphite2-1.3.14_p20210810-cmake-findpython3.patch" + "graphite2-1.3.14_p20210810-cmake-minreqver-3.16.patch" +) +_patch_sums=("63419840415e7df9c9d8fd257d6ad85a" + "91c6f43f2f61f3f1427485e6898da562" + "1d4ac3863efc426f3df269ff063fdd84" + "e22b5e6306d042e03b6180636e45c857" + "487a20652b53a9af76e8fefe180d87e2" + "494ea9f8d0e3ee094d18d507225a25c0" + "6790fdb031c855fb959499f3a4b55991" + "9d4999373dd822fe4b1b8550073f2fa8" +) +sources=("${pkgname}-${pkgver}.tgz" + ${_patches[@]} +) +urls=("https://github.com/silnrsi/graphite/releases/download/${pkgver}/${sources[0]}" + ${_patches[@]} +) +md5sums=("1bccb985a7da01092bfb53bb5041e836" + ${_patch_sums[@]} +) + +src_prepare() { + tar -xzf ${distdir}/${sources[0]} --strip-components=1 + for _patch in ${_patches[@]}; do + patch -p1 -i ${filedir}/${_patch} + done +} + +src_build() { + local cmake_args=( + -DCMAKE_BUILD_TYPE=None + -DCMAKE_INSTALL_PREFIX=/usr + -DCMAKE_SKIP_INSTALL_RPATH=ON + -DGRAPHITE2_COMPARE_RENDERER=OFF + ) + cmake -B build "${cmake_args[@]}" + cmake --build build +} + +src_install() { + DESTDIR="$pkgdir" cmake --install build + install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}" +} + +# vim:ft=sh syn=sh et sw=2: diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-cmake-files-libdir.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-cmake-files-libdir.patch new file mode 100644 index 0000000..d4ae984 --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-cmake-files-libdir.patch @@ -0,0 +1,13 @@ +Fix CMake install path. Noticed as part of the SSP patch (which we handle in +the ebuild instead). + +https://git.alpinelinux.org/aports/tree/main/graphite2/cmake.patch?h=3.15-stable +https://bugs.gentoo.org/829690 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -156,4 +152,4 @@ endif() + + + install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin) +-install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_) ++install(EXPORT graphite2 DESTINATION lib${LIB_SUFFIX}/cmake/graphite2 NAMESPACE gr2_) diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs-deux.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs-deux.patch new file mode 100644 index 0000000..64fcfd6 --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs-deux.patch @@ -0,0 +1,105 @@ +https://bugs.gentoo.org/870034 +https://bugs.gentoo.org/829690 +https://github.com/silnrsi/graphite/pull/44. +https://raw.githubusercontent.com/chimera-linux/cports/6d3cabd18bac6f4caaea08eaa928840552711c0c/main/graphite2/patches/clang.patch + +Obsoletes graphite2-1.3.14-fix-nodefaultlibs.patch whose description was: +""" +Drop -nodefaultlibs: +- graphite is written in C++ which makes avoiding libstdc++ (or libc++) a dubious + goal; +- this ends up breaking e.g. x86/musl because we need to inject -lssp_nonshared, + but it wouldn't be surprising if it broke other exotic targets too. +""" + +This patch is based on the linked one above from Chimera Linux. We have +to adapt it a bit because GCC lacks -nostdlib++. + +Quoting it: +"Clang has -nostdlib++, which can be used more effectively than disabling +all and then hardcoding linking against libgcc (which we do not have)" +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -105,7 +105,6 @@ set_target_properties(graphite2 PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}" + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + set_target_properties(graphite2 PROPERTIES + COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" +- LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" + LINKER_LANGUAGE C) + if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86") + add_definitions(-mfpmath=sse -msse2) +@@ -114,22 +113,32 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + add_definitions(-Wno-class-memaccess -Wdouble-promotion) + endif() + message(STATUS "Compiler ID is: ${CMAKE_CXX_COMPILER_ID}") +- if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") +- add_definitions(-Wimplicit-fallthrough -Wshorten-64-to-32) +- endif() ++ ++ include(Graphite) ++ + if (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*") + target_link_libraries(graphite2 kernel32 msvcr90 mingw32 gcc user32) + else (${CMAKE_CXX_COMPILER} MATCHES ".*mingw.*") +- if (GRAPHITE2_SANITIZERS) +- target_link_libraries(graphite2 c gcc_s) +- else () +- target_link_libraries(graphite2 c gcc) +- endif () ++ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++ add_definitions(-Wimplicit-fallthrough -Wshorten-64-to-32) ++ set_target_properties(graphite2 PROPERTIES ++ LINK_FLAGS "-nostdlib++ ${GRAPHITE_LINK_FLAGS}") ++ else() ++ set_target_properties(graphite2 PROPERTIES ++ LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") ++ ++ if (GRAPHITE2_SANITIZERS) ++ target_link_libraries(graphite2 c gcc_s) ++ else() ++ target_link_libraries(graphite2 c gcc) ++ endif() ++ ++ if (BUILD_SHARED_LIBS) ++ nolib_test(stdc++ $) ++ endif () ++ endif() + endif() +- include(Graphite) +- if (BUILD_SHARED_LIBS) +- nolib_test(stdc++ $) +- endif () ++ + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") + if (0) + CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -44,15 +44,25 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + COMPILE_DEFINITIONS "GRAPHITE2_STATIC;GRAPHITE2_NTRACING${TELEMETRY};_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE") + else (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + # don't -D GRAPHITE2_STATIC so that tests can see the API symbols in the static library ++ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ++ set_target_properties(graphite2-base PROPERTIES ++ LINK_FLAGS "-nostdlib++ ${GRAPHITE_LINK_FLAGS}") ++ set_target_properties(graphite2-file PROPERTIES ++ LINK_FLAGS "-nostdlib++ ${GRAPHITE_LINK_FLAGS}") ++ else() ++ set_target_properties(graphite2-base PROPERTIES ++ LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") ++ set_target_properties(graphite2-file PROPERTIES ++ LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") ++ endif() ++ + set_target_properties(graphite2-base PROPERTIES + COMPILE_FLAGS "-Wall -Wextra -Wno-class-memaccess -fno-rtti -fno-exceptions" + COMPILE_DEFINITIONS "GRAPHITE2_NTRACING" +- LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" + LINKER_LANGUAGE C) + set_target_properties(graphite2-file PROPERTIES + COMPILE_FLAGS "-Wall -Wextra -Wno-class-memaccess -fno-rtti -fno-exceptions" + COMPILE_DEFINITIONS "GRAPHITE2_NTRACING${TELEMETRY}" +- LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" + LINKER_LANGUAGE C) + endif() + diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs.patch new file mode 100644 index 0000000..c55f67c --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-fix-nodefaultlibs.patch @@ -0,0 +1,26 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -125,7 +125,7 @@ + LINK_FLAGS "-nostdlib++ ${GRAPHITE_LINK_FLAGS}") + else() + set_target_properties(graphite2 PROPERTIES +- LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") ++ LINK_FLAGS "${GRAPHITE_LINK_FLAGS}") + + if (GRAPHITE2_SANITIZERS) + target_link_libraries(graphite2 c gcc_s) +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -51,9 +51,9 @@ + LINK_FLAGS "-nostdlib++ ${GRAPHITE_LINK_FLAGS}") + else() + set_target_properties(graphite2-base PROPERTIES +- LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") ++ LINK_FLAGS "${GRAPHITE_LINK_FLAGS}") + set_target_properties(graphite2-file PROPERTIES +- LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") ++ LINK_FLAGS "${GRAPHITE_LINK_FLAGS}") + endif() + + set_target_properties(graphite2-base PROPERTIES + diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14-gcc15.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-gcc15.patch new file mode 100644 index 0000000..3eaf568 --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-gcc15.patch @@ -0,0 +1,29 @@ +https://github.com/silnrsi/graphite/pull/91 + +From fb5e7313802a32783cf0a3f1c28880f11e9588a5 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Fri, 2 Aug 2024 22:31:44 +0100 +Subject: [PATCH] tests/featuremap/featuremaptest.cpp: add missing + include + +Without the change `graphite` build fails on upcoming `gcc-15` as: + + tests/featuremap/featuremaptest.cpp:30:15: error: 'uint8_t' was not declared in this scope + 30 | std::vector _ttf; + | ^~~~~~~ + tests/featuremap/featuremaptest.cpp:16:1: note: 'uint8_t' is defined in header ''; + this is probably fixable by adding '#include ' + 15 | #include "inc/Face.h" + +++ |+#include + 16 | #include "inc/FeatureMap.h" +--- a/tests/featuremap/featuremaptest.cpp ++++ b/tests/featuremap/featuremaptest.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + #include + + diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14-no-libtool-file.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-no-libtool-file.patch new file mode 100644 index 0000000..2f1056b --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14-no-libtool-file.patch @@ -0,0 +1,68 @@ +From https://github.com/silnrsi/graphite/pull/65 + +From 3edb88b55c0870989778c670d555aa159a2c3abc Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 31 Aug 2020 20:56:43 +0200 +Subject: [PATCH] don't install a libtool file with static library + +Static library is supported since version 1.3.11 and +https://github.com/silnrsi/graphite/commit/2f143c04da5caa43ddf4dba437b2f2bc26bf4238 + +However, graphite2 is still installing libgraphite2.la which contains +incorrect information (i.e. dlname set to libgraphite2.so and +old_library set to ''): + +dlname='libgraphite2.so' + +library_names='libgraphite2.so.3.2.1 libgraphite2.so.3 libgraphite2.so' + +old_library='' + +dependency_libs='' + +This will result in the following build failure with any applications +using this file such as harfbuzz: + +arm-linux-g++.br_real: error: /home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libgraphite2.so: No such file or directory +make[5]: *** [main] Error 1 + +Instead of trying to fix this libtool file, just disable it when +building a static library as it is not needed + +Fixes: + - http://autobuild.buildroot.org/results/9ebe1d11e80755d59190ef2aae82bbba5cc45e44 + +Signed-off-by: Fabrice Fontaine + +* asturm 2021-12-28: We don't want those files at all. + +--- + src/CMakeLists.txt | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b6ac26bf..a7ace040 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -131,7 +131,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + nolib_test(stdc++ $) + endif () + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") +- CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") ++ if (0) ++ CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") ++ endif() + endif() + + if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +@@ -146,7 +148,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + include(Graphite) + nolib_test(stdc++ $) + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") +- CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") ++ if (0) ++ CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") ++ endif() + endif() + + if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-findpython3.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-findpython3.patch new file mode 100644 index 0000000..32a8e92 --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-findpython3.patch @@ -0,0 +1,95 @@ +From e3e6a1d23140d3d60b11afefed20a0094efd0ed7 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Fri, 17 Oct 2025 14:20:26 +0200 +Subject: [PATCH] Port PythonInterp -> Python3(REQUIRED COMPONENTS), + exec_program -> execute_process + +Use BUILD_TESTING to avoid building tests if not needed +Requires >=CMake-3.12 +Fixes CMP0148 and CMP0153 warnings + +Signed-off-by: Andreas Sturmlechner +--- + CMakeLists.txt | 20 ++++++++++---------- + Graphite.cmake | 12 ++++++------ + 2 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d670bd4d..55dac3ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,6 +3,5 @@ + cmake_minimum_required(VERSION 3.16) + include(TestBigEndian) +-find_package(PythonInterp 3.6) + project(graphite2) + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) + if (NOT CMAKE_BUILD_TYPE) +@@ -65,15 +64,14 @@ if (GRAPHITE2_VM_TYPE STREQUAL "direct" AND NOT (CMAKE_COMPILER_IS_GNUCXX OR CMA + endif() + message(STATUS "Using vm machine type: ${GRAPHITE2_VM_TYPE}") + +-if (BUILD_SHARED_LIBS) +- if (PYTHONINTERP_FOUND) +- EXEC_PROGRAM(${PYTHON_EXECUTABLE} +- ARGS -c \"import ctypes\; print(ctypes.sizeof(ctypes.c_void_p)) \" ++if (BUILD_TESTING AND BUILD_SHARED_LIBS) ++ find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter) ++ if (TARGET Python3::Interpreter) ++ execute_process(COMMAND ${Python3_EXECUTABLE} ++ -c "import ctypes; print(ctypes.sizeof(ctypes.c_void_p), end=\"\")" + OUTPUT_VARIABLE PYTHON_SIZEOF_VOID_P) +- if (NOT (PYTHON_VERSION_MAJOR GREATER 2 AND PYTHON_VERSION_MINOR GREATER 5)) +- message(WARNING "Python version 3.6 or greater required. Disabling some tests.") +- elseif ((PYTHON_SIZEOF_VOID_P STREQUAL CMAKE_SIZEOF_VOID_P) AND (NOT GRAPHITE2_NFILEFACE) AND ((NOT GRAPHITE2_SANITIZERS MATCHES "address") OR CMAKE_COMPILER_IS_GNUCXX)) +- set(PYTHON_CTYPES_COMPATBILE TRUE) ++ if ((PYTHON_SIZEOF_VOID_P STREQUAL CMAKE_SIZEOF_VOID_P) AND (NOT GRAPHITE2_NFILEFACE) AND ((NOT GRAPHITE2_SANITIZERS MATCHES "address") OR CMAKE_COMPILER_IS_GNUCXX)) ++ set(PYTHON_CTYPES_COMPATIBLE TRUE) + else () + if ((NOT GRAPHITE2_SANITIZERS MATCHES "address") OR CMAKE_COMPILER_IS_GNUCXX) + message(WARNING "Python ctypes is incompatible with built DLL. Disabling some tests.") +@@ -83,7 +81,9 @@ if (BUILD_SHARED_LIBS) + endif() + + add_subdirectory(src) +-add_subdirectory(tests) ++if (BUILD_TESTING) ++ add_subdirectory(tests) ++endif() + add_subdirectory(doc) + if (NOT GRAPHITE2_NFILEFACE) + add_subdirectory(gr2fonttest) +diff --git a/Graphite.cmake b/Graphite.cmake +index 02e34903..774d2cac 100644 +--- a/Graphite.cmake ++++ b/Graphite.cmake +@@ -83,10 +83,10 @@ function(fonttest TESTNAME FONTFILE) + add_test(NAME ${TESTNAME} COMMAND $ -trace ${PROJECT_BINARY_DIR}/${TESTNAME}.json -log ${PROJECT_BINARY_DIR}/${TESTNAME}.log ${PROJECT_SOURCE_DIR}/fonts/${FONTFILE} -codes ${ARGN}) + set_tests_properties(${TESTNAME} PROPERTIES TIMEOUT 3) + add_test(NAME ${TESTNAME}Output COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/${TESTNAME}.log ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}${PLATFORM_TEST_SUFFIX}.log) +- if ((NOT GRAPHITE2_NTRACING) AND PYTHONINTERP_FOUND) +- add_test(NAME ${TESTNAME}Debug COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/jsoncmp ${PROJECT_BINARY_DIR}/${TESTNAME}.json ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}.json) ++ if ((NOT GRAPHITE2_NTRACING) AND TARGET Python3::Interpreter) ++ add_test(NAME ${TESTNAME}Debug COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/jsoncmp ${PROJECT_BINARY_DIR}/${TESTNAME}.json ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}.json) + set_tests_properties(${TESTNAME}Debug PROPERTIES DEPENDS ${TESTNAME}) +- endif ((NOT GRAPHITE2_NTRACING) AND PYTHONINTERP_FOUND) ++ endif ((NOT GRAPHITE2_NTRACING) AND TARGET Python3::Interpreter) + set_tests_properties(${TESTNAME}Output PROPERTIES DEPENDS ${TESTNAME}) + endif (NOT GRAPHITE2_NFILEFACE) + endfunction(fonttest) +@@ -109,9 +109,9 @@ function(cmptest TESTNAME FONTFILE TEXTFILE) + if (EXISTS ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}${CMAKE_SYSTEM_NAME}.json) + set(PLATFORM_TEST_SUFFIX ${CMAKE_SYSTEM_NAME}) + endif (EXISTS ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}${CMAKE_SYSTEM_NAME}.json) +- if (PYTHON_CTYPES_COMPATBILE) +- add_test(NAME ${TESTNAME} COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/fnttxtrender --graphite_library=$ -t ${PROJECT_SOURCE_DIR}/texts/${TEXTFILE} -o ${PROJECT_BINARY_DIR}/${TESTNAME}.json -c ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}${PLATFORM_TEST_SUFFIX}.json ${ARGN} ${PROJECT_SOURCE_DIR}/fonts/${FONTFILE}) ++ if (PYTHON_CTYPES_COMPATIBLE) ++ add_test(NAME ${TESTNAME} COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/fnttxtrender --graphite_library=$ -t ${PROJECT_SOURCE_DIR}/texts/${TEXTFILE} -o ${PROJECT_BINARY_DIR}/${TESTNAME}.json -c ${PROJECT_SOURCE_DIR}/standards/${TESTNAME}${PLATFORM_TEST_SUFFIX}.json ${ARGN} ${PROJECT_SOURCE_DIR}/fonts/${FONTFILE}) + set_tests_properties(${TESTNAME} PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR}/python) +- endif (PYTHON_CTYPES_COMPATBILE) ++ endif () + endif () + endfunction(cmptest) +-- +2.51.0 + diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-minreqver-3.16.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-minreqver-3.16.patch new file mode 100644 index 0000000..797bf70 --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake-minreqver-3.16.patch @@ -0,0 +1,96 @@ +From 915ed5f042f2edecce7e0d014a6b0e99efeb9ca5 Mon Sep 17 00:00:00 2001 +From: Heiko Becker +Date: Thu, 20 Feb 2025 22:37:44 +0100 +Subject: [PATCH] CMake: Raised required version to 3.5 + +CMake >= 4.0.0-rc1 removed compatibility with versions < 3.5 and errors +out with such versions passed to cmake_minimum_required(). 3.5.0 has +been released 9 years ago, so I'd assume it's available almost everywhere. + +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. + +* asturm 2025-10-17: bump CMake Minimum to 3.16 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 4870971d..a2e88fa6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,5 +4,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) +-cmake_policy(SET CMP0012 NEW) ++cmake_minimum_required(VERSION 3.16) + include(TestBigEndian) + find_package(PythonInterp 3.6) + project(graphite2) +diff --git a/gr2fonttest/CMakeLists.txt b/gr2fonttest/CMakeLists.txt +--- a/gr2fonttest/CMakeLists.txt ++++ b/gr2fonttest/CMakeLists.txt +@@ -4,4 +4,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16) + + project(gr2fonttest) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -2,8 +2,7 @@ + # internet at http://www.fsf.org/licenses/lgpl.html. + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16) + 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 +--- a/tests/bittwiddling/CMakeLists.txt ++++ b/tests/bittwiddling/CMakeLists.txt +@@ -4,4 +4,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16) + project(bits) + include(Graphite) + include_directories(${graphite2_core_SOURCE_DIR}) +diff --git a/tests/json/CMakeLists.txt b/tests/json/CMakeLists.txt +--- a/tests/json/CMakeLists.txt ++++ b/tests/json/CMakeLists.txt +@@ -4,4 +4,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16) + project(jsontest) + include(Graphite) + include_directories(${graphite2_core_SOURCE_DIR}) +diff --git a/tests/sparsetest/CMakeLists.txt b/tests/sparsetest/CMakeLists.txt +--- a/tests/sparsetest/CMakeLists.txt ++++ b/tests/sparsetest/CMakeLists.txt +@@ -4,4 +4,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16) + project(sparsetest) + include(Graphite) + include_directories(${graphite2_core_SOURCE_DIR}) +diff --git a/tests/utftest/CMakeLists.txt b/tests/utftest/CMakeLists.txt +--- a/tests/utftest/CMakeLists.txt ++++ b/tests/utftest/CMakeLists.txt +@@ -4,4 +4,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.16) + project(utftest) + include(Graphite) + include_directories(${graphite2_core_SOURCE_DIR}) diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake4.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake4.patch new file mode 100644 index 0000000..45cd95d --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.14_p20210810-cmake4.patch @@ -0,0 +1,93 @@ +From 915ed5f042f2edecce7e0d014a6b0e99efeb9ca5 Mon Sep 17 00:00:00 2001 +From: Heiko Becker +Date: Thu, 20 Feb 2025 22:37:44 +0100 +Subject: [PATCH] CMake: Raised required version to 3.5 + +CMake >= 4.0.0-rc1 removed compatibility with versions < 3.5 and errors +out with such versions passed to cmake_minimum_required(). 3.5.0 has +been released 9 years ago, so I'd assume it's available almost everywhere. + +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 4870971d..a2e88fa6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,5 +4,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 +--- a/gr2fonttest/CMakeLists.txt ++++ b/gr2fonttest/CMakeLists.txt +@@ -4,4 +4,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 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -2,8 +2,7 @@ + # 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 +--- a/tests/bittwiddling/CMakeLists.txt ++++ b/tests/bittwiddling/CMakeLists.txt +@@ -4,4 +4,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 +--- a/tests/json/CMakeLists.txt ++++ b/tests/json/CMakeLists.txt +@@ -4,4 +4,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 +--- a/tests/sparsetest/CMakeLists.txt ++++ b/tests/sparsetest/CMakeLists.txt +@@ -4,4 +4,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 +--- a/tests/utftest/CMakeLists.txt ++++ b/tests/utftest/CMakeLists.txt +@@ -4,4 +4,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}) diff --git a/media-gfx/graphite2-1.3.14/graphite2-1.3.5-fix-gcc-linking.patch b/media-gfx/graphite2-1.3.14/graphite2-1.3.5-fix-gcc-linking.patch new file mode 100644 index 0000000..e4413d1 --- /dev/null +++ b/media-gfx/graphite2-1.3.14/graphite2-1.3.5-fix-gcc-linking.patch @@ -0,0 +1,17 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -127,12 +127,7 @@ + set_target_properties(graphite2 PROPERTIES + LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}") + +- if (GRAPHITE2_SANITIZERS) +- target_link_libraries(graphite2 c gcc_s) +- else() +- target_link_libraries(graphite2 c gcc) +- endif() +- ++ target_link_libraries(graphite2 c gcc_s) + if (BUILD_SHARED_LIBS) + nolib_test(stdc++ $) + endif () +