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

[wxwidgets] Fix find dependency pcre2 #24874

Merged
merged 10 commits into from
May 25, 2022

Conversation

JackBoosY
Copy link
Contributor

Currently, only the release version of the dependency pcre2 is found during the configuration of wxwidgets, fix this.

Fixes #24851.

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels May 23, 2022
ports/wxwidgets/fix-pcre2.patch Outdated Show resolved Hide resolved
@JackBoosY JackBoosY requested a review from LilyWangLL May 24, 2022 03:10
@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label May 24, 2022
@dg0yt
Copy link
Contributor

dg0yt commented May 24, 2022

For x64-linux, the config tool (tools/wxwidgets/wx-config) doesn't report any pcre2 libs. x64-linux is static. I guess there will be a linking issue as soon as pcre2 functions from wxwidgets are actually used. But I can't answer now if this is a regression.

@dg0yt
Copy link
Contributor

dg0yt commented May 24, 2022

But I can't answer now if this is a regression.

It must be a regression. Before this PR, libpcre2-32.a is listed in wx-config.

@ras0219-msft ras0219-msft removed the info:reviewed Pull Request changes follow basic guidelines label May 24, 2022
@JackBoosY
Copy link
Contributor Author

The value pcre currently left in wx-config is from libsecret-1.pc->glib-2.0.pc in the system:

root@usr:/home/usr/work/24874/vcpkg# find /usr/lib/x86_64-linux-gnu/pkgconfig/ -name *.pc | xargs grep "pcre"
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcre.pc:Name: libpcre
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcre.pc:Libs: -L${libdir} -lpcre
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcreposix.pc:Name: libpcreposix
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcreposix.pc:Description: PCREPosix - Posix compatible interface to libpcre
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcreposix.pc:Libs: -L${libdir} -lpcreposix
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcreposix.pc:Requires.private: libpcre
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcre16.pc:Name: libpcre16
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcre16.pc:Libs: -L${libdir} -lpcre16
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcre32.pc:Name: libpcre32
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcre32.pc:Libs: -L${libdir} -lpcre32
/usr/lib/x86_64-linux-gnu/pkgconfig/libselinux.pc:Requires.private: libsepol libpcre
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcrecpp.pc:Name: libpcrecpp
/usr/lib/x86_64-linux-gnu/pkgconfig/libpcrecpp.pc:Libs: -L${libdir} -lpcre -lpcrecpp
/usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc:Requires.private: libpcre
/usr/lib/x86_64-linux-gnu/pkgconfig/glib-2.0.pc:Libs.private: -pthread  -lpcre

@JackBoosY
Copy link
Contributor Author

@dg0yt
The remaining pcre is caused by wxwidgets using the default toolkit gtk3 in linux, it will look for gtk+-3.0.pc in the system, and then use the other installed libraries in systems including pcre.
Then I tried adding gtk as a dependency of wxwidgets, but I get an error:

CMake Error at ports/wxwidgets/portfile.cmake:28 (message):
  Port freetype must not be installed when building wxwidgets:x64-linux.

Seems like this problem is hard to fix at the moment?
Can we ignore this issue for now?

@dg0yt
Copy link
Contributor

dg0yt commented May 25, 2022

If pcre2 is properly referenced in wx-config again, this PR is okay.

Everything else is unrelated:

@JackBoosY
Copy link
Contributor Author

The default toolkits which we can pick is:

elseif(UNIX)
    set(wxDEFAULT_TOOLKIT gtk3)
    set(wxTOOLKIT_OPTIONS gtk2 gtk3 gtk4 motif qt)
    set(wxPLATFORM UNIX)

We can use qt but it will take more and more build time.

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label May 25, 2022
@dg0yt
Copy link
Contributor

dg0yt commented May 25, 2022

The default toolkits which we can pick is:

I know. Qt might be a future feature... but it is pointless: Why use a cross-platform framework on top of another cross-platform framework? I think that developers expect the default, which is gtk3 for Linux.

@ras0219-msft
Copy link
Contributor

set(wxTOOLKIT_OPTIONS gtk2 gtk3 gtk4 motif qt)

I notice that gtk4 is on that list -- progress!

@ras0219-msft ras0219-msft merged commit 20907dc into microsoft:master May 25, 2022
@ras0219-msft
Copy link
Contributor

This LGTM though, thanks!

@JackBoosY JackBoosY deleted the dev/jack/24851 branch May 26, 2022 02:36
@dg0yt
Copy link
Contributor

dg0yt commented May 26, 2022

set(wxTOOLKIT_OPTIONS gtk2 gtk3 gtk4 motif qt)

I notice that gtk4 is on that list -- progress!

It is on the list, but it simply won't work soon - not even with wxWidgets 3.4 3.2: https://www.wxwidgets.org/blog/2021/01/wxwidgets-in-2020-and-beyond/

Copy link

@Playgirlkaybraz11 Playgirlkaybraz11 left a comment

Choose a reason for hiding this comment

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

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 info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
5 participants