Fix cross-compilation for fwupd (#351182)

This commit is contained in:
Colin 2024-11-27 04:09:47 +00:00 committed by GitHub
commit 27dbbeec4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 53 additions and 24 deletions

View File

@ -0,0 +1,26 @@
# 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}" ];
}

View File

@ -1,6 +1,7 @@
# 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
meson
ninja
gi-docgen
pkg-config
gobject-introspection
gettext
shared-mime-info
valgrind
gnutls
protobufc # for protoc
python
wrapGAppsNoGuiHook
vala
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
pkg-config
gettext
shared-mime-info
valgrind
protobufc # for protoc
wrapGAppsNoGuiHook
vala
gobject-introspection
gi-docgen
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
buildInputs =
[
gnutls
polkit
libxmlb
gusb