summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2021-06-02 10:03:16 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2021-06-02 10:03:16 +0530
commitb13a1dea5a55c08ff1ec08f0569f2cb68d740750 (patch)
tree00ba72784a9dc5b19b8e4df8ca9a20433ccf20de
parent7c44ff9a2b14d4e1107cb6d82d50675dd079f0bc (diff)
fontconfig.recipe: Fix post-install on rebuild
The symlink will already exist, and we'll get an error that it already exists. Backport fixes from fontconfig master that fix it. Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/705>
-rw-r--r--recipes/fontconfig.recipe5
-rw-r--r--recipes/fontconfig/0001-Overwrite-symlinks-for-config-files.patch41
-rw-r--r--recipes/fontconfig/0001-Windows-Fix-symlink-privilege-error-detection.patch35
3 files changed, 80 insertions, 1 deletions
diff --git a/recipes/fontconfig.recipe b/recipes/fontconfig.recipe
index a37d95a8..2fa875b2 100644
--- a/recipes/fontconfig.recipe
+++ b/recipes/fontconfig.recipe
@@ -19,7 +19,10 @@ class Recipe(recipe.Recipe):
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/138/
'fontconfig/0001-handle-absolute-sysconfdir-when-installing-symlinks.patch',
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/165
- 'fontconfig/0001-meson-fix-cross-compilation-issues-with-gperf-header.patch'
+ 'fontconfig/0001-meson-fix-cross-compilation-issues-with-gperf-header.patch',
+ # From git master post-2.13.93
+ 'fontconfig/0001-Windows-Fix-symlink-privilege-error-detection.patch',
+ 'fontconfig/0001-Overwrite-symlinks-for-config-files.patch',
]
files_libs = ['libfontconfig']
diff --git a/recipes/fontconfig/0001-Overwrite-symlinks-for-config-files.patch b/recipes/fontconfig/0001-Overwrite-symlinks-for-config-files.patch
new file mode 100644
index 00000000..17e0cf0d
--- /dev/null
+++ b/recipes/fontconfig/0001-Overwrite-symlinks-for-config-files.patch
@@ -0,0 +1,41 @@
+From 615e2cb844a7eb266aa562071a26093ae3ec4d28 Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <akira@tagoh.org>
+Date: Tue, 2 Mar 2021 19:29:08 +0900
+Subject: [PATCH] Overwrite symlinks for config files
+
+In Makefile, we are trying to remove old symlinks first and then create a symlink.
+do the same thing in meson too.
+
+Also, the line of the exception handling for FileExistsError is meaningless
+as the above line is taking care of it instead and we shouldn't ignore it if
+os.remove and os.symlink doesn't work somehow.
+
+Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/275
+---
+ conf.d/link_confs.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py
+index 5a78d8d..e195095 100644
+--- a/conf.d/link_confs.py
++++ b/conf.d/link_confs.py
+@@ -20,6 +20,10 @@ if __name__=='__main__':
+ for link in args.links:
+ src = os.path.join(args.availpath, link)
+ dst = os.path.join(confpath, link)
++ try:
++ os.remove(dst)
++ except FileNotFoundError:
++ pass
+ try:
+ os.symlink(src, dst)
+ except NotImplementedError:
+@@ -30,5 +34,3 @@ if __name__=='__main__':
+ if platform.system().lower() == 'windows' and e.winerror == 1314:
+ break
+ raise
+- except FileExistsError:
+- pass
+--
+2.31.1.windows.1
+
diff --git a/recipes/fontconfig/0001-Windows-Fix-symlink-privilege-error-detection.patch b/recipes/fontconfig/0001-Windows-Fix-symlink-privilege-error-detection.patch
new file mode 100644
index 00000000..8412560e
--- /dev/null
+++ b/recipes/fontconfig/0001-Windows-Fix-symlink-privilege-error-detection.patch
@@ -0,0 +1,35 @@
+From 7bfbaecf819a8b1630dfc8f56126e31f985d5fb3 Mon Sep 17 00:00:00 2001
+From: Xavier Claessens <xavier.claessens@collabora.com>
+Date: Fri, 29 Jan 2021 19:17:38 -0500
+Subject: [PATCH] Windows: Fix symlink privilege error detection
+
+The message is in e.args[1] and not e.args[0] at least with python 3.8.
+Should be more future proof like this in case it change again.
+---
+ conf.d/link_confs.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py
+index 0c42efb..5a78d8d 100644
+--- a/conf.d/link_confs.py
++++ b/conf.d/link_confs.py
+@@ -3,6 +3,7 @@
+ import os
+ import sys
+ import argparse
++import platform
+
+ if __name__=='__main__':
+ parser = argparse.ArgumentParser()
+@@ -26,7 +27,7 @@ if __name__=='__main__':
+ break
+ except OSError as e:
+ # Symlink privileges are not available
+- if len(e.args) == 1 and 'privilege' in e.args[0]:
++ if platform.system().lower() == 'windows' and e.winerror == 1314:
+ break
+ raise
+ except FileExistsError:
+--
+2.31.1.windows.1
+