Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[librsvg][gdk-pixbuf] Add librsvg support to gdk-pixbuf by adding librsvg as a dependency to gdk-pixbuf. #38499

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AenBleidd
Copy link
Contributor

This changes the behavior of librsvg to be able to be built without gdk-pixbuf support (to avoid circular dependency) when built statically, and gdk-pixbuf to be built with librsvg support. librsvg is optional when building gdk-pixbuf dynamically, and enabled by default when building statically.

This fixes #38012.

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@AenBleidd AenBleidd force-pushed the vko_add_librsvg_support_to_gdk-pixbuf branch from bc55e89 to c4ddf02 Compare April 30, 2024 19:09
endif

+svg_opt = get_option('svg')
+if not svg_opt.disabled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few days ago I learned that features don't need to be tested for being disabled like this...

+if not svg_opt.disabled()
+ # We currently don't have a fallback subproject, but this handles error
+ # reporting if svg_opt is enabled.
+ svg_dep = dependency('librsvg-2.0', required: svg_opt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +31 to +34
{
"name": "svg",
"platform": "static"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want add it as a default feature?
librsvg in vcpkg is outdated and can't update ATM.

Comment on lines 142 to 144
if (ENABLE_GDK_PIXBUF_LOADER)
if (BUILD_SHARED_LIBS)
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)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this patch could be trimmed, by leaving original indent and different grouping of if(BUILD_SHARED_LIBS).


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 (ENABLE_GDK_PIXBUF_LOADER AND NOT BUILD_SHARED_LIBS)
string(REPLACE "-lm" "-lpixbufloader-svg -lm" librsvg_pc "${librsvg_pc}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Candidates for Libs.private?

@AenBleidd AenBleidd force-pushed the vko_add_librsvg_support_to_gdk-pixbuf branch 6 times, most recently from 145ad5e to 6e2813b Compare May 1, 2024 11:13
…rsvg as a dependency to gdk-pixbuf.

This changes the behavior of librsvg to be able to be built without gdk-pixbuf support (to avoid circular dependency) when built statically, and gdk-pixbuf to be built with librsvg support.
librsvg is optional when building gdk-pixbuf dynamically, and enabled by default when building statically.

This fixes microsoft#38012.

Signed-off-by: Vitalii Koshura <[email protected]>
@AenBleidd AenBleidd force-pushed the vko_add_librsvg_support_to_gdk-pixbuf branch from 6e2813b to 03e6723 Compare May 1, 2024 22:22
@MonicaLiu0311 MonicaLiu0311 added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
3 participants