summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-07-07 12:37:48 -0700
committerKhem Raj <raj.khem@gmail.com>2022-07-07 16:03:33 -0700
commitcd14aec0541ca2d9e7f8bb6f5d081be535623fb9 (patch)
tree1c184652575d0ec093f25731b099313be1d6a90a
parentb521d554322e2603cce1ac67c13f479de08f1594 (diff)
downloadmeta-openembedded-cd14aec0541ca2d9e7f8bb6f5d081be535623fb9.tar.gz
fontforge: Use alternate way to detect libm
libm is folded into libc in latest glibc and build fails to detect it with given cmake mechanism, therefore use slighly different mechanism which work on hosts with or without libm Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-graphics/fontforge/fontforge/0001-cmake-Use-alternate-way-to-detect-libm.patch67
-rw-r--r--meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb7
2 files changed, 71 insertions, 3 deletions
diff --git a/meta-oe/recipes-graphics/fontforge/fontforge/0001-cmake-Use-alternate-way-to-detect-libm.patch b/meta-oe/recipes-graphics/fontforge/fontforge/0001-cmake-Use-alternate-way-to-detect-libm.patch
new file mode 100644
index 0000000000..dd799e7485
--- /dev/null
+++ b/meta-oe/recipes-graphics/fontforge/fontforge/0001-cmake-Use-alternate-way-to-detect-libm.patch
@@ -0,0 +1,67 @@
1From 6d3c48d1b01943a467928235c3affbab463c25ab Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jul 2022 12:32:47 -0700
4Subject: [PATCH] cmake: Use alternate way to detect libm
5
6The standard package provided with MathLib cmake module does not work
7when libm is folded into libc starting glibc 2.35+
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 CMakeLists.txt | 7 ++++++-
13 contrib/fonttools/CMakeLists.txt | 2 +-
14 fontforge/CMakeLists.txt | 2 +-
15 fontforgeexe/CMakeLists.txt | 4 ++--
16 4 files changed, 10 insertions(+), 5 deletions(-)
17
18--- a/CMakeLists.txt
19+++ b/CMakeLists.txt
20@@ -111,9 +111,14 @@ find_package_with_target(Intl REQUIRED)
21 find_package(GLIB 2.6 REQUIRED COMPONENTS gio gobject)
22 find_package(Iconv REQUIRED)
23 find_package(LibXml2 REQUIRED)
24-find_package(MathLib REQUIRED)
25 find_package(ZLIB REQUIRED)
26
27+include(CheckLibraryExists)
28+CHECK_LIBRARY_EXISTS(m pow "" HAVE_LIB_M)
29+if (HAVE_LIB_M)
30+ set(EXTRA_LIBS ${EXTRA_LIBS} m)
31+endif (HAVE_LIB_M)
32+
33 check_include_file(pthread.h HAVE_PTHREAD_H)
34 if(HAVE_PTHREAD_H)
35 find_package(Threads)
36--- a/contrib/fonttools/CMakeLists.txt
37+++ b/contrib/fonttools/CMakeLists.txt
38@@ -15,6 +15,6 @@ add_executable(woff woff.c)
39
40 target_link_libraries(acorn2sfd PRIVATE fontforge)
41 target_link_libraries(dewoff PRIVATE ZLIB::ZLIB)
42-target_link_libraries(pcl2ttf PRIVATE MathLib::MathLib)
43+target_link_libraries(pcl2ttf PRIVATE ${EXTRA_LIBS})
44 target_link_libraries(ttf2eps PRIVATE fontforge)
45 target_link_libraries(woff PRIVATE ZLIB::ZLIB)
46--- a/fontforge/CMakeLists.txt
47+++ b/fontforge/CMakeLists.txt
48@@ -237,7 +237,7 @@ target_link_libraries(fontforge
49 GLIB::GLIB
50 Intl::Intl
51 PRIVATE
52- MathLib::MathLib
53+ ${EXTRA_LIBS}
54 Iconv::Iconv
55 ZLIB::ZLIB
56 )
57--- a/fontforgeexe/CMakeLists.txt
58+++ b/fontforgeexe/CMakeLists.txt
59@@ -110,7 +110,7 @@ if(ENABLE_PYTHON_SCRIPTING_RESULT)
60 target_link_libraries(fontforgeexe PRIVATE Python3::Python)
61 endif()
62
63-target_link_libraries(fontforgeexe PRIVATE fontforge Iconv::Iconv MathLib::MathLib)
64+target_link_libraries(fontforgeexe PRIVATE fontforge Iconv::Iconv ${EXTRA_LIBS})
65 install(TARGETS fontforgeexe RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
66
67 if(UNIX)
diff --git a/meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb b/meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb
index 83bf82a448..c53f2db01b 100644
--- a/meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb
+++ b/meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb
@@ -18,14 +18,15 @@ SRCREV = "582bd41a9bf04326300fc02a677fe3610d6d3ccd"
18SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https \ 18SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https \
19 file://0001-include-sys-select-on-non-glibc-platforms.patch \ 19 file://0001-include-sys-select-on-non-glibc-platforms.patch \
20 file://0001-fontforgeexe-Use-env-to-find-fontforge.patch \ 20 file://0001-fontforgeexe-Use-env-to-find-fontforge.patch \
21 file://0001-cmake-Use-alternate-way-to-detect-libm.patch \
21" 22"
22S = "${WORKDIR}/git" 23S = "${WORKDIR}/git"
23 24
24EXTRA_OECMAKE = "-DENABLE_GUI=OFF -DENABLE_DOCS=OFF" 25EXTRA_OECMAKE = "-DENABLE_DOCS=OFF"
25 26
26CFLAGS += "-fno-strict-aliasing" 27CFLAGS += "-fno-strict-aliasing"
27LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI} -lm" 28LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI}"
28BUILD_LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI} -lm" 29BUILD_LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI}"
29 30
30#do_configure:prepend() { 31#do_configure:prepend() {
31# uthash sources are expected in uthash/src 32# uthash sources are expected in uthash/src