From 9088e445fe3ae2920318805b40c0909ce33ecf53 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Wed, 25 Nov 2020 13:56:19 +0900 Subject: [PATCH] glib: fix build It's not clear why this is required, but glib includes CoreServices headers and calls CoreServices functions, so it's reasonable to link against the framework explicitly. --- pkgs/development/libraries/glib/default.nix | 1 + .../libraries/glib/link-with-coreservices.patch | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 pkgs/development/libraries/glib/link-with-coreservices.patch diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index adaca105df0..e15f5975786 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -54,6 +54,7 @@ stdenv.mkDerivation rec { patches = optionals stdenv.isDarwin [ ./darwin-compilation.patch + ./link-with-coreservices.patch ] ++ optionals stdenv.hostPlatform.isMusl [ ./quark_init_on_demand.patch ./gobject_init_on_demand.patch diff --git a/pkgs/development/libraries/glib/link-with-coreservices.patch b/pkgs/development/libraries/glib/link-with-coreservices.patch new file mode 100644 index 00000000000..dcc0a8998cc --- /dev/null +++ b/pkgs/development/libraries/glib/link-with-coreservices.patch @@ -0,0 +1,11 @@ +--- a/meson.build.orig 2020-11-25 13:47:38.499149252 +0900 ++++ b/meson.build 2020-11-25 13:48:47.098444800 +0900 +@@ -742,7 +742,7 @@ + + if glib_have_carbon + glib_conf.set('HAVE_CARBON', true) +- osx_ldflags += '-Wl,-framework,Carbon' ++ osx_ldflags += ['-Wl,-framework,Carbon', '-Wl,-framework,CoreServices'] + glib_have_os_x_9_or_later = objcc.compiles('''#include + #if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 + #error Compiling for minimum OS X version before 10.9