buildEnv: add new parameters: extraPrefix and buildInputs

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