Skip to content

Commit ff7b216

Browse files
authored
perlPackages: add default meta.mainProgram (NixOS#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.
1 parent d8fad83 commit ff7b216

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pkgs/development/perl-modules/generic/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ lib.warnIf (attrs ? name) "builtPerlPackage: `name' (\"${attrs.name}\") is depre
3535
(let
3636
defaultMeta = {
3737
homepage = "https://metacpan.org/release/${lib.getName attrs}"; # TODO: phase-out `attrs.name`
38+
mainProgram = attrs.pname or (builtins.parseDrvName attrs.name).name;
3839
platforms = perl.meta.platforms;
3940
};
4041

0 commit comments

Comments
 (0)