Merge pull request #275732 from uninsane/pr-dconf-ed-cross

dconf: enable cross compilation
This commit is contained in:
Rick van Schijndel 2024-02-13 16:11:07 +01:00 committed by GitHub
commit e4a5140341
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
{ lib, stdenv
, fetchurl
, meson
, mesonEmulatorHook
, ninja
, python3
, vala
@ -13,16 +14,15 @@
, gtk-doc
, docbook-xsl-nons
, docbook_xml_dtd_42
, withDocs ? true
}:
let
isCross = (stdenv.hostPlatform != stdenv.buildPlatform);
in
stdenv.mkDerivation rec {
pname = "dconf";
version = "0.40.0";
outputs = [ "out" "lib" "dev" ]
++ lib.optional (!isCross) "devdoc";
++ lib.optional withDocs "devdoc";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
@ -38,19 +38,23 @@ stdenv.mkDerivation rec {
glib
docbook-xsl-nons
docbook_xml_dtd_42
] ++ lib.optional (!isCross) gtk-doc;
gtk-doc
] ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook # gtkdoc invokes the host binary to produce documentation
];
buildInputs = [
glib
bash-completion
dbus
] ++ lib.optional (!isCross) vala;
# Vala cross compilation is broken. For now, build dconf without vapi when cross-compiling.
vala
];
mesonFlags = [
"--sysconfdir=/etc"
"-Dgtk_doc=${lib.boolToString (!isCross)}" # gtk-doc does do some gobject introspection, which doesn't yet cross-compile.
] ++ lib.optional isCross "-Dvapi=false";
"-Dgtk_doc=${lib.boolToString withDocs}"
];
nativeCheckInputs = [
dbus # for dbus-daemon