diff --git a/pkgs/by-name/fw/fwupd/build-time-python.nix b/pkgs/by-name/fw/fwupd/build-time-python.nix new file mode 100644 index 000000000000..5599e894e3e6 --- /dev/null +++ b/pkgs/by-name/fw/fwupd/build-time-python.nix @@ -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}" ]; + } diff --git a/pkgs/by-name/fw/fwupd/package.nix b/pkgs/by-name/fw/fwupd/package.nix index 72edb331e2b2..d635400aabc8 100644 --- a/pkgs/by-name/fw/fwupd/package.nix +++ b/pkgs/by-name/fw/fwupd/package.nix @@ -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 @@ -170,30 +164,39 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - 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