cmake/amule: drop the glib dep on macOS, even under wxGTK - #647
Merged
mrjimenez merged 1 commit intoMay 17, 2026
Merged
Conversation
…ect#641) amule.cpp and amule-remote-gui.cpp include <glib.h> and call g_set_prgname() under #ifdef __WXGTK__ to bind the Wayland wl_app_id / X11 WM_CLASS to the .desktop filename. The cmake gate that runs pkg_check_modules(GLIB ... glib-2.0) and propagates GLIB_INCLUDE_DIRS to the affected targets was wrapped in "if (CMAKE_SYSTEM_NAME STREQUAL Linux)" -- which is too narrow. wxGTK builds aren't a Linux-only configuration. MacPorts ships wxWidgets as a wxGTK port, so on that setup __WXGTK__ was defined but the cmake gate stayed false, the include path was never added, and the build died with "glib.h: No such file or directory" mid-compile. g_set_prgname is a no-op on macOS even when wxGTK is the toolkit: no Wayland, no .desktop binding, app identity comes from Info.plist in the .app bundle. So tighten the C-side gate to "#if defined(__WXGTK__) && !defined(__APPLE__)" in both files; macOS wxGTK builds skip the include and the call entirely. Match the cmake gate the same way: glib is required only when __WXGTK__ is in wxWidgets_DEFINITIONS AND the host isn't Apple. Configurations: - macOS Homebrew (wxMac): no glib needed (unchanged). - macOS MacPorts (wxGTK): no glib needed (was the bug). - Linux wxGTK: glib required, unchanged FATAL_ERROR with install hint. - Windows MinGW (wxMSW): no glib needed (unchanged).
ngosang
pushed a commit
to ngosang/amule
that referenced
this pull request
Jul 27, 2026
…ject#647) Fixes amule-project#631. Opening a collection from a file manager has never worked on any platform: nothing declared the type to the OS, nothing handled the open-document event on macOS, and the command-line path rejected anything that was not an eD2k or magnet link. Accepts a .emulecollection path or file:// URL as an argument, handles MacOpenFiles on macOS, and declares the type to each OS. Registration is exposed on the same four surfaces as the URL schemes so a portable copy can register itself; UriScheme becomes HandlerTarget so the existing policy layer and the Linux mimeapps.list handling are reused rather than duplicated. Hardens CMuleCollection, which becomes reachable from arbitrary files: a blank line threw std::out_of_range out of Open(), a length prefix could request a 4 GiB allocation, a filename containing a newline forged extra lines in the ED2KLinks IPC file, an entry without a hash produced an unusable link, a link smuggled into a filename was harvested by the text parser after the binary parser rejected it, and a UTF-8 BOM made a collection parse as empty. Adds unit tests, which the parser had none of. Also fixes pre-existing bugs this feature was the first to depend on: wxExecute's string form passed quote characters through to the XDG cache helpers, those helpers inherited the AppImage's LD_LIBRARY_PATH and died on a bundled glib symbol, mimeapps.list was written without a trailing newline so the next writer's entry fused onto ours, and four installer strings were never extractable by xgettext.
mrjimenez
added a commit
to mrjimenez/amule
that referenced
this pull request
Jul 29, 2026
conftest.mmap and conftest.txt were accidentally committed in 9aa8fe4 (amule-project#647). They are disposable output of the mmap capability check (random page-sized garbage), not project data, and are no longer written to the source tree now that the probe runs inside build/.
mrjimenez
added a commit
to mrjimenez/amule
that referenced
this pull request
Jul 30, 2026
conftest.mmap and conftest.txt were accidentally committed in 9aa8fe4 (amule-project#647). They are disposable output of the mmap capability check (random page-sized garbage), not project data, and are no longer written to the source tree now that the probe runs inside build/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #641.
amule.cppandamule-remote-gui.cppinclude<glib.h>and callg_set_prgname()under#ifdef __WXGTK__to bind the Waylandwl_app_id/ X11WM_CLASSto the.desktopfilename. The cmake gate that runspkg_check_modules(GLIB ... glib-2.0)and propagatesGLIB_INCLUDE_DIRSto the affected targets was wrapped inif (CMAKE_SYSTEM_NAME STREQUAL "Linux"), which is too narrow: wxGTK builds aren't a Linux-only configuration. MacPorts ships wxWidgets as a wxGTK port (/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/...), so on that setup__WXGTK__is defined but the cmake gate stayed false, the include path was never added, and the build died withglib.h: No such file or directorymid-compile.@barracuda156's MacPorts ppc / 10.6 build is the trigger.
Fix
g_set_prgnameis a no-op on macOS even when wxGTK happens to be the toolkit — there's no Wayland, no.desktopbinding, and macOS apps identify viaInfo.plistin the.appbundle. The C-side gate is tightened to#if defined(__WXGTK__) && !defined(__APPLE__)in bothamule.cppandamule-remote-gui.cppso macOS wxGTK builds skip the include and the call entirely. The cmake gate matches: glib is required only when__WXGTK__is inwxWidgets_DEFINITIONSAND the host isn't Apple. Wherever there was reason to ask for glib2 on a macOS build, the answer is now "you don't need it."Effect by configuration:
__WXGTK__not defined). No glib needed. Unchanged behavior.NOT APPLEshort-circuits) and at compile (!defined(__APPLE__)short-circuits). No glib needed. This is the fix.__WXGTK__not in DEFINITIONS, gate false. No glib needed. Unchanged behavior.