@@ -8,6 +8,7 @@
88, doCheck ? stdenv.config.doCheckByDefault or false
99, coreutils, dbus, libxml2, tzdata
1010, desktop-file-utils, shared-mime-info
11+, darwin
1112}:
1213
1314with stdenv.lib;
@@ -44,6 +45,7 @@ let
4445 ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
4546 '';
4647
48+ binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ];
4749 version = "2.58.2";
4850in
4951
@@ -83,7 +85,12 @@ stdenv.mkDerivation rec {
8385 ] ++ optionals stdenv.isLinux [
8486 libselinux
8587 utillinuxMinimal # for libmount
86− ];
88+ ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
89+ AppKit Carbon Cocoa CoreFoundation CoreServices Foundation
90+ # Needed for CFURLCreateFromFSRef, etc. which have deen deprecated
91+ # since 10.9 and are not part of swift-corelibs CoreFoundation.
92+ darwin.cf-private
93+ ]);
8794
8895 nativeBuildInputs = [
8996 meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
@@ -121,15 +128,17 @@ stdenv.mkDerivation rec {
121128
122129 postInstall = ''
123130 mkdir -p $bin/bin
124− for app in gapplication gdbus gio gsettings; do
131+ for app in ${concatStringsSep " " binPrograms}; do
125132 mv "$dev/bin/$app" "$bin/bin"
126133 done
127134
135+ '' + optionalString (!stdenv.isDarwin) ''
128136 # Add gio-launch-desktop to $out so we can refer to it from $dev
129137 mkdir $out/bin
130138 mv "$dev/bin/gio-launch-desktop" "$out/bin/"
131139 ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
132140
141+ '' + ''
133142 moveToOutput "share/glib-2.0" "$dev"
134143 substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev"
135144 sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"