diff --git a/ports/gegl/fix-ctx-msvc.patch b/ports/gegl/fix-ctx-msvc.patch new file mode 100644 index 00000000000000..3afc4daf414c39 --- /dev/null +++ b/ports/gegl/fix-ctx-msvc.patch @@ -0,0 +1,402 @@ +diff --git a/bin/argvs.h b/bin/argvs.h +index bd28f14..17217db 100644 +--- a/bin/argvs.h ++++ b/bin/argvs.h +@@ -1,6 +1,12 @@ + #ifndef __ARGVS__ + #define __ARGVS__ + ++#ifdef _MSC_VER ++#ifndef __attribute__ ++#define __attribute__(x) ++#endif ++#endif ++ + /********/ + #define UNUSED __attribute__((__unused__)) + #define COMMAND_ARGS int argc UNUSED, char **argv UNUSED, void *userdata +diff --git a/libs/ctx/ctx.h b/libs/ctx/ctx.h +index ebf5aa2..71fa3b7 100644 +--- a/libs/ctx/ctx.h ++++ b/libs/ctx/ctx.h +@@ -51,6 +51,9 @@ extern "C" { + #include + #ifndef _WIN32 + #include ++#include ++#else ++#include + #endif + #include + +@@ -63,6 +66,12 @@ typedef SSIZE_T ssize_t; + typedef int pid_t; + #endif + ++#ifdef _MSC_VER ++#ifndef __attribute__ ++#define __attribute__(x) ++#endif ++#endif ++ + /*** h2: context management */ + + typedef struct _Ctx Ctx; +@@ -15399,8 +15408,9 @@ ctx_u8 (CtxCode code, + static void + ctx_process_cmd_str_with_len (Ctx *ctx, CtxCode code, const char *string, uint32_t arg0, uint32_t arg1, int len) + { +- CtxEntry commands[1 + 2 + (len+1+1)/9]; +- memset (commands, 0, sizeof (commands) ); ++ size_t commands_count = (size_t) (1 + 2 + (len + 1 + 1) / 9); ++ CtxEntry *commands = (CtxEntry *) alloca (sizeof (CtxEntry) * commands_count); ++ memset (commands, 0, sizeof (CtxEntry) * commands_count); + commands[0] = ctx_u32 (code, arg0, arg1); + commands[1].code = CTX_DATA; + commands[1].data.u32[0] = len; +@@ -18439,7 +18449,7 @@ ctx_fragment_color_RGBAF (CtxRasterizer *rasterizer, float x, float y, float z, + static void ctx_fragment_image_RGBAF (CtxRasterizer *rasterizer, float x, float y, float z, void *out, int count, float dx, float dy, float dz) + { + float *outf = (float *) out; +- uint8_t rgba[4 * count]; ++ uint8_t *rgba = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); + CtxSource *g = &rasterizer->state->gstate.source_fill; + #if CTX_ENABLE_CM + CtxBuffer *buffer = g->texture.buffer->color_managed?g->texture.buffer->color_managed:g->texture.buffer; +@@ -18962,7 +18972,7 @@ ctx_RGBA8_source_over_normal_fragment (CTX_COMPOSITE_ARGUMENTS) + float ud = 0; float vd = 0; + float w0 = 1; float wd = 0; + ctx_init_uv (rasterizer, x0, rasterizer->scanline/CTX_FULL_AA, &u0, &v0, &w0, &ud, &vd, &wd); +- uint8_t _tsrc[4 * (count)]; ++ uint8_t *_tsrc = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); + if (rasterizer->fragment) + rasterizer->fragment (rasterizer, u0, v0, w0, &_tsrc[0], count, ud, vd, wd); + ctx_RGBA8_source_over_normal_buf (count, +@@ -18979,7 +18989,7 @@ CTX_SIMD_SUFFIX(ctx_RGBA8_source_over_normal_full_cov_fragment) (CTX_COMPOSITE_A + if (CTX_LIKELY(ctx_matrix_no_perspective (transform))) + { + float u0, v0, ud, vd, w0, wd; +- uint8_t _tsrc[4 * count]; ++ uint8_t *_tsrc = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); + ctx_init_uv (rasterizer, x0, scan, &u0, &v0, &w0, &ud, &vd, &wd); + for (int y = 0; y < scanlines; y++) + { +@@ -18993,7 +19003,7 @@ CTX_SIMD_SUFFIX(ctx_RGBA8_source_over_normal_full_cov_fragment) (CTX_COMPOSITE_A + } + else + { +- uint8_t _tsrc[4 * count]; ++ uint8_t *_tsrc = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); + for (int y = 0; y < scanlines; y++) + { + float u0, v0, ud, vd, w0, wd; +@@ -19013,7 +19023,7 @@ ctx_RGBA8_source_copy_normal_fragment (CTX_COMPOSITE_ARGUMENTS) + float ud = 0; float vd = 0; + float w0 = 1; float wd = 0; + ctx_init_uv (rasterizer, x0, rasterizer->scanline/CTX_FULL_AA, &u0, &v0, &w0, &ud, &vd, &wd); +- uint8_t _tsrc[4 * (count)]; ++ uint8_t *_tsrc = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); + rasterizer->fragment (rasterizer, u0, v0, w0, &_tsrc[0], count, ud, vd, wd); + ctx_RGBA8_source_copy_normal_buf (count, + dst, src, coverage, rasterizer, x0, &_tsrc[0]); +@@ -19126,7 +19136,7 @@ static inline void \ + ctx_u8_blend_##name (int components, uint8_t * __restrict__ dst, uint8_t *src, uint8_t *blended, int count)\ + {\ + for (int j = 0; j < count; j++) { \ +- uint8_t *s=src; uint8_t b[components];\ ++ uint8_t *s=src; uint8_t *b = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (components));\ + ctx_u8_deassociate_alpha (components, dst, b);\ + CODE;\ + blended[components-1] = src[components-1];\ +@@ -19274,7 +19284,7 @@ static int ctx_u8_get_sat (int components, uint8_t *c) + static void ctx_u8_set_lum (int components, uint8_t *c, uint8_t lum) + { + int d = lum - ctx_u8_get_lum (components, c); +- int tc[components]; ++ int *tc = (int *) alloca (sizeof (int) * (size_t) (components)); + for (int i = 0; i < components - 1; i++) + { + tc[i] = c[i] + d; +@@ -19402,7 +19412,7 @@ __ctx_u8_porter_duff (CtxRasterizer *rasterizer, + ctx_porter_duff_factors (compositing_mode, &f_s, &f_d); + CtxGState *gstate = &rasterizer->state->gstate; + uint8_t global_alpha_u8 = gstate->global_alpha_u8; +- uint8_t tsrc[components * count]; ++ uint8_t *tsrc = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (components * count)); + int src_step = 0; + + if (gstate->source_fill.type == CTX_SOURCE_COLOR) +@@ -19433,7 +19443,7 @@ __ctx_u8_porter_duff (CtxRasterizer *rasterizer, + if (CTX_UNLIKELY(global_alpha_u8 != 255)) + cov = (cov * global_alpha_u8 + 255) >> 8; + +- uint8_t csrc[components]; ++ uint8_t *csrc = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (components)); + for (int c = 0; c < components; c++) + csrc[c] = (src[c] * cov + 255) >> 8; + +@@ -19811,7 +19821,7 @@ ctx_setup_RGB8 (CtxRasterizer *rasterizer) + static inline void + ctx_composite_convert (CTX_COMPOSITE_ARGUMENTS) + { +- uint8_t pixels[count * rasterizer->format->ebpp]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * rasterizer->format->ebpp)); + rasterizer->format->to_comp (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + rasterizer->format->from_comp (rasterizer, x0, &pixels[0], dst, count); +@@ -20001,7 +20011,7 @@ static float ctx_float_get_sat (int components, float *c) + static void ctx_float_set_lum (int components, float *c, float lum) + { + float d = lum - ctx_float_get_lum (components, c); +- float tc[components]; ++ float *tc = (float *) alloca (sizeof (float) * (size_t) (components)); + for (int i = 0; i < components - 1; i++) + { + tc[i] = c[i] + d; +@@ -20051,7 +20061,7 @@ static void ctx_float_set_sat (int components, float *c, float sat) + static inline void \ + ctx_float_blend_##name (int components, float * __restrict__ dst, float *src, float *blended)\ + {\ +- float *s = src; float b[components];\ ++ float *s = src; float *b = (float *) alloca (sizeof (float) * (size_t) (components));\ + ctx_float_deassociate_alpha (components, dst, b);\ + CODE;\ + blended[components-1] = s[components-1];\ +@@ -20179,7 +20189,7 @@ ctx_float_porter_duff (CtxRasterizer *rasterizer, + + if (rasterizer->state->gstate.source_fill.type == CTX_SOURCE_COLOR) + { +- float tsrc[components]; ++ float *tsrc = (float *) alloca (sizeof (float) * (size_t) (components)); + + while (count--) + { +@@ -20241,7 +20251,7 @@ ctx_float_porter_duff (CtxRasterizer *rasterizer, + } + else + { +- float tsrc[components]; ++ float *tsrc = (float *) alloca (sizeof (float) * (size_t) (components)); + float u0 = 0; float v0 = 0; + float ud = 0; float vd = 0; + float w0 = 1; float wd = 0; +@@ -20605,8 +20615,8 @@ ctx_fragment_color_GRAYAF (CtxRasterizer *rasterizer, float x, float y, float z, + + static void ctx_fragment_image_GRAYAF (CtxRasterizer *rasterizer, float x, float y, float z, void *out, int count, float dx, float dy, float dz) + { +- uint8_t rgba[4*count]; +- float rgbaf[4*count]; ++ uint8_t *rgba = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); ++ float *rgbaf = (float *) alloca (sizeof (float) * (size_t) (4 * count)); + CtxSource *g = &rasterizer->state->gstate.source_fill; + #if CTX_ENABLE_CM + CtxBuffer *buffer = g->texture.buffer->color_managed?g->texture.buffer->color_managed:g->texture.buffer; +@@ -20764,7 +20774,7 @@ ctx_composite_GRAYF (CTX_COMPOSITE_ARGUMENTS) + { + float *dstf = (float*)dst; + +- float temp[count*2]; ++ float *temp = (float *) alloca (sizeof (float) * (size_t) (count * 2)); + for (unsigned int i = 0; i < count; i++) + { + temp[i*2] = dstf[i]; +@@ -20819,7 +20829,7 @@ ctx_composite_BGRA8 (CTX_COMPOSITE_ARGUMENTS) + // of gradient or image + // + // +- uint8_t pixels[count * 4]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * 4)); + ctx_BGRA8_to_RGBA8 (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_BGRA8_to_RGBA8 (rasterizer, x0, &pixels[0], dst, count); +@@ -20844,7 +20854,7 @@ static void + ctx_fragment_other_CMYKAF (CtxRasterizer *rasterizer, float x, float y, float z, void *out, int count, float dx, float dy, float dz) + { + float *cmyka = (float*)out; +- float _rgba[4 * count]; ++ float *_rgba = (float *) alloca (sizeof (float) * (size_t) (4 * count)); + float *rgba = &_rgba[0]; + CtxGState *gstate = &rasterizer->state->gstate; + switch (gstate->source_fill.type) +@@ -21099,7 +21109,7 @@ ctx_CMYKAF_to_CMYKA8 (CtxRasterizer *rasterizer, float *src, uint8_t *dst, int c + static void + ctx_composite_CMYKA8 (CTX_COMPOSITE_ARGUMENTS) + { +- float pixels[count * 5]; ++ float *pixels = (float *) alloca (sizeof (float) * (size_t) (count * 5)); + ctx_CMYKA8_to_CMYKAF (rasterizer, dst, &pixels[0], count); + rasterizer->comp_op (count, (uint8_t *) &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_CMYKAF_to_CMYKA8 (rasterizer, &pixels[0], dst, count); +@@ -21156,7 +21166,7 @@ ctx_CMYKAF_to_CMYK8 (CtxRasterizer *rasterizer, float *src, uint8_t *dst, int co + static void + ctx_composite_CMYK8 (CTX_COMPOSITE_ARGUMENTS) + { +- float pixels[count * 5]; ++ float *pixels = (float *) alloca (sizeof (float) * (size_t) (count * 5)); + ctx_CMYK8_to_CMYKAF (rasterizer, dst, &pixels[0], count); + rasterizer->comp_op (count, (uint8_t *) &pixels[0], src, coverage, rasterizer, x0); + ctx_CMYKAF_to_CMYK8 (rasterizer, &pixels[0], dst, count); +@@ -21234,7 +21244,7 @@ ctx_composite_BGR8 (CTX_COMPOSITE_ARGUMENTS) + } + #endif + +- uint8_t pixels[count * 4]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * 4)); + ctx_BGR8_to_RGBA8 (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_RGBA8_to_BGR8 (rasterizer, x0, &pixels[0], dst, count); +@@ -21313,7 +21323,7 @@ ctx_composite_RGB8 (CTX_COMPOSITE_ARGUMENTS) + } + #endif + +- uint8_t pixels[count * 4]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * 4)); + ctx_RGB8_to_RGBA8 (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_RGBA8_to_RGB8 (rasterizer, x0, &pixels[0], dst, count); +@@ -21882,7 +21892,7 @@ ctx_fragment_color_GRAYA8 (CtxRasterizer *rasterizer, float x, float y, float z, + + static void ctx_fragment_image_GRAYA8 (CtxRasterizer *rasterizer, float x, float y, float z, void *out, int count, float dx, float dy, float dz) + { +- uint8_t rgba[4*count]; ++ uint8_t *rgba = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (4 * count)); + CtxSource *g = &rasterizer->state->gstate.source_fill; + #if CTX_ENABLE_CM + CtxBuffer *buffer = g->texture.buffer->color_managed?g->texture.buffer->color_managed:g->texture.buffer; +@@ -22204,7 +22214,7 @@ ctx_composite_RGB332 (CTX_COMPOSITE_ARGUMENTS) + return; + } + #endif +- uint8_t pixels[count * 4]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * 4)); + ctx_RGB332_to_RGBA8 (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_RGBA8_to_RGB332 (rasterizer, x0, &pixels[0], dst, count); +@@ -22308,7 +22318,7 @@ ctx_RGBA8_source_copy_normal_color (CTX_COMPOSITE_ARGUMENTS); + static void + ctx_composite_RGB565 (CTX_COMPOSITE_ARGUMENTS) + { +- uint8_t pixels[count * 4]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * 4)); + ctx_RGB565_to_RGBA8 (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_RGBA8_to_RGB565 (rasterizer, x0, &pixels[0], dst, count); +@@ -22324,7 +22334,7 @@ ctx_RGBA8_to_RGB565_BS (CtxRasterizer *rasterizer, int x, const uint8_t *rgba, v + static void + ctx_composite_RGB565_BS (CTX_COMPOSITE_ARGUMENTS) + { +- uint8_t pixels[count * 4]; ++ uint8_t *pixels = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (count * 4)); + ctx_RGB565_BS_to_RGBA8 (rasterizer, x0, dst, &pixels[0], count); + rasterizer->comp_op (count, &pixels[0], rasterizer->color, coverage, rasterizer, x0); + ctx_RGBA8_to_RGB565_BS (rasterizer, x0, &pixels[0], dst, count); +@@ -22804,8 +22814,8 @@ ctx_composite_fill_rect_aligned (CtxRasterizer *rasterizer, + /* fallback */ + if (width <= blit_width) + { +- uint8_t coverage[width]; +- memset (coverage, cov, sizeof (coverage) ); ++ uint8_t *coverage = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (width)); ++ memset (coverage, cov, sizeof (uint8_t) * width); + uint8_t *rasterizer_src = rasterizer->color; + ctx_apply_coverage_fun apply_coverage = + rasterizer->apply_coverage; +@@ -22889,7 +22899,7 @@ CTX_SIMD_SUFFIX (ctx_composite_fill_rect) (CtxRasterizer *rasterizer, + if ((width >0) & (height>0)) + { + uint8_t *dst = ( (uint8_t *) rasterizer->buf); +- uint8_t coverage[width+2]; ++ uint8_t *coverage = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (width + 2)); + uint32_t x0i = (int)x0+has_left; + uint32_t x1i = (int)x1-has_right; + uint32_t y0i = (int)y0+has_top; +@@ -24473,7 +24483,7 @@ ctx_rasterizer_rasterize_edges2 (CtxRasterizer *rasterizer, const int fill_rule, + // sometimes reached by stroking code + return; + } +- uint8_t _coverage[pixs + 32]; // XXX this might hide some valid asan warnings ++ uint8_t *_coverage = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (pixs + 32)); // XXX this might hide some valid asan warnings + uint8_t *coverage = &_coverage[0]; + ctx_apply_coverage_fun apply_coverage = rasterizer->apply_coverage; + +@@ -24670,11 +24680,11 @@ ctx_rasterizer_rasterize_edges2 (CtxRasterizer *rasterizer, const int fill_rule, + (gstate->compositing_mode == CTX_COMPOSITE_CLEAR))) + { + /* fill in the rest of the blitrect when compositing mode permits it */ +- uint8_t nocoverage[rasterizer->blit_width]; ++ uint8_t *nocoverage = (uint8_t *) alloca (sizeof (uint8_t) * (size_t) (rasterizer->blit_width)); ++ memset (nocoverage, 0, sizeof (uint8_t) * rasterizer->blit_width); + int gscan_start = gstate->clip_min_y * CTX_FULL_AA; + //int gscan_end = gstate->clip_max_y * CTX_FULL_AA; +- memset (nocoverage, 0, sizeof(nocoverage)); + int startx = gstate->clip_min_x; + int endx = gstate->clip_max_x; + int clipw = endx-startx + 1; + uint8_t *dst = ( (uint8_t *) rasterizer->buf); +@@ -25362,7 +25372,7 @@ ctx_rasterizer_fill (CtxRasterizer *rasterizer) + int blit_width = rasterizer->blit_width; + int blit_height = rasterizer->blit_height; + +- CtxSegment temp[preserved_count]; /* copy of already built up path's poly line ++ CtxSegment *temp = (CtxSegment *) alloca (sizeof (CtxSegment) * (size_t) (preserved_count)); /* copy of already built up path's poly line + XXX - by building a large enough path + the stack can be smashed! + */ +@@ -25928,8 +25938,8 @@ ctx_rasterizer_stroke (CtxRasterizer *rasterizer) + } + #endif + +- CtxSegment temp[count]; /* copy of already built up path's poly line */ +- memcpy (temp, rasterizer->edge_list.entries, sizeof (temp) ); ++ CtxSegment *temp = (CtxSegment *) alloca (sizeof (CtxSegment) * (size_t) (count)); /* copy of already built up path's poly line */ ++ memcpy (temp, rasterizer->edge_list.entries, sizeof (CtxSegment) * count); + #if CTX_FAST_FILL_RECT + #if CTX_FAST_STROKE_RECT + if (rasterizer->edge_list.count == 5) +@@ -26508,14 +26518,14 @@ static void + _ctx_rasterizer_clip (CtxRasterizer *rasterizer) + { + int count = rasterizer->edge_list.count; +- CtxSegment temp[count+1]; /* copy of already built up path's poly line */ ++ CtxSegment *temp = (CtxSegment *) alloca (sizeof (CtxSegment) * (size_t) (count + 1)); /* copy of already built up path's poly line */ + rasterizer->state->has_clipped=1; + rasterizer->state->gstate.clipped=1; + //if (rasterizer->preserve) +- { memcpy (temp + 1, rasterizer->edge_list.entries, sizeof (temp) - sizeof (temp[0])); ++ { memcpy (temp + 1, rasterizer->edge_list.entries, sizeof (CtxSegment) * count); + temp[0].code = CTX_NOP; + temp[0].u32[0] = count; +- ctx_state_set_blob (rasterizer->state, SQZ_clip, (char*)temp, sizeof(temp)); ++ ctx_state_set_blob (rasterizer->state, SQZ_clip, (char*)temp, sizeof (CtxSegment) * (count + 1)); + } + ctx_rasterizer_clip_apply (rasterizer, temp); + _ctx_rasterizer_reset (rasterizer); +@@ -27026,8 +27036,8 @@ ctx_rasterizer_process (Ctx *ctx, const CtxCommand *c) + float *dashes = state->gstate.dashes; + float factor = ctx_matrix_get_scale (&state->gstate.transform); + +- CtxSegment temp[count]; /* copy of already built up path's poly line */ +- memcpy (temp, rasterizer->edge_list.entries, sizeof (temp)); ++ CtxSegment *temp = (CtxSegment *) alloca (sizeof (CtxSegment) * (size_t) (count)); /* copy of already built up path's poly line */ ++ memcpy (temp, rasterizer->edge_list.entries, sizeof (CtxSegment) * count); + int start = 0; + int end = 0; + CtxMatrix transform_backup = state->gstate.transform; +@@ -57303,7 +57313,7 @@ static int _ctx_resolve_font (const char *name) + } + #endif + +- char temp[ctx_strlen (name)+8]; ++ char *temp = (char *) alloca (sizeof (char) * (size_t) (ctx_strlen (name) + 8)); + /* first we look for exact */ + for (int i = 0; ret < 0 && i < ctx_font_count; i ++) + { +@@ -58656,7 +58666,7 @@ ctx_load_font_hb (const char *name, const char *data, int length, int close_path + + int axes_count = hb_ot_var_get_axis_count(font->hb.face); + fprintf (stderr, " axes: %i\n", axes_count); +- hb_ot_var_axis_info_t axes_array[axes_count]; ++ hb_ot_var_axis_info_t *axes_array = (hb_ot_var_axis_info_t *) alloca (sizeof (hb_ot_var_axis_info_t) * (size_t) (axes_count)); + hb_ot_var_get_axis_infos(font->hb.face, 0, &axes_count, axes_array); + + for (int i = 0; i < axes_count; i++) diff --git a/ports/gegl/gegl-msvc-upstream.patch b/ports/gegl/gegl-msvc-upstream.patch new file mode 100644 index 00000000000000..d85b7b3499af2d --- /dev/null +++ b/ports/gegl/gegl-msvc-upstream.patch @@ -0,0 +1,614 @@ +diff --git a/gegl/graph/gegl-node.h b/gegl/graph/gegl-node.h +index a9d76e53f..9cd94c57ed 100644 +--- a/gegl/graph/gegl-node.h ++++ b/gegl/graph/gegl-node.h +@@ -112,27 +112,27 @@ GeglNode * gegl_node_new_child (GeglNode *parent, + * Returns TRUE if the connection was successfully made. + */ + +-gboolean gegl_node_connect_from (GeglNode *sink, ++G_DEPRECATED_FOR (gegl_node_connect or gegl_node_link if pads are "input" and "output") ++gboolean gegl_node_connect_from (GeglNode *sink, + const gchar *input_pad_name, + GeglNode *source, +- const gchar *output_pad_name) +-G_DEPRECATED_FOR (gegl_node_connect or gegl_node_link if pads are "input" and "output"); ++ const gchar *output_pad_name); + + /** + * gegl_node_connect_to: + * @source: the node producing data we want to connect. + * @output_pad_name: the output pad we want to use on the source. + * @sink: the node we're connecting an input to + * @input_pad_name: the name of the input pad we are connecting to + * + * Makes a connection between the pads of two nodes. + * + * Returns TRUE if the connection was successfully made. + */ +-gboolean gegl_node_connect_to (GeglNode *source, ++G_DEPRECATED_FOR (gegl_node_connect or gegl_node_link if pads are "output" and "input") ++gboolean gegl_node_connect_to (GeglNode *source, + const gchar *output_pad_name, + GeglNode *sink, +- const gchar *input_pad_name) +-G_DEPRECATED_FOR (gegl_node_connect or gegl_node_link if pads are "output" and "input"); ++ const gchar *input_pad_name); + + /** + * gegl_node_connect: + +diff --git a/gegl/buffer/gegl-algorithms-bilinear.inc b/gegl/buffer/gegl-algorithms-bilinear.inc +index 1beb569..7a139c0 100644 +--- a/gegl/buffer/gegl-algorithms-bilinear.inc ++++ b/gegl/buffer/gegl-algorithms-bilinear.inc +@@ -12,8 +12,8 @@ BILINEAR_FUNCNAME (guchar *dest_buf, + const gint ver = s_rowstride/(bpp/components); + const gint diag = ver + components; + +- gfloat dx[dst_rect->width]; +- gint jj[dst_rect->width]; ++ gfloat *dx = g_newa (gfloat, dst_rect->width); ++ gint *jj = g_newa (gint, dst_rect->width); + + for (gint x = 0; x < dst_rect->width; x++) + { +diff --git a/gegl/buffer/gegl-algorithms-boxfilter.inc b/gegl/buffer/gegl-algorithms-boxfilter.inc +index fd67dce..cda1141 100644 +--- a/gegl/buffer/gegl-algorithms-boxfilter.inc ++++ b/gegl/buffer/gegl-algorithms-boxfilter.inc +@@ -13,11 +13,11 @@ BOXFILTER_FUNCNAME (guchar *dest_buf, + const BOXFILTER_TYPE *src[9]; + gint components = bpp / sizeof(BOXFILTER_TYPE); + +- gfloat left_weight[dst_rect->width]; +- gfloat center_weight[dst_rect->width]; +- gfloat right_weight[dst_rect->width]; ++ gfloat *left_weight = g_newa (gfloat, dst_rect->width); ++ gfloat *center_weight = g_newa (gfloat, dst_rect->width); ++ gfloat *right_weight = g_newa (gfloat, dst_rect->width); + +- gint jj[dst_rect->width]; ++ gint *jj = g_newa (gint, dst_rect->width); + + for (gint x = 0; x < dst_rect->width; x++) + { +diff --git a/gegl/buffer/gegl-algorithms.c b/gegl/buffer/gegl-algorithms.c +index 176ba29..dd03994 100644 +--- a/gegl/buffer/gegl-algorithms.c ++++ b/gegl/buffer/gegl-algorithms.c +@@ -75,10 +75,10 @@ gegl_boxfilter_u8_nl (guchar *dest_buf, + const uint8_t *src[9]; + gint components = bpp / sizeof(uint8_t); + +- gfloat left_weight[dst_rect->width]; +- gfloat right_weight[dst_rect->width]; ++ gfloat *left_weight = g_newa (gfloat, dst_rect->width); ++ gfloat *right_weight = g_newa (gfloat, dst_rect->width); + +- gint jj[dst_rect->width]; ++ gint *jj = g_newa (gint, dst_rect->width); + + for (gint x = 0; x < dst_rect->width; x++) + { +@@ -238,10 +238,10 @@ gegl_boxfilter_u8_nl_alpha (guchar *dest_buf, + const uint8_t *src[9]; + gint components = bpp / sizeof(uint8_t); + +- gfloat left_weight[dst_rect->width]; +- gfloat right_weight[dst_rect->width]; ++ gfloat *left_weight = g_newa (gfloat, dst_rect->width); ++ gfloat *right_weight = g_newa (gfloat, dst_rect->width); + +- gint jj[dst_rect->width]; ++ gint *jj = g_newa (gint, dst_rect->width); + + for (gint x = 0; x < dst_rect->width; x++) + { +@@ -363,8 +363,8 @@ gegl_bilinear_u8_nl (guchar *dest_buf, + const gint src_y = src_rect->y; + const gint dst_width = dst_rect->width; + const gint dst_height = dst_rect->height; +- gfloat dx[dst_rect->width]; +- gint jj[dst_rect->width]; ++ gfloat *dx = g_newa (gfloat, dst_rect->width); ++ gint *jj = g_newa (gint, dst_rect->width); + + for (gint x = 0; x < dst_rect->width; x++) + { +@@ -501,8 +501,8 @@ gegl_bilinear_u8_nl_alpha (guchar *dest_buf, + const gint src_y = src_rect->y; + const gint dst_width = dst_rect->width; + const gint dst_height = dst_rect->height; +- gfloat dx[dst_rect->width]; +- gint jj[dst_rect->width]; ++ gfloat *dx = g_newa (gfloat, dst_rect->width); ++ gint *jj = g_newa (gint, dst_rect->width); + + for (gint x = 0; x < dst_rect->width; x++) + { +@@ -889,8 +889,8 @@ GEGL_SIMD_SUFFIX(gegl_resample_nearest) (guchar *dst, + const gdouble scale, + const gint bpp, + const gint dst_stride) + { +- gint jj[dst_rect->width]; ++ gint *jj = g_newa (gint, dst_rect->width); + gint x, y; + for (x = 0; x < dst_rect->width; x++) + { + +diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c +index c1cfb9f6c9..3a8f9b9d89 100644 +--- a/gegl/buffer/gegl-buffer-access.c ++++ b/gegl/buffer/gegl-buffer-access.c +@@ -1972,9 +1972,9 @@ gegl_buffer_set (GeglBuffer *buffer, + rowstride == babl_format_get_bytes_per_pixel (format)) + { + int bpp = babl_format_get_bytes_per_pixel (buffer->soft_format); +- uint8_t tmp[rect->height * bpp]; ++ uint8_t *tmp = g_newa (uint8_t, rect->height * bpp); + babl_process (babl_fish (format, buffer->soft_format), +- src, &tmp[0], rect->height); ++ src, tmp, rect->height); + _gegl_buffer_set_with_flags (buffer, rect, level, buffer->soft_format, tmp, bpp, + GEGL_BUFFER_SET_FLAG_LOCK| + GEGL_BUFFER_SET_FLAG_NOTIFY); +@@ -2071,12 +2071,12 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer, + { + /* first fetch all pixels to a temporary buffer */ + gint bpp = babl_format_get_bytes_per_pixel (buffer->soft_format); +- uint8_t tmp[rect->height * bpp]; +- gegl_buffer_iterate_read_dispatch (buffer, rect, &tmp[0], ++ uint8_t *tmp = g_newa (uint8_t, rect->height * bpp); ++ gegl_buffer_iterate_read_dispatch (buffer, rect, tmp, + bpp, buffer->soft_format, 0, repeat_mode); + /* then convert in a single shot */ + babl_process (babl_fish (buffer->soft_format, format), +- &tmp[0], dest_buf, rect->height); ++ tmp, dest_buf, rect->height); + } + } + return; +diff --git a/gegl/buffer/gegl-sampler-linear.c b/gegl/buffer/gegl-sampler-linear.c +index f8a6df8ab6..820b7edb63 100644 +--- a/gegl/buffer/gegl-sampler-linear.c ++++ b/gegl/buffer/gegl-sampler-linear.c +@@ -127,8 +127,8 @@ gegl_sampler_linear_interpolate ( GeglSampler *self, + /* + * Load top row: + */ +- gfloat top_left[nc]; +- gfloat top_rite[nc]; ++ gfloat *top_left = g_newa (gfloat, nc); ++ gfloat *top_rite = g_newa (gfloat, nc); + + for (gint c = 0; c < nc; c++) + top_left[c] = *in_bptr++; + +diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c +index 0d0ebb41e1..3f5fc1250e 100644 +--- a/gegl/buffer/gegl-sampler-lohalo.c ++++ b/gegl/buffer/gegl-sampler-lohalo.c +@@ -504,7 +504,7 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self, + * The newval array will contain one computed resampled value per + * channel: + */ +- gfloat newval[channels]; ++ gfloat *newval = g_newa (gfloat, channels); + for (c = 0; c < channels-1; c++) + newval[c] = + extended_sigmoidal ( +@@ -954,11 +954,9 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self, + /* + * Storage for the EWA contribution: + */ +- gfloat ewa_newval[channels]; +- ewa_newval[0] = (gfloat) 0; +- ewa_newval[1] = (gfloat) 0; +- ewa_newval[2] = (gfloat) 0; +- ewa_newval[3] = (gfloat) 0; ++ gfloat *ewa_newval = g_newa (gfloat, channels); ++ for (gint c = 0; c < channels; c++) ++ ewa_newval[c] = (gfloat) 0; + + { + gint i = out_top_0; + +diff --git a/gegl/buffer/gegl-sampler-nohalo.c b/gegl/buffer/gegl-sampler-nohalo.c +index cab2390e2d..3a0d1ffd60 100644 +--- a/gegl/buffer/gegl-sampler-nohalo.c ++++ b/gegl/buffer/gegl-sampler-nohalo.c +@@ -1316,7 +1316,7 @@ gegl_sampler_nohalo_get ( GeglSampler* restrict self, + * The newval array will contain one computed resampled value per + * channel: + */ +- gfloat newval[channels]; ++ gfloat *newval = g_newa (gfloat, channels); + + { + /* +@@ -1878,7 +1878,7 @@ gegl_sampler_nohalo_get ( GeglSampler* restrict self, + /* + * Storage for the EWA contribution: + */ +- gfloat ewa_newval[channels]; ++ gfloat *ewa_newval = g_newa (gfloat, channels); + for (gint c = 0; c < channels; c++) + ewa_newval[c] = (gfloat) 0; + + +diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h +index 39cd7a93f7..d807b0e257 100644 +--- a/gegl/buffer/gegl-sampler.h ++++ b/gegl/buffer/gegl-sampler.h +@@ -276,7 +276,7 @@ _gegl_sampler_box_get (GeglSampler* restrict self, + + if (u_norm2 >= 4.0 || v_norm2 >= 4.0) + { +- gfloat result[channels]; ++ gfloat *result = g_newa (gfloat, channels); + gdouble uv_samples_inv; + + for (gint c = 0; c < channels; c++) +@@ -355,7 +355,7 @@ _gegl_sampler_box_get (GeglSampler* restrict self, + for (u = 0; u < u_samples; u++) + { + int c; +- gfloat input[channels]; ++ gfloat *input = g_newa (gfloat, channels); + self->interpolate (self, x, y, input, repeat_mode); + for (c = 0; c < channels; c++) + result[c] += input[c]; + +diff --git a/gegl/opencl/gegl-cl-color.c b/gegl/opencl/gegl-cl-color.c +index ce0244c9df..2916b5a855 100644 +--- a/gegl/opencl/gegl-cl-color.c ++++ b/gegl/opencl/gegl-cl-color.c +@@ -70,7 +70,7 @@ gegl_cl_color_load_conversion_set (ColorConversionInfo *conversions, + GeglClRunData **kernels, + const gchar *source) + { +- const char *kernel_names[num_conversions + 1]; ++ const char **kernel_names = g_newa (const char *, num_conversions + 1); + + for (int i = 0; i < num_conversions; ++i) + { + +diff --git a/gegl/buffer/gegl-buffer-load.c b/gegl/buffer/gegl-buffer-load.c +index 0fcb72aa26..ca6c813796 100644 +--- a/gegl/buffer/gegl-buffer-load.c ++++ b/gegl/buffer/gegl-buffer-load.c +@@ -42,7 +42,7 @@ + + #ifdef _WIN32 + #define BINARY_FLAG O_BINARY +-#ifdef _WIN64 ++#ifdef _WIN32 + #include + typedef SSIZE_T ssize_t; + #endif + +diff --git a/gegl/buffer/gegl-buffer-save.c b/gegl/buffer/gegl-buffer-save.c +index f09015b1af..c3dd61939f 100644 +--- a/gegl/buffer/gegl-buffer-save.c ++++ b/gegl/buffer/gegl-buffer-save.c +@@ -44,7 +44,7 @@ + + #ifdef _WIN32 + #define BINARY_FLAG O_BINARY +-#ifdef _WIN64 ++#ifdef _WIN32 + #include + typedef SSIZE_T ssize_t; + #endif + +diff --git a/operations/common/gblur-1d.c b/operations/common/gblur-1d.c +index 1b67cb9dd4..164a9950a0 100644 +--- a/operations/common/gblur-1d.c ++++ b/operations/common/gblur-1d.c +@@ -330,7 +330,7 @@ fix_right_boundary_generic (gdouble *buf, + const gfloat *uplus, + const gint nc) + { +- gdouble u[nc*3]; ++ gdouble *u = g_newa (gdouble, nc * 3); + gint i, k, c; + + for (k = 0; k < 3; k++) +@@ -339,7 +339,7 @@ fix_right_boundary_generic (gdouble *buf, + + for (i = 0; i < 3; i++) + { +- gdouble tmp[nc]; ++ gdouble *tmp = g_newa (gdouble, nc); + for (c = 0; c < nc ; c++) + tmp[c] = m[i][0] * u[0 * nc + c]; + + +diff --git a/operations/common/watershed-transform.c b/operations/common/watershed-transform.c +index 8546abc9ce..810f9cf7f1 100644 +--- a/operations/common/watershed-transform.c ++++ b/operations/common/watershed-transform.c +@@ -363,7 +363,7 @@ process (GeglOperation *operation, + while (!HQ_is_empty (&hq)) + { + PixelCoords *p = (PixelCoords *) HQ_pop (&hq); +- guint8 label[bpp]; ++ guint8 *label = g_newa (guint8, bpp); + + GeglRectangle square_rect = {p->x - 1, p->y - 1, 3, 3}; + + +diff --git a/operations/common/map-common.h b/operations/common/map-common.h +index 6ede486cb7..2efb861135 100644 +--- a/operations/common/map-common.h ++++ b/operations/common/map-common.h +@@ -184,10 +184,10 @@ process (GeglOperation *operation, + else + { + gint stride = 2 * roi->width; +- gfloat coords_top[2 * roi->width]; +- gfloat coords_bottom[2 * roi->width]; +- gfloat coords_left[2 * roi->height]; +- gfloat coords_right[2 * roi->height]; ++ gfloat *coords_top = g_newa (gfloat, 2 * roi->width); ++ gfloat *coords_bottom = g_newa (gfloat, 2 * roi->width); ++ gfloat *coords_left = g_newa (gfloat, 2 * roi->height); ++ gfloat *coords_right = g_newa (gfloat, 2 * roi->height); + + gegl_buffer_get (aux, + GEGL_RECTANGLE (roi->x, roi->y - 1, + +diff --git a/operations/common/normal-map.c b/operations/common/normal-map.c +index f14cbf4c7c..3002fb6dfc 100644 +--- a/operations/common/normal-map.c ++++ b/operations/common/normal-map.c +@@ -145,10 +145,10 @@ process (GeglOperation *operation, + gfloat *out = iter->items[0].data; + const GeglRectangle *roi = &iter->items[0].roi; + gint stride = 2 * roi->width; +- gfloat top[2 * roi->width]; +- gfloat bottom[2 * roi->width]; +- gfloat left[2 * roi->height]; +- gfloat right[2 * roi->height]; ++ gfloat *top = g_newa (gfloat, 2 * roi->width); ++ gfloat *bottom = g_newa (gfloat, 2 * roi->width); ++ gfloat *left = g_newa (gfloat, 2 * roi->height); ++ gfloat *right = g_newa (gfloat, 2 * roi->height); + gint x; + gint y; + + + +diff --git a/gegl/property-types/gegl-color.c b/gegl/property-types/gegl-color.c +index 193ec597e5..8972b855a8 100644 +--- a/gegl/property-types/gegl-color.c ++++ b/gegl/property-types/gegl-color.c +@@ -45,7 +45,11 @@ struct _GeglColorPrivate + * be 16-byte aligned and would crash otherwise. + * See: https://gitlab.gnome.org/GNOME/gegl/-/merge_requests/142 + */ ++#ifdef _MSC_VER ++ __declspec(align(16)) guint8 pixel[48]; ++#else + guint8 pixel[48] __attribute__((aligned(16))); ++#endif + gdouble alignment; + }; + }; + +diff --git a/gegl/gegl.h b/gegl/gegl.h +index 6bd3324d61..536c835be0 100644 +--- a/gegl/gegl.h ++++ b/gegl/gegl.h +@@ -71,7 +71,11 @@ G_BEGIN_DECLS + * determine the smallest buffers needed at each stage of processing. + */ + ++#ifdef _MSC_VER ++#define GEGL_ALIGNED __restrict__ ++#else + #define GEGL_ALIGNED __restrict__ __attribute__((__aligned__ (16))) ++#endif + + G_END_DECLS + #endif /* __GEGL_H__ */ + + +diff --git a/meson.build b/meson.build +index 52817cdcb0..6bd0a93280 100644 +--- a/meson.build ++++ b/meson.build +@@ -245,6 +245,12 @@ if os_win32 + endif + endif #if os_win32 + ++build_ctx = cc.get_id() != 'msvc' ++ ++if cc.get_id() == 'msvc' ++ cflags_common += ['/D__restrict__=__restrict'] ++endif ++ + if buildtype == 'debugoptimized' or buildtype == 'release' + cflags_common += cc.get_supported_arguments(['-ftree-vectorize']) + endif +@@ -614,7 +616,11 @@ subdir('libs/rgbe') + subdir('opencl') + subdir('gegl') + subdir('libs/npd') +-subdir('libs/ctx') ++if build_ctx ++ subdir('libs/ctx') ++else ++ libgegl_ctx = declare_dependency() ++endif + + # pkg-config file + gegl_pub_deps = [ +@@ -640,7 +646,12 @@ pkgconfig.generate(gegl_lib, + subdirs: api_name, + ) + +-gegl_dep = declare_dependency(link_with: [gegl_lib, gegl_ctx_lib], ++gegl_link_with = [gegl_lib] ++if build_ctx ++ gegl_link_with += [gegl_ctx_lib] ++endif ++ ++gegl_dep = declare_dependency(link_with: gegl_link_with, + include_directories: geglInclude, + dependencies: [gegl_pub_deps, libnpd], + sources: g_ir.found() ? gegl_gir : [], + +diff --git a/operations/external/meson.build b/operations/external/meson.build +index 64c84e45b6..806bbd5fae 100644 +--- a/operations/external/meson.build ++++ b/operations/external/meson.build +@@ -3,12 +3,15 @@ operations = [ + { 'name': 'ppm-load' }, + { 'name': 'ppm-save' }, + { 'name': 'npy-save' }, +- { 'name': 'vector-fill', 'deps': libgegl_ctx }, + { 'name': 'rgbe-load', 'deps': librgbe }, + { 'name': 'rgbe-save', 'deps': librgbe }, + { 'name': 'gif-load', 'deps': libnsgif }, + ] + ++if build_ctx ++ operations += { 'name': 'vector-fill', 'deps': libgegl_ctx } ++endif ++ + + if pangocairo.found() + operations += { 'name': 'text', 'deps': pangocairo } + +diff --git a/operations/workshop/external/meson.build b/operations/workshop/external/meson.build +index 24a9cf4432..572a33d6e7 100644 +--- a/operations/workshop/external/meson.build ++++ b/operations/workshop/external/meson.build +@@ -118,11 +118,13 @@ if maxflow.found() + ) + endif + +-gegl_operations+=shared_library('ctx-script', +- 'ctx-script.c', include_directories: [rootInclude, geglInclude], +- dependencies:[babl,glib,gobject,math,libgegl_ctx], +- link_with:[gegl_lib], +- name_prefix:'', +- install:true, +- install_dir: get_option('libdir') / api_name, +-) ++if build_ctx ++ gegl_operations+=shared_library('ctx-script', ++ 'ctx-script.c', include_directories: [rootInclude, geglInclude], ++ dependencies:[babl,glib,gobject,math,libgegl_ctx], ++ link_with:[gegl_lib], ++ name_prefix:'', ++ install:true, ++ install_dir: get_option('libdir') / api_name, ++ ) ++endif + + +diff --git a/operations/common/long-shadow.c b/operations/common/long-shadow.c +index 6f98a90bd2..5171bb05c1 100644 +--- a/operations/common/long-shadow.c ++++ b/operations/common/long-shadow.c +@@ -41,6 +41,12 @@ enum_start (gegl_long_shadow_composition) + enum_value (GEGL_LONG_SHADOW_COMPOSITION_SHADOW_MINUS_IMAGE, "shadow-minus-image", N_("Shadow minus image")) + enum_end (GeglLongShadowComposition) + ++#ifdef WITH_FADING_FIXED_RATE ++#define GEGL_LONG_SHADOW_FIXED_RATE_SUFFIX ",fading-fixed-rate" ++#else ++#define GEGL_LONG_SHADOW_FIXED_RATE_SUFFIX "" ++#endif ++ + property_enum (style, _("Style"), + GeglLongShadowStyle, gegl_long_shadow_style, + GEGL_LONG_SHADOW_STYLE_FINITE) +@@ -56,12 +62,10 @@ property_double (length, _("Length"), 100.0) + description (_("Shadow length")) + value_range (0.0, G_MAXDOUBLE) + ui_range (0.0, 1000.0) +- ui_meta ("visible", "style {finite, " +- " fading-fixed-length" +-#ifdef WITH_FADING_FIXED_RATE +- " , fading-fixed-rate" +-#endif +- " }") ++ ui_meta ("visible", "style {finite, " ++ " fading-fixed-length" ++ GEGL_LONG_SHADOW_FIXED_RATE_SUFFIX ++ " }") + + property_double (midpoint, _("Midpoint"), 100.0) + description (_("Shadow fade midpoint")) +@@ -72,11 +76,9 @@ property_double (midpoint, _("Midpoint"), 100.0) + property_double (midpoint_rel, _("Midpoint (relative)"), 0.5) + description (_("Shadow fade midpoint, as a factor of the shadow length")) + value_range (0.0, 1.0) +- ui_meta ("visible", "style {fading-fixed-length" +-#ifdef WITH_FADING_FIXED_RATE +- " , fading-fixed-rate" +-#endif +- " }") ++ ui_meta ("visible", "style {fading-fixed-length" ++ GEGL_LONG_SHADOW_FIXED_RATE_SUFFIX ++ " }") + ui_meta ("label", "alt-label") + ui_meta ("alt-label", _("Midpoint")) + + + +diff --git a/operations/external/png-load.c b/operations/external/png-load.c +index a5e63ed3e2..9a364736ba 100644 +--- a/operations/external/png-load.c ++++ b/operations/external/png-load.c +@@ -19,6 +19,11 @@ + */ + + #include "config.h" ++ ++#ifndef __PRETTY_FUNCTION__ ++#define __PRETTY_FUNCTION__ __FUNCTION__ ++#endif ++ + #ifdef HAVE_STRPTIME + #define _XOPEN_SOURCE + #include + +diff --git a/operations/external/png-save.c b/operations/external/png-save.c +index 4cf914deda..ee6a7185ac 100644 +--- a/operations/external/png-save.c ++++ b/operations/external/png-save.c +@@ -18,6 +18,11 @@ + */ + + #include "config.h" ++ ++#ifndef __PRETTY_FUNCTION__ ++#define __PRETTY_FUNCTION__ __FUNCTION__ ++#endif ++ + #include + #include + + +diff --git a/operations/external/jpg-load.c b/operations/external/jpg-load.c +index 71db03e69d..de0374aa7b 100644 +--- a/operations/external/jpg-load.c ++++ b/operations/external/jpg-load.c +@@ -17,6 +17,11 @@ + */ + + #include "config.h" ++ ++#ifndef __PRETTY_FUNCTION__ ++#define __PRETTY_FUNCTION__ __FUNCTION__ ++#endif ++ + #include + + #ifdef GEGL_PROPERTIES diff --git a/ports/gegl/portfile.cmake b/ports/gegl/portfile.cmake index 5f420ffa90367f..6c55e7f9765294 100644 --- a/ports/gegl/portfile.cmake +++ b/ports/gegl/portfile.cmake @@ -1,16 +1,15 @@ string(REGEX MATCH [[^[0-9][0-9]*\.[1-9][0-9]*]] VERSION_MAJOR_MINOR ${VERSION}) -vcpkg_download_distfile(ARCHIVE - URLS https://download.gimp.org/pub/gegl/${VERSION_MAJOR_MINOR}/gegl-${VERSION}.tar.xz - FILENAME "gegl-${VERSION}.tar.xz" - SHA512 9f47480dc2fad58c052aa3df3ac914d500614e7acb0dc46677bea4228350a00a0fe38b5b0572303251210e3e544b5b7cb51415476586630df4da8f4b7c6486d8 -) - -vcpkg_extract_source_archive( - SOURCE_PATH - ARCHIVE "${ARCHIVE}" +vcpkg_from_gitlab( + OUT_SOURCE_PATH SOURCE_PATH + GITLAB_URL https://gitlab.gnome.org/ + REPO GNOME/gegl + REF bf52f2e6daa3c0c3ed9e45f2aa6e70109144e030 + SHA512 15cbfeb3574fd404f609527939567ce0a3fb7efd50426bed4c7d7077b2cef54d4ec9840cad7c2b3098bea79f43682695830e37b6bf21f11d8752bf85800dfa33 PATCHES disable_tests.patch + fix-ctx-msvc.patch + use-plugins-dir.patch remove_execinfo_support.patch remove-consistency-check.patch ) @@ -69,6 +68,11 @@ vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() +vcpkg_copy_tools( + TOOL_NAMES gegl gegl-imgcmp + AUTO_CLEAN +) + vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/gegl/use-plugins-dir.patch b/ports/gegl/use-plugins-dir.patch new file mode 100644 index 00000000000000..595f9deda248f7 --- /dev/null +++ b/ports/gegl/use-plugins-dir.patch @@ -0,0 +1,372 @@ +diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c +index 9f47f886..4c2d531c 100644 +--- a/gegl/gegl-init.c ++++ b/gegl/gegl-init.c +@@ -745,7 +745,7 @@ gegl_get_default_module_paths(void) + } + #elif defined(G_OS_WIN32) + prefix = g_win32_get_package_installation_directory_of_module (hLibGeglModule); +- module_path = g_build_filename (prefix, "lib", GEGL_LIBRARY, NULL); ++ module_path = g_build_filename (prefix, "plugins", GEGL_LIBRARY, NULL); + g_free(prefix); + #else + #if defined(ENABLE_RELOCATABLE) +diff --git a/meson.build b/meson.build +index c11242eb..1335533b 100644 +--- a/meson.build ++++ b/meson.build +@@ -249,6 +249,8 @@ if cc.get_id() == 'msvc' + cflags_common += ['/D__restrict__=__restrict'] + endif + ++gegl_plugins_dir = 'plugins' / api_name ++ + if buildtype == 'debugoptimized' or buildtype == 'release' + cflags_common += cc.get_supported_arguments(['-ftree-vectorize']) + endif +@@ -635,7 +640,7 @@ pkgconfig.generate(gegl_lib, + name: 'GEGL', + description: 'Generic Graphics Library', + version: meson.project_version(), +- variables: 'pluginsdir=' + '${prefix}' / get_option('libdir') / api_name, ++ variables: 'pluginsdir=' + '${prefix}' / gegl_plugins_dir, + # gegl_npd_lib API is actually used by software, such as GIMP. It must + # not be removed, even though adding it like this is not so proper. If + # one wants to clean up this dependency, a proper port must be done +diff --git a/operations/common-cxx/meson.build b/operations/common-cxx/meson.build +index 146967fa..0b7db2b7 100644 +--- a/operations/common-cxx/meson.build ++++ b/operations/common-cxx/meson.build +@@ -35,7 +35,7 @@ gegl_common_cxx = shared_library('gegl-common-cxx', + cpp_args: [ '-DGEGL_OP_BUNDLE', ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_common_cxx +@@ -58,7 +58,7 @@ if host_cpu_family == 'x86_64' + cpp_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v2_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_cxx_x86_64_v2 + +@@ -78,7 +78,7 @@ if host_cpu_family == 'x86_64' + cpp_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v3_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_cxx_x86_64_v3 + +@@ -100,7 +100,7 @@ elif host_cpu_family == 'arm' + cpp_args: [ '-DGEGL_OP_BUNDLE' ] + arm_neon_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_cxx_arm_neon + +diff --git a/operations/common-gpl3+/meson.build b/operations/common-gpl3+/meson.build +index 0513fb44..18956e16 100644 +--- a/operations/common-gpl3+/meson.build ++++ b/operations/common-gpl3+/meson.build +@@ -78,7 +78,7 @@ gegl_common_gpl3 = shared_library('gegl-common-gpl3', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_common_gpl3 +@@ -101,7 +101,7 @@ if host_cpu_family == 'x86_64' + c_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v2_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_gpl3_x86_64_v2 + +@@ -121,7 +121,7 @@ if host_cpu_family == 'x86_64' + c_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v3_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_gpl3_x86_64_v3 + +@@ -143,7 +143,7 @@ elif host_cpu_family == 'arm' + c_args: [ '-DGEGL_OP_BUNDLE' ] + arm_neon_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_gpl3_arm_neon + +diff --git a/operations/common/meson.build b/operations/common/meson.build +index 29249844..82df99e6 100644 +--- a/operations/common/meson.build ++++ b/operations/common/meson.build +@@ -152,7 +152,7 @@ gegl_common = shared_library('gegl-common', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_common +@@ -167,7 +167,7 @@ if host_cpu_family == 'x86_64' + c_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v2_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_x86_64_v2 + +@@ -179,7 +179,7 @@ if host_cpu_family == 'x86_64' + c_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v3_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_common_x86_64_v3 +@@ -193,7 +193,7 @@ elif host_cpu_family == 'arm' + c_args: [ '-DGEGL_OP_BUNDLE' ] + arm_neon_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_common_arm_neon + endif +diff --git a/operations/core/meson.build b/operations/core/meson.build +index ca9e72cc..0729f24b 100644 +--- a/operations/core/meson.build ++++ b/operations/core/meson.build +@@ -37,7 +37,7 @@ gegl_core = shared_library('gegl-core', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_core +diff --git a/operations/external/meson.build b/operations/external/meson.build +index 64c84e45..f9e7c435 100644 +--- a/operations/external/meson.build ++++ b/operations/external/meson.build +@@ -128,6 +128,6 @@ foreach operation : operations + link_with: [ gegl_lib, ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endforeach +diff --git a/operations/generated/meson.build b/operations/generated/meson.build +index b2d0e82d..66f73501 100644 +--- a/operations/generated/meson.build ++++ b/operations/generated/meson.build +@@ -52,7 +52,7 @@ gegl_generated = shared_library('gegl-generated', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_generated +@@ -67,7 +67,7 @@ if host_cpu_family == 'x86_64' + c_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v2_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_generated_x86_64_v2 + +@@ -79,7 +79,7 @@ if host_cpu_family == 'x86_64' + c_args: [ '-DGEGL_OP_BUNDLE' ] + x86_64_v3_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_generated_x86_64_v3 + +@@ -93,7 +93,7 @@ elif host_cpu_family == 'arm' + c_args: [ '-DGEGL_OP_BUNDLE' ] + arm_neon_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_generated_arm_neon + +diff --git a/operations/json/meson.build b/operations/json/meson.build +index feab852b..ccccb956 100644 +--- a/operations/json/meson.build ++++ b/operations/json/meson.build +@@ -11,6 +11,6 @@ foreach _file : json_operations + output: _file, + copy: true, + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endforeach +diff --git a/operations/seamless-clone/meson.build b/operations/seamless-clone/meson.build +index 47562a2e..708ad1e2 100644 +--- a/operations/seamless-clone/meson.build ++++ b/operations/seamless-clone/meson.build +@@ -21,6 +21,6 @@ foreach lib : seamless_clone_libs + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endforeach +diff --git a/operations/transform/meson.build b/operations/transform/meson.build +index 110b2896..33e2c0a6 100644 +--- a/operations/transform/meson.build ++++ b/operations/transform/meson.build +@@ -29,7 +29,7 @@ gegl_transformops = shared_library('transformops', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + gegl_operations += gegl_transformops +@@ -44,7 +44,7 @@ if host_cpu_family == 'x86_64' + c_args: x86_64_v2_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_transformops_x86_64_v2 + +@@ -56,7 +56,7 @@ if host_cpu_family == 'x86_64' + c_args: x86_64_v3_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_transformops_x86_64_v3 + +@@ -70,7 +70,7 @@ elif host_cpu_family == 'arm' + c_args: arm_neon_flags, + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + gegl_operations += gegl_transformops_arm_neon + +diff --git a/operations/workshop/external/meson.build b/operations/workshop/external/meson.build +index 24a9cf44..61c78cb7 100644 +--- a/operations/workshop/external/meson.build ++++ b/operations/workshop/external/meson.build +@@ -14,7 +14,7 @@ gegl_operations += shared_library('voroni_diagram', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + + +@@ -34,7 +34,7 @@ if lua.found() + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endif + +@@ -54,7 +54,7 @@ if lensfun.found() + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endif + +@@ -74,7 +74,7 @@ if cairo.found() + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endif + +@@ -94,7 +94,7 @@ if libv4l2.found() + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endif + +@@ -114,7 +114,7 @@ if maxflow.found() + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endif + +@@ -124,5 +124,5 @@ gegl_operations+=shared_library('ctx-script', + link_with:[gegl_lib], + name_prefix:'', + install:true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) +diff --git a/operations/workshop/generated/meson.build b/operations/workshop/generated/meson.build +index 318931d4..ffb3e942 100644 +--- a/operations/workshop/generated/meson.build ++++ b/operations/workshop/generated/meson.build +@@ -22,6 +22,6 @@ foreach lib : libraries + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) + endforeach +diff --git a/operations/workshop/meson.build b/operations/workshop/meson.build +index 6bb3046f..9c8594dc 100644 +--- a/operations/workshop/meson.build ++++ b/operations/workshop/meson.build +@@ -46,5 +46,5 @@ gegl_workshop = shared_library('gegl-workshop', + ], + name_prefix: '', + install: true, +- install_dir: get_option('libdir') / api_name, ++ install_dir: gegl_plugins_dir, + ) diff --git a/ports/gegl/vcpkg.json b/ports/gegl/vcpkg.json index c0b13366befa6c..f5e51d51c35665 100644 --- a/ports/gegl/vcpkg.json +++ b/ports/gegl/vcpkg.json @@ -1,10 +1,11 @@ { "name": "gegl", "version": "0.4.70", + "port-version": 1, "description": "Generic Graphical Library.", "homepage": "https://gegl.org/", "license": "LGPL-3.0-or-later", - "supports": "!windows | mingw", + "supports": "!(windows & arm64)", "dependencies": [ "babl", "json-glib", @@ -27,7 +28,7 @@ }, "introspection": { "description": "Enable introspection", - "supports": "!static", + "supports": "!static & (!windows | mingw)", "dependencies": [ { "name": "babl", diff --git a/ports/json-glib/portfile.cmake b/ports/json-glib/portfile.cmake index 3a904f6dec9f75..cbdb10ffe4699a 100644 --- a/ports/json-glib/portfile.cmake +++ b/ports/json-glib/portfile.cmake @@ -33,6 +33,14 @@ vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/include/json-glib-1.0/json-glib/json-version-macros.h" + "#include \"json-version.h\"\n\n#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(JSON_STATIC_BUILD)" + "#include \"json-version.h\"\n\n#define JSON_STATIC_BUILD 1\n\n#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(JSON_STATIC_BUILD)" + ) +endif() + vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSES/LGPL-2.1-or-later.txt" "${SOURCE_PATH}/LICENSES/CC0-1.0.txt" "${SOURCE_PATH}/LICENSES/MIT.txt") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/json-glib/vcpkg.json b/ports/json-glib/vcpkg.json index f9b702937a7068..6492ceda4e23f8 100644 --- a/ports/json-glib/vcpkg.json +++ b/ports/json-glib/vcpkg.json @@ -1,6 +1,7 @@ { "name": "json-glib", "version": "1.10.8", + "port-version": 1, "description": "Implements a full JSON parser and generator using GLib and GObject, and integrates JSON with GLib data types.", "homepage": "https://wiki.gnome.org/Projects/JsonGlib", "license": "LGPL-2.1-or-later AND CC0-1.0 AND MIT", diff --git a/versions/baseline.json b/versions/baseline.json index 465a7a68ebfd57..86fc72cb7db1f5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3326,7 +3326,7 @@ }, "gegl": { "baseline": "0.4.70", - "port-version": 0 + "port-version": 1 }, "gemmlowp": { "baseline": "2021-09-28", @@ -4154,7 +4154,7 @@ }, "json-glib": { "baseline": "1.10.8", - "port-version": 0 + "port-version": 1 }, "json-rpc-cxx": { "baseline": "0.3.2", diff --git a/versions/g-/gegl.json b/versions/g-/gegl.json index 7f4a9e7024d2d0..7695c428515ad0 100644 --- a/versions/g-/gegl.json +++ b/versions/g-/gegl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2a0ba42a848cf60f8a8f36a57e47eebb24aa1c86", + "version": "0.4.70", + "port-version": 1 + }, { "git-tree": "24ef813e729c2db7af765cf5c0aa2a3fe4fddd4b", "version": "0.4.70", diff --git a/versions/j-/json-glib.json b/versions/j-/json-glib.json index 7ceb5e1118af92..a6a6c2fd37b15e 100644 --- a/versions/j-/json-glib.json +++ b/versions/j-/json-glib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e837ce2ceeeb439ad683e64bf45ff73950ce0f5f", + "version": "1.10.8", + "port-version": 1 + }, { "git-tree": "a643582cfcabca9b6d1abb46e821d123ddf3dca0", "version": "1.10.8",