From a4956ab68638bc81c7ab011c02538c35a9cc19b5 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 2 May 2025 05:20:16 +0000 Subject: [PATCH] bamf: fix cross compilation --- pkgs/by-name/ba/bamf/package.nix | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ba/bamf/package.nix b/pkgs/by-name/ba/bamf/package.nix index f19d19ce426c..94276bfa2565 100644 --- a/pkgs/by-name/ba/bamf/package.nix +++ b/pkgs/by-name/ba/bamf/package.nix @@ -19,17 +19,21 @@ dbus, python3, wrapGAppsHook3, + withDocs ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, }: stdenv.mkDerivation rec { pname = "bamf"; version = "0.5.6"; - outputs = [ - "out" - "dev" - "devdoc" - ]; + outputs = + [ + "out" + "dev" + ] + ++ lib.optionals withDocs [ + "devdoc" + ]; src = fetchgit { url = "https://git.launchpad.net/~unity-team/bamf"; @@ -37,14 +41,18 @@ stdenv.mkDerivation rec { sha256 = "7U+2GcuDjPU8quZjkd8bLADGlG++tl6wSo0mUQkjAXQ="; }; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ - (python3.withPackages (ps: with ps; [ lxml ])) # Tests + (python3.pythonOnBuildForHost.withPackages (ps: with ps; [ lxml ])) # Tests autoreconfHook dbus docbook_xsl gnome-common gobject-introspection - gtk-doc + gtk-doc # required for autoreconfHook, even when `withDocs = false` pkg-config vala which @@ -66,10 +74,13 @@ stdenv.mkDerivation rec { --replace '/usr/lib/systemd/user' '@prefix@/lib/systemd/user' ''; - configureFlags = [ - "--enable-gtk-doc" - "--enable-headless-tests" - ]; + configureFlags = + [ + "--enable-headless-tests" + ] + ++ lib.optionals withDocs [ + "--enable-gtk-doc" + ]; # Fix paths makeFlags = [ @@ -79,6 +90,7 @@ stdenv.mkDerivation rec { # TODO: Requires /etc/machine-id doCheck = false; + strictDeps = true; # Ignore deprecation errors env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";