Unverified Commit 27dbbeec authored by Colin's avatar Colin Committed by GitHub
Browse files

Fix cross-compilation for fwupd (#351182)

parents c68ee69b 7fa27c07
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
# Python environment that needs to be able to run the following:
# https://github.com/fwupd/fwupd/blob/f8b5ed554ce3d5e7a016e6e97f0a03e48e510ddb/plugins/uefi-capsule/meson.build#L73

{
  lib,
  glib,
  pango,
  python3,
  harfbuzz,
}:

let
  giTypelibPath = lib.makeSearchPathOutput "out" "lib/girepository-1.0" [
    harfbuzz
    pango
    glib
  ];
in
(python3.withPackages (p: [
  p.jinja2
  p.pygobject3
  p.setuptools
])).override
  {
    makeWrapperArgs = [ "--set GI_TYPELIB_PATH ${giTypelibPath}" ];
  }
+27 −24
Original line number Diff line number Diff line
# Updating? Keep $out/etc synchronized with passthru keys

{
  pkgsBuildBuild,
  stdenv,
  lib,
  fetchFromGitHub,
@@ -22,6 +23,7 @@
  elfutils,
  valgrind,
  meson,
  mesonEmulatorHook,
  libuuid,
  ninja,
  gnutls,
@@ -57,14 +59,6 @@
}:

let
  python = python3.withPackages (
    p: with p; [
      jinja2
      pygobject3
      setuptools
    ]
  );

  isx86 = stdenv.hostPlatform.isx86;

  # Dell isn't supported on Aarch64
@@ -165,30 +159,39 @@ stdenv.mkDerivation (finalAttrs: {
    ./efi-app-path.patch
  ];

  nativeBuildInputs = [
    # required for firmware zipping
    ensureNewerSourcesForZipFilesHook
  strictDeps = true;

  depsBuildBuild = [
    pkg-config # for finding build-time dependencies
    (pkgsBuildBuild.callPackage ./build-time-python.nix { })
  ];

  propagatedBuildInputs = [
    json-glib
  ];

  nativeBuildInputs =
    [
      ensureNewerSourcesForZipFilesHook # required for firmware zipping
      meson
      ninja
    gi-docgen
      pkg-config
    gobject-introspection
      gettext
      shared-mime-info
      valgrind
    gnutls
      protobufc # for protoc
    python
      wrapGAppsNoGuiHook
      vala
  ];

  propagatedBuildInputs = [
    json-glib
      gobject-introspection
      gi-docgen
    ]
    ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
      mesonEmulatorHook
    ];

  buildInputs =
    [
      gnutls
      polkit
      libxmlb
      gusb