0001-Fix-the-build-issue-with-enable-static.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. From 8208f99fa1676c42bfd8d74de3e9dac5366c150c Mon Sep 17 00:00:00 2001
  2. From: Akira TAGOH <akira@tagoh.org>
  3. Date: Mon, 3 Sep 2018 04:56:16 +0000
  4. Subject: [PATCH] Fix the build issue with --enable-static
  5. Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/109
  6. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  7. [Retrieved from:
  8. https://gitlab.freedesktop.org/fontconfig/fontconfig/commit/8208f99fa1676c42bfd8d74de3e9dac5366c150c]
  9. ---
  10. doc/fcstring.fncs | 12 ++++++++++++
  11. fontconfig/fontconfig.h | 4 ++++
  12. src/fcint.h | 4 ----
  13. test/test-bz106632.c | 35 ++++++++++++-----------------------
  14. 4 files changed, 28 insertions(+), 27 deletions(-)
  15. diff --git a/doc/fcstring.fncs b/doc/fcstring.fncs
  16. index 0412bbd..d5ec043 100644
  17. --- a/doc/fcstring.fncs
  18. +++ b/doc/fcstring.fncs
  19. @@ -223,6 +223,18 @@ This is just a wrapper around free(3) which helps track memory usage of
  20. strings within the fontconfig library.
  21. @@
  22. +@RET@ FcChar8 *
  23. +@FUNC@ FcStrBuildFilename
  24. +@TYPE1@ const FcChar8 * @ARG1@ path
  25. +@TYPE2@ ...
  26. +@PURPOSE@ Concatenate strings as a file path
  27. +@DESC@
  28. +Creates a filename from the given elements of strings as file paths
  29. +and concatenate them with the appropriate file separator.
  30. +Arguments must be null-terminated.
  31. +This returns a newly-allocated memory which should be freed when no longer needed.
  32. +@@
  33. +
  34. @RET@ FcChar8 *
  35. @FUNC@ FcStrDirname
  36. @TYPE1@ const FcChar8 * @ARG1@ file
  37. diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
  38. index bac1dda..af870d0 100644
  39. --- a/fontconfig/fontconfig.h
  40. +++ b/fontconfig/fontconfig.h
  41. @@ -1076,6 +1076,10 @@ FcUtf16Len (const FcChar8 *string,
  42. int *nchar,
  43. int *wchar);
  44. +FcPublic FcChar8 *
  45. +FcStrBuildFilename (const FcChar8 *path,
  46. + ...);
  47. +
  48. FcPublic FcChar8 *
  49. FcStrDirname (const FcChar8 *file);
  50. diff --git a/src/fcint.h b/src/fcint.h
  51. index de78cd8..a9d075a 100644
  52. --- a/src/fcint.h
  53. +++ b/src/fcint.h
  54. @@ -1282,10 +1282,6 @@ FcStrUsesHome (const FcChar8 *s);
  55. FcPrivate FcBool
  56. FcStrIsAbsoluteFilename (const FcChar8 *s);
  57. -FcPrivate FcChar8 *
  58. -FcStrBuildFilename (const FcChar8 *path,
  59. - ...);
  60. -
  61. FcPrivate FcChar8 *
  62. FcStrLastSlash (const FcChar8 *path);
  63. diff --git a/test/test-bz106632.c b/test/test-bz106632.c
  64. index daa0c1e..2d67c2e 100644
  65. --- a/test/test-bz106632.c
  66. +++ b/test/test-bz106632.c
  67. @@ -25,25 +25,26 @@
  68. #ifdef HAVE_CONFIG_H
  69. #include "config.h"
  70. #endif
  71. +#include <stdio.h>
  72. #include <stdlib.h>
  73. +#include <string.h>
  74. #include <dirent.h>
  75. +#include <unistd.h>
  76. +#include <errno.h>
  77. #ifndef HAVE_STRUCT_DIRENT_D_TYPE
  78. #include <sys/types.h>
  79. #include <sys/stat.h>
  80. -#include <unistd.h>
  81. #endif
  82. -#include "fcstr.c"
  83. -#undef FcConfigBuildFonts
  84. -#undef FcConfigCreate
  85. -#undef FcConfigGetCurrent
  86. -#undef FcConfigParseAndLoadFromMemory
  87. -#undef FcConfigUptoDate
  88. -#undef FcFontList
  89. -#undef FcInitReinitialize
  90. -#undef FcPatternCreate
  91. -#undef FcPatternDestroy
  92. #include <fontconfig/fontconfig.h>
  93. +#ifdef _WIN32
  94. +# define FC_DIR_SEPARATOR '\\'
  95. +# define FC_DIR_SEPARATOR_S "\\"
  96. +#else
  97. +# define FC_DIR_SEPARATOR '/'
  98. +# define FC_DIR_SEPARATOR_S "/"
  99. +#endif
  100. +
  101. #ifdef HAVE_MKDTEMP
  102. #define fc_mkdtemp mkdtemp
  103. #else
  104. @@ -154,18 +155,6 @@ unlink_dirs (const char *dir)
  105. return ret;
  106. }
  107. -FcChar8 *
  108. -FcLangNormalize (const FcChar8 *lang)
  109. -{
  110. - return NULL;
  111. -}
  112. -
  113. -FcChar8 *
  114. -FcConfigHome (void)
  115. -{
  116. - return NULL;
  117. -}
  118. -
  119. int
  120. main (void)
  121. {
  122. --
  123. 2.18.1