diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/gdk-pixbuf | |
Diffstat (limited to 'vcpkg/ports/gdk-pixbuf')
| -rw-r--r-- | vcpkg/ports/gdk-pixbuf/fix-static-deps.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/gdk-pixbuf/fix_build_error_windows.patch | 19 | ||||
| -rw-r--r-- | vcpkg/ports/gdk-pixbuf/loaders-cache.patch | 20 | ||||
| -rw-r--r-- | vcpkg/ports/gdk-pixbuf/portfile.cmake | 97 | ||||
| -rw-r--r-- | vcpkg/ports/gdk-pixbuf/use-libtiff-4-pkgconfig.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/gdk-pixbuf/vcpkg.json | 67 |
6 files changed, 228 insertions, 0 deletions
diff --git a/vcpkg/ports/gdk-pixbuf/fix-static-deps.patch b/vcpkg/ports/gdk-pixbuf/fix-static-deps.patch new file mode 100644 index 0000000..693f11d --- /dev/null +++ b/vcpkg/ports/gdk-pixbuf/fix-static-deps.patch @@ -0,0 +1,12 @@ +diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build +index d7aa127b48..c313dc272d 100644 +--- a/gdk-pixbuf/meson.build ++++ b/gdk-pixbuf/meson.build +@@ -214,6 +214,7 @@ gdkpixbuf = library('gdk_pixbuf-2.0', + dependencies: [ + gdk_pixbuf_deps, + included_loaders_deps, ++ loaders_deps + ], + install: true) + diff --git a/vcpkg/ports/gdk-pixbuf/fix_build_error_windows.patch b/vcpkg/ports/gdk-pixbuf/fix_build_error_windows.patch new file mode 100644 index 0000000..b213ac8 --- /dev/null +++ b/vcpkg/ports/gdk-pixbuf/fix_build_error_windows.patch @@ -0,0 +1,19 @@ +--- a/meson.build ++++ b/meson.build +@@ -90,8 +90,14 @@ + gdk_pixbuf_conf.set('HAVE_ROUND', 1) + endif + +-if cc.has_function('lrint', dependencies: mathlib_dep) +- gdk_pixbuf_conf.set('HAVE_LRINT', 1) ++if cc.get_id() == 'msvc' ++ if cc.has_function('lrint', dependencies: mathlib_dep, args: '-Oi-') ++ gdk_pixbuf_conf.set('HAVE_LRINT', 1) ++ endif ++else ++ if cc.has_function('lrint', dependencies: mathlib_dep) ++ gdk_pixbuf_conf.set('HAVE_LRINT', 1) ++ endif + endif + + intl_dep = cc.find_library('intl', required: false) diff --git a/vcpkg/ports/gdk-pixbuf/loaders-cache.patch b/vcpkg/ports/gdk-pixbuf/loaders-cache.patch new file mode 100644 index 0000000..d0a8ce9 --- /dev/null +++ b/vcpkg/ports/gdk-pixbuf/loaders-cache.patch @@ -0,0 +1,20 @@ +diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build +index 54ff9dd..27f8512 100644 +--- a/gdk-pixbuf/meson.build ++++ b/gdk-pixbuf/meson.build +@@ -348,7 +348,14 @@ foreach bin: gdkpixbuf_bin + set_variable(bin_name.underscorify(), bin) + endforeach + +-if not meson.is_cross_build() ++if dynamic_loaders.length() == 0 ++ # skip tool invocation ++ cmake = find_program('cmake', required : true) ++ loaders_cache = custom_target('loaders.cache', output: 'loaders.cache', capture: true, ++ command: [ cmake, '-E', 'echo', '# No dynamic loaders enabled at build time' ], ++ build_by_default: true) ++ loaders_dep = declare_dependency(sources: [ loaders_cache ]) ++elif not meson.is_cross_build() + # The 'loaders.cache' used for testing, so we don't accidentally + # load the installed cache; we always build it by default + loaders_cache = custom_target('loaders.cache', diff --git a/vcpkg/ports/gdk-pixbuf/portfile.cmake b/vcpkg/ports/gdk-pixbuf/portfile.cmake new file mode 100644 index 0000000..82d534b --- /dev/null +++ b/vcpkg/ports/gdk-pixbuf/portfile.cmake @@ -0,0 +1,97 @@ +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.gnome.org/ + OUT_SOURCE_PATH SOURCE_PATH + REPO GNOME/gdk-pixbuf + REF "${VERSION}" + SHA512 f95c92974ed6efac9845790ef5c4ed74dd6e28b182ea3732013c46b016166e92f8bc10c1994358d79ff53e988c615c43cb1a2130c6ef531ef9d84c2fdcc87e52 + HEAD_REF master + PATCHES + fix_build_error_windows.patch + loaders-cache.patch + use-libtiff-4-pkgconfig.patch + fix-static-deps.patch +) + +if("introspection" IN_LIST FEATURES) + list(APPEND OPTIONS_RELEASE -Dintrospection=enabled) + vcpkg_get_gobject_introspection_programs(PYTHON3 GIR_COMPILER GIR_SCANNER) +else() + list(APPEND OPTIONS_RELEASE -Dintrospection=disabled) +endif() + +if("png" IN_LIST FEATURES) + list(APPEND OPTIONS -Dpng=enabled) +else() + list(APPEND OPTIONS -Dpng=disabled) +endif() + +if("tiff" IN_LIST FEATURES) + list(APPEND OPTIONS -Dtiff=enabled) +else() + list(APPEND OPTIONS -Dtiff=disabled) +endif() + +if("jpeg" IN_LIST FEATURES) + list(APPEND OPTIONS -Djpeg=enabled) +else() + list(APPEND OPTIONS -Djpeg=disabled) +endif() + +if("others" IN_LIST FEATURES) + list(APPEND OPTIONS -Dothers=enabled) +else() + list(APPEND OPTIONS -Dothers=disabled) +endif() + +# Whether to enable application bundle relocation support. +# Limitation cf. gdk-pixbuf/gdk-pixbuf-io.c +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_WINDOWS) + list(APPEND OPTIONS -Drelocatable=true) +endif() + +if(VCPKG_TARGET_IS_WINDOWS) + #list(APPEND OPTIONS -Dnative_windows_loaders=true) # Use Windows system components to handle BMP, EMF, GIF, ICO, JPEG, TIFF and WMF images, overriding jpeg and tiff. To build this into gdk-pixbuf, pass in windows" with the other loaders to build in or use "all" with the builtin_loaders option +endif() +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -Dman=false # Whether to generate man pages (requires xlstproc) + -Dgtk_doc=false # Whether to generate the API reference (requires GTK-Doc) + -Ddocs=false + -Dtests=false + -Dinstalled_tests=false + -Dgio_sniffing=false # Perform file type detection using GIO (Unused on MacOS and Windows) + -Dbuiltin_loaders=all # since it is unclear where loadable plugins should be located; + # Comma-separated list of loaders to build into gdk-pixbuf, or "none", or "all" to build all buildable loaders into gdk-pixbuf + ${OPTIONS} + OPTIONS_RELEASE + ${OPTIONS_RELEASE} + OPTIONS_DEBUG + -Dintrospection=disabled + ADDITIONAL_BINARIES + glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources' + glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal' + glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums' + "g-ir-compiler='${GIR_COMPILER}'" + "g-ir-scanner='${GIR_SCANNER}'" +) +vcpkg_install_meson(ADD_BIN_TO_PATH) + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gdk-pixbuf-2.0.pc" [[${bindir}]] "\${prefix}/tools/${PORT}") +if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gdk-pixbuf-2.0.pc" [[${bindir}]] "\${prefix}/../tools/${PORT}") +endif() +vcpkg_fixup_pkgconfig() + +set(TOOL_NAMES gdk-pixbuf-csource gdk-pixbuf-pixdata gdk-pixbuf-query-loaders) +# gdk-pixbuf-thumbnailer is not compiled for cross-compiling +# vcpkg-meson cross-build configuration differs from VCPKG_CROSSCOMPILING +if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/gdk-pixbuf-thumbnailer${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + list(APPEND TOOL_NAMES gdk-pixbuf-thumbnailer) +endif() +vcpkg_copy_pdbs() +vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/gdk-pixbuf/use-libtiff-4-pkgconfig.patch b/vcpkg/ports/gdk-pixbuf/use-libtiff-4-pkgconfig.patch new file mode 100644 index 0000000..be8cb00 --- /dev/null +++ b/vcpkg/ports/gdk-pixbuf/use-libtiff-4-pkgconfig.patch @@ -0,0 +1,13 @@ +diff --git a/meson.build b/meson.build +index b5280f3..4927ed5 100644 +--- a/meson.build ++++ b/meson.build +@@ -333,7 +333,7 @@ tiff_opt = get_option('tiff') + if not tiff_opt.disabled() and not native_windows_loaders + # We currently don't have a fallback subproject, but this handles error + # reporting if tiff_opt is enabled. +- tiff_dep = dependency(is_msvc_like ? 'tiff' : 'libtiff-4', required: tiff_opt) ++ tiff_dep = dependency(false ? 'tiff' : 'libtiff-4', required: tiff_opt) + + if tiff_dep.found() + enabled_loaders += 'tiff' diff --git a/vcpkg/ports/gdk-pixbuf/vcpkg.json b/vcpkg/ports/gdk-pixbuf/vcpkg.json new file mode 100644 index 0000000..5dd1ed4 --- /dev/null +++ b/vcpkg/ports/gdk-pixbuf/vcpkg.json @@ -0,0 +1,67 @@ +{ + "name": "gdk-pixbuf", + "version": "2.42.12", + "port-version": 4, + "description": "Image loading library.", + "homepage": "https://gitlab.gnome.org/GNOME/gdk-pixbuf", + "license": "LGPL-2.1-or-later", + "supports": "!xbox", + "dependencies": [ + { + "name": "gettext", + "host": true, + "default-features": false, + "features": [ + "tools" + ] + }, + "gettext-libintl", + "glib", + { + "name": "glib", + "host": true + }, + { + "name": "vcpkg-tool-meson", + "host": true + } + ], + "default-features": [ + "jpeg", + "png", + "tiff" + ], + "features": { + "introspection": { + "description": "Build with introspection", + "supports": "!static", + "dependencies": [ + "gobject-introspection" + ] + }, + "jpeg": { + "description": "Enable JPEG loader (requires libjpeg)", + "dependencies": [ + "libjpeg-turbo" + ] + }, + "others": { + "description": "Enable other loaders, which are weakly maintained (ani, bmp, icns, ico, pnm, qtif, tga, xbm, xpm)" + }, + "png": { + "description": "Enable PNG loader (requires libpng)", + "dependencies": [ + "libpng" + ] + }, + "tiff": { + "description": "Enable TIFF loader (requires libtiff)", + "dependencies": [ + { + "name": "tiff", + "default-features": false + } + ] + } + } +} |