[packages/crossmingw32-cairo] - updated to 1.18.0

qboosh qboosh at pld-linux.org
Mon Sep 25 17:59:54 CEST 2023


commit a2982962d8d4019cd9db2136126e382ff3ed7de6
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Sep 25 17:30:35 2023 +0200

    - updated to 1.18.0

 cairo-link.patch        |  11 ----
 cairo-mingw32-gl.patch  | 158 ------------------------------------------------
 cairo-mingw32.patch     |  70 ++-------------------
 crossmingw32-cairo.spec | 110 +++++++++++++++++----------------
 4 files changed, 59 insertions(+), 290 deletions(-)
---
diff --git a/crossmingw32-cairo.spec b/crossmingw32-cairo.spec
index 989babc..4f030ef 100644
--- a/crossmingw32-cairo.spec
+++ b/crossmingw32-cairo.spec
@@ -1,36 +1,29 @@
-#
-# Conditional build:
-%bcond_with	opengl		# OpenGL surface backend
-
+# TODO: dwrite=enabled (BR: libd2d1, libdwrite, d2d1.h, dwrite.h
 Summary:	Cairo - multi-platform 2D graphics library - cross MinGW32 version
 Summary(pl.UTF-8):	Cairo - wieloplatformowa biblioteka graficzna 2D - skrośna wersja MinGW32
 %define		realname   cairo
 Name:		crossmingw32-%{realname}
-Version:	1.16.0
-Release:	3
+Version:	1.18.0
+Release:	1
 License:	LGPL v2.1 or MPL v1.1
 Group:		Development/Libraries
 Source0:	https://www.cairographics.org/releases/%{realname}-%{version}.tar.xz
-# Source0-md5:	f19e0353828269c22bd72e271243a552
-Patch0:		cairo-link.patch
-Patch1:		cairo-mingw32.patch
-# https://gitlab.freedesktop.org/cairo/cairo/issues/204
-Patch2:		cairo-mingw32-gl.patch
+# Source0-md5:	3f0685fbadc530606f965b9645bb51d9
+Patch0:		cairo-mingw32.patch
 URL:		https://www.cairographics.org/
-BuildRequires:	autoconf >= 2.63
-BuildRequires:	automake >= 1:1.11
 BuildRequires:	crossmingw32-fontconfig >= 2.2.95
-BuildRequires:	crossmingw32-freetype >= 2.5.1
+BuildRequires:	crossmingw32-freetype >= 2.13.0
 BuildRequires:	crossmingw32-glib2 >= 2.14
-BuildRequires:	crossmingw32-libpng
-BuildRequires:	crossmingw32-pixman >= 0.30.0
+BuildRequires:	crossmingw32-libpng >= 1.4.0
+BuildRequires:	crossmingw32-pixman >= 0.36.0
 BuildRequires:	crossmingw32-zlib
-BuildRequires:	libtool >= 2:2.2
+BuildRequires:	meson >= 0.59.0
+BuildRequires:	ninja >= 1.5
 BuildRequires:	pkgconfig >= 1:0.18
 Requires:	crossmingw32-fontconfig >= 2.2.95
-Requires:	crossmingw32-freetype >= 2.5.1
-Requires:	crossmingw32-libpng
-Requires:	crossmingw32-pixman >= 0.30.0
+Requires:	crossmingw32-freetype >= 2.13.0
+Requires:	crossmingw32-libpng >= 1.4.0
+Requires:	crossmingw32-pixman >= 0.36.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		no_install_post_strip	1
@@ -107,9 +100,9 @@ Summary:	DLL Cairo library for Windows
 Summary(pl.UTF-8):	Biblioteka DLL Cairo dla Windows
 Group:		Applications/Emulators
 Requires:	crossmingw32-fontconfig-dll >= 2.2.95
-Requires:	crossmingw32-freetype-dll >= 2.5.1
-Requires:	crossmingw32-libpng-dll
-Requires:	crossmingw32-pixman-dll >= 0.30.0
+Requires:	crossmingw32-freetype-dll >= 2.13.0
+Requires:	crossmingw32-libpng-dll >= 1.4.0
+Requires:	crossmingw32-pixman-dll >= 0.36.0
 
 %description dll
 DLL Cairo library for Windows.
@@ -158,46 +151,53 @@ Biblioteka DLL Cairo GObject dla Windows.
 %prep
 %setup -q -n %{realname}-%{version}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
+
+cat > meson-cross.txt <<'EOF'
+[host_machine]
+system = 'windows'
+cpu_family = 'x86'
+cpu = 'i386'
+endian='little'
+[binaries]
+c = '%{target}-gcc'
+cpp = '%{target}-g++'
+ar = '%{target}-ar'
+windres = '%{target}-windres'
+pkgconfig = 'pkg-config'
+[built-in options]
+%ifarch %{ix86}
+c_args = ['%(echo %{rpmcflags} | sed -e "s/ \+/ /g;s/ /', '/g")']
+%else
+# arch-specific flags (like alpha's -mieee) are not valid for i386 gcc.
+c_args = ['-O2']
+%endif
+EOF
 
 %build
 export PKG_CONFIG_LIBDIR=%{_prefix}/lib/pkgconfig
-%{__libtoolize}
-%{__aclocal} -I build
-%{__autoheader}
-%{__autoconf}
-%{__automake}
-%configure \
-	CPPFLAGS="%{rpmcppflags} -Dffs=__builtin_ffs" \
-	lt_cv_deplibs_check_method=pass_all \
-	--target=%{target} \
-	--host=%{target} \
-	--disable-gtk-doc \
-	--disable-silent-rules \
-	--disable-xlib \
-	--enable-ft \
-	%{?with_opengl:--enable-gl} \
-	--enable-pdf \
-	--enable-png \
-	--enable-ps \
-	--enable-tee \
-	--enable-windows \
-	--enable-xml
-
-%{__make}
+%meson build \
+	--cross-file meson-cross.txt \
+	-Ddwrite=disabled \
+	-Dfontconfig=enabled \
+	-Dfreetype=enabled \
+	-Dpng=enabled \
+	-Dspectre=disabled \
+	-Dtee=enabled \
+	-Dtests=disabled \
+	-Dxcb=disabled \
+	-Dxlib=disabled \
+	-Dzlib=enabled
+
+%ninja_build -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
-	DESTDIR=$RPM_BUILD_ROOT
+%ninja_install -C build
 
 install -d $RPM_BUILD_ROOT%{_dlldir}
 %{__mv} $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
 
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libcairo*.la
-
 %if 0%{!?debug:1}
 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
 %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{_libdir}/*.a
@@ -211,7 +211,7 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 # COPYING contains only notes, not LGPL/MPL texts
-%doc AUTHORS COPYING ChangeLog NEWS README
+%doc AUTHORS COPYING NEWS README.md
 %{_libdir}/libcairo.dll.a
 %{_libdir}/libcairo-script-interpreter.dll.a
 %{_includedir}/cairo
@@ -219,17 +219,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_pkgconfigdir}/cairo.pc
 %{_pkgconfigdir}/cairo-fc.pc
 %{_pkgconfigdir}/cairo-ft.pc
-%{?with_opengl:%{_pkgconfigdir}/cairo-gl.pc}
 %{_pkgconfigdir}/cairo-pdf.pc
 %{_pkgconfigdir}/cairo-png.pc
 %{_pkgconfigdir}/cairo-ps.pc
 %{_pkgconfigdir}/cairo-script.pc
+%{_pkgconfigdir}/cairo-script-interpreter.pc
 %{_pkgconfigdir}/cairo-svg.pc
 %{_pkgconfigdir}/cairo-tee.pc
-%{?with_opengl:%{_pkgconfigdir}/cairo-wgl.pc}
 %{_pkgconfigdir}/cairo-win32.pc
 %{_pkgconfigdir}/cairo-win32-font.pc
-%{_pkgconfigdir}/cairo-xml.pc
 
 %files static
 %defattr(644,root,root,755)
diff --git a/cairo-link.patch b/cairo-link.patch
deleted file mode 100644
index 8bce68a..0000000
--- a/cairo-link.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- cairo-1.12.4/configure.ac~	2012-09-13 13:38:21.000000000 +0200
-+++ cairo-1.12.4/configure.ac	2012-10-07 07:13:25.814449494 +0200
-@@ -71,7 +71,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib,
- 		     if test "x$no_x" = xyes; then
- 		       use_xlib="no (requires X development libraries)"
- 		     else
--		       xlib_NONPKGCONFIG_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
-+		       xlib_NONPKGCONFIG_LIBS="$X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
- 		       xlib_NONPKGCONFIG_CFLAGS=$X_CFLAGS
- 		     fi])
- ])
diff --git a/cairo-mingw32-gl.patch b/cairo-mingw32-gl.patch
deleted file mode 100644
index af0eb92..0000000
--- a/cairo-mingw32-gl.patch
+++ /dev/null
@@ -1,158 +0,0 @@
---- cairo-1.16.0/src/cairo-gl-composite.c.orig	2018-10-21 18:12:52.400945600 +0200
-+++ cairo-1.16.0/src/cairo-gl-composite.c	2018-10-21 18:14:57.924277503 +0200
-@@ -340,7 +340,7 @@ _cairo_gl_context_setup_operand (cairo_g
-     case CAIRO_GL_OPERAND_CONSTANT:
- 	break;
-     case CAIRO_GL_OPERAND_TEXTURE:
--	glActiveTexture (GL_TEXTURE0 + tex_unit);
-+	ctx->dispatch.ActiveTexture (GL_TEXTURE0 + tex_unit);
- 	glBindTexture (ctx->tex_target, operand->texture.tex);
- 	_cairo_gl_texture_set_extend (ctx, ctx->tex_target,
- 				      operand->texture.attributes.extend);
-@@ -358,7 +358,7 @@ _cairo_gl_context_setup_operand (cairo_g
-     case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
-     case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
-     case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT:
--	glActiveTexture (GL_TEXTURE0 + tex_unit);
-+	ctx->dispatch.ActiveTexture (GL_TEXTURE0 + tex_unit);
- 	glBindTexture (ctx->tex_target, operand->gradient.gradient->tex);
- 	_cairo_gl_texture_set_extend (ctx, ctx->tex_target, operand->gradient.extend);
- 	_cairo_gl_texture_set_filter (ctx, ctx->tex_target, CAIRO_FILTER_BILINEAR);
-@@ -481,9 +481,9 @@ _cairo_gl_set_operator (cairo_gl_context
-     }
- 
-     if (ctx->current_target->base.content == CAIRO_CONTENT_ALPHA) {
--	glBlendFuncSeparate (GL_ZERO, GL_ZERO, src_factor, dst_factor);
-+	ctx->dispatch.BlendFuncSeparate (GL_ZERO, GL_ZERO, src_factor, dst_factor);
-     } else if (ctx->current_target->base.content == CAIRO_CONTENT_COLOR) {
--	glBlendFuncSeparate (src_factor, dst_factor, GL_ONE, GL_ONE);
-+	ctx->dispatch.BlendFuncSeparate (src_factor, dst_factor, GL_ONE, GL_ONE);
-     } else {
- 	glBlendFunc (src_factor, dst_factor);
-     }
---- cairo-1.16.0/src/cairo-gl-device.c.orig	2018-10-21 18:12:52.400945600 +0200
-+++ cairo-1.16.0/src/cairo-gl-device.c	2018-10-21 18:16:20.617609890 +0200
-@@ -341,9 +341,9 @@ _cairo_gl_context_activate (cairo_gl_con
- 	    _cairo_gl_composite_flush (ctx);
- 	    _cairo_gl_context_destroy_operand (ctx, ctx->max_textures - 1);
- 	}
--	glActiveTexture (ctx->max_textures - 1);
-+	ctx->dispatch.ActiveTexture (ctx->max_textures - 1);
-     } else {
--	glActiveTexture (GL_TEXTURE0 + tex_unit);
-+	ctx->dispatch.ActiveTexture (GL_TEXTURE0 + tex_unit);
-     }
- }
- 
-diff -x '*.am' -x '*.in' -rupwN cairo-1.12.16.old/src/cairo-gl-dispatch-private.h cairo-1.12.16.new/src/cairo-gl-dispatch-private.h
---- cairo-1.12.16.old/src/cairo-gl-dispatch-private.h	2013-08-26 15:07:21 +0000
-+++ cairo-1.12.16.new/src/cairo-gl-dispatch-private.h	2014-08-02 14:58:08 +0000
-@@ -59,6 +59,16 @@ typedef struct _cairo_gl_dispatch_entry
- 			                     offsetof(cairo_gl_dispatch_t, name)}
- #define DISPATCH_ENTRY_LAST { { NULL, NULL, NULL }, 0 }
- 
-+cairo_private cairo_gl_dispatch_entry_t dispatch_multitexture_entries[] = {
-+    DISPATCH_ENTRY_ARB     (ActiveTexture),
-+    DISPATCH_ENTRY_LAST
-+};
-+
-+cairo_private cairo_gl_dispatch_entry_t dispatch_blendfuncseparate_entries[] = {
-+    DISPATCH_ENTRY_EXT     (BlendFuncSeparate),
-+    DISPATCH_ENTRY_LAST
-+};
-+
- cairo_private cairo_gl_dispatch_entry_t dispatch_buffers_entries[] = {
-     DISPATCH_ENTRY_ARB     (GenBuffers),
-     DISPATCH_ENTRY_ARB     (BindBuffer),
-diff -x '*.am' -x '*.in' -rupwN cairo-1.12.16.old/src/cairo-gl-dispatch.c cairo-1.12.16.new/src/cairo-gl-dispatch.c
---- cairo-1.12.16.old/src/cairo-gl-dispatch.c	2013-08-26 15:07:21 +0000
-+++ cairo-1.12.16.new/src/cairo-gl-dispatch.c	2014-08-02 15:00:10 +0000
-@@ -226,6 +226,45 @@ _cairo_gl_dispatch_init_multisampling (c
-     return CAIRO_STATUS_SUCCESS;
- }
- 
-+static cairo_status_t
-+_cairo_gl_dispatch_init_multitexture (cairo_gl_dispatch_t *dispatch,
-+				       cairo_gl_get_proc_addr_func_t get_proc_addr,
-+				       int gl_version,
-+				       cairo_gl_flavor_t gl_flavor)
-+{
-+    cairo_gl_dispatch_name_t dispatch_name = CAIRO_GL_DISPATCH_NAME_EXT;
-+
-+    if (gl_version >= CAIRO_GL_VERSION_ENCODE (1, 3))
-+      dispatch_name = CAIRO_GL_DISPATCH_NAME_CORE;
-+    else if (!_cairo_gl_has_extension ("GL_ARB_multitexture"))
-+    return CAIRO_STATUS_DEVICE_ERROR;
-+
-+    _cairo_gl_dispatch_init_entries (dispatch, get_proc_addr,
-+				     dispatch_multitexture_entries,
-+				     dispatch_name);
-+    return CAIRO_STATUS_SUCCESS;
-+}
-+
-+static cairo_status_t
-+_cairo_gl_dispatch_init_blendfuncseparate (cairo_gl_dispatch_t *dispatch,
-+				       cairo_gl_get_proc_addr_func_t get_proc_addr,
-+				       int gl_version,
-+				       cairo_gl_flavor_t gl_flavor)
-+{
-+    cairo_gl_dispatch_name_t dispatch_name = CAIRO_GL_DISPATCH_NAME_EXT;
-+
-+    if (gl_version >= CAIRO_GL_VERSION_ENCODE (1, 4))
-+    {
-+      dispatch_name = CAIRO_GL_DISPATCH_NAME_CORE;
-+    } else if (!_cairo_gl_has_extension ("GL_EXT_blend_func_separate"))
-+    return CAIRO_STATUS_DEVICE_ERROR;
-+
-+    _cairo_gl_dispatch_init_entries (dispatch, get_proc_addr,
-+				     dispatch_blendfuncseparate_entries,
-+				     dispatch_name);
-+    return CAIRO_STATUS_SUCCESS;
-+}
-+
- cairo_status_t
- _cairo_gl_dispatch_init (cairo_gl_dispatch_t *dispatch,
- 			 cairo_gl_get_proc_addr_func_t get_proc_addr)
-@@ -257,5 +296,15 @@ _cairo_gl_dispatch_init (cairo_gl_dispat
-     if (status != CAIRO_STATUS_SUCCESS)
- 	return status;
- 
-+    status = _cairo_gl_dispatch_init_multitexture (dispatch, get_proc_addr,
-+						    gl_version, gl_flavor);
-+    if (status != CAIRO_STATUS_SUCCESS)
-+	return status;
-+
-+    status = _cairo_gl_dispatch_init_blendfuncseparate (dispatch, get_proc_addr,
-+						    gl_version, gl_flavor);
-+    if (status != CAIRO_STATUS_SUCCESS)
-+	return status;
-+
-     return CAIRO_STATUS_SUCCESS;
- }
-diff -x '*.am' -x '*.in' -rupwN cairo-1.12.16.old/src/cairo-gl-glyphs.c cairo-1.12.16.new/src/cairo-gl-glyphs.c
---- cairo-1.12.16.old/src/cairo-gl-glyphs.c	2013-08-26 15:07:21 +0000
-+++ cairo-1.12.16.new/src/cairo-gl-glyphs.c	2014-08-01 21:45:43 +0000
-@@ -130,7 +130,7 @@ _cairo_gl_glyph_cache_add_glyph (cairo_g
- 	return status;
- 
-     /* XXX: Make sure we use the mask texture. This should work automagically somehow */
--    glActiveTexture (GL_TEXTURE1);
-+    ctx->dispatch.ActiveTexture (GL_TEXTURE1);
-     status = _cairo_gl_surface_draw_image (cache->surface, glyph_surface,
-                                            0, 0,
-                                            glyph_surface->width, glyph_surface->height,
-diff -x '*.am' -x '*.in' -rupwN cairo-1.12.16.old/src/cairo-gl-private.h cairo-1.12.16.new/src/cairo-gl-private.h
---- cairo-1.12.16.old/src/cairo-gl-private.h	2013-08-26 15:07:21 +0000
-+++ cairo-1.12.16.new/src/cairo-gl-private.h	2014-08-01 21:35:01 +0000
-@@ -325,6 +325,11 @@ typedef struct _cairo_gl_dispatch {
-     void (*FramebufferTexture2DMultisample) (GLenum target, GLenum attachment,
- 					     GLenum textarget, GLuint texture,
- 					     GLint level, GLsizei samples);
-+
-+    /* Misc */
-+    void (*ActiveTexture) (GLenum texture);
-+    void (*BlendFuncSeparate) (GLenum sfactorRGB, GLenum dfactorRGB,
-+                         GLenum sfactorAlpha, GLenum dfactorAlpha);
- } cairo_gl_dispatch_t;
- 
- struct _cairo_gl_context {
diff --git a/cairo-mingw32.patch b/cairo-mingw32.patch
index e3a43b9..7a2a34e 100644
--- a/cairo-mingw32.patch
+++ b/cairo-mingw32.patch
@@ -1,71 +1,11 @@
---- cairo-1.12.0/util/cairo-missing/cairo-missing.h.orig	2012-02-02 01:48:15.000000000 +0100
-+++ cairo-1.12.0/util/cairo-missing/cairo-missing.h	2012-03-25 12:56:29.970335651 +0200
-@@ -37,7 +37,7 @@
- #include <string.h>
- #include <sys/types.h>
- 
--#ifdef _WIN32
-+#if defined(_WIN32) && !defined(__MINGW32__)
- #define WIN32_LEAN_AND_MEAN
- #include <windows.h>
-
---- cairo-1.14.4/boilerplate/cairo-boilerplate-win32.c.orig	2015-10-27 22:04:22.000000000 +0100
-+++ cairo-1.14.4/boilerplate/cairo-boilerplate-win32.c	2015-10-30 17:16:38.317127499 +0100
-@@ -26,6 +26,7 @@
- 
- #include "cairo-boilerplate-private.h"
- 
-+#include <limits.h>
- #include <cairo-win32.h>
- 
- static const cairo_user_data_key_t win32_closure_key;
---- cairo-1.14.12/src/cairo-compiler-private.h.orig	2017-12-04 23:24:46.000000000 +0100
-+++ cairo-1.14.12/src/cairo-compiler-private.h	2018-09-27 21:39:54.869047194 +0200
-@@ -195,7 +195,7 @@
+--- cairo-1.18.0/src/cairo-compiler-private.h.orig	2023-09-25 17:24:13.379273100 +0200
++++ cairo-1.18.0/src/cairo-compiler-private.h	2023-09-25 17:24:48.662415288 +0200
+@@ -149,7 +149,7 @@
  #define __attribute__(x)
  #endif
  
 -#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
 +#if (defined(__WIN32__) && !defined(__WINE__) && !defined(__MINGW32__)) || defined(_MSC_VER)
  #define access _access
- #define fdopen _fdopen
- #define hypot _hypot
---- cairo-1.16.0/configure.ac.orig	2018-10-21 16:21:17.304355378 +0200
-+++ cairo-1.16.0/configure.ac	2018-10-21 17:09:07.484322608 +0200
-@@ -334,7 +334,12 @@
- 	  AC_CHECK_HEADER(GL/gl.h,, [use_gl="no (gl.pc nor OpenGL headers not found)"])
- 	  if test "x$use_gl" = "xyes"; then
- 	      gl_NONPKGCONFIG_CFLAGS=
-+	      if test "x$have_windows" = xyes; then
-+		      gl_NONPKGCONFIG_LIBS="-lopengl32"
-+		      gl_REQUIRES=
-+	      else
- 	      gl_NONPKGCONFIG_LIBS="-lGL"
-+	      fi
- 	  fi])
- 
-   if test "x$have_dl" = "xyes" -a "x$have_dlsym" = "xyes"; then
---- cairo-1.16.0/test/Makefile.am.orig	2018-08-17 03:10:53.000000000 +0200
-+++ cairo-1.16.0/test/Makefile.am	2018-10-21 18:46:12.054256102 +0200
-@@ -17,8 +17,11 @@ endif
- endif
- 
- if CAIRO_HAS_GL_SURFACE
-+if CAIRO_HAS_XLIB_SURFACE
-+# gl_surface test relies on X11/GLX
- test_sources += $(gl_surface_test_sources)
- endif
-+endif
- 
- if CAIRO_HAS_EGL_FUNCTIONS
- test_sources += $(egl_surface_test_sources)
---- cairo-1.16.0/boilerplate/cairo-boilerplate-wgl.c.orig	2018-08-17 03:10:53.000000000 +0200
-+++ cairo-1.16.0/boilerplate/cairo-boilerplate-wgl.c	2018-10-21 20:14:56.554195307 +0200
-@@ -35,6 +35,7 @@
- 
- #include "cairo-boilerplate-private.h"
- 
-+#include <GL/gl.h>
- #include <cairo-gl.h>
- 
- static const cairo_user_data_key_t gl_closure_key;
+ #ifndef R_OK
+ #define R_OK 4
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-cairo.git/commitdiff/a2982962d8d4019cd9db2136126e382ff3ed7de6



More information about the pld-cvs-commit mailing list