Merge branch 'update-macos-min' into 'main'

Raise minimum supported macOS version to 10.13 (High Sierra)

Closes #3441

See merge request GNOME/glib!4405
This commit is contained in:
Philip Withnall 2024-11-21 11:13:04 +00:00
commit 2b155f86dd
6 changed files with 13 additions and 49 deletions

View File

@ -13,13 +13,9 @@ support. The list will be periodically updated for the development branch,
with versions typically being updated as they lapse from receiving support from
their vendor.
* macOS: minimum version OS X 10.7 (we
[dont support universal binaries](https://bugzilla.gnome.org/show_bug.cgi?id=780238);
some features (like notification support)
[require OS X 10.9](https://bugzilla.gnome.org/show_bug.cgi?id=747146)
* Note that older versions of macOS than whats currently officially
supported by Apple are supported by GLib on a best-effort basis due to
still having significant user bases
* macOS: minimum version macOS 11.
* [No support for universal binaries ](https://bugzilla.gnome.org/show_bug.cgi?id=780238);
* macOS 10.13 support is maintained on a best-effort basis.
* Windows:
[minimum version is Windows 8](https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1970),
minimum build chain is Visual Studio 2012

View File

@ -1093,11 +1093,8 @@ extern GType g_proxy_resolver_portal_get_type (void);
extern GType g_network_monitor_portal_get_type (void);
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
extern GType g_cocoa_notification_backend_get_type (void);
#endif
#ifdef HAVE_COCOA
extern GType g_cocoa_notification_backend_get_type (void);
extern GType g_osx_network_monitor_get_type (void);
#endif
@ -1352,6 +1349,7 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_registry_settings_backend_get_type ());
#endif
#ifdef HAVE_COCOA
g_type_ensure (g_cocoa_notification_backend_get_type ());
g_type_ensure (g_nextstep_settings_backend_get_type ());
g_type_ensure (g_osx_app_info_get_type ());
g_type_ensure (g_osx_network_monitor_get_type ());
@ -1368,9 +1366,6 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_power_profile_monitor_portal_get_type ());
g_type_ensure (g_proxy_resolver_portal_get_type ());
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
g_type_ensure (g_cocoa_notification_backend_get_type ());
#endif
#ifdef G_OS_WIN32
g_type_ensure (g_win32_notification_backend_get_type ());
g_type_ensure (_g_winhttp_vfs_get_type ());

View File

@ -345,12 +345,7 @@ g_nextstep_settings_backend_get_g_variant (id object,
g_variant_builder_init_static (&builder, type);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
for(key in object)
#else
NSEnumerator *enumerator = [object objectEnumerator];
while((key = [enumerator nextObject]))
#endif
{
GVariant *name;
id value;
@ -386,12 +381,7 @@ g_nextstep_settings_backend_get_g_variant (id object,
value_type = g_variant_type_element (type);
g_variant_builder_init_static (&builder, type);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
for(value in object)
#else
NSEnumerator *enumerator = [object objectEnumerator];
while((value = [enumerator nextObject]))
#endif
{
GVariant *variant = g_nextstep_settings_backend_get_g_variant (value, value_type);

View File

@ -314,7 +314,6 @@ get_bundle_for_id (CFStringRef bundle_id)
CFURLRef app_url;
NSBundle *bundle;
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
CFArrayRef urls = LSCopyApplicationURLsForBundleIdentifier (bundle_id, NULL);
if (urls)
{
@ -326,9 +325,6 @@ get_bundle_for_id (CFStringRef bundle_id)
CFRelease (urls);
}
else
#else
if (LSFindApplicationForInfo (kLSUnknownCreator, bundle_id, NULL, NULL, &app_url) == kLSApplicationNotFoundErr)
#endif
{
#ifdef G_ENABLE_DEBUG /* This can fail often, no reason to alloc strings */
gchar *id_str = create_cstr_from_cfstring (bundle_id);
@ -744,11 +740,7 @@ g_app_info_get_default_for_type_impl (const char *content_type,
gchar *mime_type;
CFStringRef type;
NSBundle *bundle;
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
CFURLRef bundle_id;
#else
CFStringRef bundle_id;
#endif
mime_type = g_content_type_get_mime_type (content_type);
if (g_str_has_prefix (mime_type, "x-scheme-handler/"))
@ -763,11 +755,7 @@ g_app_info_get_default_for_type_impl (const char *content_type,
type = create_cfstring_from_cstr (content_type);
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
bundle_id = LSCopyDefaultApplicationURLForContentType (type, kLSRolesAll, NULL);
#else
bundle_id = LSCopyDefaultRoleHandlerForContentType (type, kLSRolesAll);
#endif
CFRelease (type);
if (!bundle_id)
@ -776,11 +764,7 @@ g_app_info_get_default_for_type_impl (const char *content_type,
return NULL;
}
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
bundle = get_bundle_for_url (bundle_id);
#else
bundle = get_bundle_for_id (bundle_id);
#endif
CFRelease (bundle_id);
if (!bundle)

View File

@ -396,9 +396,7 @@ if host_system != 'windows'
unix_sources += files('gosxappinfo.m')
framework_dep = dependency('appleframeworks', modules : ['Foundation', 'CoreFoundation', 'AppKit'])
platform_deps += [framework_dep]
if glib_have_os_x_9_or_later
unix_sources += files('gcocoanotificationbackend.m')
endif
unix_sources += files('gcocoanotificationbackend.m')
unix_sources += files('gosxnetworkmonitor.c')
application_headers += files('gosxappinfo.h')
else

View File

@ -965,12 +965,18 @@ if host_system == 'linux'
endif
osx_ldflags = []
glib_have_os_x_9_or_later = false
glib_have_carbon = false
glib_have_cocoa = false
if host_system == 'darwin'
add_languages('objc', native: false, required: true)
objcc = meson.get_compiler('objc')
if not objcc.compiles('''#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
#error message "GLib requires macOS 10.13 or later."
#endif''',
name : 'macOS 10.13 or later')
error('GLib requires macOS 10.13 or later.')
endif
add_project_arguments(objcc.get_supported_arguments(warning_objc_args), language: 'objc')
@ -981,11 +987,6 @@ if host_system == 'darwin'
if glib_have_carbon
glib_conf.set('HAVE_CARBON', true)
glib_have_os_x_9_or_later = objcc.compiles('''#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
#error Compiling for minimum OS X version before 10.9
#endif''',
name : 'OS X 9 or later')
endif
# Mac OS X Cocoa support