[glib] fix for macOS dynamic library#9799
[glib] fix for macOS dynamic library#9799angelmixu wants to merge 23 commits intomicrosoft:masterfrom
Conversation
ports/glib/CONTROL
Outdated
| @@ -1,5 +1,5 @@ | |||
| Source: glib | |||
| Version: 2.52.3-14-5 | |||
| Version: 2.52.3-14-6 | |||
There was a problem hiding this comment.
maybe some of those fixes are not required if updated to 2.63.0
There was a problem hiding this comment.
And maybe ported to the official meson build system instead of a custom cmake file... But that's another topic
There was a problem hiding this comment.
maybe some of those fixes are not required if updated to 2.63.0
Oh, I can try!
And maybe ported to the official meson build system instead of a custom cmake file... But that's another topic
As the guidelines say... all ports should use a CMakeFile, isn't it? :/
There was a problem hiding this comment.
When multiple buildsystems are available, prefer using CMake. Additionally, when appropriate, it can be easier and more maintainable to rewrite alternative buildsystems into CMake using file(GLOB) directives.
the problem with using a vcpkg internal CMakeLists.txt is that it must be maintained and checked for correctness/equivalence with the ports real build system. Since vcpkg_(configure|build|install)_meson exists I would also rewrite it using these functions instead.
There was a problem hiding this comment.
Oh, I see, thanks!
|
@angelmixu, thanks for the PR! Could you please open an issue for this PR? so others may replicate this problem. BTW, glib failed on Linux in CI testing, could you have a look? |
Thanks to you @PhoebeHui :) Looks like "gnetworkmonitornm.c" is still needed in Linux, sorry :/ In some days I hope I can take a look and try to migrate the port to the vcpkg_*_meson way as mentioned before. Regarding opening an issue for this PR, should I mention that this PR needs help, or someone to consider anything? |
for that to work |
Ah, I thought it was working correctly! |
|
Trying to fix vcpkg_build_meson opened an extremely deep rabbit hole which made me decide to abandon (too busy) some time ago. It required fixing pkgconfig (which I saw also @Neumann-A then had to do), expand coverage into many ports, etc etc... |
|
I'm trying to update the CMakeLists.txt and the latest version I can use is 2.57.1, because the latter versions doesn't have the vcprojects for parsing the sources. Do you have any suggestion on it? |
|
Sorry for late. |
|
@angelmixu Okay, please ping me if this PR is ready for review. |
|
Hi people! I'm trying to use meson, and it's failing and I don't know why :/ I have pushed the changes to this branch, and the error is the following: Looks like it should be my macOS meson installation (I used brew install meson), because if I send this command in the terminal:
The same error appears. The contents of /usr/local/bin/meson is this: I have googled for something similar and I haven't found anything :( EDIT: just thought on installing meson with pip3, and it's working! Maybe vcpkg should change install instructions? Or maybe... brew should fix this? |
|
Ok, the next error is the following, libffi headers are installed in: And it looks like meson build is looking for it inside include/ffi: The only mention of ffi in the meson.build file is this one: Where should this be changed? :/ |
|
Is there a |
|
Try adding to libffi's portfile before the install of the copyright: taken from https://github.com/microsoft/vcpkg/pull/9966/files#diff-dffa210f772539f6ecaddd8ab285c1ac |
|
Oh thanks, it worked!!! :D there's a new error about files shouldn't be present in debug/share, I'll take a look next week! |
in my OpenCV 4.3 PR I fixed the usage of meson for osx. This also made some meson ports work on CI... :) |
|
I've uploaded libffi changes for testing if glib is building correctly, later we can create an individual PR with this change. Now the changes I made to glib port, looks like build correctly on macOS statically and dynamically, although... tools/executables are not correctly placed in the tools/ directory and they are in the bin/ directory. |
|
Hey people, I was trying to build it on windows, and here's the error on meson-log.txt: There's also another error for pcre.lib, it's in the debug configuration, intl.lib file is libintl.lib, and the missing pcre.lib is pcred.lib in the disk. Do any of you know how would it be fixed? |
|
glib depends on pcre in vcpkg, so you should use libpcre.a in VCPKG_ROOT/installed/TRIPLET/lib or VCPKG_ROOT/installed/TRIPLET/debug/lib. |
|
@JackBoosY thanks! Do you know if there's any vcpkg_meson_add_include/lib_path or similar? |
|
@Neumann-A Do you have any suggestions? |
BillyONeal
left a comment
There was a problem hiding this comment.
I believe this as initially "requires:discussion" because prognosis of dynamic libs on macos was itself in flux; after discussion #17363 (comment) it seems dynamic libs can work there.
There are conflicts, are you interested in continuing @angelmixu ?
| configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION | ||
| install(FILES gobject/glib-mkenums DESTINATION tools/glib) | ||
|
|
||
| #configure_file(gobject/glib-genmarshal.in ${CMAKE_SOURCE_DIR}/gobject/glib-genmarshal @ONLY) # uses GLIB_VERSION |
There was a problem hiding this comment.
Probably shouldn't add commented out code
Hi! |
|
this PR can be closed. glib was switched to meson in #13100 |
This PR fixes the build of a dynamic library on macOS.
The dynamic library suffix was missing, it needs to link with AppKit, it needs the RPATH correctly set.
And also, there's a cyclic dependence on kqueue, so I made it to build staticlly, and lastly, "gnetworkmonitornm.c" was not building at all, so I commented it.
Maybe someone can fix this file, but I didn't know how; although, I have tested glib and it looks like it is not needed in my case.