Browse Source

fontconfig: compile with meson

Faster compilation.

Backport upstream patch fixing cross compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lilik-openwrt-22.03
Rosen Penev 4 years ago
parent
commit
0aa5d541ef
3 changed files with 54 additions and 13 deletions
  1. +11
    -13
      utils/fontconfig/Makefile
  2. +32
    -0
      utils/fontconfig/patches/010-Handle-absolute-sysconfdir-when-installing-symlinks.patch
  3. +11
    -0
      utils/fontconfig/patches/020-distutils.patch

+ 11
- 13
utils/fontconfig/Makefile View File

@ -9,20 +9,22 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=fontconfig PKG_NAME:=fontconfig
PKG_VERSION:=2.13.93 PKG_VERSION:=2.13.93
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://fontconfig.org/release/ PKG_SOURCE_URL:=https://fontconfig.org/release/
PKG_HASH:=ea968631eadc5739bc7c8856cef5c77da812d1f67b763f5e51b57b8026c1a0a0 PKG_HASH:=ea968631eadc5739bc7c8856cef5c77da812d1f67b763f5e51b57b8026c1a0a0
PKG_MAINTAINER:=
PKG_LICENSE:=
PKG_LICENSE_FILES:=
PKG_CPE_ID:=cpe:/a:fontconfig_project:fontconfig PKG_CPE_ID:=cpe:/a:fontconfig_project:fontconfig
PKG_FIXUP:=libtool
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=gperf/host PKG_BUILD_DEPENDS:=gperf/host
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include ../../devel/meson/meson.mk
define Package/fontconfig define Package/fontconfig
SECTION:=xorg-util SECTION:=xorg-util
@ -33,16 +35,12 @@ define Package/fontconfig
URL:=http://fontconfig.org/ URL:=http://fontconfig.org/
endef endef
#TODO: better put cache on persistent storage for faster boot time?
CONFIGURE_ARGS+= \
--with-cache-dir=/tmp/fontconfig/cache \
--with-arch=$(ARCH) \
--disable-iconv \
--disable-libxml2 \
--disable-docs
CONFIGURE_VARS+= \
ac_cv_prog_HASDOCBOOK=no \
MESON_ARGS += \
-Ddoc=disabled \
-Ddoc-txt=disabled \
-Dnls=disabled \
-Dtests=disabled \
-Dtools=enabled
define Build/InstallDev define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(INSTALL_DIR) $(1)/usr/include


+ 32
- 0
utils/fontconfig/patches/010-Handle-absolute-sysconfdir-when-installing-symlinks.patch View File

@ -0,0 +1,32 @@
From 4e42925096e97f4a6c9d09f475de7eb54a226668 Mon Sep 17 00:00:00 2001
From: Heiko Becker <heirecka@exherbo.org>
Date: Thu, 3 Dec 2020 21:04:26 +0100
Subject: [PATCH] Handle absolute sysconfdir when installing symlinks
sysconfdir defaults to /etc when the prefix is set to /usr. But joining
MESON_INSTALL_DESTDIR_PREFIX and sysconfdir when the latter is an
absoulte path, results in sysconfdir only. Which might lead to an error
during install because /etc/fonts/conf.d/ might already exist from an
pre-existing fontconfig installation.
---
conf.d/link_confs.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/conf.d/link_confs.py
+++ b/conf.d/link_confs.py
@@ -11,7 +11,14 @@ if __name__=='__main__':
parser.add_argument('links', nargs='+')
args = parser.parse_args()
- confpath = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.confpath)
+ if os.path.isabs(args.confpath):
+ destdir = os.environ.get('DESTDIR')
+ if destdir:
+ confpath = os.path.join(destdir, args.confpath[1:])
+ else:
+ confpath = args.confpath
+ else:
+ confpath = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.confpath)
if not os.path.exists(confpath):
os.makedirs(confpath)

+ 11
- 0
utils/fontconfig/patches/020-distutils.patch View File

@ -0,0 +1,11 @@
--- a/meson.build
+++ b/meson.build
@@ -38,7 +38,7 @@ expat_dep = dependency('expat',
i18n = import('i18n')
pkgmod = import('pkgconfig')
-python3 = import('python').find_installation()
+python3 = 'python3'
check_headers = [
['dirent.h'],

Loading…
Cancel
Save