shithub: freetype+ttf2subf

Download patch

ref: f41070fef0d9b3844c9f75714c637a8265739784
parent: ab76d970e70634e1fcef774ab4ea59d9365b03fb
author: Werner Lemberg <[email protected]>
date: Thu Mar 27 13:38:23 EDT 2014

Fix Savannah bug #38235.

Work around a bug in pkg-config version 0.28 and earlier: If a
variable value gets surrounded by doublequotes (in particular values
for the `prefix' variable), the prefix override mechanism fails.

* builds/unix/freetype2.in: Don't use doublequotes.
* builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
names with backslashes.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-03-27  Werner Lemberg  <[email protected]>
+
+	Fix Savannah bug #38235.
+
+	Work around a bug in pkg-config version 0.28 and earlier: If a
+	variable value gets surrounded by doublequotes (in particular values
+	for the `prefix' variable), the prefix override mechanism fails.
+
+	* builds/unix/freetype2.in: Don't use doublequotes.
+	* builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
+	names with backslashes.
+
 2014-03-24  Werner Lemberg  <[email protected]>
 
 	Fix Savannah bug #41946.
--- a/builds/unix/freetype2.in
+++ b/builds/unix/freetype2.in
@@ -1,7 +1,7 @@
-prefix="%prefix%"
-exec_prefix="%exec_prefix%"
-libdir="%libdir%"
-includedir="%includedir%/freetype2"
+prefix=%prefix%
+exec_prefix=%exec_prefix%
+libdir=%libdir%
+includedir=%includedir%/freetype2
 
 Name: FreeType 2
 URL: http://freetype.org
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -114,16 +114,29 @@
 	chmod a-w [email protected]
 	mv [email protected] $@
 
+# To support directory names with spaces (as might easily happen on Windows
+# platforms), the right solution would be to surround the pkg-variables in
+# `freetype2.pc' with double quotes.  However, doing so ironically disables
+# the prefix override mechanism especially written for Windows.  This is a
+# bug in pkg-config version 0.28 and earlier.
+#
+# For this reason, we escape spaces with backslashes.
+
+exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix))
+includedir_x  := $(subst $(space),\\$(space),$(includedir))
+libdir_x      := $(subst $(space),\\$(space),$(libdir))
+prefix_x      := $(subst $(space),\\$(space),$(prefix))
+
 $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
 	rm -f $@ [email protected]
 	sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|'     \
 	    -e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|'             \
 	    -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
-	    -e 's|%exec_prefix%|$(exec_prefix)|'               \
+	    -e 's|%exec_prefix%|$(exec_prefix_x)|'             \
 	    -e 's|%ft_version%|$(ft_version)|'                 \
-	    -e 's|%includedir%|$(includedir)|'                 \
-	    -e 's|%libdir%|$(libdir)|'                         \
-	    -e 's|%prefix%|$(prefix)|'                         \
+	    -e 's|%includedir%|$(includedir_x)|'               \
+	    -e 's|%libdir%|$(libdir_x)|'                       \
+	    -e 's|%prefix%|$(prefix_x)|'                       \
 	    $<                                                 \
 	    > [email protected]
 	chmod a-w [email protected]