From 292b2445689ed3146d9d1bf6e341e42f51dde002 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Mon, 1 Aug 2022 23:21:17 +0200 Subject: [PATCH] [Cairo] fix clang-cl build (#26056) * [cairo] fix clang-cl build * v db --- ports/cairo/fix_clang-cl_build.patch | 37 ++++++++++++++++++++++++++++ ports/cairo/portfile.cmake | 6 +++++ ports/cairo/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/c-/cairo.json | 5 ++++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 ports/cairo/fix_clang-cl_build.patch diff --git a/ports/cairo/fix_clang-cl_build.patch b/ports/cairo/fix_clang-cl_build.patch new file mode 100644 index 0000000000..133afb7eb5 --- /dev/null +++ b/ports/cairo/fix_clang-cl_build.patch @@ -0,0 +1,37 @@ +diff --git a/util/cairo-script/cairo-script-objects.c b/util/cairo-script/cairo-script-objects.c +index 2d7937be3..4d55ca848 100644 +--- a/util/cairo-script/cairo-script-objects.c ++++ b/util/cairo-script/cairo-script-objects.c +@@ -127,7 +127,7 @@ csi_array_append (csi_t *ctx, + return _csi_stack_push (ctx, &array->stack, csi_object_reference (obj)); + } + +-inline csi_status_t ++csi_status_t + _csi_array_execute (csi_t *ctx, csi_array_t *array) + { + csi_integer_t i; +diff --git a/meson.build b/meson.build +index 7b20c0c48..9cb4a82ba 100644 +--- a/meson.build ++++ b/meson.build +@@ -38,7 +38,7 @@ cc = meson.get_compiler('c') + + # Compiler flags + cflags = [] +-if cc.get_id() != 'msvc' ++if cc.get_argument_syntax() != 'msvc' + cflags += [ + '-Wmissing-declarations', + '-Werror-implicit-function-declaration', +@@ -159,8 +159,7 @@ check_headers = [ + + check_types = [ + ['uint64_t', {'headers': ['stdint.h']}], +- ['uint128_t', {'headers': ['stdint.h']}], +- ['__uint128_t'] ++ ['uint128_t', {'headers': ['stdint.h']}] + ] + + check_funcs = [ + \ No newline at end of file diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake index 02d1185112..737f310cf8 100644 --- a/ports/cairo/portfile.cmake +++ b/ports/cairo/portfile.cmake @@ -1,3 +1,8 @@ + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(PATCHES fix_clang-cl_build.patch) +endif() + vcpkg_from_gitlab( GITLAB_URL https://gitlab.freedesktop.org OUT_SOURCE_PATH SOURCE_PATH @@ -9,6 +14,7 @@ vcpkg_from_gitlab( cairo_static_fix.patch disable-atomic-ops-check.patch # See https://gitlab.freedesktop.org/cairo/cairo/-/issues/554 mingw-dllexport.patch + ${PATCHES} ) if("fontconfig" IN_LIST FEATURES) diff --git a/ports/cairo/vcpkg.json b/ports/cairo/vcpkg.json index c185a2915e..e5e135c2c1 100644 --- a/ports/cairo/vcpkg.json +++ b/ports/cairo/vcpkg.json @@ -1,7 +1,7 @@ { "name": "cairo", "version": "1.17.6", - "port-version": 3, + "port-version": 4, "description": "Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.", "homepage": "https://cairographics.org", "license": "MPL-1.1", diff --git a/versions/baseline.json b/versions/baseline.json index 5589ac67b8..5ceccdbc47 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1250,7 +1250,7 @@ }, "cairo": { "baseline": "1.17.6", - "port-version": 3 + "port-version": 4 }, "cairomm": { "baseline": "1.16.1", diff --git a/versions/c-/cairo.json b/versions/c-/cairo.json index b59decf711..0e83f32c8f 100644 --- a/versions/c-/cairo.json +++ b/versions/c-/cairo.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "eac156360b2a89a655152bafd92c3e285adc473e", + "version": "1.17.6", + "port-version": 4 + }, { "git-tree": "c339d543f41d311c7d4282ca1efa4e400eb30b73", "version": "1.17.6",