Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions ports/cairo/fix-HAVE_FT_PALETTE_SELECT-assumption.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 75d6f8c16..cb506b600 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2518,20 +2518,20 @@ _cairo_ft_glyph_fini (cairo_scaled_glyph_private_t *glyph_private,
}


-#ifdef HAVE_FT_PALETTE_SELECT
static void
_cairo_ft_scaled_glyph_set_palette (cairo_ft_scaled_font_t *scaled_font,
FT_Face face,
unsigned int *num_entries_ret,
FT_Color **entries_ret)
{
- FT_Palette_Data palette_data;
- unsigned int num_entries;
- FT_Color *entries;
+ unsigned int num_entries = 0;
+ FT_Color *entries = NULL;

num_entries = 0;
entries = NULL;

+#ifdef HAVE_FT_PALETTE_SELECT
+ FT_Palette_Data palette_data;
if (FT_Palette_Data_Get (face, &palette_data) == 0 && palette_data.num_palettes > 0) {
FT_UShort palette_index = CAIRO_COLOR_PALETTE_DEFAULT;
if (scaled_font->base.options.palette_index < palette_data.num_palettes)
@@ -2552,13 +2552,13 @@ _cairo_ft_scaled_glyph_set_palette (cairo_ft_scaled_font_t *scaled_font,
}
}
}
+#endif
if (num_entries_ret)
*num_entries_ret = num_entries;

if (entries_ret)
*entries_ret = entries;
}
-#endif

/* returns TRUE if foreground color used */
static cairo_bool_t
@@ -2628,9 +2628,7 @@ _cairo_ft_scaled_glyph_init_surface (cairo_ft_scaled_font_t *scaled_font,
scaled_glyph,
face,
foreground_color);
-#ifdef HAVE_FT_PALETTE_SELECT
_cairo_ft_scaled_glyph_set_palette (scaled_font, face, NULL, NULL);
-#endif

load_flags &= ~FT_LOAD_MONOCHROME;
/* clear load target mode */
32 changes: 32 additions & 0 deletions ports/cairo/fix-emscripten-linux-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/meson.build b/meson.build
index a238763..810cdca 100644
--- a/meson.build
+++ b/meson.build
@@ -819,7 +819,7 @@ else
cairoboilerplate_dep = dependency('', required: false)
endif

-subdir('util')
+#subdir('util')

if not get_option('tests').disabled() and feature_conf.get('CAIRO_HAS_PNG_FUNCTIONS', 0) == 1
subdir('test')
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index a37af4c..8e1c0f9 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -103,12 +103,14 @@
#endif

#ifndef HAVE_CTIME_R
+#ifndef __EMSCRIPTEN__
static char *ctime_r(const time_t *timep, char *buf)
{
(void)buf;
return ctime(timep);
}
#endif
+#endif

/**
* SECTION:cairo-ps
2 changes: 2 additions & 0 deletions ports/cairo/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ vcpkg_from_gitlab(
disable-atomic-ops-check.patch # See https://gitlab.freedesktop.org/cairo/cairo/-/issues/554
mingw-dllexport.patch
fix-static-missing-lib-msimg32.patch
fix-HAVE_FT_PALETTE_SELECT-assumption.patch
disable-lzo.patch
fix-emscripten-linux-build.patch
${PATCHES}
)

Expand Down
6 changes: 0 additions & 6 deletions ports/cairo/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
"freetype"
]
},
"gobject": {
"description": "build gobject module",
"dependencies": [
"glib"
]
},
"x11": {
"description": "build with x11 support",
"supports": "!windows"
Expand Down
13 changes: 13 additions & 0 deletions ports/fontconfig/fix-emscripten-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/meson.build b/src/meson.build
index 34ccd8c..7edfa4a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -37,6 +37,8 @@ elif cc.get_id() == 'msvc'
cpp += ['/EP']
elif cc.get_id() == 'clang'
cpp += ['-E', '-P']
+elif cc.get_id() == 'emscripten'
+ cpp += ['-E', '-P']
else
error('FIXME: implement cc.preprocess')
endif
10 changes: 6 additions & 4 deletions ports/fontconfig/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_gitlab(
no-etc-symlinks.patch
libgetopt.patch
fix-preprocessor-clang-cl.patch
fix-emscripten-build.patch
)

vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf")
Expand All @@ -19,6 +20,7 @@ vcpkg_configure_meson(
-Ddoc=disabled
-Dcache-build=disabled
-Dtests=disabled
-Dtools=disabled
)
#https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
# Adding OPTIONS for e.g. baseconfig-dir etc. won't work since meson will try to install into those dirs!
Expand Down Expand Up @@ -79,10 +81,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
endforeach()
endif()

vcpkg_copy_tools(
TOOL_NAMES fc-match fc-cat fc-list fc-pattern fc-query fc-scan fc-cache fc-validate fc-conflist
AUTO_CLEAN
)
#vcpkg_copy_tools(
# TOOL_NAMES fc-match fc-cat fc-list fc-pattern fc-query fc-scan fc-cache fc-validate fc-conflist
# AUTO_CLEAN
#)

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
Expand Down
Loading