lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

as requested: - moved function into strings.nix - renamed function from makePerl5Lib - removed duplicates entries in the resulting value - rewrote the function from scratch after learning a few things (much cleaner now)

authored by

Aaron Andersen and committed by
Profpatsch
74d44617 d5003f5f

+17 -9
+1 -1
lib/default.nix
··· 80 80 inherit (strings) concatStrings concatMapStrings concatImapStrings 81 81 intersperse concatStringsSep concatMapStringsSep 82 82 concatImapStringsSep makeSearchPath makeSearchPathOutput 83 - makeLibraryPath makeBinPath makePerlPath optionalString 83 + makeLibraryPath makeBinPath makePerlPath makeFullPerlPath optionalString 84 84 hasPrefix hasSuffix stringToCharacters stringAsChars escape 85 85 escapeShellArg escapeShellArgs replaceChars lowerChars 86 86 upperChars toLower toUpper addContextFrom splitString
+16
lib/strings.nix
··· 126 126 */ 127 127 makePerlPath = makeSearchPathOutput "lib" "lib/perl5/site_perl"; 128 128 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 + 129 145 /* Depending on the boolean `cond', return either the given string 130 146 or the empty string. Useful to concatenate against a bigger string. 131 147
-8
pkgs/top-level/perl-packages.nix
··· 28 28 checkPhase = "./Build test"; 29 29 }); 30 30 31 - # Helper function to make a PERL5LIB environment variable for a list of perlPackages and all associated runtime dependencies 32 - makePerl5Lib = deps: 33 - with stdenv; 34 - lib.concatStringsSep ":" [ 35 - (lib.makePerlPath deps) 36 - (lib.concatStringsSep ":" (map (dep: dep + "/lib/perl5/site_perl") (builtins.filter (dep: dep != null) (lib.flatten (map (dep: lib.getOutput "propagatedBuildInputs" dep) deps))))) 37 - ] 38 - ; 39 31 40 32 ack = buildPerlPackage rec { 41 33 name = "ack-2.24";