buildEnv: add new parameters: extraPrefix and buildInputs

+10 -3
+2 -1
pkgs/build-support/buildenv/builder.pl
··· 142 143 144 # Create the symlinks. 145 my $nrLinks = 0; 146 foreach my $relName (sort keys %symlinks) { 147 my ($target, $priority) = @{$symlinks{$relName}}; 148 - my $abs = "$out/$relName"; 149 next unless isInPathsToLink $relName; 150 if ($target eq "") { 151 #print "creating directory $relName\n";
··· 142 143 144 # Create the symlinks. 145 + my $extraPrefix = $ENV{"extraPrefix"}; 146 my $nrLinks = 0; 147 foreach my $relName (sort keys %symlinks) { 148 my ($target, $priority) = @{$symlinks{$relName}}; 149 + my $abs = "$out" . "$extraPrefix" . "/$relName"; 150 next unless isInPathsToLink $relName; 151 if ($target eq "") { 152 #print "creating directory $relName\n";
+8 -2
pkgs/build-support/buildenv/default.nix
··· 21 # directories in the list is not symlinked. 22 pathsToLink ? ["/"] 23 24 - , # Shell command to run after building the symlink tree. 25 postBuild ? "" 26 27 , passthru ? {} 28 }: 29 30 runCommand name 31 - { inherit manifest ignoreCollisions passthru pathsToLink postBuild; 32 pkgs = builtins.toJSON (map (drv: { 33 paths = [ drv ]; # FIXME: handle multiple outputs 34 priority = drv.meta.priority or 5;
··· 21 # directories in the list is not symlinked. 22 pathsToLink ? ["/"] 23 24 + , # Root the result in directory "$out${extraPrefix}", e.g. "/share". 25 + extraPrefix ? "" 26 + 27 + , # Shell commands to run after building the symlink tree. 28 postBuild ? "" 29 30 + , # Additional inputs. Handy e.g. if using makeWrapper in `postBuild`. 31 + buildInputs ? [] 32 + 33 , passthru ? {} 34 }: 35 36 runCommand name 37 + { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs; 38 pkgs = builtins.toJSON (map (drv: { 39 paths = [ drv ]; # FIXME: handle multiple outputs 40 priority = drv.meta.priority or 5;