diff --git a/3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json b/3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json index a53e5e2711..2d4dea7480 100644 --- a/3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json +++ b/3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json @@ -16,6 +16,12 @@ "name": "wxwidgets", "default-features": false }, - "freetype" + "freetype", + "librsvg", + { + "name": "gdk-pixbuf", + "features": ["jpeg", "png", "svg", "tiff", "others"], + "default-features": false + } ] } diff --git a/3rdParty/vcpkg_ports/ports/gdk-pixbuf/add_optional_svg_support.patch b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/add_optional_svg_support.patch new file mode 100644 index 0000000000..88dec18547 --- /dev/null +++ b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/add_optional_svg_support.patch @@ -0,0 +1,75 @@ +diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c +index e1df5900f..d7018da6e 100644 +--- a/gdk-pixbuf/gdk-pixbuf-io.c ++++ b/gdk-pixbuf/gdk-pixbuf-io.c +@@ -592,7 +592,10 @@ gdk_pixbuf_init_modules (const char *path, + g_free (filename); + return ret; + } +- ++#ifdef INCLUDE_svg ++extern void _gdk_pixbuf__svg_fill_info (GdkPixbufFormat *info) __attribute__((weak)); ++extern void _gdk_pixbuf__svg_fill_vtable (GdkPixbufModule *module) __attribute__((weak)); ++#endif + static void + gdk_pixbuf_io_init_builtin (void) + { +@@ -659,6 +662,10 @@ gdk_pixbuf_io_init_builtin (void) + /* Except the gdip-png loader which normally isn't built at all even */ + load_one_builtin_module (png); + #endif ++#ifdef INCLUDE_svg ++ if (_gdk_pixbuf__svg_fill_info && _gdk_pixbuf__svg_fill_vtable) ++ load_one_builtin_module (svg); ++#endif + + #undef load_one_builtin_module + } +@@ -777,6 +784,15 @@ gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module, + #ifdef INCLUDE_qtif + try_module (qtif,qtif); + #endif ++#ifdef INCLUDE_svg ++if (fill_info == NULL && ++ strcmp (image_module->module_name, "svg") == 0) { ++ if (_gdk_pixbuf__svg_fill_info && _gdk_pixbuf__svg_fill_vtable) { ++ fill_info = _gdk_pixbuf__svg_fill_info; ++ fill_vtable = _gdk_pixbuf__svg_fill_vtable; ++ } ++ } ++#endif + + #undef try_module + +diff --git a/meson.build b/meson.build +index 3eb3fcc15..b11331239 100644 +--- a/meson.build ++++ b/meson.build +@@ -280,6 +280,12 @@ if not gif_opt.disabled() + enabled_loaders += 'gif' + endif + ++svg_opt = get_option('svg') ++if not svg_opt.disabled() ++ enabled_loaders += 'svg' ++ add_project_arguments([ '-DINCLUDE_svg' ], language: 'c') ++endif ++ + others_opt = get_option('others') + if not others_opt.disabled() + # Keep sorted alphabetically +diff --git a/meson_options.txt b/meson_options.txt +index 74830154a..6961c9530 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -18,6 +18,10 @@ option('others', + description: 'Enable other loaders, which are weakly maintained', + type: 'feature', + value: 'disabled') ++option('svg', ++ description: 'Enable SVG loader', ++ type: 'feature', ++ value: 'disabled') + option('builtin_loaders', + description: 'Comma-separated list of loaders to build into gdk-pixbuf', + type: 'array', diff --git a/3rdParty/vcpkg_ports/ports/gdk-pixbuf/fix-static-deps.patch b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/fix-static-deps.patch new file mode 100644 index 0000000000..693f11db6b --- /dev/null +++ b/3rdParty/vcpkg_ports/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/3rdParty/vcpkg_ports/ports/gdk-pixbuf/fix_build_error_windows.patch b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/fix_build_error_windows.patch new file mode 100644 index 0000000000..b213ac865f --- /dev/null +++ b/3rdParty/vcpkg_ports/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/3rdParty/vcpkg_ports/ports/gdk-pixbuf/loaders-cache.patch b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/loaders-cache.patch new file mode 100644 index 0000000000..d0a8ce9441 --- /dev/null +++ b/3rdParty/vcpkg_ports/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/3rdParty/vcpkg_ports/ports/gdk-pixbuf/portfile.cmake b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/portfile.cmake new file mode 100644 index 0000000000..2248a59f26 --- /dev/null +++ b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/portfile.cmake @@ -0,0 +1,105 @@ +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 + add_optional_svg_support.patch +) + +if("introspection" IN_LIST FEATURES) + list(APPEND OPTIONS_DEBUG -Dintrospection=disabled) + list(APPEND OPTIONS_RELEASE -Dintrospection=enabled) +else() + list(APPEND OPTIONS -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() + +if("svg" IN_LIST FEATURES) + list(APPEND OPTIONS -Dsvg=enabled) +else() + list(APPEND OPTIONS -Dsvg=disabled) +endif() + +if(CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(GIR_TOOL_DIR ${CURRENT_INSTALLED_DIR}) +else() + set(GIR_TOOL_DIR ${CURRENT_HOST_INSTALLED_DIR}) +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 + -Drelocatable=true # Whether to enable application bundle relocation support + -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_DEBUG + ${OPTIONS_DEBUG} + OPTIONS_RELEASE + ${OPTIONS_RELEASE} + 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='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}' + g-ir-scanner='${GIR_TOOL_DIR}/tools/gobject-introspection/g-ir-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/3rdParty/vcpkg_ports/ports/gdk-pixbuf/use-libtiff-4-pkgconfig.patch b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/use-libtiff-4-pkgconfig.patch new file mode 100644 index 0000000000..be8cb0065f --- /dev/null +++ b/3rdParty/vcpkg_ports/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/3rdParty/vcpkg_ports/ports/gdk-pixbuf/vcpkg.json b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/vcpkg.json new file mode 100644 index 0000000000..078a3d6051 --- /dev/null +++ b/3rdParty/vcpkg_ports/ports/gdk-pixbuf/vcpkg.json @@ -0,0 +1,68 @@ +{ + "name": "gdk-pixbuf", + "version": "2.42.12", + "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, + "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", + "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" + ] + }, + "svg": { + "description": "Enable SVG loader", + "supports": "!windows" + }, + "tiff": { + "description": "Enable TIFF loader (requires libtiff)", + "dependencies": [ + { + "name": "tiff", + "default-features": false + } + ] + } + } +} diff --git a/3rdParty/vcpkg_ports/ports/librsvg/CMakeLists.txt b/3rdParty/vcpkg_ports/ports/librsvg/CMakeLists.txt new file mode 100644 index 0000000000..fc72a1d952 --- /dev/null +++ b/3rdParty/vcpkg_ports/ports/librsvg/CMakeLists.txt @@ -0,0 +1,214 @@ +cmake_minimum_required(VERSION 3.11) +project(librsvg C) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(LIBCROCO libcroco-0.6 IMPORTED_TARGET) +pkg_check_modules(GLIB2 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 IMPORTED_TARGET) +pkg_check_modules(CAIRO cairo IMPORTED_TARGET) +pkg_check_modules(GDK_PIXBUF gdk-pixbuf-2.0 IMPORTED_TARGET) +pkg_check_modules(PANGO pango pangocairo IMPORTED_TARGET) +find_package(LibXml2 REQUIRED) + +if(CMAKE_SYSTEM_NAME MATCHES "Windows") +elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") +else() + pkg_check_modules(PANGO2 pangoft2 pangofc IMPORTED_TARGET) + set(PANGO_FT2_LIB PkgConfig::PANGO2) +endif() + +set(RSVG_API_MAJOR_VERSION 2) +set(RSVG_API_VERSION "2.0") +Set(VERSION "2.40.20") +set(LIBRSVG_TARGET "rsvg-${RSVG_API_MAJOR_VERSION}") + +Set(prefix "${CMAKE_INSTALL_PREFIX}") +Set(exec_prefix "\${prefix}") +Set(libdir "\${prefix}/lib") +Set(includedir "\${prefix}/include") + +# Public required modules (cf. headers and librsvg.pc) +set(librsvg_pc_requires glib-2.0 gio-2.0 gdk-pixbuf-2.0 cairo) +# Other required modules from configure.ac +set(librsvg_pc_requires_private + libxml-2.0 + pangocairo + pangoft2 + cairo-png + libcroco-0.6 + gthread-2.0 + gmodule-2.0 + gobject-2.0 + gio-unix-2.0 + fontconfig +) +if(WIN32) + string(REPLACE "gio-unix" "gio-windows" librsvg_pc_requires_private "${librsvg_pc_requires_private}") +endif() + +find_package(PkgConfig REQUIRED) +pkg_check_modules(LIBRSVG_LINK_PUBLIC ${librsvg_pc_requires} IMPORTED_TARGET REQUIRED) +pkg_check_modules(LIBRSVG_LINK_PRIVATE ${librsvg_pc_requires_private} IMPORTED_TARGET REQUIRED) + +set(LIBRSVG_SOURCES + librsvg-features.c + rsvg-css.c + rsvg-css.h + rsvg-compat.h + rsvg-defs.c + rsvg-defs.h + rsvg-image.c + rsvg-image.h + rsvg-io.c + rsvg-io.h + rsvg-paint-server.c + rsvg-paint-server.h + rsvg-path.c + rsvg-path.h + rsvg-private.h + rsvg-base-file-util.c + rsvg-filter.c + rsvg-filter.h + rsvg-marker.c + rsvg-marker.h + rsvg-mask.c + rsvg-mask.h + rsvg-shapes.c + rsvg-shapes.h + rsvg-structure.c + rsvg-structure.h + rsvg-styles.c + rsvg-styles.h + rsvg-text.c + rsvg-text.h + rsvg-cond.c + rsvg-base.c + librsvg-enum-types.c + rsvg-cairo-draw.c + rsvg-cairo-draw.h + rsvg-cairo-render.c + rsvg-cairo-render.h + rsvg-cairo-clip.h + rsvg-cairo-clip.c + rsvg.c + rsvg-gobject.c + rsvg-file-util.c + rsvg-size-callback.c + rsvg-size-callback.h + rsvg-xml.c + rsvg-xml.h + rsvg.h + rsvg-cairo.h + librsvg-features.h + librsvg-enum-types.h +) + +if(WIN32) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.win32" "${CMAKE_CURRENT_BINARY_DIR}/config.h" COPYONLY) + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/rsvg.symbols" rsvg_symbols) + string(REGEX REPLACE "/[*][^*]*[*]/" "" rsvg_symbols "${rsvg_symbols}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rsvg.def" "EXPORTS\n${rsvg_symbols}") + list(APPEND LIBRSVG_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/rsvg.def") +else() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.linux" "${CMAKE_CURRENT_BINARY_DIR}/config.h" COPYONLY) + list(APPEND LIBRSVG_SOURCES rsvg.symbols) +endif() + +add_library(${LIBRSVG_TARGET} ${LIBRSVG_SOURCES}) +target_compile_definitions(${LIBRSVG_TARGET} PRIVATE + -DRSVG_COMPILATION + -D_CRT_SECURE_NO_WARNINGS + -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" + -DGDK_PIXBUF_ENABLE_BACKEND + -DG_LOG_DOMAIN="libpixbufloader-svg" + -DSRCDIR="" + $<$:HAVE_STRTOK_R> +) + +target_link_libraries(${LIBRSVG_TARGET} PRIVATE + PkgConfig::GLIB2 + ${LIBXML2_LIBRARIES} + PkgConfig::PANGO + PkgConfig::GDK_PIXBUF + ${PANGO_FT2_LIB} + PkgConfig::LIBCROCO +) + +target_include_directories(${LIBRSVG_TARGET} + PRIVATE + "${CMAKE_CURRENT_BINARY_DIR}" + PUBLIC + "$" + "$" +) +target_link_libraries(${LIBRSVG_TARGET} + PUBLIC + PkgConfig::LIBRSVG_LINK_PUBLIC + PRIVATE + PkgConfig::LIBRSVG_LINK_PRIVATE +) +install(TARGETS ${LIBRSVG_TARGET} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +install( + FILES + rsvg.h + rsvg-cairo.h + librsvg-features.h + librsvg-enum-types.h + DESTINATION include/librsvg-${RSVG_API_VERSION}/librsvg +) + +set(gdk_pixbuf_pc_requires_private gdk-pixbuf-2.0) +pkg_check_modules(GDK_PIXBUF ${gdk_pixbuf_pc_requires_private} IMPORTED_TARGET REQUIRED) +pkg_get_variable(GDK_PIXBUF_MODULEDIR ${gdk_pixbuf_pc_requires_private} gdk_pixbuf_moduledir) + +set(PIXBUFLOADERSVG_SOURCES + gdk-pixbuf-loader/io-svg.c +) + +if (BUILD_SHARED_LIBS) + add_library(pixbufloader-svg MODULE ${PIXBUFLOADERSVG_SOURCES}) +else() + add_library(pixbufloader-svg ${PIXBUFLOADERSVG_SOURCES}) +endif() +target_include_directories(pixbufloader-svg + PRIVATE + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" +) +target_compile_definitions(pixbufloader-svg PRIVATE + -DRSVG_COMPILATION + -D_CRT_SECURE_NO_WARNINGS + -DSRCDIR="" + -DGDK_PIXBUF_ENABLE_BACKEND + -DG_LOG_DOMAIN="libpixbufloader-svg" +) +target_link_libraries(pixbufloader-svg + PRIVATE + ${LIBRSVG_TARGET} + PkgConfig::GDK_PIXBUF +) +if (BUILD_SHARED_LIBS) + install(TARGETS pixbufloader-svg + RUNTIME DESTINATION "${GDK_PIXBUF_MODULEDIR}" + LIBRARY DESTINATION "${GDK_PIXBUF_MODULEDIR}" + ) +else() + install(TARGETS pixbufloader-svg + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/librsvg.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/librsvg.pc" @ONLY) +file(READ "${CMAKE_CURRENT_BINARY_DIR}/librsvg.pc" librsvg_pc) +list(JOIN librsvg_pc_requires_private " " requires_private) +string(REPLACE "Requires.private:" "Requires.private: ${requires_private}" librsvg_pc "${librsvg_pc}") +if (NOT BUILD_SHARED_LIBS) + string(REPLACE "-lm" "-lpixbufloader-svg -lm" librsvg_pc "${librsvg_pc}") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/librsvg.pc" "${librsvg_pc}") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/librsvg.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" RENAME "librsvg-${RSVG_API_VERSION}.pc") diff --git a/3rdParty/vcpkg_ports/ports/librsvg/config.h.linux b/3rdParty/vcpkg_ports/ports/librsvg/config.h.linux new file mode 100644 index 0000000000..c3881b8c99 --- /dev/null +++ b/3rdParty/vcpkg_ports/ports/librsvg/config.h.linux @@ -0,0 +1,89 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Have the pangoft2 library */ +#define HAVE_PANGOFT2 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtok_r' function. */ +#define HAVE_STRTOK_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "librsvg" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://bugzilla.gnome.org/enter_bug.cgi?product=librsvg" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "RSVG" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "RSVG 2.40.20" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "librsvg" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.40.20" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.40.20" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif diff --git a/3rdParty/vcpkg_ports/ports/librsvg/fix_io_svg_for_static_build.patch b/3rdParty/vcpkg_ports/ports/librsvg/fix_io_svg_for_static_build.patch new file mode 100644 index 0000000000..a304b44d4a --- /dev/null +++ b/3rdParty/vcpkg_ports/ports/librsvg/fix_io_svg_for_static_build.patch @@ -0,0 +1,43 @@ +diff --git a/gdk-pixbuf-loader/io-svg.c b/gdk-pixbuf-loader/io-svg.c +index bcdfd0bb..4e8ede6d 100644 +--- a/gdk-pixbuf-loader/io-svg.c ++++ b/gdk-pixbuf-loader/io-svg.c +@@ -43,8 +43,8 @@ typedef struct { + gpointer user_data; + } SvgContext; + +-G_MODULE_EXPORT void fill_vtable (GdkPixbufModule *module); +-G_MODULE_EXPORT void fill_info (GdkPixbufFormat *info); ++// G_MODULE_EXPORT void fill_vtable (GdkPixbufModule *module); ++// G_MODULE_EXPORT void fill_info (GdkPixbufFormat *info); + + enum { + ERROR_WRITING = 1, +@@ -173,17 +173,23 @@ gdk_pixbuf__svg_image_stop_load (gpointer data, GError **error) + return result; + } + +-void +-fill_vtable (GdkPixbufModule *module) ++#ifdef BUILD_SHARED_LIBS ++#define MODULE_ENTRY(function) G_MODULE_EXPORT void function ++#else ++#define MODULE_ENTRY(function) void _gdk_pixbuf__svg_ ## function ++#endif ++ ++MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module) + { ++ if (module == NULL) return; + module->begin_load = gdk_pixbuf__svg_image_begin_load; + module->stop_load = gdk_pixbuf__svg_image_stop_load; + module->load_increment = gdk_pixbuf__svg_image_load_increment; + } + +-void +-fill_info (GdkPixbufFormat *info) ++MODULE_ENTRY (fill_info) (GdkPixbufFormat *info) + { ++ if (info == NULL) return; + static const GdkPixbufModulePattern signature[] = { + { "