summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSchala2016-09-28 15:08:45 -0700
committerSchala2016-09-28 15:08:45 -0700
commit4a9870fb21c26b92be43c8d1683dc02d50a9f6e8 (patch)
treec9e00fd371d13e92bae49b6706da4d936fd7ec72
downloadaur-4a9870fb21c26b92be43c8d1683dc02d50a9f6e8.tar.gz
init
-rw-r--r--.SRCINFO30
-rw-r--r--.gitignore4
-rw-r--r--001-graphite2-1.3.8-win64.patch26
-rw-r--r--002-graphite2-1.2.1-pkgconfig.patch20
-rw-r--r--003-graphite2-1.3.8-staticbuild.patch64
-rw-r--r--004-graphite2-1.3.8-dllimport-fix.patch84
-rw-r--r--PKGBUILD55
7 files changed, 283 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..7080f45f86a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+# Generated by mksrcinfo v8
+# Wed Sep 28 22:08:34 UTC 2016
+pkgbase = mingw-w64-graphite
+ pkgdesc = reimplementation of the SIL Graphite text processing engine (mingw-w64)
+ pkgver = 1.3.8
+ pkgrel = 1
+ url = https://github.com/silnrsi/graphite
+ arch = any
+ license = LGPL
+ license = GPL
+ license = custom
+ makedepends = mingw-w64-cmake
+ makedepends = python2
+ depends = mingw-w64-crt
+ options = staticlibs
+ options = !strip
+ options = !buildflags
+ source = https://github.com/silnrsi/graphite/releases/download/1.3.8/graphite2-1.3.8.tgz
+ source = 001-graphite2-1.3.8-win64.patch
+ source = 002-graphite2-1.2.1-pkgconfig.patch
+ source = 003-graphite2-1.3.8-staticbuild.patch
+ source = 004-graphite2-1.3.8-dllimport-fix.patch
+ sha1sums = 0c802628dacf3bfa2c1654d7d72b76e20e1adc97
+ sha1sums = 68c7b3c1c9e38f357a95e5b3b266d4afcfe78329
+ sha1sums = 4460d61e238892c421ae7771e3b36dc0b21d682c
+ sha1sums = da2c20e50cd50a6cac422fd69459060a02311988
+ sha1sums = d872ba0db6040865cfb1227e83f0f02cbdbe083a
+
+pkgname = mingw-w64-graphite
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..62333083ac7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg/
+src/
+*.tar
+*.tgz
diff --git a/001-graphite2-1.3.8-win64.patch b/001-graphite2-1.3.8-win64.patch
new file mode 100644
index 00000000000..cd00c3d6e4c
--- /dev/null
+++ b/001-graphite2-1.3.8-win64.patch
@@ -0,0 +1,26 @@
+--- graphite2-1.3.8/src/inc/json.h.orig 2016-04-01 03:31:38.543833400 -0400
++++ graphite2-1.3.8/src/inc/json.h 2016-04-01 03:38:38.112543400 -0400
+@@ -86,6 +86,10 @@ public:
+ json & operator << (number) throw();
+ json & operator << (integer) throw();
+ json & operator << (long unsigned int d) throw();
++#ifdef _WIN32
++ json & operator << (unsigned __int64 d) throw();
++ json & operator << (__int64 d) throw();
++#endif
+ json & operator << (boolean) throw();
+ json & operator << (_null_t) throw();
+ json & operator << (_context_t) throw();
+--- graphite2-1.3.8/src/json.cpp.orig 2016-04-01 03:31:38.550833700 -0400
++++ graphite2-1.3.8/src/json.cpp 2016-04-01 03:41:05.363588200 -0400
+@@ -133,6 +133,10 @@ json & json::operator << (json::number f
+ }
+ json & json::operator << (json::integer d) throw() { context(seq); fprintf(_stream, "%ld", d); return *this; }
+ json & json::operator << (long unsigned d) throw() { context(seq); fprintf(_stream, "%ld", d); return *this; }
++#ifdef _WIN32
++json & json::operator << (unsigned __int64 d) throw() { context(seq); fprintf(_stream, "%I64", d); return *this; }
++json & json::operator << (__int64 d) throw() { context(seq); fprintf(_stream, "%I64", d); return *this; }
++#endif
+ json & json::operator << (json::boolean b) throw() { context(seq); fputs(b ? "true" : "false", _stream); return *this; }
+ json & json::operator << (json::_null_t) throw() { context(seq); fputs("null",_stream); return *this; }
+
diff --git a/002-graphite2-1.2.1-pkgconfig.patch b/002-graphite2-1.2.1-pkgconfig.patch
new file mode 100644
index 00000000000..27eae13a2cb
--- /dev/null
+++ b/002-graphite2-1.2.1-pkgconfig.patch
@@ -0,0 +1,20 @@
+--- graphite2-1.2.1/graphite2.pc.in 2013-02-27 20:32:04.000000000 +0100
++++ graphite2-1.2.1/graphite2.pc.in 2013-05-09 22:52:58.990959979 +0200
+@@ -1,3 +1,7 @@
++prefix=${prefix}
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
+
+ Name: Graphite2
+ Description: Font rendering engine for Complex Scripts
+--- graphite2-1.2.1/CMakeLists.txt 2013-02-27 20:32:04.000000000 +0100
++++ graphite2-1.2.1/CMakeLists.txt 2013-06-06 21:11:28.241391998 +0200
+@@ -64,6 +64,7 @@
+ endif (NOT (GRAPHITE2_NSEGCACHE OR GRAPHITE2_NFILEFACE))
+
+ set(version 3.0.1)
++set(prefix ${CMAKE_INSTALL_PREFIX})
+ set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+ set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+
diff --git a/003-graphite2-1.3.8-staticbuild.patch b/003-graphite2-1.3.8-staticbuild.patch
new file mode 100644
index 00000000000..74b864e3141
--- /dev/null
+++ b/003-graphite2-1.3.8-staticbuild.patch
@@ -0,0 +1,64 @@
+--- 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})
+
++add_library(graphite2_static STATIC
++ ${GRAPHITE2_VM_TYPE}_machine.cpp
++ gr_char_info.cpp
++ gr_features.cpp
++ gr_face.cpp
++ gr_font.cpp
++ gr_logging.cpp
++ gr_segment.cpp
++ gr_slot.cpp
++ CachedFace.cpp
++ CmapCache.cpp
++ Code.cpp
++ Collider.cpp
++ Decompressor.cpp
++ Face.cpp
++ FeatureMap.cpp
++ Font.cpp
++ GlyphFace.cpp
++ GlyphCache.cpp
++ Intervals.cpp
++ Justifier.cpp
++ NameTable.cpp
++ Pass.cpp
++ Position.cpp
++ Segment.cpp
++ Silf.cpp
++ Slot.cpp
++ Sparse.cpp
++ TtfUtil.cpp
++ UtfCodec.cpp
++ ${FILEFACE}
++ ${SEGCACHE}
++ ${TRACING})
++
++set_target_properties(graphite2_static PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}"
++ SOVERSION ${GRAPHITE_SO_VERSION}
++ VERSION ${GRAPHITE_VERSION}
++ LT_VERSION_CURRENT ${GRAPHITE_API_CURRENT}
++ LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
++ LT_VERSION_AGE ${GRAPHITE_API_AGE}
++ OUTPUT_NAME graphite2)
++
+ 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"
+@@ -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")
+
+
+-install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin)
++install(TARGETS graphite2 graphite2_static EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin)
+ install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_)
diff --git a/004-graphite2-1.3.8-dllimport-fix.patch b/004-graphite2-1.3.8-dllimport-fix.patch
new file mode 100644
index 00000000000..76ff44df5a6
--- /dev/null
+++ b/004-graphite2-1.3.8-dllimport-fix.patch
@@ -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.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..7d95afc332e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+pkgname=mingw-w64-graphite
+pkgver=1.3.8
+pkgrel=1
+arch=(any)
+pkgdesc="reimplementation of the SIL Graphite text processing engine (mingw-w64)"
+license=("LGPL" "GPL" "custom")
+depends=(mingw-w64-crt)
+makedepends=(mingw-w64-cmake python2)
+options=(staticlibs !strip !buildflags)
+url="https://github.com/silnrsi/graphite"
+source=("https://github.com/silnrsi/graphite/releases/download/${pkgver}/graphite2-${pkgver}.tgz"
+"001-graphite2-1.3.8-win64.patch"
+"002-graphite2-1.2.1-pkgconfig.patch"
+"003-graphite2-1.3.8-staticbuild.patch"
+"004-graphite2-1.3.8-dllimport-fix.patch")
+sha1sums=('0c802628dacf3bfa2c1654d7d72b76e20e1adc97'
+ '68c7b3c1c9e38f357a95e5b3b266d4afcfe78329'
+ '4460d61e238892c421ae7771e3b36dc0b21d682c'
+ 'da2c20e50cd50a6cac422fd69459060a02311988'
+ 'd872ba0db6040865cfb1227e83f0f02cbdbe083a')
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd graphite2-$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
+ sed -i "s:\/usr\/bin\/python:\/usr\/bin\/python2:" tests/{corrupt.py,defuzz,fnttxtrender,fuzzbidi,fuzztest,hbspeeds,jsoncmp}
+}
+
+build() {
+ cd graphite2-$pkgver
+ for _arch in ${_architectures}; do
+ unset LDFLAGS
+ mkdir "build-${_arch}" && pushd "build-${_arch}"
+ ${_arch}-cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DGRAPHITE2_COMPARE_RENDERER=OFF \
+ ..
+ make
+ popd
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/${pkgname#mingw-w64-}2-$pkgver/build-${_arch}"
+ make DESTDIR="$pkgdir" install
+ find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
+ find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
+ find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
+ done
+}