mingw-w64-graphite2

Try to fix linking by specifying GRAPHITE_STATIC and trying to fix
header files.
This commit is contained in:
J. Peter Mugaas
2016-09-19 02:56:14 -04:00
parent 5fc32722ec
commit b7afbb8c83
3 changed files with 100 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
--- graphite2-1.3.8/src/CMakeLists.txt.orig 2016-04-29 04:04:30 -0400
+++ graphite2-1.3.8/src/CMakeLists.txt 2016-04-29 04:49:19 -0400
--- graphite2-1.3.8/src/CMakeLists.txt.orig 2016-09-17 06:30:02.570522500 -0400
+++ graphite2-1.3.8/src/CMakeLists.txt 2016-09-17 06:33:57.962672400 -0400
@@ -106,6 +106,48 @@
LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
LT_VERSION_AGE ${GRAPHITE_API_AGE})
@@ -49,7 +49,13 @@
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set_target_properties(graphite2 PROPERTIES
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
@@ -151,5 +193,5 @@
@@ -148,8 +190,11 @@
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set_target_properties(graphite2 PROPERTIES
COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_EXPORTING")
+ set_target_properties(graphite2_static PROPERTIES
+ COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_STATIC")
+
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")

View File

@@ -0,0 +1,84 @@
--- graphite2-1.3.8/include/graphite2/Types.h.orig 2016-09-16 23:16:38.006355900 -0400
+++ graphite2-1.3.8/include/graphite2/Types.h 2016-09-16 23:18:12.217540500 -0400
@@ -40,6 +40,31 @@
gr_utf8 = 1/*sizeof(uint8)*/, gr_utf16 = 2/*sizeof(uint16)*/, gr_utf32 = 4/*sizeof(uint32)*/
};
+#if defined(__GNUC__) || defined(__clang__)
+#define GR_MAYBE_UNUSED __attribute__((unused))
+#else
+#define GR_MAYBE_UNUSED
+#endif
+
+#if defined(__clang__) && __cplusplus >= 201103L
+ /* clang's fallthrough annotations are only available starting in C++11. */
+ #define GR_FALLTHROUGH [[clang::fallthrough]]
+#elif defined(_MSC_VER)
+ /*
+ * MSVC's __fallthrough annotations are checked by /analyze (Code Analysis):
+ * https://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx
+ */
+ #include <sal.h>
+ #define GR_FALLTHROUGH __fallthrough
+#else
+ #define GR_FALLTHROUGH /* fallthrough */
+#endif
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4800)
+#pragma warning(disable: 4355)
+#endif
+
// Definitions for library publicly exported symbols
#if defined _WIN32 || defined __CYGWIN__
#if defined GRAPHITE2_STATIC
--- graphite2-1.3.8/src/inc/Main.h.orig 2016-09-16 23:15:44.029355200 -0400
+++ graphite2-1.3.8/src/inc/Main.h 2016-09-16 23:18:14.601872400 -0400
@@ -120,27 +120,3 @@
void operator delete[] (void * p)throw() { free(p); } \
void operator delete[] (void *, void *) throw() {}
-#if defined(__GNUC__) || defined(__clang__)
-#define GR_MAYBE_UNUSED __attribute__((unused))
-#else
-#define GR_MAYBE_UNUSED
-#endif
-
-#if defined(__clang__) && __cplusplus >= 201103L
- /* clang's fallthrough annotations are only available starting in C++11. */
- #define GR_FALLTHROUGH [[clang::fallthrough]]
-#elif defined(_MSC_VER)
- /*
- * MSVC's __fallthrough annotations are checked by /analyze (Code Analysis):
- * https://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx
- */
- #include <sal.h>
- #define GR_FALLTHROUGH __fallthrough
-#else
- #define GR_FALLTHROUGH /* fallthrough */
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable: 4800)
-#pragma warning(disable: 4355)
-#endif
--- graphite2-1.3.8/include/graphite2/Log.h.orig 2016-09-16 23:28:23.462998100 -0400
+++ graphite2-1.3.8/include/graphite2/Log.h 2016-09-16 23:31:58.675576600 -0400
@@ -56,7 +56,7 @@
* @param face the gr_face whose segments you want to log to the given file
* @param log_path a utf8 encoded file name and path to log to.
*/
-GR2_API bool gr_start_logging(gr_face * face, const char *log_path);
+GR2_API bool gr_start_logging(GR_MAYBE_UNUSED gr_face * face, const char *log_path);
/** Stop logging on the given face. This will close the log file created by
@@ -64,7 +64,7 @@
*
* @param face the gr_face whose segments you want to stop logging
*/
-GR2_API void gr_stop_logging(gr_face * face);
+GR2_API void gr_stop_logging(GR_MAYBE_UNUSED gr_face * face);
/** Start logging to a FILE object.
* This function is deprecated as of 1.2.0, use the _face versions instead.

View File

@@ -4,7 +4,7 @@ _realname=graphite2
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.3.8
pkgrel=4
pkgrel=5
pkgdesc="Font rendering capabilities for complex non-Roman writing systems (mingw-w64)"
arch=('any')
url="https://github.com/silnrsi/graphite"
@@ -14,17 +14,21 @@ options=('strip' 'staticlibs')
source=("https://github.com/silnrsi/graphite/releases/download/${pkgver}/${_realname}-${pkgver}.tgz"
"001-graphite2-1.3.8-win64.patch"
"002-graphite2-1.2.1-pkgconfig.patch"
"003-graphite2-1.3.8-staticbuild.patch")
"003-graphite2-1.3.8-staticbuild.patch"
"004-graphite2-1.3.8-dllimport-fix.patch"
)
sha256sums=('9f3f25b3a8495ce0782e77f69075c0dd9b7c054847b9bf9ff130bec38f4c8cc2'
'bd6e108929110fcbfd69434221974395a4839710432fe58a9aa432e95bdf4354'
'22bef0d90c0266b3b0eff01859c1e002f84c165d12242c2bfc153f8f98fb272a'
'a7d17b8de6bec8d383f62c2a61d6eac86390a7287f5ceebf550bc19155a5adf0')
'5fecf72c0d8231b78ecfce5f88e0b6d402d6000dec3106d78f89e820489184b6'
'a84d16e160ac5911dbb442fa42f20b6a86fb281a37524d2acfaac5b2750697d2')
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
patch -p1 -i "${srcdir}"/001-graphite2-1.3.8-win64.patch
patch -p1 -i "${srcdir}"/002-graphite2-1.2.1-pkgconfig.patch
patch -p1 -i "${srcdir}"/003-graphite2-1.3.8-staticbuild.patch
patch -p1 -i "${srcdir}"/004-graphite2-1.3.8-dllimport-fix.patch
# python2 fixes
sed -i "s:\/usr\/bin\/python:\/usr\/bin\/python2:" tests/{corrupt.py,defuzz,fnttxtrender,fuzzbidi,fuzztest,hbspeeds,jsoncmp}
}