Skip to content

[sdl2] declare glib-2.0, gobject-2.0, gio-2.0 and ibus-1.0 as SYSTEM_LIBRARIES#14019

Closed
jgilje wants to merge 1 commit intomicrosoft:masterfrom
jgilje:sdl2_ignore_ibus
Closed

[sdl2] declare glib-2.0, gobject-2.0, gio-2.0 and ibus-1.0 as SYSTEM_LIBRARIES#14019
jgilje wants to merge 1 commit intomicrosoft:masterfrom
jgilje:sdl2_ignore_ibus

Conversation

@jgilje
Copy link
Contributor

@jgilje jgilje commented Oct 13, 2020

Describe the pull request

  • What does your PR fix?

On Linux, if you've got the ibus development headers installed, the sdl2 build will detect it use it for linking via pkg-config. This in turn adds glib-2.0, gobject-2.0, gio-2.0 and ibus-1.0 to the linked libraries. This PR declares them as SYSTEM_LIBRARIES.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

NA

Yes

vcpkg_fixup_pkgconfig(
IGNORE_FLAGS "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib" "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib" "-Wl,--enable-new-dtags" "-Wl,--no-undefined" "-Wl,-undefined,error" "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}" "-Wl,-current_version,${DYLIB_CURRENT_VERSION}" "-Wl,-weak_framework,Metal" "-Wl,-weak_framework,QuartzCore"
SYSTEM_LIBRARIES dbus-1
SYSTEM_LIBRARIES dbus-1 glib-2.0 gobject-2.0 gio-2.0 ibus-1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

glib is not a system library in vcpkg since there is a port for it. The problem is more or less that glib is using a custom cmakelists.txt which does not install pkgconfig files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The thing here, is that the glib dependency gets added from ibus. So it's a situation were you may or may not have glib installed in vcpkg, but the dependency gets added by ibus anyway. And the SDL2 configure script doesn't have any knobs to turn off IME if ibus is detected.

Copy link
Contributor

Choose a reason for hiding this comment

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

is ibus found via find_package? If yes it can be deactivated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's the detection from the source: http://hg.libsdl.org/SDL/file/355a4f94a782/CMakeLists.txt#l1188. It gets added by pkg_search_module.

I just noticed the vcpkg CMakeLists file is already patched quite a bit, so I can remove the check if that's a preferred solution.

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Oct 14, 2020
@jube
Copy link
Contributor

jube commented Oct 15, 2020

Duplicate of #13963

If you install glib from vcpkg, you only have to set ibus-1.0 as a system dependency. So, the patch should be changed to depend on glib and add ibus as a system dependency.

@jgilje
Copy link
Contributor Author

jgilje commented Oct 15, 2020

@jube Yeah, that works.

In principle, I don't like having SDL2 depend on glib, it adds no value to the SDL2 target. However, if this is will get this patch accepted by @Neumann-A, I have no problem modifying the patch.

As mentioned earlier, I'd rather just remove the IBUS check from the CMakeLists file during the patch phase.

@jube
Copy link
Contributor

jube commented Oct 16, 2020

I don't understand why SDL needs glib. I think there is a problem with the configuration of the port. Making this port installable again is a priority, then a correction can be made to avoid glib as a dependency.

@jgilje
Copy link
Contributor Author

jgilje commented Oct 17, 2020

@jube It's only when ibus is detected that glib gets added as a dependency. It's quite easy to see for yourself if running Linux and having the ibus dev-package installed. From the CMakeLists.txt file I linked, you can see that ibus flags are added via pkg-config

$ pkg-config --libs ibus-1.0
-libus-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0

@JackBoosY JackBoosY linked an issue Oct 21, 2020 that may be closed by this pull request
@BillyONeal
Copy link
Member

I'm closing this as an exact duplicate of #13551

@BillyONeal BillyONeal closed this Oct 22, 2020
@jgilje jgilje deleted the sdl2_ignore_ibus branch October 28, 2020 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sdl2] build failure

6 participants