go-modules: Fix the application of reference removal on packages like mongo-tools

This commit is contained in:
William A. Kennington III 2015-08-27 01:00:25 -07:00
parent 2c4186b045
commit d0880a27dd

View File

@ -1,6 +1,9 @@
{ go, govers, lib }:
{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}
{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? ""
# We want parallel builds by default
, enableParallelBuilding ? true
# Disabled flag
, disabled ? false
@ -156,13 +159,16 @@ go.stdenv.mkDerivation (
dir="$NIX_BUILD_TOP/go/bin"
[ -e "$dir" ] && cp -r $dir $out
runHook postInstall
'';
preFixup = preFixup + ''
while read file; do
cat $file ${removeExpr removeReferences} > $file.tmp
mv $file.tmp $file
chmod +x $file
done < <(find $out/bin -type f 2>/dev/null)
runHook postInstall
'';
disallowedReferences = lib.optional (!allowGoReference) go
@ -170,6 +176,8 @@ go.stdenv.mkDerivation (
passthru = passthru // lib.optionalAttrs (goPackageAliases != []) { inherit goPackageAliases; };
enableParallelBuilding = enableParallelBuilding;
meta = {
# Add default meta information
platforms = lib.platforms.all;