Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package babl for openSUSE:Factory checked in at 2026-03-22 14:11:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/babl (Old) and /work/SRC/openSUSE:Factory/.babl.new.8177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "babl" Sun Mar 22 14:11:18 2026 rev:71 rq:1341593 version:0.1.124 Changes: -------- --- /work/SRC/openSUSE:Factory/babl/babl.changes 2025-12-20 21:45:46.293409204 +0100 +++ /work/SRC/openSUSE:Factory/.babl.new.8177/babl.changes 2026-03-22 14:11:24.199461641 +0100 @@ -1,0 +2,14 @@ +Fri Mar 20 18:51:43 UTC 2026 - Bjørn Lie <[email protected]> + +- Update to version 0.1.124: + + DisplayP3 pre-defined colorspace, build and sanity improvements + for CI and windows. +- Changes from version 0.1.122: + + Fix for startup crash due to mis-loading of x86_64-v4 on -v2 + with some ports. +- Changes from version 0.1.120: + + x86_64-v4 microarchitecture support. +- Drop 4efc8b827e008417c4995a93ae3310697318cfab.patch: Fixed + upstream. + +------------------------------------------------------------------- Old: ---- 4efc8b827e008417c4995a93ae3310697318cfab.patch babl-0.1.118.tar.xz New: ---- babl-0.1.124.tar.xz ----------(Old B)---------- Old: + x86_64-v4 microarchitecture support. - Drop 4efc8b827e008417c4995a93ae3310697318cfab.patch: Fixed upstream. ----------(Old E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ babl.spec ++++++ --- /var/tmp/diff_new_pack.g4bx18/_old 2026-03-22 14:11:24.827487465 +0100 +++ /var/tmp/diff_new_pack.g4bx18/_new 2026-03-22 14:11:24.827487465 +0100 @@ -1,7 +1,7 @@ # # spec file for package babl # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define debug_package_requires libbabl-0_1-0 = %{version}-%{release} Name: babl -Version: 0.1.118 +Version: 0.1.124 Release: 0 Summary: Dynamic Pixel Format Translation Library License: GPL-3.0-or-later AND LGPL-3.0-or-later @@ -27,8 +27,7 @@ URL: https://gegl.org/babl/ Source0: https://download.gimp.org/pub/babl/0.1/%{name}-%{version}.tar.xz Source99: baselibs.conf -# PATCH-FIX-UPSTREAM https://gitlab.gnome.org/GNOME/babl/-/commit/4efc8b827e008417c4995a93ae3310697318cfab.patch - really make git an optional dependency -Patch0: 4efc8b827e008417c4995a93ae3310697318cfab.patch + BuildRequires: meson >= 0.54.0 BuildRequires: pkgconfig BuildRequires: vala ++++++ babl-0.1.118.tar.xz -> babl-0.1.124.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/.gitlab-ci.yml new/babl-0.1.124/.gitlab-ci.yml --- old/babl-0.1.118/.gitlab-ci.yml 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/.gitlab-ci.yml 2026-03-10 16:56:45.000000000 +0100 @@ -23,6 +23,10 @@ FDO_DISTRIBUTION_PACKAGES: > meson lcms2-devel git diffutils shellcheck devscripts FDO_UPSTREAM_REPO: $CI_PROJECT_PATH + # Enable colorful output when supported (e.g. ninja) + CLICOLOR_FORCE: "1" + # Disable timestamps on CI logs + FF_TIMESTAMPS: false stages: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/NEWS new/babl-0.1.124/NEWS --- old/babl-0.1.118/NEWS 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/NEWS 2026-03-10 16:56:45.000000000 +0100 @@ -3,6 +3,17 @@ the news section both in the README and the webpage. --> + +2026-03-10 babl-0.1.124 </dt><dd> +DisplayP3 pre-defined colorspace, build and sanity improvements for CI and +windows. + </dd><dt> +2026-01-28 babl-0.1.122 </dt><dd> +fix for startup crash due to mis-loading of x86_64-v4 on -v2 with some ports. + </dd><dt> +2026-01-15 babl-0.1.120 </dt><dd> +x86_64-v4 microarchitecture support. + </dd><dt> 2025-12-08 babl-0.1.118 </dt><dd> build and portability fixes, babl is now relocatedable. </dd><dt> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-cache.c new/babl-0.1.124/babl/babl-cache.c --- old/babl-0.1.118/babl/babl-cache.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-cache.c 2026-03-10 16:56:45.000000000 +0100 @@ -133,7 +133,7 @@ if (appdata) babl_free (appdata); } -#ifdef _WIN64 +#ifdef _UCRT else if (_dupenv_s(&env, NULL, "TEMP") == 0 && env != NULL) #else else if (getenv("TEMP")) @@ -312,7 +312,7 @@ time_t tim = time (NULL); char *env = NULL; -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_DEBUG_CONVERSIONS"); #else _dupenv_s (&env, NULL, "BABL_DEBUG_CONVERSIONS"); @@ -385,7 +385,7 @@ babl->instance.id = babl_fish_get_id (from_format, to_format); babl->instance.name = ((char *) babl) + sizeof (BablFish); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); @@ -407,7 +407,7 @@ babl->class_type = BABL_FISH_PATH; babl->instance.id = babl_fish_get_id (from_format, to_format); babl->instance.name = ((char *) babl) + sizeof (BablFishPath); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-component.c new/babl-0.1.124/babl/babl-component.c --- old/babl-0.1.118/babl/babl-component.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-component.c 2026-03-10 16:56:45.000000000 +0100 @@ -36,7 +36,7 @@ babl = babl_malloc (sizeof (BablComponent) + strlen (name) + 1); babl->instance.name = (char *) babl + sizeof (BablComponent); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-conversion.c new/babl-0.1.124/babl/babl-conversion.c --- old/babl-0.1.118/babl/babl-conversion.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-conversion.c 2026-03-10 16:56:45.000000000 +0100 @@ -151,7 +151,7 @@ babl = babl_malloc (sizeof (BablConversion) + strlen (name) + 1); babl->instance.name = (char *) babl + sizeof (BablConversion); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-cpuaccel.c new/babl-0.1.124/babl/babl-cpuaccel.c --- old/babl-0.1.118/babl/babl-cpuaccel.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-cpuaccel.c 2026-03-10 16:56:45.000000000 +0100 @@ -128,8 +128,14 @@ // extended features ARCH_X86_INTEL_FEATURE_BMI1 = 1 << 3, - ARCH_X86_INTEL_FEATURE_BMI2 = 1 << 8, ARCH_X86_INTEL_FEATURE_AVX2 = 1 << 5, + ARCH_X86_INTEL_FEATURE_BMI2 = 1 << 8, + + ARCH_X86_INTEL_FEATURE_AVX512F = 1 << 15, + ARCH_X86_INTEL_FEATURE_AVX512DQ = 1 << 17, + ARCH_X86_INTEL_FEATURE_AVX512CD = 1 << 28, + ARCH_X86_INTEL_FEATURE_AVX512BW = 1 << 30, + ARCH_X86_INTEL_FEATURE_AVX512VL = 1 << 31 }; @@ -299,6 +305,17 @@ caps |= BABL_CPU_ACCEL_X86_BMI1; if (ebx & ARCH_X86_INTEL_FEATURE_BMI2) caps |= BABL_CPU_ACCEL_X86_BMI2; + + if (ebx & ARCH_X86_INTEL_FEATURE_AVX512F) + caps |= BABL_CPU_ACCEL_X86_AVX512F; + if (ebx & ARCH_X86_INTEL_FEATURE_AVX512DQ) + caps |= BABL_CPU_ACCEL_X86_AVX512DQ; + if (ebx & ARCH_X86_INTEL_FEATURE_AVX512CD) + caps |= BABL_CPU_ACCEL_X86_AVX512CD; + if (ebx & ARCH_X86_INTEL_FEATURE_AVX512BW) + caps |= BABL_CPU_ACCEL_X86_AVX512BW; + if (ebx & ARCH_X86_INTEL_FEATURE_AVX512VL) + caps |= BABL_CPU_ACCEL_X86_AVX512VL; } #endif /* USE_SSE */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-cpuaccel.h new/babl-0.1.124/babl/babl-cpuaccel.h --- old/babl-0.1.118/babl/babl-cpuaccel.h 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-cpuaccel.h 2026-03-10 16:56:45.000000000 +0100 @@ -43,6 +43,11 @@ BABL_CPU_ACCEL_X86_BMI1 = 0x00008000, BABL_CPU_ACCEL_X86_BMI2 = 0x00004000, BABL_CPU_ACCEL_X86_AVX2 = 0x00002000, + BABL_CPU_ACCEL_X86_AVX512F = 0x00001000, + BABL_CPU_ACCEL_X86_AVX512DQ= 0x00000800, + BABL_CPU_ACCEL_X86_AVX512CD= 0x00000400, + BABL_CPU_ACCEL_X86_AVX512BW= 0x00000200, + BABL_CPU_ACCEL_X86_AVX512VL= 0x00000100, BABL_CPU_ACCEL_X86_64_V2 = (BABL_CPU_ACCEL_X86_POPCNT| @@ -61,6 +66,14 @@ BABL_CPU_ACCEL_X86_OSXSAVE| BABL_CPU_ACCEL_X86_MOVBE), + BABL_CPU_ACCEL_X86_64_V4 = + (BABL_CPU_ACCEL_X86_64_V3| + BABL_CPU_ACCEL_X86_AVX512F| + BABL_CPU_ACCEL_X86_AVX512DQ| + BABL_CPU_ACCEL_X86_AVX512CD| + BABL_CPU_ACCEL_X86_AVX512BW| + BABL_CPU_ACCEL_X86_AVX512VL), + /* powerpc accelerations */ BABL_CPU_ACCEL_PPC_ALTIVEC = 0x00000010, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-extension.c new/babl-0.1.124/babl/babl-extension.c --- old/babl-0.1.118/babl/babl-extension.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-extension.c 2026-03-10 16:56:45.000000000 +0100 @@ -64,7 +64,7 @@ babl = babl_malloc (sizeof (BablExtension) + strlen (path) + 1); babl_set_destructor (babl, babl_extension_destroy); babl->instance.name = (char *) babl + sizeof (BablExtension); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, path); #else strcpy_s (babl->instance.name, strlen(path) + 1, path); @@ -325,7 +325,7 @@ src = path; -#if defined(_WIN32) || defined(_WIN64) +#ifdef _WIN32 return babl_strdup (path); #endif @@ -335,7 +335,7 @@ switch (*src) { case '~': -#ifndef _WIN64 +#ifndef _UCRT home = getenv ("HOME"); #else _dupenv_s (&home, NULL, "HOME"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-fish-path.c new/babl-0.1.124/babl/babl-fish-path.c --- old/babl-0.1.118/babl/babl-fish-path.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-fish-path.c 2026-03-10 16:56:45.000000000 +0100 @@ -324,7 +324,7 @@ memset (lut, 11, 256 * 256 * 256 *16); memset (src, 12, num_pixels * 16); -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_LUT_INFO"); #else _dupenv_s (&env, NULL, "BABL_LUT_INFO"); @@ -334,7 +334,7 @@ lut_info_level = atoi (env); } -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_LUT_UNUSED_LIMIT"); #else _dupenv_s (&env, NULL, "BABL_LUT_UNUSED_LIMIT"); @@ -364,7 +364,7 @@ free (lut); free (src); free (dst); -#ifdef _WIN64 +#ifdef _UCRT free(env); #endif } @@ -643,7 +643,7 @@ if (error != 0.0) return error; -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_TOLERANCE"); #else _dupenv_s (&env, NULL, "BABL_TOLERANCE"); @@ -653,7 +653,7 @@ else error = BABL_TOLERANCE; -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_DEBUG_CONVERSIONS"); #else _dupenv_s (&env, NULL, "BABL_DEBUG_CONVERSIONS"); @@ -663,7 +663,7 @@ else debug_conversions = 0; -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_LUT"); #else _dupenv_s (&env, NULL, "BABL_LUT"); @@ -672,7 +672,7 @@ enable_lut = atoi(env); else enable_lut = 1; -#ifdef _WIN64 +#ifdef _UCRT free (env); #endif @@ -696,7 +696,7 @@ if (max_length != 0) return max_length; -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_PATH_LENGTH"); #else _dupenv_s (&env, NULL, "BABL_PATH_LENGTH"); @@ -711,7 +711,7 @@ depth if none are found within two steps in the initial search. */ -#ifdef _WIN64 +#ifdef _UCRT free (env); #endif if (max_length > BABL_HARD_MAX_PATH_LENGTH) @@ -1167,7 +1167,7 @@ char *val = NULL; if (debug_missing < 0) { -#ifndef _WIN64 +#ifndef _UCRT val = getenv ("BABL_DEBUG_MISSING"); #else _dupenv_s (&val, NULL, "BABL_DEBUG_MISSING"); @@ -1176,7 +1176,7 @@ debug_missing = 1; else debug_missing = 0; -#ifdef _WIN64 +#ifdef _UCRT free (val); #endif } @@ -1251,7 +1251,7 @@ babl->class_type = BABL_FISH_PATH; babl->instance.id = babl_fish_get_id (source, destination); babl->instance.name = ((char *) babl) + sizeof (BablFishPath); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-fish-reference.c new/babl-0.1.124/babl/babl-fish-reference.c --- old/babl-0.1.118/babl/babl-fish-reference.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-fish-reference.c 2026-03-10 16:56:45.000000000 +0100 @@ -138,7 +138,7 @@ babl->class_type = BABL_FISH_REFERENCE; babl->instance.id = babl_fish_get_id (source, destination); babl->instance.name = ((char *) babl) + sizeof (BablFishReference); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); @@ -732,8 +732,7 @@ } } -typedef enum _Kind Kind; -enum _Kind { KIND_RGB, KIND_CMYK}; +typedef enum _Kind { KIND_RGB, KIND_CMYK} Kind; static int format_has_cmyk_model (const Babl *format) { @@ -1388,7 +1387,7 @@ { static const void *type_float = NULL; static int allow_float_reference = -1; -#ifdef _WIN32 +#ifdef _UCRT char *env = NULL; #endif @@ -1432,7 +1431,7 @@ if (allow_float_reference == -1) { -#ifndef _WIN64 +#ifndef _UCRT allow_float_reference = getenv ("BABL_REFERENCE_NOFLOAT") ? 0 : 1; #else _dupenv_s(&env, NULL, "BABL_REFERENCE_NOFLOAT"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-fish-simple.c new/babl-0.1.124/babl/babl-fish-simple.c --- old/babl-0.1.118/babl/babl-fish-simple.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-fish-simple.c 2026-03-10 16:56:45.000000000 +0100 @@ -47,7 +47,7 @@ babl->class_type = BABL_FISH_SIMPLE; babl->instance.id = babl_fish_get_id (conversion->source, conversion->destination); babl->instance.name = ((char *) babl) + sizeof (BablFishSimple); -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-fish.c new/babl-0.1.124/babl/babl-fish.c --- old/babl-0.1.118/babl/babl-fish.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-fish.c 2026-03-10 16:56:45.000000000 +0100 @@ -322,7 +322,7 @@ fish->class_type = BABL_FISH; fish->instance.id = babl_fish_get_id (source_format, destination_format); fish->instance.name = ((char *) fish) + sizeof (BablFish); -#ifndef _WIN64 +#ifndef _UCRT strcpy (fish->instance.name, name); #else strcpy_s (fish->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-format.c new/babl-0.1.124/babl/babl-format.c --- old/babl-0.1.118/babl/babl-format.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-format.c 2026-03-10 16:56:45.000000000 +0100 @@ -104,7 +104,7 @@ babl->class_type = BABL_FORMAT; babl->instance.id = id; -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-memory.c new/babl-0.1.124/babl/babl-memory.c --- old/babl-0.1.118/babl/babl-memory.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-memory.c 2026-03-10 16:56:45.000000000 +0100 @@ -297,7 +297,7 @@ if (!ret) babl_log ("args=(%s): failed", s); -#ifndef _WIN64 +#ifndef _UCRT strcpy (ret, s); #else strcpy_s (ret, strlen(s) + 1, s); @@ -333,7 +333,7 @@ if (!dest) { ret = babl_malloc (src_len + 1); -#ifndef _WIN64 +#ifndef _UCRT strcpy (ret, src); #else strcpy_s (ret, strlen(src) + 1, src); @@ -353,7 +353,7 @@ ret = babl_realloc (dest, new_size); } -#ifndef _WIN64 +#ifndef _UCRT strcpy (&ret[dst_len], src); #else strcpy_s (&ret[dst_len], strlen(src) + 1, src); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-model.c new/babl-0.1.124/babl/babl-model.c --- old/babl-0.1.118/babl/babl-model.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-model.c 2026-03-10 16:56:45.000000000 +0100 @@ -77,7 +77,7 @@ babl->model.data = NULL; babl->model.model = NULL; babl->model.flags = flags; -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-space.c new/babl-0.1.124/babl/babl-space.c --- old/babl-0.1.118/babl/babl-space.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-space.c 2026-03-10 16:56:45.000000000 +0100 @@ -605,6 +605,13 @@ // XXX: is using sRGB TRC right? babl_trc("sRGB"), NULL, NULL, 1); + babl_space_from_chromaticities ("DisplayP3", + 0.3127, 0.3290, + 0.680, 0.320, + 0.265, 0.690, + 0.150, 0.060, + babl_trc("sRGB"), NULL, NULL, 1); + babl_space_from_chromaticities ( "Adobish", /* a space that can be used as a place-holder for a sRGB like space with displaced green coordinates from a big graphics software vendor that diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-type.c new/babl-0.1.124/babl/babl-type.c --- old/babl-0.1.118/babl/babl-type.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-type.c 2026-03-10 16:56:45.000000000 +0100 @@ -52,7 +52,7 @@ babl->class_type = BABL_TYPE; babl->instance.id = id; babl->instance.doc = doc; -#ifndef _WIN64 +#ifndef _UCRT strcpy (babl->instance.name, name); #else strcpy_s (babl->instance.name, strlen(name) + 1, name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl-util.c new/babl-0.1.124/babl/babl-util.c --- old/babl-0.1.118/babl/babl-util.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl-util.c 2026-03-10 16:56:45.000000000 +0100 @@ -173,7 +173,7 @@ wchar_t *mode_utf16 = babl_convert_utf8_to_utf16 (mode); FILE *result = NULL; -#ifndef _WIN64 +#ifndef _UCRT result = _wfopen (path_utf16, mode_utf16); #else if (_wfopen_s (&result, path_utf16, mode_utf16) != 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl.c new/babl-0.1.124/babl/babl.c --- old/babl-0.1.118/babl/babl.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl.c 2026-03-10 16:56:45.000000000 +0100 @@ -20,6 +20,10 @@ #ifndef _WIN32 #include <unistd.h> #endif +#ifdef __APPLE__ +#include <dlfcn.h> +#include <libgen.h> +#endif #include "config.h" #include "babl-internal.h" @@ -31,10 +35,10 @@ #define BABL_PATH LIBDIR BABL_DIR_SEPARATOR BABL_LIBRARY #endif - +#if !defined(_WIN32) && !defined(__APPLE__) static char * _babl_find_relocatable_exe (void); static char * _babl_guess_libdir (void); - +#endif /* * Returns a list of directories if the environment variable $BABL_PATH @@ -49,7 +53,7 @@ { char *ret = NULL; -#ifndef _WIN64 +#ifndef _UCRT ret = getenv ("BABL_PATH"); #else _dupenv_s (&ret, NULL, "BABL_PATH"); @@ -57,7 +61,32 @@ if (!ret) { -#if defined(_WIN32) +#if defined(__APPLE__) + Dl_info info; + /* The checked symbol must be exported in the libbabl*.dylib */ + if (dladdr((const void *)babl_dir_list, &info) && info.dli_fname) + { + char dylib_path[PATH_MAX]; + char *dylib_dir; + char *babl_dir; + + /* Get the parent directory containing the .dylib (e.g. <foobar>\Frameworks\, + does not matter the parent dir, this is packaging-agnostic) */ + strlcpy(dylib_path, info.dli_fname, sizeof(dylib_path)); + dylib_dir = dirname(dylib_path); + + /* Construct the babl dir on the parent dir (e.g. <foobar>\Frameworks\{BABL_LIBRARY}) */ + babl_dir = babl_malloc(strlen(dylib_dir) + strlen(BABL_DIR_SEPARATOR) + + strlen(BABL_LIBRARY) + 1); + sprintf(babl_dir, "%s%s%s", dylib_dir, BABL_DIR_SEPARATOR, BABL_LIBRARY); + + ret = babl_dir; + } + else + { + babl_fatal ("Getting module path for relocatibility failed"); + } +#elif defined(_WIN32) /* Figure it out from the location of this DLL */ wchar_t w_filename[MAX_PATH]; char *filename = NULL; @@ -180,7 +209,7 @@ { char* ret_tmp = babl_malloc (sizeof (char) * (strlen (ret) + 1)); -#ifndef _WIN64 +#ifndef _UCRT strcpy (ret_tmp, ret); #else strcpy_s (ret_tmp, strlen (ret) + 1, ret); @@ -227,14 +256,14 @@ babl_extension_load_dir_list (dir_list, exclusion_pattern); babl_free (dir_list); -#ifndef _WIN64 +#ifndef _UCRT env = getenv ("BABL_INHIBIT_CACHE"); #else _dupenv_s (&env, NULL, "BABL_INHIBIT_CACHE"); #endif if (!env) babl_init_db (); -#ifdef _WIN64 +#ifdef _UCRT free (env); #endif } @@ -302,13 +331,17 @@ #ifdef ARCH_X86_64 void babl_base_init_x86_64_v2 (void); void babl_base_init_x86_64_v3 (void); +void babl_base_init_x86_64_v4 (void); void _babl_space_add_universal_rgb_x86_64_v2 (const Babl *space); void _babl_space_add_universal_rgb_x86_64_v3 (const Babl *space); +void _babl_space_add_universal_rgb_x86_64_v4 (const Babl *space); const Babl * babl_trc_lookup_by_name_x86_64_v2 (const char *name); const Babl * babl_trc_lookup_by_name_x86_64_v3 (const char *name); +const Babl * +babl_trc_lookup_by_name_x86_64_v4 (const char *name); const Babl * babl_trc_new_x86_64_v2 (const char *name, @@ -322,6 +355,12 @@ double gamma, int n_lut, float *lut); +const Babl * +babl_trc_new_x86_64_v4 (const char *name, + BablTRCType type, + double gamma, + int n_lut, + float *lut); #endif #ifdef ARCH_ARM @@ -342,12 +381,22 @@ static const char **simd_init (void) { - static const char *exclude[] = {"neon-", "x86-64-v3", "x86-64-v2", NULL}; + static const char *exclude[] = {"neon-", "x86-64-v4", "x86-64-v3", "x86-64-v2", NULL}; #ifdef ARCH_X86_64 BablCpuAccelFlags accel = babl_cpu_accel_get_support (); - if ((accel & BABL_CPU_ACCEL_X86_64_V3) == BABL_CPU_ACCEL_X86_64_V3) + if ((accel & BABL_CPU_ACCEL_X86_64_V4) == BABL_CPU_ACCEL_X86_64_V4) { - static const char *exclude[] = {NULL}; + static const char *exclude[] = {"x86-64-v3-", "x86-64-v2", NULL}; + // TODO : make use of actual builds for this arch + babl_base_init = babl_base_init_x86_64_v2; + babl_trc_new = babl_trc_new_x86_64_v2; + babl_trc_lookup_by_name = babl_trc_lookup_by_name_x86_64_v2; + _babl_space_add_universal_rgb = _babl_space_add_universal_rgb_x86_64_v3; + return exclude; + } + else if ((accel & BABL_CPU_ACCEL_X86_64_V3) == BABL_CPU_ACCEL_X86_64_V3) + { + static const char *exclude[] = {"x86-64-v4-", "x86-64-v2-", NULL}; babl_base_init = babl_base_init_x86_64_v2; /// !! // this is correct, // it performs better @@ -359,7 +408,7 @@ } else if ((accel & BABL_CPU_ACCEL_X86_64_V2) == BABL_CPU_ACCEL_X86_64_V2) { - static const char *exclude[] = {"x86-64-v3-", NULL}; + static const char *exclude[] = {"x86-64-v3-", "x86-64-v4-", NULL}; babl_base_init = babl_base_init_x86_64_v2; babl_trc_new = babl_trc_new_x86_64_v2; babl_trc_lookup_by_name = babl_trc_lookup_by_name_x86_64_v2; @@ -368,7 +417,7 @@ } else { - static const char *exclude[] = {"x86-64-v3-", "x86-64-v2-", NULL}; + static const char *exclude[] = {"x86-64-v4-", "x86-64-v3-", "x86-64-v2-", NULL}; return exclude; } #endif @@ -394,7 +443,7 @@ /* Private functions */ - +#if !defined(_WIN32) && !defined(__APPLE__) static char * _babl_find_relocatable_exe (void) { @@ -535,3 +584,4 @@ return rel_libdir; } +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/babl.def new/babl-0.1.124/babl/babl.def --- old/babl-0.1.118/babl/babl.def 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/babl.def 2026-03-10 16:56:45.000000000 +0100 @@ -1,92 +1,92 @@ EXPORTS + babl_backtrack + babl_chromatic_adaptation_matrix + babl_class_name babl_component babl_component_new + babl_conversion_class_for_each babl_conversion_get_destination_space babl_conversion_get_source_space babl_conversion_new - babl_chromatic_adaptation_matrix babl_cpu_accel_get_support + babl_db_each + babl_db_exist_by_id + babl_db_exist_by_name + babl_db_find + babl_db_init babl_exit + babl_extender + babl_extension_quiet_log babl_fast_fish babl_fish + babl_fish_db + babl_fish_get_process + babl_fish_path babl_format + babl_format_class_for_each babl_format_exists babl_format_get_bytes_per_pixel + babl_format_get_encoding babl_format_get_model babl_format_get_n_components babl_format_get_space babl_format_get_type - babl_format_get_encoding babl_format_has_alpha babl_format_is_format_n babl_format_is_palette babl_format_n babl_format_new babl_format_with_space + babl_formats_count babl_free + babl_gc babl_get_model_flags babl_get_name babl_get_user_data babl_get_version + babl_icc_get_key + babl_icc_make_space babl_init babl_introspect babl_malloc babl_model + babl_model_class_for_each babl_model_is - babl_model_with_space + babl_model_is_symmetric babl_model_new + babl_model_with_space babl_new_palette babl_new_palette_with_space babl_palette_reset babl_palette_set_palette + babl_polynomial_approximate_gamma babl_process babl_process_rows babl_sampling + babl_sanity + babl_set_extender babl_set_user_data babl_space - babl_space_from_rgbxyz_matrix babl_space_from_chromaticities babl_space_from_icc + babl_space_from_rgbxyz_matrix + babl_space_from_xyz babl_space_get + babl_space_get_gamma babl_space_get_icc - babl_space_get_rgbtoxyz babl_space_get_rgb_luminance - babl_space_to_xyz - babl_space_from_xyz - babl_space_to_icc - babl_space_with_trc + babl_space_get_rgbtoxyz babl_space_is_cmyk babl_space_is_gray babl_space_is_rgb - babl_space_get_gamma - babl_icc_make_space - babl_icc_get_key + babl_space_to_icc + babl_space_to_xyz + babl_space_with_trc babl_ticks - babl_type - babl_type_new babl_trc babl_trc_gamma babl_trc_new - babl_db_exist_by_name - babl_db_find - babl_db_init - babl_db_exist_by_id - babl_db_each - babl_formats_count - babl_format_class_for_each - babl_gc - babl_model_class_for_each + babl_type babl_type_class_for_each - babl_conversion_class_for_each - babl_set_extender - babl_extension_quiet_log - babl_fish_path - babl_fish_get_process - babl_extender - babl_class_name - babl_sanity babl_type_is_symmetric - babl_model_is_symmetric - babl_fish_db - babl_polynomial_approximate_gamma - babl_backtrack + babl_type_new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/base/babl-trc.c new/babl-0.1.124/babl/base/babl-trc.c --- old/babl-0.1.118/babl/base/babl-trc.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/base/babl-trc.c 2026-03-10 16:56:45.000000000 +0100 @@ -428,7 +428,7 @@ trc.gamma = gamma > 0.0 ? gamma : 0.0; trc.rgamma = gamma > 0.0001 ? 1.0 / gamma : 0.0; if(name) -#ifndef _WIN64 +#ifndef _UCRT strncpy (trc.name, name, sizeof (trc.name) - 1); #else strncpy_s (trc.name, sizeof(trc.name), name, _TRUNCATE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/base/meson.build new/babl-0.1.124/babl/base/meson.build --- old/babl-0.1.118/babl/base/meson.build 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/base/meson.build 2026-03-10 16:56:45.000000000 +0100 @@ -41,6 +41,13 @@ c_args: common_c_flags + x86_64_v3_flags ) + babl_base_x86_64_v4 = static_library('babl_base-x86-64-v4', + babl_base_sources, + include_directories: [rootInclude, bablInclude], + dependencies: [math, lcms, log], + c_args: common_c_flags + x86_64_v4_flags + ) + endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/babl/meson.build new/babl-0.1.124/babl/meson.build --- old/babl-0.1.118/babl/meson.build 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/babl/meson.build 2026-03-10 16:56:45.000000000 +0100 @@ -126,7 +126,7 @@ babl_includes = [rootInclude, bablBaseInclude] if host_cpu_family == 'x86_64' - simd_extra = [babl_base_x86_64_v2, babl_base_x86_64_v3] + simd_extra = [babl_base_x86_64_v2, babl_base_x86_64_v3, babl_base_x86_64_v4] elif host_cpu_family == 'arm' simd_extra = [babl_base_arm_neon] else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/bin/babl.c new/babl-0.1.124/bin/babl.c --- old/babl-0.1.118/bin/babl.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/bin/babl.c 2026-03-10 16:56:45.000000000 +0100 @@ -586,11 +586,11 @@ long icc_length; size_t icc_read; const char *error = NULL; -#ifdef _WIN64 +#ifdef _UCRT char errbuf[256]; #endif -#ifndef _WIN64 +#ifndef _UCRT f = fopen (path, "r"); #else if (fopen_s (&f, path, "r") != 0) @@ -599,7 +599,7 @@ if (f == NULL) { -#ifndef _WIN64 +#ifndef _UCRT fprintf(stderr, "babl: failed to open '%s': %s\n", path, strerror(errno)); #else @@ -618,7 +618,7 @@ icc_read = fread(icc_data, icc_length, 1, f); if (icc_read != 1) { -#ifndef _WIN64 +#ifndef _UCRT fprintf(stderr, "babl: failed to read '%s': %s\n", path, strerror(errno)); #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/extensions/babl-verify-cpu.inc new/babl-0.1.124/extensions/babl-verify-cpu.inc --- old/babl-0.1.118/extensions/babl-verify-cpu.inc 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/extensions/babl-verify-cpu.inc 2026-03-10 16:56:45.000000000 +0100 @@ -8,10 +8,21 @@ #define BABL_SIMD_x86_64_v3 #define BABL_SIMD_SUFFIX(symbol) symbol##_x86_64_v3 #else +#ifdef X86_64_V4 +#define BABL_SIMD_x86_64_v4 +#define BABL_SIMD_SUFFIX(symbol) symbol##_x86_64_v4 +#else #define BABL_SIMD_generic #define BABL_SIMD_SUFFIX(symbol) symbol##_generic #endif #endif +#endif + +/* Note: there is code-duplication in excluding babl extensions (.so/.dll/.dylib) +to be loaded between this, and the list of exclusion substrings passed to the +extension loading code. Compilers might use code making this early bail still +fail with illegal instructions. + */ #define BABL_VERIFY_CPU() do{}while(0) @@ -25,7 +36,9 @@ if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V2)\ == BABL_CPU_ACCEL_X86_64_V2) return 0;\ if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V3)\ - == BABL_CPU_ACCEL_X86_64_V3) return 0; + == BABL_CPU_ACCEL_X86_64_V3) return 0;\ + if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V4)\ + == BABL_CPU_ACCEL_X86_64_V4) return 0; #endif @@ -44,14 +57,25 @@ if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V2)\ != BABL_CPU_ACCEL_X86_64_V2) return 0;\ if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V3)\ - == BABL_CPU_ACCEL_X86_64_V3) return 0; + == BABL_CPU_ACCEL_X86_64_V3) return 0;\ + if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V4)\ + == BABL_CPU_ACCEL_X86_64_V4) return 0; #endif #ifdef X86_64_V3 #undef BABL_VERIFY_CPU #define BABL_VERIFY_CPU()\ if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V3)\ - != BABL_CPU_ACCEL_X86_64_V3) return 0; + != BABL_CPU_ACCEL_X86_64_V3) return 0;\ + if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V4)\ + == BABL_CPU_ACCEL_X86_64_V4) return 0; +#endif + +#ifdef X86_64_V4 +#undef BABL_VERIFY_CPU +#define BABL_VERIFY_CPU()\ + if ((babl_cpu_accel_get_support() & BABL_CPU_ACCEL_X86_64_V4)\ + != BABL_CPU_ACCEL_X86_64_V4) return 0; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/extensions/meson.build new/babl-0.1.124/extensions/meson.build --- old/babl-0.1.118/extensions/meson.build 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/extensions/meson.build 2026-03-10 16:56:45.000000000 +0100 @@ -121,6 +121,21 @@ ) endforeach + foreach ext : autosimd_extensions + shared_module( + 'x86-64-v4-' + ext[0], + ext[0] + '.c', + c_args: [ext[1]] + x86_64_v4_flags, + include_directories: babl_ext_inc, + link_with: babl, + link_args: babl_ext_link_args, + dependencies: babl_ext_dep, + name_prefix: '', + install: true, + install_dir: babl_libdir / lib_name, + ) + endforeach + elif host_cpu_family == 'arm' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/git-version.h new/babl-0.1.124/git-version.h --- old/babl-0.1.118/git-version.h 2025-12-08 12:36:51.873241400 +0100 +++ new/babl-0.1.124/git-version.h 2026-03-10 16:57:03.478251200 +0100 @@ -1,6 +1,6 @@ #ifndef __BABL_GIT_VERSION_H__ #define __BABL_GIT_VERSION_H__ -#define BABL_GIT_VERSION "BABL_0_1_116-36-gb47df7d" +#define BABL_GIT_VERSION "BABL_0_1_124" #endif /* __BABL_GIT_VERSION_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/meson.build new/babl-0.1.124/meson.build --- old/babl-0.1.118/meson.build 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/meson.build 2026-03-10 16:56:45.000000000 +0100 @@ -1,6 +1,6 @@ project('babl', 'c', license: 'LGPL3+', - version: '0.1.118', + version: '0.1.124', meson_version: '>=0.60.0', default_options: [ 'buildtype=debugoptimized' @@ -223,9 +223,11 @@ if host_cpu_family == 'x86_64' x86_64_v2_flags = cc.get_supported_arguments(['-march=x86-64','-msse2', '-msse2','-msse4.1','-msse4.2','-mpopcnt','-mssse3']) x86_64_v3_flags = x86_64_v2_flags + cc.get_supported_arguments(['-mavx','-mavx2','-mf16c','-mfma','-mmovbe', '-mbmi', '-mbmi2']) + x86_64_v4_flags = x86_64_v3_flags + cc.get_supported_arguments(['-mavx512f', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-mavx512dq']) x86_64_v2_flags += '-DX86_64_V2' x86_64_v3_flags += '-DX86_64_V3' + x86_64_v4_flags += '-DX86_64_V4' elif host_cpu_family == 'arm' arm_neon_flags = cc.get_supported_arguments(['-mfpu=neon-vfpv3', '-mfpu=neon-vfpv4']) @@ -468,15 +470,11 @@ # Build relocatable babl relocatable = false if get_option('relocatable').auto() - if platform_win32 + if platform_win32 or platform_osx relocatable = true endif else relocatable = get_option('relocatable').enabled() - if relocatable and platform_osx - warning('-Drelocatable=enabled not implemented yet for macOS.') - relocatable = false - endif endif conf.set('ENABLE_RELOCATABLE', relocatable) @@ -497,11 +495,9 @@ # updated. If git is not available, don't do anything if git-version.h # already exists because then we are probably working with a tarball # in which case the git-version.h we ship is correct. -is_git_repository = run_command( - git_bin, - 'rev-parse', - '--is-inside-work-tree', - check: false, +is_git_repository = run_command(python, '-c', + 'import sys,os; sys.exit(0 if os.path.exists(".git") else 1)', + check: false ).returncode() == 0 has_version_h = run_command(python, '-c', @@ -578,14 +574,9 @@ endif subdir('bin') -if not platform_win32 and not platform_osx - # Verify .def files for Windows. - # Ironically we only check this on non-Windows platform, since the - # script expects .so libraries, and I'm not sure that the `nm` tool is - # available on Windows. - # On the other hand, it is how it always has been, since we used to - # only run this on dist step (which we historically run on a GNU/Linux - # machine). And it worked fine until now. +if not platform_osx and host_cpu_family != 'x86' + # Verify .def files for Windows linking. + # We check this on non-Windows platform on CI, and on Windows itself. custom_target('check-def-files', input: [ babl_def diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/tools/babl-html-dump.c new/babl-0.1.124/tools/babl-html-dump.c --- old/babl-0.1.118/tools/babl-html-dump.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/tools/babl-html-dump.c 2026-03-10 16:56:45.000000000 +0100 @@ -80,7 +80,7 @@ { char *s = normalized_buf; -#ifndef _WIN64 +#ifndef _UCRT strcpy (normalized_buf, str); #else strcpy_s (normalized_buf, strlen(str) + 1, str); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/tools/babl-icc-dump.c new/babl-0.1.124/tools/babl-icc-dump.c --- old/babl-0.1.118/tools/babl-icc-dump.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/tools/babl-icc-dump.c 2026-03-10 16:56:45.000000000 +0100 @@ -658,7 +658,7 @@ long size; char *buffer; -#ifndef _WIN64 +#ifndef _UCRT file = fopen (path, "rb"); #else if (fopen_s (&file, path, "rb") != 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/tools/babl-icc-rewrite.c new/babl-0.1.124/tools/babl-icc-rewrite.c --- old/babl-0.1.118/tools/babl-icc-rewrite.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/tools/babl-icc-rewrite.c 2026-03-10 16:56:45.000000000 +0100 @@ -156,7 +156,7 @@ long size; char *buffer; -#ifndef _WIN64 +#ifndef _UCRT file = fopen (path, "rb"); #else if (fopen_s (&file, path, "rb") != 0) @@ -195,7 +195,7 @@ long length) { FILE *fp; -#ifndef _WIN64 +#ifndef _UCRT fp = fopen (path, "wb"); #else if (fopen_s (&fp, path, "wb") != 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/tools/babl-verify.c new/babl-0.1.124/tools/babl-verify.c --- old/babl-0.1.118/tools/babl-verify.c 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/tools/babl-verify.c 2026-03-10 16:56:45.000000000 +0100 @@ -31,7 +31,7 @@ long size; char *buffer; -#ifndef _WIN64 +#ifndef _UCRT file = fopen (path, "rb"); #else if (fopen_s (&file, path, "rb") != 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.118/tools/defcheck.py new/babl-0.1.124/tools/defcheck.py --- old/babl-0.1.118/tools/defcheck.py 2025-12-08 12:36:42.000000000 +0100 +++ new/babl-0.1.124/tools/defcheck.py 2026-03-10 16:56:45.000000000 +0100 @@ -21,30 +21,46 @@ This is a hack to check the consistency of the .def files compared to the respective libraries. -Invoke in the top level of the gimp source tree after compiling GIMP. -If srcdir != builddir, run it in the build directory and pass the name -of the source directory on the command-line. +Invoke in the build directory and pass the name +of the built .def files on the command-line. -Needs the tool "nm" to work +Needs the tool "nm", "objdump" or "dumpbin" to work """ -import sys, subprocess +import os, sys, subprocess, shutil from os import path def_files = sys.argv[1:] +#V0_1_0 is an "absolute symbol" so exclusive to ELF (see gen_babl_map.py) exclude_symbols = [ "V0_1_0" ] have_errors = 0 +libextension = ".so" +command = "nm --defined-only --extern-only " +libprefix = "lib" +platform_linux = True + +if sys.platform in ['win32', 'cygwin']: + libextension = ".dll" + command = "objdump -p " + if shutil.which("dumpbin"): + command = "dumpbin /EXPORTS " + libprefix = "" + platform_linux = False + for df in def_files: directory, name = path.split (df) basename, extension = name.split (".") - libname = path.join(directory, "lib" + basename + "-*.so") + + libname = path.join(os.getcwd(), directory, libprefix + basename + "-*" + libextension) + #FIXME: This leaks to ninja stdout, which should not happen + #print ("platform: " + sys.platform + " - extracting symbols from " + libname) filename = df try: @@ -58,28 +74,61 @@ if defsymbols[i] in defsymbols[:i]: doublesymbols.append ((defsymbols[i], i+2)) - #Useless, see more below - #unsortindex = -1 - #for i in range (len (defsymbols)-1): - # if defsymbols[i] > defsymbols[i+1]: - # unsortindex = i+1 - # break; + sorterrors = "" + sortok = True + for i in range (len (defsymbols)-1): + if defsymbols[i].lower() > defsymbols[i+1].lower(): + sorterrors += f"{defsymbols[i]} > {defsymbols[i+1]}\n" + sortok = False + sorterrors = sorterrors.split(sep='\n') - status, nm = subprocess.getstatusoutput ("nm --defined-only --extern-only " + - libname) + status, nm = subprocess.getstatusoutput (command + libname) if status != 0: print("trouble reading {} - has it been compiled?".format(libname)) have_errors = -1 continue - nmsymbols = nm.split()[2::3] + nmsymbols = "" + if platform_linux: + nmsymbols = nm + + elif not shutil.which("dumpbin"): # Windows MSYS2 + # remove parts of objdump output we don't need: anything up to a few lines + # after Export Table: ' Ordinal RVA Name' + + objnm = nm.split(sep='\n') + + found = False + nmsymbols = "" + for s in objnm: + if s == " Ordinal RVA Name": + found = True + elif found: + nmsymbols += s + # else: skip this line + + else: # Windows MSVC + + dbin = nm.split(sep='\n') + + found = False + nmsymbols = "" + for s in dbin: + if "ordinal" in s and "hint" in s and "RVA" in s: + found = True + elif found and s.strip() and "Summary" not in s: + parts = s.split() + if len(parts) >= 4: + nmsymbols += " 0 0 " + parts[3] # Keep the [2::3] logic happy + # else: skip this line + + nmsymbols = nmsymbols.split()[2::3] nmsymbols = [s for s in nmsymbols if s[0] != '_'] missing_defs = [s for s in nmsymbols if s not in defsymbols and s not in exclude_symbols] missing_nms = [s for s in defsymbols if s not in nmsymbols and s not in exclude_symbols] - #if unsortindex >= 0 or missing_defs or missing_nms or doublesymbols: - if missing_defs or missing_nms or doublesymbols: + if missing_defs or missing_nms or doublesymbols or not sortok: print() print("Problem found in", filename) @@ -103,10 +152,11 @@ print(" : %s (line %d)" % s) print() - #Useless, gives no info on how to fix the ordering - #if unsortindex >= 0: - # print(" the .def-file is not properly sorted (line %d)" % (unsortindex + 2)) - # print() + if not sortok: + print(" the .def-file is not properly sorted in the following cases") + for s in sorterrors: + if s != "": + print(" * ", s) have_errors = -1
