From e92e3047b7551dc11c6bf9523f29d7ebe6e82795 Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:51:58 +0200 Subject: [PATCH 1/9] [build-baseline] require a consistent modern C build environment Define C11 consistently in CMake and Meson, enable compiler warnings, and raise the declared GLib baseline from 2.38 to 2.56. Require libtiff 4.3 when TIFF support is selected and initialize CTest from the top-level build.\n\nThis removes differences between the two supported build systems and makes unsupported dependency combinations fail during configuration instead of later during compilation. The explicit language standard also prevents compiler-default changes from silently altering how libuca is built. --- CMakeLists.txt | 26 ++++++++++++++++---------- meson.build | 11 ++++++----- src/meson.build | 4 ++-- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3069537..3b239f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,12 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.16) project(uca C) +include(CTest) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) + # Prefer a Python 3 interpreter; keep compatibility with older CMake versions. if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.12") find_package(Python3 COMPONENTS Interpreter REQUIRED) @@ -25,10 +31,10 @@ else() message(STATUS "Using pkg-config for GLib") find_package(PkgConfig) find_program(GLIB2_MKENUMS glib-mkenums REQUIRED) - pkg_check_modules(GLIB2 glib-2.0>=2.38 REQUIRED) - pkg_check_modules(GOBJECT2 gobject-2.0>=2.38 REQUIRED) - pkg_check_modules(GMODULE2 gmodule-2.0>=2.38 REQUIRED) - pkg_check_modules(GIO2 gio-2.0>=2.38 REQUIRED) + pkg_check_modules(GLIB2 glib-2.0>=2.56 REQUIRED) + pkg_check_modules(GOBJECT2 gobject-2.0>=2.56 REQUIRED) + pkg_check_modules(GMODULE2 gmodule-2.0>=2.56 REQUIRED) + pkg_check_modules(GIO2 gio-2.0>=2.56 REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(PkgConfigVars) @@ -50,7 +56,7 @@ else() endif() if (WITH_TIFF) - find_package(TIFF REQUIRED) + find_package(TIFF 4.3 REQUIRED) set(HAVE_LIBTIFF "1") endif() @@ -118,15 +124,15 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package.sh.in #{{{ Common dependencies find_program(GLIB2_MKENUMS glib-mkenums REQUIRED) -set(GLIB_VERSION_MIN_REQUIRED "GLIB_VERSION_2_38") -set(GLIB_VERSION_MAX_ALLOWED "GLIB_VERSION_2_38") +set(GLIB_VERSION_MIN_REQUIRED "GLIB_VERSION_2_56") +set(GLIB_VERSION_MAX_ALLOWED "GLIB_VERSION_2_56") link_directories(${GLIB2_LIBRARY_DIRS}) #}}} #{{{ Common definitions -if (GNU) - add_definitions("-std=c99 -Wall -fPIC") +if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + add_compile_options(-Wall -Wextra) endif() #}}} #{{{ Subdirectories diff --git a/meson.build b/meson.build index eb6de12..9572583 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,6 @@ project('libuca', 'c', - version: '2.4.0' + version: '2.4.0', + default_options: ['c_std=c11', 'warning_level=2'] ) version = meson.project_version() @@ -10,10 +11,10 @@ version_patch = components[2] gnome = import('gnome') -glib_dep = dependency('glib-2.0', version: '>= 2.38') -gio_dep = dependency('gio-2.0', version: '>= 2.38') -gobject_dep = dependency('gobject-2.0', version: '>= 2.38') -gmodule_dep = dependency('gmodule-2.0', version: '>= 2.38') +glib_dep = dependency('glib-2.0', version: '>= 2.56') +gio_dep = dependency('gio-2.0', version: '>= 2.56') +gobject_dep = dependency('gobject-2.0', version: '>= 2.56') +gmodule_dep = dependency('gmodule-2.0', version: '>= 2.56') deps = [glib_dep, gio_dep, gobject_dep, gmodule_dep] diff --git a/src/meson.build b/src/meson.build index 84b004a..ff1428f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -17,8 +17,8 @@ plugindir = '@0@/@1@/uca'.format(get_option('prefix'), get_option('libdir')) conf = configuration_data() conf.set_quoted('UCA_PLUGINDIR', plugindir) -conf.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_38') -conf.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_2_38') +conf.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_56') +conf.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_2_56') if python_dep.found() conf.set('WITH_PYTHON_MULTITHREADING', get_option('with_python_multithreading')) From 754dee26af27accc656b4b7015acaa0d3b03d15c Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:54:16 +0200 Subject: [PATCH 2/9] [legacy-gui] make the deprecated GTK 2 viewer explicitly optional Disable the old GTK 2 camera-control GUI by default in both CMake and Meson while preserving an explicit opt-in build path. Raise its GTK requirement to 2.24 and emit a deprecation notice whenever it is selected.\n\nHeadless camera servers and packaging jobs no longer acquire an obsolete desktop dependency accidentally. Existing users can still build the tool deliberately with WITH_GUI=ON in CMake or -Dgui=enabled in Meson. --- CMakeLists.txt | 2 +- bin/gui/CMakeLists.txt | 3 ++- bin/gui/meson.build | 3 ++- bin/meson.build | 4 +++- meson_options.txt | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b239f4..05984fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ endif() option(WITH_PYTHON_MULTITHREADING "Enable Python multithreading support" ON) option(WITH_GIR "Build introspection files" ON) option(WITH_TIFF "Support loading tiff files" ON) -option(WITH_GUI "Build the GUI tools" ON) +option(WITH_GUI "Build the deprecated GTK 2 GUI tools" OFF) option(WITH_TOOLS "Build the CLI tools" ON) option(USE_FIND_PACKAGE_FOR_GLIB "Use find_package instead of pkg-config to find GLib dependencies" OFF) diff --git a/bin/gui/CMakeLists.txt b/bin/gui/CMakeLists.txt index fd29129..bc2e778 100644 --- a/bin/gui/CMakeLists.txt +++ b/bin/gui/CMakeLists.txt @@ -1,7 +1,8 @@ find_package(PkgConfig) +message(DEPRECATION "The GTK 2 camera-control GUI is deprecated and disabled by default") find_program(GLIB_COMPILE_RESOURCES glib-compile-resources REQUIRED) -pkg_check_modules(GTK2 gtk+-2.0>=2.22) +pkg_check_modules(GTK2 gtk+-2.0>=2.24) pkg_check_modules(GTHREAD2 gthread-2.0) if (GTK2_FOUND) diff --git a/bin/gui/meson.build b/bin/gui/meson.build index eb2424d..a574a1f 100644 --- a/bin/gui/meson.build +++ b/bin/gui/meson.build @@ -1,7 +1,8 @@ cc = meson.get_compiler('c') libm = cc.find_library('m') -gtk_dep = dependency('gtk+-2.0', required: false) +warning('The GTK 2 camera-control GUI is deprecated and disabled by default') +gtk_dep = dependency('gtk+-2.0', version: '>= 2.24', required: get_option('gui')) gthread_dep = dependency('gthread-2.0') if gtk_dep.found() diff --git a/bin/meson.build b/bin/meson.build index 12810f5..22cf107 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -1,2 +1,4 @@ -subdir('gui') +if not get_option('gui').disabled() + subdir('gui') +endif subdir('tools') diff --git a/meson_options.txt b/meson_options.txt index 3a387d8..8d8077c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,3 +11,7 @@ option('python', type : 'string', value : 'python3', description : 'Name of python executable') + +option('gui', + type : 'feature', value : 'disabled', + description : 'Build the deprecated GTK 2 GUI tools') From 890b77f7177e62c43475a1a9f202e53c0e3c8777 Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:55:38 +0200 Subject: [PATCH 3/9] [tiff-build] honor optional TIFF support consistently Link the command-line tools to libtiff only when TIFF support is enabled and apply the same minimum libtiff version to CMake and Meson builds.\n\nThis makes WITH_TIFF=OFF a real supported configuration instead of allowing configuration to succeed and then failing at link time. It also keeps the file plugin and command-line tools aligned on their dependency contract. --- bin/tools/CMakeLists.txt | 5 ++++- bin/tools/meson.build | 2 +- plugins/file/meson.build | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/tools/CMakeLists.txt b/bin/tools/CMakeLists.txt index bca0537..00a0191 100644 --- a/bin/tools/CMakeLists.txt +++ b/bin/tools/CMakeLists.txt @@ -12,7 +12,10 @@ set(BINARIES "benchmark" "gen-doc" "info" "grab") foreach (BINARY ${BINARIES}) add_executable(uca-${BINARY} ${BINARY}.c common.c) - target_link_libraries(uca-${BINARY} PUBLIC uca TIFF::TIFF) + target_link_libraries(uca-${BINARY} PUBLIC uca) + if (WITH_TIFF) + target_link_libraries(uca-${BINARY} PUBLIC TIFF::TIFF) + endif () endforeach () if (GNU) diff --git a/bin/tools/meson.build b/bin/tools/meson.build index b44aa44..77b6d05 100644 --- a/bin/tools/meson.build +++ b/bin/tools/meson.build @@ -1,7 +1,7 @@ cc = meson.get_compiler('c') libm = cc.find_library('m') -tiff_dep = dependency('libtiff-4', required: false) +tiff_dep = dependency('libtiff-4', version: '>= 4.3', required: false) config = configuration_data() config.set('HAVE_LIBTIFF', tiff_dep.found()) diff --git a/plugins/file/meson.build b/plugins/file/meson.build index 47273dd..8b75240 100644 --- a/plugins/file/meson.build +++ b/plugins/file/meson.build @@ -1,4 +1,4 @@ -tiff_dep = dependency('libtiff-4', required: false) +tiff_dep = dependency('libtiff-4', version: '>= 4.3', required: false) if tiff_dep.found() shared_library('ucafile', From 979a2b8c1ad112749173b2dcfaa37fb35acf2c10 Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:56:09 +0200 Subject: [PATCH 4/9] [uca-grab] write valid multi-page grayscale TIFF files Set image geometry before asking libtiff to choose a strip size, restore all directory fields for every page, and declare grayscale data as PHOTOMETRIC_MINISBLACK.\n\nTIFFWriteDirectory clears per-page state, so the previous implementation could produce malformed or ambiguously interpreted multi-frame files. This commit makes every captured frame a complete, standards-compliant TIFF directory. --- bin/tools/grab.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/tools/grab.c b/bin/tools/grab.c index 5074387..d002e42 100644 --- a/bin/tools/grab.c +++ b/bin/tools/grab.c @@ -86,25 +86,27 @@ write_tiff (UcaRingBuffer *buffer, tif = TIFFOpen (opts->filename, "w"); n_frames = uca_ring_buffer_get_num_blocks (buffer); - rows_per_strip = TIFFDefaultStripSize (tif, (guint32) - 1); bytes_per_pixel = get_bytes_per_pixel (bits_per_pixel); bits_per_sample = bits_per_pixel > 8 ? 16 : 8; - /* Write multi page TIFF file */ - TIFFSetField (tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE); - + /* Write multi page TIFF file. libtiff needs the image geometry before it + * can calculate a valid default strip size, and TIFFWriteDirectory resets + * the directory fields for the following page. */ for (guint i = 0; i < n_frames; i++) { gpointer data; gsize offset = 0; data = uca_ring_buffer_get_read_pointer (buffer); + TIFFSetField (tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE); TIFFSetField (tif, TIFFTAG_IMAGEWIDTH, width); TIFFSetField (tif, TIFFTAG_IMAGELENGTH, height); TIFFSetField (tif, TIFFTAG_BITSPERSAMPLE, bits_per_sample); TIFFSetField (tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField (tif, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField (tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField (tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + rows_per_strip = TIFFDefaultStripSize (tif, (guint32) -1); TIFFSetField (tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip); TIFFSetField (tif, TIFFTAG_PAGENUMBER, i, n_frames); From 01fbfc0f7bcd82d43948014efc253cba35d80f7a Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:56:57 +0200 Subject: [PATCH 5/9] [plugin-discovery] recognize installed camera modules safely Match complete plugin basenames instead of arbitrary path substrings, accept camera names containing underscores or hyphens, and recognize versioned Unix shared libraries. Ignore non-matching files and release the temporary camera-name list after network-camera counting.\n\nThis prevents false plugin names, supports normal packaged library filenames such as libucacamera.so.2, and removes a repeated discovery-time memory leak. --- src/uca-plugin-manager.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/uca-plugin-manager.c b/src/uca-plugin-manager.c index b37a3e3..071a162 100644 --- a/src/uca-plugin-manager.c +++ b/src/uca-plugin-manager.c @@ -51,12 +51,13 @@ struct _UcaPluginManagerPrivate { #ifdef _WIN32 -static const gchar *MODULE_SEARCH_PATTERN = "uca([A-Za-z0-9]+).dll"; +static const gchar *MODULE_SEARCH_PATTERN = "^uca([A-Za-z0-9_-]+)\\.dll$"; static const gchar *MODULE_PRINT_PATTERN = "uca%s.dll"; #else -static const gchar *MODULE_SEARCH_PATTERN = "libuca([A-Za-z0-9]+)"; +static const gchar *MODULE_SEARCH_PATTERN = + "^libuca([A-Za-z0-9_-]+)\\.so(?:\\.[0-9]+)*$"; static const gchar *MODULE_PRINT_PATTERN = "libuca%s.so"; #endif @@ -166,12 +167,16 @@ transform_camera_module_path_to_name (gchar *path, GList **result) { GRegex *pattern; GMatchInfo *match_info; + gchar *basename; pattern = g_regex_new (MODULE_SEARCH_PATTERN, 0, 0, NULL); - g_regex_match (pattern, path, 0, &match_info); + basename = g_path_get_basename (path); + g_regex_match (pattern, basename, 0, &match_info); - *result = g_list_append (*result, g_match_info_fetch (match_info, 1)); + if (g_match_info_matches (match_info)) + *result = g_list_append (*result, g_match_info_fetch (match_info, 1)); g_match_info_free (match_info); + g_free (basename); g_regex_unref (pattern); } @@ -203,7 +208,7 @@ uca_plugin_manager_get_available_cameras (UcaPluginManager *manager) } unsigned int get_num_net_cameras(UcaPluginManager *manager) { - const GList *camera_names = uca_plugin_manager_get_available_cameras(manager); + GList *camera_names = uca_plugin_manager_get_available_cameras(manager); unsigned int count = 0; for (const GList *it = camera_names; it != NULL; it = g_list_next(it)) { @@ -213,6 +218,7 @@ unsigned int get_num_net_cameras(UcaPluginManager *manager) { } } + g_list_free_full (camera_names, g_free); return count; } From b8cb0408c37fe56ed9a81df87b2cfea47c3f8427 Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:57:15 +0200 Subject: [PATCH 6/9] [binary-packaging] make CPack output portable and configurable Replace the hard-coded RPM-only generator with a cache-selectable CPack generator that defaults to a portable TGZ archive, and enable automatic shared-library dependency calculation for Debian packages.\n\nDownstream builders can now request TGZ, DEB, or RPM output without editing libuca sources. Debian packages also declare the runtime libraries discovered from their binaries instead of relying on manual dependency lists. --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 238b334..3660649 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -151,7 +151,9 @@ set(CPACK_PACKAGE_VERSION_MINOR ${UCA_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${UCA_VERSION_PATCH}) set(VERSION ${UCA_VERSION_STRING}) -set(CPACK_GENERATOR "RPM;") +set(CPACK_GENERATOR "TGZ" CACHE STRING + "Binary package generator(s), for example TGZ, DEB, or RPM") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_IGNORE_FILES ".git" "tags" ".bzr" ".swp") From f682097388674b596a21e00641c7266f7d365adc Mon Sep 17 00:00:00 2001 From: by1462 Date: Mon, 7 Sep 2026 18:58:01 +0200 Subject: [PATCH 7/9] [conan2] provide a reproducible Conan package and CI build Modernize the recipe and workflow for Conan 2, pin a tested dependency graph with a lock file, export every source required by CMake, and expose TIFF as a package option. Use current maintained GitHub Actions and install a bounded Conan release explicitly.\n\nThe previous job depended on an unpinned third-party action and the recipe omitted source directories needed by packaged builds. The new path can reproduce the same GLib and libtiff inputs locally and in CI, rejects unsupported static GLib configurations, and supports packages built without TIFF. --- .github/workflows/conan.yml | 15 ++++++++------- conan.lock | 34 ++++++++++++++++++++++++++++++++++ conanfile.py | 25 +++++++++++++++---------- 3 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 conan.lock diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 81c1857..e7a21ba 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -15,10 +15,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: install conan - uses: turtlebrowser/get-conan@main - - - name: create package - run: | - conan create -pr:a conan/windows_release . --build=missing + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install Conan + run: python -m pip install "conan>=2.10,<3" + - name: Create package + run: conan create -pr:a conan/windows_release . --build=missing diff --git a/conan.lock b/conan.lock new file mode 100644 index 0000000..847c036 --- /dev/null +++ b/conan.lock @@ -0,0 +1,34 @@ +{ + "version": "0.5", + "requires": [ + "zstd/1.5.7#b68ca8e3de04ba5957761751d1d661f4%1760955092.069", + "zlib/1.3.2#1cb806da49011867778ffb6ac7190fcb%1777558780.503", + "xz_utils/5.8.3#a8432fead347c69d8b2737c35f936132%1775752656.4", + "pcre2/10.42#a0b25dffca18f5987304619e9c93fb44%1783075188.143", + "libtiff/4.7.2#7283595b6a38d0781953fa63881e0e92%1783597163.469", + "libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4%1717655459.344", + "libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8%1705591482.625", + "libjpeg/9f#8b1b89da851ad9172565c35f14e23c4c%1780476337.068", + "libffi/3.4.8#a045c00fb26779635e3bed40e80c5254%1753360042.396", + "glib/2.86.5#2886b0810a99a7d54b313db5d214f221%1783335578.429", + "elfutils/0.190#8e8c47bd9b2578e29a0341b09b977be8%1739188192.515", + "bzip2/1.0.8#c470882369c2d95c5c77e970c0c7e321%1762886692.465" + ], + "build_requires": [ + "pkgconf/2.5.1#93c2051284cba1279494a43a4fcfeae2%1757684701.089", + "pkgconf/2.2.0#4ac315b50ef734072b00ff3aacbf52bf%1755505628.021", + "ninja/1.13.2#c8c5dc2a52ed6e4e42a66d75b4717ceb%1764096931.974", + "meson/1.10.2#9d2d10681fe7fe61c788c58626c89b25%1775558003.754", + "m4/1.4.19#34c4bbc3eeebe98ca6edf2f52d602e7d%1777282960.259", + "libiconv/1.17#9923bc6dc6f106646d6967e0039a5ada%1774021608.288", + "gnu-config/cci.20210814#466e9d4d7779e1c142443f7ea44b4284%1762363589.329", + "gettext/0.22.5#2f6edba611e8db1a8a18488b116e8c2a%1765299121.036", + "flex/2.6.4#efa781fc5088b47c895bd4eef6911f2e%1761560242.855", + "cmake/4.4.0#a5dd5d73bd9fc56b0fc3163a04573dc8%1784051561.926", + "bison/3.8.2#c3490cbe0078b6fd3eb4cf5ed64144dc%1755688988.644", + "automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56", + "autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86" + ], + "python_requires": [], + "config_requires": [] +} diff --git a/conanfile.py b/conanfile.py index ffd243e..420a8ce 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,19 +5,23 @@ class UcaConan(ConanFile): name = "libuca" - version = "2.3.0" - license = "LGPL-2.1" + version = "2.4.0" + license = "LGPL-2.1-or-later" author = "Marius Elvert marius.elvert@softwareschneiderei.de" url = "https://github.com/ufo-kit/libuca" description = "GLib-based C library for unified camera access ." topics = ("utilities",) settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False]} - default_options = {"shared": True} + options = { + "shared": [True, False], + "with_tiff": [True, False], + } + default_options = { + "shared": True, + "with_tiff": True, + } generators = "CMakeDeps" - exports_sources = "src/*", "include/*", "test/*", "bin/*", "plugins/*", "CMakeLists.txt", "package.sh.in" - tool_requires = "glib/2.81.0", - + exports_sources = "src/*", "test/*", "bin/*", "plugins/*", "cmake/*", "CMakeLists.txt", "package.sh.in", "COPYING" def configure(self): # These are not applicable for C libraries self.settings.rm_safe("compiler.libcxx") @@ -26,8 +30,9 @@ def configure(self): self.options["glib"].shared = True def requirements(self): - self.requires("libtiff/4.4.0") - self.requires("glib/2.81.0", transitive_headers=True) + if self.options.with_tiff: + self.requires("libtiff/4.7.2") + self.requires("glib/2.86.5", transitive_headers=True) def generate(self): tc = CMakeToolchain(self) @@ -35,7 +40,7 @@ def generate(self): tc.variables["WITH_GIR"] = False tc.variables["WITH_GUI"] = False tc.variables["WITH_TOOLS"] = True - tc.variables["WITH_TIFF"] = True + tc.variables["WITH_TIFF"] = bool(self.options.with_tiff) tc.variables["USE_FIND_PACKAGE_FOR_GLIB"] = True tc.generate() From 2e97b63654bcd00a93f7e48b4557979fd9616887 Mon Sep 17 00:00:00 2001 From: by1462 Date: Fri, 11 Sep 2026 13:51:03 +0200 Subject: [PATCH 8/9] fix Conan lockfile coverage for Windows builds The Windows CI job failed before compilation because the committed lockfile omitted platform-specific dependencies. Extend it using the existing Windows host and build profiles, preserving all previous version and recipe pins. Pin msys2 as a build requirement and libiconv and libgettext as host requirements. Keep strict lockfile enforcement in CI; partial resolution is used only when generating the expanded lockfile. Validation: Conan graph info succeeds with conan/windows_release for both --build=missing and forced source builds, without --lockfile-partial. Actual Windows compilation must be confirmed by CI. --- conan.lock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conan.lock b/conan.lock index 847c036..0f70fb2 100644 --- a/conan.lock +++ b/conan.lock @@ -9,6 +9,8 @@ "libselinux/3.6#5a78ff6ae5034eeaac8da723361a8ce4%1717655459.344", "libmount/2.39.2#64850679fa9d5ead878e5076b0cab2a8%1705591482.625", "libjpeg/9f#8b1b89da851ad9172565c35f14e23c4c%1780476337.068", + "libiconv/1.17#9923bc6dc6f106646d6967e0039a5ada%1774021608.288", + "libgettext/0.22#b09eea019e19b9b9c46d8f1da7d75444%1765809130.834", "libffi/3.4.8#a045c00fb26779635e3bed40e80c5254%1753360042.396", "glib/2.86.5#2886b0810a99a7d54b313db5d214f221%1783335578.429", "elfutils/0.190#8e8c47bd9b2578e29a0341b09b977be8%1739188192.515", @@ -18,6 +20,7 @@ "pkgconf/2.5.1#93c2051284cba1279494a43a4fcfeae2%1757684701.089", "pkgconf/2.2.0#4ac315b50ef734072b00ff3aacbf52bf%1755505628.021", "ninja/1.13.2#c8c5dc2a52ed6e4e42a66d75b4717ceb%1764096931.974", + "msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649", "meson/1.10.2#9d2d10681fe7fe61c788c58626c89b25%1775558003.754", "m4/1.4.19#34c4bbc3eeebe98ca6edf2f52d602e7d%1777282960.259", "libiconv/1.17#9923bc6dc6f106646d6967e0039a5ada%1774021608.288", From e1c8fbdafc610550046683bb6a75ab47d68c241f Mon Sep 17 00:00:00 2001 From: by1462 Date: Fri, 11 Sep 2026 13:57:03 +0200 Subject: [PATCH 9/9] locate glib-mkenums directly in the Conan GLib package Windows CI resolves all dependencies but CMake cannot find glib-mkenums on the build PATH. The GLib host library requirement does not ensure that its bin directory is available as a build-tool search path. Set GLIB2_MKENUMS in the generated CMake toolchain to the script in the resolved GLib package. Existing CMake commands execute it with the build Python interpreter. This avoids depending on global GLib tools or adding another GLib build dependency. Validated recipe path generation for Windows and Linux package paths and Linux CMake configuration/build with an explicit script path. Windows compilation still requires a CI rerun. --- conanfile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conanfile.py b/conanfile.py index 420a8ce..ab3827b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,3 +1,5 @@ +import os + from conan import ConanFile from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake from conan.tools.microsoft.visual import is_msvc @@ -36,6 +38,12 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) + # glib-mkenums is a Python script from the GLib library package. + # Host dependencies are not necessarily on the build PATH (Windows). + # CMake invokes this script using the build machine's Python interpreter. + tc.variables["GLIB2_MKENUMS"] = os.path.join( + self.dependencies["glib"].package_folder, "bin", "glib-mkenums" + ).replace("\\", "/") tc.variables["WITH_PYTHON_MULTITHREADING"] = False tc.variables["WITH_GIR"] = False tc.variables["WITH_GUI"] = False