freebsd.mkDerivation: do not crash on packages not using FreeBSD src

This includes drm-kmod and drm-kmod firmware.
This commit is contained in:
Audrey Dutcher 2024-07-16 22:29:11 -07:00
parent 9d7caf75a3
commit 8e26d7ca85
2 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,9 @@ let
fetchOptions = (lib.importJSON ./versions.json).${branch};
in
mkDerivation {
# this derivation is tricky; it is not an in-tree FreeBSD build but it is meant to be built
# at the same time as the in-tree FreeBSD code, so it expects the same environment. Therefore,
# it is appropriate to use the freebsd mkDerivation.
pname = "drm-kmod";
version = branch;

View File

@ -107,7 +107,9 @@ lib.makeOverridable (
// {
patches =
(lib.optionals (attrs.autoPickPatches or true) (
freebsd-lib.filterPatches patches (attrs.extraPaths or [ ] ++ [ attrs.path ])
freebsd-lib.filterPatches patches (
attrs.extraPaths or [ ] ++ (lib.optional (attrs ? path) attrs.path)
)
))
++ attrs.patches or [ ];
}