summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO29
-rw-r--r--.gitignore3
-rw-r--r--0009-standalone-headers.mingw.patch11
-rw-r--r--0013-mozilla-transparent-windows.all.patch109
-rw-r--r--0022-dont-fail-argb-similar.all.patch11
-rw-r--r--0026-create-argb-fonts.all.patch22
-rw-r--r--PKGBUILD63
7 files changed, 248 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..a3c71958c3df
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = mingw-w64-cairo
+ pkgdesc = Cairo vector graphics library (mingw-w64)
+ pkgver = 1.14.2
+ pkgrel = 2
+ url = http://cairographics.org/
+ arch = any
+ license = LGPL
+ license = MPL
+ makedepends = mingw-w64-configure
+ makedepends = mingw-w64-glib2
+ depends = mingw-w64-fontconfig
+ depends = mingw-w64-pixman
+ optdepends = mingw-w64-glib2: libcairo-gobject
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = http://cairographics.org/releases/cairo-1.14.2.tar.xz
+ source = 0009-standalone-headers.mingw.patch
+ source = 0013-mozilla-transparent-windows.all.patch
+ source = 0022-dont-fail-argb-similar.all.patch
+ source = 0026-create-argb-fonts.all.patch
+ sha1sums = c8da68aa66ca0855b5d0ff552766d3e8679e1d24
+ sha1sums = 58c548d2791ba20dd7f6e328ff596f746df3aa10
+ sha1sums = b4b8c6f4931814e7e77ddeb98fecaf70cb807e04
+ sha1sums = fa601d6d2b2c75b0b1608ab3fa9c2e5b6cc31c9e
+ sha1sums = 9c0e533614782a41af2c3806a43ab7fe9d6a5431
+
+pkgname = mingw-w64-cairo
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..f46de972b6fc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+pkg/
+src/
+*.xz
diff --git a/0009-standalone-headers.mingw.patch b/0009-standalone-headers.mingw.patch
new file mode 100644
index 000000000000..ce591c78c00c
--- /dev/null
+++ b/0009-standalone-headers.mingw.patch
@@ -0,0 +1,11 @@
+--- cairo-1.12.10/src/Makefile.am.analysis.orig 2013-01-19 16:35:36 +0400
++++ cairo-1.12.10/src/Makefile.am.analysis 2013-01-19 17:16:51 +0400
+@@ -24,7 +24,7 @@
+ @echo Checking that enabled public/private headers can be compiled standalone
+ @status=true; for f in $(enabled_cairo_headers) $(enabled_cairo_private); do \
+ echo " CHECK $$f"; \
+- echo "#include \"$(srcdir)/$$f\"" > headers-standalone-tmp.c; \
++ echo "#include \"$(shell cd $(srcdir) ; pwd -W)/$$f\"" > headers-standalone-tmp.c; \
+ echo "int main(int argc, char * argv[]) { return 0; }" >> headers-standalone-tmp.c; \
+ $(COMPILE) -o headers-standalone-tmp headers-standalone-tmp.c || status=false; \
+ $(RM) headers-standalone-tmp headers-standalone-tmp.c; \
diff --git a/0013-mozilla-transparent-windows.all.patch b/0013-mozilla-transparent-windows.all.patch
new file mode 100644
index 000000000000..e6712c01a989
--- /dev/null
+++ b/0013-mozilla-transparent-windows.all.patch
@@ -0,0 +1,109 @@
+diff --git a/gfx/cairo/cairo/src/cairo-win32.h b/gfx/cairo/cairo/src/cairo-win32.h
+--- a/src/cairo-win32.h
++++ b/src/cairo-win32.h
+@@ -44,16 +44,19 @@
+ #include <windows.h>
+
+ CAIRO_BEGIN_DECLS
+
+ cairo_public cairo_surface_t *
+ cairo_win32_surface_create (HDC hdc);
+
+ cairo_public cairo_surface_t *
++cairo_win32_surface_create_with_alpha (HDC hdc);
++
++cairo_public cairo_surface_t *
+ cairo_win32_printing_surface_create (HDC hdc);
+
+ cairo_public cairo_surface_t *
+ cairo_win32_surface_create_with_ddb (HDC hdc,
+ cairo_format_t format,
+ int width,
+ int height);
+
+--- cairo-1.12.16/src/win32/cairo-win32-display-surface.c.orig 2013-08-26 15:07:21.000000000 +0000
++++ cairo-1.12.16/src/win32/cairo-win32-display-surface.c 2014-03-27 00:04:01.097336000 +0000
+@@ -916,33 +916,14 @@
+ * multiplied by all the src components.
+ */
+
+-/**
+- * cairo_win32_surface_create:
+- * @hdc: the DC to create a surface for
+- *
+- * Creates a cairo surface that targets the given DC. The DC will be
+- * queried for its initial clip extents, and this will be used as the
+- * size of the cairo surface. The resulting surface will always be of
+- * format %CAIRO_FORMAT_RGB24; should you need another surface format,
+- * you will need to create one through
+- * cairo_win32_surface_create_with_dib().
+- *
+- * Return value: the newly created surface
+- *
+- * Since: 1.0
+- **/
+-cairo_surface_t *
+-cairo_win32_surface_create (HDC hdc)
++static cairo_surface_t *
++cairo_win32_surface_create_internal (HDC hdc, cairo_format_t format)
+ {
+ cairo_win32_display_surface_t *surface;
+
+- cairo_format_t format;
+ cairo_status_t status;
+ cairo_device_t *device;
+
+- /* Assume that everything coming in as a HDC is RGB24 */
+- format = CAIRO_FORMAT_RGB24;
+-
+ surface = malloc (sizeof (*surface));
+ if (surface == NULL)
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
+@@ -977,6 +958,47 @@
+ }
+
+ /**
++ * cairo_win32_surface_create:
++ * @hdc: the DC to create a surface for
++ *
++ * Creates a cairo surface that targets the given DC. The DC will be
++ * queried for its initial clip extents, and this will be used as the
++ * size of the cairo surface. The resulting surface will always be of
++ * format %CAIRO_FORMAT_RGB24; should you need another surface format,
++ * you will need to create one through
++ * cairo_win32_surface_create_with_dib().
++ *
++ * Return value: the newly created surface
++ *
++ * Since: 1.0
++ **/
++cairo_surface_t *
++cairo_win32_surface_create (HDC hdc)
++{
++ return cairo_win32_surface_create_internal(hdc, CAIRO_FORMAT_RGB24);
++}
++
++/**
++ * cairo_win32_surface_create_with_alpha:
++ * @hdc: the DC to create a surface for
++ *
++ * Creates a cairo surface that targets the given DC. The DC will be
++ * queried for its initial clip extents, and this will be used as the
++ * size of the cairo surface. The resulting surface will always be of
++ * format %CAIRO_FORMAT_ARGB32; this format is used when drawing into
++ * transparent windows.
++ *
++ * Return value: the newly created surface
++ *
++ * Since: 1.12
++ **/
++cairo_surface_t *
++cairo_win32_surface_create_with_alpha (HDC hdc)
++{
++ return cairo_win32_surface_create_internal(hdc, CAIRO_FORMAT_ARGB32);
++}
++
++/**
+ * cairo_win32_surface_create_with_dib:
+ * @format: format of pixels in the surface to create
+ * @width: width of the surface, in pixels
diff --git a/0022-dont-fail-argb-similar.all.patch b/0022-dont-fail-argb-similar.all.patch
new file mode 100644
index 000000000000..4306e54608c4
--- /dev/null
+++ b/0022-dont-fail-argb-similar.all.patch
@@ -0,0 +1,11 @@
+--- cairo-bb17403622e9ea474017e0039af8ee48b2b285db/src/win32/cairo-win32-display-surface.c.orig 2014-04-05 19:23:25.770005100 +0000
++++ cairo-bb17403622e9ea474017e0039af8ee48b2b285db/src/win32/cairo-win32-display-surface.c 2014-04-05 19:27:59.506765200 +0000
+@@ -1049,7 +1049,7 @@
+ HDC screen_dc, ddb_dc;
+ HBITMAP saved_dc_bitmap;
+
+- if (format != CAIRO_FORMAT_RGB24)
++ if (format != CAIRO_FORMAT_RGB24 && format != CAIRO_FORMAT_ARGB32)
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
+ /* XXX handle these eventually
+ format != CAIRO_FORMAT_A8 ||
diff --git a/0026-create-argb-fonts.all.patch b/0026-create-argb-fonts.all.patch
new file mode 100644
index 000000000000..866b49f8a8b7
--- /dev/null
+++ b/0026-create-argb-fonts.all.patch
@@ -0,0 +1,22 @@
+--- cairo-bb17403622e9ea474017e0039af8ee48b2b285db/src/win32/cairo-win32-font.c.orig 2014-04-02 04:16:04.638143700 +0000
++++ cairo-bb17403622e9ea474017e0039af8ee48b2b285db/src/win32/cairo-win32-font.c 2014-04-05 20:10:47.108309200 +0000
+@@ -1600,7 +1600,7 @@
+ width = x2 - x1;
+ height = y2 - y1;
+
+- surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_RGB24,
++ surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32,
+ width, height);
+ status = _cairo_surface_paint (surface, CAIRO_OPERATOR_SOURCE,
+ &_cairo_pattern_white.base, NULL);
+--- cairo-bb17403622e9ea474017e0039af8ee48b2b285db/src/win32/cairo-win32-surface.c.orig 2014-03-21 13:10:19.000000000 +0000
++++ cairo-bb17403622e9ea474017e0039af8ee48b2b285db/src/win32/cairo-win32-surface.c 2014-04-05 20:12:14.176865500 +0000
+@@ -227,7 +227,7 @@
+
+ /* We can only handle opaque solid color sources and destinations */
+ assert (_cairo_pattern_is_opaque_solid(source));
+- assert (dst->format == CAIRO_FORMAT_RGB24);
++ assert (dst->format == CAIRO_FORMAT_RGB24 || dst->format == CAIRO_FORMAT_ARGB32);
+
+ solid_pattern = (cairo_solid_pattern_t *)source;
+ color = RGB(((int)solid_pattern->color.red_short) >> 8,
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d83b0a151ae5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,63 @@
+# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
+pkgname=mingw-w64-cairo
+pkgver=1.14.2
+pkgrel=2
+pkgdesc="Cairo vector graphics library (mingw-w64)"
+arch=(any)
+url="http://cairographics.org/"
+license=("LGPL" "MPL")
+makedepends=(mingw-w64-configure mingw-w64-glib2)
+depends=(mingw-w64-fontconfig mingw-w64-pixman)
+optdepends=("mingw-w64-glib2: libcairo-gobject")
+options=(!strip !buildflags staticlibs)
+source=("http://cairographics.org/releases/cairo-${pkgver}.tar.xz"
+"0009-standalone-headers.mingw.patch"
+"0013-mozilla-transparent-windows.all.patch"
+"0022-dont-fail-argb-similar.all.patch"
+"0026-create-argb-fonts.all.patch")
+sha1sums=('c8da68aa66ca0855b5d0ff552766d3e8679e1d24'
+ '58c548d2791ba20dd7f6e328ff596f746df3aa10'
+ 'b4b8c6f4931814e7e77ddeb98fecaf70cb807e04'
+ 'fa601d6d2b2c75b0b1608ab3fa9c2e5b6cc31c9e'
+ '9c0e533614782a41af2c3806a43ab7fe9d6a5431')
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd cairo-$pkgver
+ patch -p1 -i ${srcdir}/0009-standalone-headers.mingw.patch
+ patch -p1 -i ${srcdir}/0013-mozilla-transparent-windows.all.patch
+ patch -p1 -i ${srcdir}/0022-dont-fail-argb-similar.all.patch
+ patch -p1 -i ${srcdir}/0026-create-argb-fonts.all.patch
+ autoreconf -fi
+}
+
+build() {
+ cd cairo-${pkgver}
+ CFLAGS+=" -Wno-implicit-function-declaration"
+ for _arch in ${_architectures}; do
+ mkdir -p build-${_arch} && pushd build-${_arch}
+ ${_arch}-configure \
+ --enable-win32 \
+ --enable-win32-font \
+ --enable-png \
+ --enable-gobject \
+ --enable-tee \
+ --disable-xlib \
+ --disable-xcb \
+ --enable-fc \
+ --enable-ft
+ make
+ popd
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/cairo-${pkgver}/build-${_arch}"
+ make DESTDIR="$pkgdir" install
+ find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
+ find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
+ rm -r "$pkgdir/usr/${_arch}/share"
+ done
+}