buildGoPackage: Only install files from the goPackagePath

This commit is contained in:
William A. Kennington III 2015-05-20 02:34:00 -07:00
parent 9a159fc2bc
commit f247481b5d

View file

@ -113,12 +113,12 @@ go.stdenv.mkDerivation (
mkdir -p $out
if [ -z "$dontInstallSrc" ]; then
local dir
for d in pkg src; do
mkdir -p $out/share/go
dir="$NIX_BUILD_TOP/go/$d"
[ -e "$dir" ] && cp -r $dir $out/share/go
done
(cd "$NIX_BUILD_TOP/go"
find . -type f | while read f; do
echo "$f" | grep -q '^./\(src\|pkg/[^/]*\)/${goPackagePath}' || continue
mkdir -p "$(dirname "$out/share/go/$f")"
cp $NIX_BUILD_TOP/go/$f $out/share/go/$f
done)
fi
dir="$NIX_BUILD_TOP/go/bin"