diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/cairo | |
Diffstat (limited to 'vcpkg/ports/cairo')
| -rw-r--r-- | vcpkg/ports/cairo/fix_clang-cl_build.patch | 37 | ||||
| -rw-r--r-- | vcpkg/ports/cairo/msvc-convenience.diff | 15 | ||||
| -rw-r--r-- | vcpkg/ports/cairo/portfile.cmake | 76 | ||||
| -rw-r--r-- | vcpkg/ports/cairo/vcpkg.json | 70 |
4 files changed, 198 insertions, 0 deletions
diff --git a/vcpkg/ports/cairo/fix_clang-cl_build.patch b/vcpkg/ports/cairo/fix_clang-cl_build.patch new file mode 100644 index 0000000..133afb7 --- /dev/null +++ b/vcpkg/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/vcpkg/ports/cairo/msvc-convenience.diff b/vcpkg/ports/cairo/msvc-convenience.diff new file mode 100644 index 0000000..664d320 --- /dev/null +++ b/vcpkg/ports/cairo/msvc-convenience.diff @@ -0,0 +1,15 @@ +diff --git a/src/win32/cairo-win32-private.h b/src/win32/cairo-win32-private.h +index d457b78..0b1b4ed 100644 +--- a/src/win32/cairo-win32-private.h ++++ b/src/win32/cairo-win32-private.h +@@ -53,6 +53,10 @@ + + #define WIN32_FONT_LOGICAL_SCALE 32 + ++#ifdef _MSC_VER ++#pragma comment(lib, "MSImg32.Lib") ++#endif ++ + CAIRO_BEGIN_DECLS + + /* Surface DC flag values */ diff --git a/vcpkg/ports/cairo/portfile.cmake b/vcpkg/ports/cairo/portfile.cmake new file mode 100644 index 0000000..4da4f24 --- /dev/null +++ b/vcpkg/ports/cairo/portfile.cmake @@ -0,0 +1,76 @@ +set(EXTRA_PATCHES "") +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + list(APPEND EXTRA_PATCHES fix_clang-cl_build.patch) +endif() + +vcpkg_from_gitlab( + OUT_SOURCE_PATH SOURCE_PATH + GITLAB_URL https://gitlab.freedesktop.org + REPO cairo/cairo + REF "${VERSION}" + SHA512 663e6edf2718e8205e30ba309ac609ced9e88e6e1ec857fc48b345dfce82b044d58ec6b4a2d2b281fba30a659a368625ea7501f8b43fe26c137a7ebffdbaac91 + PATCHES + msvc-convenience.diff + ${EXTRA_PATCHES} +) + +if("fontconfig" IN_LIST FEATURES) + list(APPEND OPTIONS -Dfontconfig=enabled) +else() + list(APPEND OPTIONS -Dfontconfig=disabled) +endif() + +if("freetype" IN_LIST FEATURES) + list(APPEND OPTIONS -Dfreetype=enabled) +else() + list(APPEND OPTIONS -Dfreetype=disabled) +endif() + +if ("x11" IN_LIST FEATURES) + message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n") + list(APPEND OPTIONS -Dxlib=enabled) +else() + list(APPEND OPTIONS -Dxlib=disabled) +endif() +list(APPEND OPTIONS -Dxcb=disabled) +list(APPEND OPTIONS -Dxlib-xcb=disabled) + +if("gobject" IN_LIST FEATURES) + list(APPEND OPTIONS -Dglib=enabled) +else() + list(APPEND OPTIONS -Dglib=disabled) +endif() + +if("lzo" IN_LIST FEATURES) + list(APPEND OPTIONS -Dlzo=enabled) +else() + list(APPEND OPTIONS -Dlzo=disabled) +endif() + +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${OPTIONS} + -Dtests=disabled + -Dzlib=enabled + -Dpng=enabled + -Dspectre=auto + -Dgtk2-utils=disabled + -Dsymbol-lookup=disabled +) +vcpkg_install_meson() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/cairo/cairo.h" "defined(CAIRO_WIN32_STATIC_BUILD)" "1") +endif() + +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/COPYING-LGPL-2.1" "${SOURCE_PATH}/COPYING-MPL-1.1") diff --git a/vcpkg/ports/cairo/vcpkg.json b/vcpkg/ports/cairo/vcpkg.json new file mode 100644 index 0000000..4d45978 --- /dev/null +++ b/vcpkg/ports/cairo/vcpkg.json @@ -0,0 +1,70 @@ +{ + "name": "cairo", + "version": "1.18.4", + "port-version": 1, + "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": "LGPL-2.1-only OR MPL-1.1", + "supports": "!xbox & !uwp", + "dependencies": [ + "dirent", + "expat", + "libpng", + "pixman", + "pthread", + { + "name": "vcpkg-tool-meson", + "host": true + }, + "zlib" + ], + "default-features": [ + "fontconfig", + "freetype" + ], + "features": { + "fontconfig": { + "description": "Build with fontconfig", + "dependencies": [ + "fontconfig" + ] + }, + "freetype": { + "description": "Use the freetype font backend", + "dependencies": [ + { + "name": "freetype", + "default-features": false + } + ] + }, + "gobject": { + "description": "Build the gobject module", + "dependencies": [ + "glib" + ] + }, + "lzo": { + "description": "Build with lzo support", + "dependencies": [ + "lzo" + ] + }, + "x11": { + "description": "Build with X11 support", + "supports": "!windows", + "dependencies": [ + { + "name": "cairo", + "default-features": false, + "features": [ + "fontconfig" + ] + }, + "libx11", + "libxext", + "libxrender" + ] + } + } +} |