-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[gettext] Add gettext cmake wrapper #18159
Conversation
I think that just needs a change at vcpkg/scripts/buildsystems/vcpkg.cmake Lines 548 to 554 in 9d7244f
|
I think the same, however minus the "just". It is the widest possible change, it will rebuild the world and affect virtually all ports if done naively, leading to all types of non-obvious side effects. |
kf5i18n:x64-windows-static:
i.e. successful, but not from vcpkg. ( This seems to cause the build failure:
|
So, this works now. I will rearrange and re-run x-add-version later today. However, I wonder if the additional msys2 packages are needed for kf5i18n. At least for mingw, they invite mixing different versions of compiler and libs when they should actually match closely. |
I tried using this in #16562. However, the config log showed that vcpkg kept using the apt-provided gettext binaries, so I force-removed getext with
I then tried doing the same with your |
Or it works as expected: On Linux, gettext is an empty package for all features. This should be obvious from the head of the portfile, and this PR didn't promise to change that. I do have a commit which actually builds |
Fair enough. I assumed that gettext tools were being built for Linux as well by now. |
@wrobelda Please ping me if this PR is ready for review. |
@JackBoosY well, I am not the author, but it does work for the kf5i18n in this PR, and it does work in #16562, so I'd say it's ready for review. |
kf5i18n is running |
@JackBoosY It is ready for review. |
Azure Pipelines successfully started running 1 pipeline(s). |
Can you please resolve the file conflict? |
@JackBoosY Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM as it is but I would like a more expert opinion.
I'm testing this locally with just a few minor changes -- if everything is good I'll push those and merge when CI turns green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final tweaks:
- We should still perform the
if (NOT EXISTS "/usr/include/libintl.h")
when the tools feature is selected for consistency with when the feature is not selected. - Avoid copying the Makefile; since it can be anywhere, just reference it from the port directory
- Consider backslashes in the path regexes
- Do not deploy
share/intl/vcpkg-cmake-wrapper.cmake
on Linux -- this wrapper is only for if we're providing the runtime libraries.
LGTM, let's ship it!
Thanks again @dg0yt for the continued awesome work! |
[gettext] Add gettext cmake wrapper (microsoft#18159)
[gettext] Add gettext cmake wrapper (microsoft#18159)
OPTIONS | ||
${OPTIONS} | ||
) | ||
vcpkg_install_make(SUBPATH "/intl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to use this? Can we manually set the target intl instead of doing this?
If the intl's makefile is generated, then it should be related to the target in the makefile in the root directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to use this? Can we manually set the target intl instead of doing this?
It was there before this PR.
Anyway, the gettext build system is complex and slow, and the gettext port has seen many attempts to shorten build times. The top-level Makefile (for ${SOURCE_PATH}/gettext-runtime
!) will pull in additional build and install steps. If you don't like the SUBPATH
approach, we might perhaps add entry points to an/the external Makefile provided by vcpkg - similar to what we already do for gettext-tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish to reduce the vcpkg_configure_cmake options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me. Shall I try to prepare a PR for the gettext Makefile approach? (Assuming we are not in a hurry.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dg0yt Yes, also I will have a try.
@dg0yt this works for all the ports that do
(where , as if the wrapper was actually not being used at all in this case. This is very odd, me and @hellozee both having same issue on our ends. Any idea why this could be? |
The gettext tools path is added by |
@dg0yt thanks for the explanation, it makes sense now. It's also a pretty bad situation – without explicit workarounds in my project's CMakeLists, I can't get it to work. And that kind of kills the whole joy of vcpkg being "transparent". |
What does your PR fix?
This PR adds a cmake config wrapper which covers
find_package(Gettext)
.Task: [gettext] msgfmt (and other gettext bin tools) missing on macOS & Windows #13518.
Which triplets are supported/not supported? Have you updated the CI baseline?
all, no
Does your PR follow the maintainer guide?
yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?yes
CC @wrobelda