--- gio/giomodule.c.orig 2026-02-10 12:16:26 +++ gio/giomodule.c 2026-02-10 12:15:07 @@ -67,11 +67,12 @@ #endif #include -#if defined(G_OS_UNIX) && !defined(__APPLE__) +#if defined(G_OS_UNIX) +#if !defined(HAVE_COCOA) || defined(USE_APPINFO_GENERIC) #include "gdesktopappinfo.h" -#endif -#ifdef HAVE_COCOA +#elif defined(HAVE_COCOA) #include "gosxappinfo.h" +#endif #endif #ifdef __APPLE__ @@ -1193,7 +1194,7 @@ if (g_once_init_enter (®istered_extensions)) { -#if defined(G_OS_UNIX) && !defined(__APPLE__) +#if defined(G_OS_UNIX) && (!defined(HAVE_COCOA) || defined(USE_APPINFO_GENERIC)) #if !GLIB_CHECK_VERSION (3, 0, 0) ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME); g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP); --- meson.options.orig 2026-02-10 12:17:07 +++ meson.options 2026-02-10 12:15:18 @@ -1,3 +1,9 @@ +option('appinfo_backend', + type : 'combo', + choices : ['generic', 'native'], + value : 'generic', + description : '''appinfo backend to use; either generic (for x11 based builds) + or native (for quartz based builds)''') option('runtime_libdir', type : 'string', value : '', --- gio/meson.build.orig 2026-02-11 10:43:00 +++ gio/meson.build 2026-02-11 10:47:16 @@ -399,16 +399,33 @@ if host_system != 'sunos' unix_sources += files('gmemorymonitorpsi.c') endif + + appinfo_backend = get_option('appinfo_backend') if glib_have_cocoa settings_sources += files('gnextstepsettingsbackend.m') - contenttype_sources += files('gcontenttype-osx.m') - unix_sources += files('gosxappinfo.m') + if appinfo_backend == 'native' + contenttype_sources += files('gcontenttype-osx.m') + unix_sources += files('gosxappinfo.m') + application_headers += files('gosxappinfo.h') + else + contenttype_sources += files('gcontenttype-fdo.c') + unix_sources += files('gdesktopappinfo.c') + gio_unix_include_headers += files('gdesktopappinfo.h') + launch_desktop_sources = files('gio-launch-desktop.c') + gio_launch_desktop = executable('gio-launch-desktop', launch_desktop_sources, + include_directories : glibinc, + install : true, + install_dir : multiarch_libexecdir, + install_tag : 'bin', + c_args : gio_c_args, + # intl.lib is not compatible with SAFESEH + link_args : noseh_link_args) + endif framework_dep = dependency('appleframeworks', modules : ['Foundation', 'CoreFoundation', 'AppKit']) platform_deps += [framework_dep] unix_sources += files('gcocoanotificationbackend.m') unix_sources += files('gosxnetworkmonitor.c') - application_headers += files('gosxappinfo.h') else contenttype_sources += files('gcontenttype-fdo.c') unix_sources += files('gdesktopappinfo.c') @@ -861,6 +878,13 @@ ) endif +appinfo_backend = get_option('appinfo_backend') +if appinfo_backend == 'native' + glib_conf.set('USE_APPINFO_NATIVE', 1) +else + glib_conf.set('USE_APPINFO_GENERIC', 1) +endif + if enable_dtrace gio_dtrace_obj = dtrace_obj_gen.process('gio_probes.d') gio_dtrace_hdr = dtrace_hdr_gen.process('gio_probes.d') --- meson.build.orig 2026-02-11 12:01:24 +++ meson.build 2026-02-11 12:03:17 @@ -1021,15 +1021,18 @@ endif # Mac OS X Cocoa support - glib_have_cocoa = objcc.compiles('''#include - #ifdef GNUSTEP_BASE_VERSION - #error "Detected GNUstep, not Cocoa" - #endif''', - name : 'Mac OS X Cocoa support') + appinfo_backend = get_option('appinfo_backend') + if appinfo_backend == 'native' + glib_have_cocoa = objcc.compiles('''#include + #ifdef GNUSTEP_BASE_VERSION + #error "Detected GNUstep, not Cocoa" + #endif''', + name : 'Mac OS X Cocoa support') - if glib_have_cocoa - glib_conf.set('HAVE_COCOA', true) - osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit'] + if glib_have_cocoa + glib_conf.set('HAVE_COCOA', true) + osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit'] + endif endif endif