@@ -126,6 +126,22 @@ rec {
126126 */
127127 makePerlPath = makeSearchPathOutput "lib" "lib/perl5/site_perl";
128128
129+ /* Construct a perl search path recursively including all dependencies (such as $PERL5LIB)
130+
131+ Example:
132+ pkgs = import <nixpkgs> { }
133+ makeFullPerlPath [ pkgs.perlPackages.CGI ]
134+ => "/nix/store/fddivfrdc1xql02h9q500fpnqy12c74n-perl-CGI-4.38/lib/perl5/site_perl:/nix/store/8hsvdalmsxqkjg0c5ifigpf31vc4vsy2-perl-HTML-Parser-3.72/lib/perl5/site_perl:/nix/store/zhc7wh0xl8hz3y3f71nhlw1559iyvzld-perl-HTML-Tagset-3.20/lib/perl5/site_perl"
135+ */
136+ makeFullPerlPath = deps:
137+ let
138+ recurse = dep:
139+ [ dep ] ++ dep.propagatedBuildInputs ++ (map (arg: recurse arg) dep.propagatedBuildInputs)
140+ ;
141+ in
142+ makePerlPath (lib.unique (lib.flatten (map (arg: recurse arg) deps)))
143+ ;
144+
129145 /* Depending on the boolean `cond', return either the given string
130146 or the empty string. Useful to concatenate against a bigger string.
131147