package/netsurf: add optional dependency on freetype
authorFrancois Perrad <fperrad@gmail.com>
Wed, 12 Dec 2018 07:14:52 +0000 (08:14 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 16 Dec 2018 20:32:16 +0000 (21:32 +0100)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/netsurf/0002-fix-freetype-detection.patch [new file with mode: 0644]
package/netsurf/netsurf.mk

diff --git a/package/netsurf/0002-fix-freetype-detection.patch b/package/netsurf/0002-fix-freetype-detection.patch
new file mode 100644 (file)
index 0000000..27e3a6a
--- /dev/null
@@ -0,0 +1,32 @@
+From 85336f2404b9583267019650ea0112ebf1bb571a Mon Sep 17 00:00:00 2001
+From: Francois Perrad <francois.perrad@gadz.org>
+Date: Wed, 28 Nov 2018 17:59:44 +0100
+Subject: [PATCH] fix freetype detection
+
+Using freetype-config doesn't work well, because it's going to use the
+system freetype-config instead of the one installed in the
+cross-compilation sysroot. So, let's use pkg-config instead.
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+---
+ netsurf/frontends/framebuffer/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/netsurf/frontends/framebuffer/Makefile b/netsurf/frontends/framebuffer/Makefile
+index bdedd90..249c7c4 100644
+--- a/netsurf/frontends/framebuffer/Makefile
++++ b/netsurf/frontends/framebuffer/Makefile
+@@ -35,8 +35,8 @@ LDFLAGS += -Wl,--no-whole-archive
+ # freetype is optional but does not use pkg-config
+ ifeq ($(NETSURF_FB_FONTLIB),freetype)
+-  CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
+-  LDFLAGS += $(shell freetype-config --libs)
++  CFLAGS += -DFB_USE_FREETYPE $(shell $(PKG_CONFIG) --cflags freetype2)
++  LDFLAGS += $(shell $(PKG_CONFIG) --libs freetype2)
+ endif
+-- 
+2.17.1
+
index 3339b35c91b15b7158dfe6e3e9747bc60ba1a929..23e4de63775b71aeb5681c93916ad0adce292196 100644 (file)
@@ -27,6 +27,12 @@ endif
 ifeq ($(BR2_PACKAGE_NETSURF_SDL),y)
 NETSURF_DEPENDENCIES += sdl host-libpng
 NETSURF_FRONTEND = framebuffer
+ifeq ($(BR2_PACKAGE_FREETYPE),y)
+NETSURF_DEPENDENCIES += freetype
+define NETSURF_FONTLIB_CONFIGURE_CMDS
+       echo "override NETSURF_FB_FONTLIB := freetype"  >> $(@D)/netsurf/Makefile.config
+endef
+endif
 endif
 
 ifeq ($(BR2_PACKAGE_LIBICONV),y)
@@ -41,6 +47,7 @@ define NETSURF_CONFIGURE_CMDS
        echo "override NETSURF_USE_DUKTAPE := NO"       >  $(@D)/netsurf/Makefile.config
        $(NETSURF_ICONV_CONFIGURE_CMDS)
        $(NETSURF_SVG_CONFIGURE_CMDS)
+       $(NETSURF_FONTLIB_CONFIGURE_CMDS)
 endef
 
 NETSURF_MAKE_OPTS = \