Merge pull request #54007 from jtojnar/darwin-gsettings
Darwin GSettings support
This commit is contained in:
commit
ef14a225bb
@ -8,6 +8,7 @@
|
|||||||
, doCheck ? stdenv.config.doCheckByDefault or false
|
, doCheck ? stdenv.config.doCheckByDefault or false
|
||||||
, coreutils, dbus, libxml2, tzdata
|
, coreutils, dbus, libxml2, tzdata
|
||||||
, desktop-file-utils, shared-mime-info
|
, desktop-file-utils, shared-mime-info
|
||||||
|
, darwin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -44,6 +45,7 @@ let
|
|||||||
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
|
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ];
|
||||||
version = "2.58.2";
|
version = "2.58.2";
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -83,7 +85,12 @@ stdenv.mkDerivation rec {
|
|||||||
] ++ optionals stdenv.isLinux [
|
] ++ optionals stdenv.isLinux [
|
||||||
libselinux
|
libselinux
|
||||||
utillinuxMinimal # for libmount
|
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 = [
|
nativeBuildInputs = [
|
||||||
meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
|
meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
|
||||||
@ -121,15 +128,17 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $bin/bin
|
mkdir -p $bin/bin
|
||||||
for app in gapplication gdbus gio gsettings; do
|
for app in ${concatStringsSep " " binPrograms}; do
|
||||||
mv "$dev/bin/$app" "$bin/bin"
|
mv "$dev/bin/$app" "$bin/bin"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
'' + optionalString (!stdenv.isDarwin) ''
|
||||||
# Add gio-launch-desktop to $out so we can refer to it from $dev
|
# Add gio-launch-desktop to $out so we can refer to it from $dev
|
||||||
mkdir $out/bin
|
mkdir $out/bin
|
||||||
mv "$dev/bin/gio-launch-desktop" "$out/bin/"
|
mv "$dev/bin/gio-launch-desktop" "$out/bin/"
|
||||||
ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
|
ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
|
||||||
|
|
||||||
|
'' + ''
|
||||||
moveToOutput "share/glib-2.0" "$dev"
|
moveToOutput "share/glib-2.0" "$dev"
|
||||||
substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$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|"
|
sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"
|
||||||
|
@ -44,6 +44,13 @@ python3Packages.buildPythonApplication rec {
|
|||||||
src = ./fix-rpath.patch;
|
src = ./fix-rpath.patch;
|
||||||
inherit (builtins) storeDir;
|
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;
|
setupHook = ./setup-hook.sh;
|
||||||
|
@ -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)
|
@ -419,7 +419,7 @@ in
|
|||||||
findXMLCatalogs = makeSetupHook { } ../build-support/setup-hooks/find-xml-catalogs.sh;
|
findXMLCatalogs = makeSetupHook { } ../build-support/setup-hooks/find-xml-catalogs.sh;
|
||||||
|
|
||||||
wrapGAppsHook = makeSetupHook {
|
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;
|
} ../build-support/setup-hooks/wrap-gapps-hook.sh;
|
||||||
|
|
||||||
separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;
|
separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user