mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-24 18:58:08 -07:00
media-gfx/graphite2: python3_14, fix CMake <3.10, CMP0148/CMP0153 warnings
Tests passed. Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
From e3e6a1d23140d3d60b11afefed20a0094efd0ed7 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Sturmlechner <asturm@gentoo.org>
|
||||
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 <asturm@gentoo.org>
|
||||
---
|
||||
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 $<TARGET_FILE:gr2fonttest> -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=$<TARGET_FILE:graphite2> -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=$<TARGET_FILE:graphite2> -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
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
From 915ed5f042f2edecce7e0d014a6b0e99efeb9ca5 Mon Sep 17 00:00:00 2001
|
||||
From: Heiko Becker <mail@heiko-becker.de>
|
||||
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})
|
||||
133
media-gfx/graphite2/graphite2-1.3.14_p20210810-r5.ebuild
Normal file
133
media-gfx/graphite2/graphite2-1.3.14_p20210810-r5.ebuild
Normal file
@@ -0,0 +1,133 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
COMMIT=80c52493ef42e6fe605a69dcddd2a691cd8a1380
|
||||
GENTOO_DEPEND_ON_PERL="no"
|
||||
PYTHON_COMPAT=( python3_{11..14} )
|
||||
inherit flag-o-matic perl-module python-any-r1 cmake-multilib
|
||||
|
||||
DESCRIPTION="Library providing rendering capabilities for complex non-Roman writing systems"
|
||||
HOMEPAGE="https://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_home"
|
||||
SRC_URI="https://github.com/silnrsi/graphite/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
S="${WORKDIR}/graphite-${COMMIT}"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
||||
IUSE="perl test ${GENTOO_PERL_USESTRING}"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
perl? (
|
||||
${GENTOO_PERL_DEPSTRING}
|
||||
dev-lang/perl:=
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
test? ( dev-libs/glib:2 )
|
||||
"
|
||||
BDEPEND="
|
||||
perl? (
|
||||
dev-lang/perl
|
||||
dev-perl/Locale-Maketext-Lexicon
|
||||
dev-perl/Module-Build
|
||||
)
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
$(python_gen_any_dep 'dev-python/fonttools[${PYTHON_USEDEP}]')
|
||||
media-libs/fontconfig
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-1.3.5-includes-libs-perl.patch"
|
||||
"${FILESDIR}/${PN}-1.3.14-fix-cmake-files-libdir.patch"
|
||||
"${FILESDIR}/${PN}-1.3.14-no-libtool-file.patch"
|
||||
"${FILESDIR}/${PN}-1.3.14-fix-nodefaultlibs-deux.patch"
|
||||
"${FILESDIR}/${PN}-1.3.14-fix-nodefaultlibs.patch"
|
||||
"${FILESDIR}/${PN}-1.3.5-fix-gcc-linking.patch"
|
||||
"${FILESDIR}/${PN}-1.3.14-gcc15.patch"
|
||||
"${FILESDIR}/${P}-cmake-minreqver-3.16.patch" # bug 951367, PR#92 + PR#97 pending
|
||||
"${FILESDIR}/${P}-cmake-findpython3.patch" # TODO: upstream
|
||||
)
|
||||
|
||||
pkg_setup() {
|
||||
use perl && perl_set_version
|
||||
use test && python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
python_check_deps() {
|
||||
python_has_version "dev-python/fonttools[${PYTHON_USEDEP}]"
|
||||
}
|
||||
|
||||
multilib_src_configure() {
|
||||
# ODR (bug #875224)
|
||||
filter-lto
|
||||
|
||||
local mycmakeargs=(
|
||||
# Renamed VM_MACHINE_TYPE to GRAPHITE2_VM_TYPE
|
||||
-DGRAPHITE2_VM_TYPE=direct
|
||||
)
|
||||
# https://sourceforge.net/p/silgraphite/bugs/49/
|
||||
[[ ${CHOST} == powerpc*-apple* ]] && mycmakeargs+=(
|
||||
-DGRAPHITE2_NSEGCACHE:BOOL=ON
|
||||
)
|
||||
|
||||
if use elibc_musl ; then
|
||||
# bug #829690
|
||||
if use ppc || use x86 ; then
|
||||
sed -e 's:${GRAPHITE_LINK_FLAGS}:-lssp_nonshared &:' \
|
||||
-i "${S}"/src/CMakeLists.txt || die
|
||||
fi
|
||||
fi
|
||||
|
||||
local mycmakeargs=( -DBUILD_TESTING=$(usex test) )
|
||||
cmake_src_configure
|
||||
|
||||
# fix perl linking
|
||||
if multilib_is_native_abi && use perl; then
|
||||
# we rely on the fact that cmake_src_configure sets BUILD_DIR
|
||||
sed -e "s:@BUILD_DIR@:\"${BUILD_DIR}/src\":" \
|
||||
-i "${S}"/contrib/perl/Build.PL || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-multilib_src_compile
|
||||
if use perl; then
|
||||
cd contrib/perl || die
|
||||
perl-module_src_configure
|
||||
perl-module_src_compile
|
||||
fi
|
||||
}
|
||||
|
||||
multilib_src_test() {
|
||||
CMAKE_SKIP_TESTS=(
|
||||
# https://github.com/silnrsi/graphite/pull/74
|
||||
nametabletest
|
||||
)
|
||||
|
||||
cmake_src_test
|
||||
}
|
||||
|
||||
src_test() {
|
||||
cmake-multilib_src_test
|
||||
if use perl; then
|
||||
# Perl tests fail due to missing POD coverage...
|
||||
perl_rm_files "contrib/perl/t/pod.t" "contrib/perl/t/pod-coverage.t"
|
||||
cd contrib/perl || die
|
||||
perl-module_src_test
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-multilib_src_install
|
||||
if use perl; then
|
||||
cd contrib/perl || die
|
||||
perl-module_src_install
|
||||
perl_delete_localpod
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user