3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #54007 from jtojnar/darwin-gsettings

Darwin GSettings support
This commit is contained in:
Jan Tojnar 2019-01-20 13:53:47 +01:00 committed by GitHub
commit ef14a225bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 3 deletions

View file

@ -8,6 +8,7 @@
, doCheck ? stdenv.config.doCheckByDefault or false
, coreutils, dbus, libxml2, tzdata
, desktop-file-utils, shared-mime-info
, darwin
}:
with stdenv.lib;
@ -44,6 +45,7 @@ let
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
'';
binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ];
version = "2.58.2";
in
@ -83,7 +85,12 @@ stdenv.mkDerivation rec {
] ++ optionals stdenv.isLinux [
libselinux
utillinuxMinimal # for libmount
];
] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
AppKit Carbon Cocoa CoreFoundation CoreServices Foundation
# Needed for CFURLCreateFromFSRef, etc. which have deen deprecated
# since 10.9 and are not part of swift-corelibs CoreFoundation.
darwin.cf-private
]);
nativeBuildInputs = [
meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
@ -121,15 +128,17 @@ stdenv.mkDerivation rec {
postInstall = ''
mkdir -p $bin/bin
for app in gapplication gdbus gio gsettings; do
for app in ${concatStringsSep " " binPrograms}; do
mv "$dev/bin/$app" "$bin/bin"
done
'' + optionalString (!stdenv.isDarwin) ''
# Add gio-launch-desktop to $out so we can refer to it from $dev
mkdir $out/bin
mv "$dev/bin/gio-launch-desktop" "$out/bin/"
ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
'' + ''
moveToOutput "share/glib-2.0" "$dev"
substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev"
sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"

View file

@ -44,6 +44,13 @@ python3Packages.buildPythonApplication rec {
src = ./fix-rpath.patch;
inherit (builtins) storeDir;
})
] ++ lib.optionals stdenv.isDarwin [
# We use custom Clang, which makes Meson think *not Apple*, while still
# relying on system linker. When it detects standard Clang, Meson will
# pass it `-Wl,-O1` flag but optimizations are not recognized by
# Mac linker.
# https://github.com/mesonbuild/meson/issues/4784
./fix-objc-linking.patch
];
setupHook = ./setup-hook.sh;

View file

@ -0,0 +1,20 @@
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -795,7 +795,7 @@
compiler_type = self.get_gnu_compiler_type(defines)
version = self.get_gnu_version_from_defines(defines)
return GnuObjCCompiler(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines)
- if out.startswith('Apple LLVM'):
+ if out.startswith('Apple LLVM') or mesonlib.for_darwin(want_cross, self):
return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, is_cross, exe_wrap)
if out.startswith('clang'):
return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_STANDARD, is_cross, exe_wrap)
@@ -822,7 +822,7 @@
compiler_type = self.get_gnu_compiler_type(defines)
version = self.get_gnu_version_from_defines(defines)
return GnuObjCPPCompiler(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines)
- if out.startswith('Apple LLVM'):
+ if out.startswith('Apple LLVM') or mesonlib.for_darwin(want_cross, self):
return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, is_cross, exe_wrap)
if out.startswith('clang'):
return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_STANDARD, is_cross, exe_wrap)

View file

@ -419,7 +419,7 @@ in
findXMLCatalogs = makeSetupHook { } ../build-support/setup-hooks/find-xml-catalogs.sh;
wrapGAppsHook = makeSetupHook {
deps = [ gnome3.dconf.lib gnome3.gtk librsvg makeWrapper ];
deps = lib.optional (!stdenv.isDarwin) gnome3.dconf.lib ++ [ gtk3 librsvg makeWrapper ];
} ../build-support/setup-hooks/wrap-gapps-hook.sh;
separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;