[meta-oe,2/2] fontforge: Upgrade to 20220308

Message ID 20220706120050.1461724-2-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/2] libspiro: Add recipe | expand

Commit Message

Khem Raj July 6, 2022, noon UTC
Switch build system to cmake
Add patch to avoid hardcoding build paths in scripts
Forward port musl patch

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ntforgeexe-Use-env-to-find-fontforge.patch | 29 +++++++++++++++++++
 ...de-sys-select-on-non-glibc-platforms.patch | 11 ++-----
 ...orge_20190801.bb => fontforge_20220308.bb} | 17 ++++++-----
 3 files changed, 41 insertions(+), 16 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/fontforge/fontforge/0001-fontforgeexe-Use-env-to-find-fontforge.patch
 rename meta-oe/recipes-graphics/fontforge/{fontforge_20190801.bb => fontforge_20220308.bb} (68%)

Patch

diff --git a/meta-oe/recipes-graphics/fontforge/fontforge/0001-fontforgeexe-Use-env-to-find-fontforge.patch b/meta-oe/recipes-graphics/fontforge/fontforge/0001-fontforgeexe-Use-env-to-find-fontforge.patch
new file mode 100644
index 0000000000..e8c1a11d48
--- /dev/null
+++ b/meta-oe/recipes-graphics/fontforge/fontforge/0001-fontforgeexe-Use-env-to-find-fontforge.patch
@@ -0,0 +1,29 @@ 
+From f5a19ad9b2aea85dab28e7c61ac39404631fad2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jul 2022 04:54:23 -0700
+Subject: [PATCH] fontforgeexe: Use env to find fontforge
+
+This helps in avoiding to encode build paths into interpeter
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fontforgeexe/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fontforgeexe/CMakeLists.txt b/fontforgeexe/CMakeLists.txt
+index b2d663b88..e2a8fee54 100644
+--- a/fontforgeexe/CMakeLists.txt
++++ b/fontforgeexe/CMakeLists.txt
+@@ -118,7 +118,7 @@ if(UNIX)
+     foreach(_script fontimage.pe fontlint.pe sfddiff.pe)
+       get_filename_component(_output \"\${_script}\" NAME_WE)
+       file(READ \"${CMAKE_CURRENT_SOURCE_DIR}/\${_script}\" _input)
+-      file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/\${_output}\" \"#!\${CMAKE_INSTALL_PREFIX}/bin/fontforge -lang=ff\\n\${_input}\")
++      file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/\${_output}\" \"#!/usr/bin/env fontforge -lang=ff\\n\${_input}\")
+     endforeach()
+   " COMPONENT nativescripts)
+   install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fontimage" "${CMAKE_CURRENT_BINARY_DIR}/fontlint" "${CMAKE_CURRENT_BINARY_DIR}/sfddiff"
+-- 
+2.37.0
+
diff --git a/meta-oe/recipes-graphics/fontforge/fontforge/0001-include-sys-select-on-non-glibc-platforms.patch b/meta-oe/recipes-graphics/fontforge/fontforge/0001-include-sys-select-on-non-glibc-platforms.patch
index 54ff7b76d2..27de27d57d 100644
--- a/meta-oe/recipes-graphics/fontforge/fontforge/0001-include-sys-select-on-non-glibc-platforms.patch
+++ b/meta-oe/recipes-graphics/fontforge/fontforge/0001-include-sys-select-on-non-glibc-platforms.patch
@@ -11,19 +11,14 @@  Signed-off-by: Khem Raj <raj.khem@gmail.com>
  gdraw/gdraw.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/gdraw/gdraw.c b/gdraw/gdraw.c
-index 24591b778..217c63140 100644
 --- a/gdraw/gdraw.c
 +++ b/gdraw/gdraw.c
-@@ -32,7 +32,7 @@
+@@ -33,7 +33,7 @@
  #include "gkeysym.h"
  #include "ustring.h"
  
--#if __Mac || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__
-+#if __Mac || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ || !defined(__GLIBC__)
+-#if __Mac
++#if __Mac || (defined(__linux__) && !defined(__GLIBC__))
  #  include <sys/select.h>
  #endif
  
--- 
-2.23.0
-
diff --git a/meta-oe/recipes-graphics/fontforge/fontforge_20190801.bb b/meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb
similarity index 68%
rename from meta-oe/recipes-graphics/fontforge/fontforge_20190801.bb
rename to meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb
index cb5f4d5ea1..83bf82a448 100644
--- a/meta-oe/recipes-graphics/fontforge/fontforge_20190801.bb
+++ b/meta-oe/recipes-graphics/fontforge/fontforge_20220308.bb
@@ -6,25 +6,26 @@  LIC_FILES_CHKSUM = " \
     file://LICENSE;md5=d042f3d2a8fd7208b704a499168e3c89 \
 "
 
-DEPENDS = "python3 glib-2.0 pango giflib tiff libxml2 jpeg libtool uthash gettext-native"
+DEPENDS = "python3 glib-2.0 pango giflib tiff libxml2 jpeg libtool uthash gettext-native libspiro"
 DEPENDS:append:class-target = " libxi"
 
-inherit autotools pkgconfig python3native features_check gettext gtk-icon-cache mime mime-xdg
+inherit cmake pkgconfig python3native features_check gettext gtk-icon-cache mime mime-xdg
 
 REQUIRED_DISTRO_FEATURES:append:class-target = " x11"
 
-# tag 20190801
-SRCREV = "ac635b818e38ddb8e7e2e1057330a32b4e25476e"
+# tag 20220308
+SRCREV = "582bd41a9bf04326300fc02a677fe3610d6d3ccd"
 SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https \
            file://0001-include-sys-select-on-non-glibc-platforms.patch \
+           file://0001-fontforgeexe-Use-env-to-find-fontforge.patch \
 "
 S = "${WORKDIR}/git"
 
-EXTRA_OECONF += "--without-libuninameslist  --enable-python-scripting --enable-python-extension"
-EXTRA_OECONF:append:class-native = " with_x=no"
+EXTRA_OECMAKE = "-DENABLE_GUI=OFF -DENABLE_DOCS=OFF"
 
-LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI}"
-BUILD_LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI}"
+CFLAGS += "-fno-strict-aliasing"
+LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI} -lm"
+BUILD_LDFLAGS += "-lpython${PYTHON_BASEVERSION}${PYTHON_ABI} -lm"
 
 #do_configure:prepend() {
 # uthash sources are expected in uthash/src