From ff7b216dcf3b3396b24ebd73204f6841839bdd2a Mon Sep 17 00:00:00 2001 From: Jonas Chevalier Date: Mon, 6 Jun 2022 14:35:07 +0200 Subject: [PATCH] perlPackages: add default meta.mainProgram (#176398) Because perl packages are prefixed with the perl version, it means that the `lib.getExe` heuristic will never point to the binary name. So we provide the meta.mainProgram that overrides that, using the original pname or parsed name. It's not perfect but should yield better results already. --- pkgs/development/perl-modules/generic/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index 9ff63c14e518..aa8d66f037ad 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -35,6 +35,7 @@ lib.warnIf (attrs ? name) "builtPerlPackage: `name' (\"${attrs.name}\") is depre (let defaultMeta = { homepage = "https://metacpan.org/release/${lib.getName attrs}"; # TODO: phase-out `attrs.name` + mainProgram = attrs.pname or (builtins.parseDrvName attrs.name).name; platforms = perl.meta.platforms; };