nixos/tests/letsencrypt: Fix go source install

Since e95f17e272, Go packages no longer
contain the source tree, however Boulder seems to need that as it
generates a few files during build.

Ideally we would only pick the files that are needed and put it into a
separate output, but I currently don't have time for this so I'm marking
this with XXX to get back to it later.

Signed-off-by: aszlig <aszlig@nix.build>
This commit is contained in:
aszlig 2018-07-12 00:52:16 +02:00
parent 4794aa5de2
commit c21b1ede95
No known key found for this signature in database
GPG Key ID: 684089CE67EBB691

View File

@ -173,6 +173,21 @@ let
rm -r go/src/github.com/letsencrypt/boulder/vendor/github.com/miekg/pkcs11 rm -r go/src/github.com/letsencrypt/boulder/vendor/github.com/miekg/pkcs11
''; '';
# XXX: Temporarily brought back putting the source code in the output,
# since e95f17e2720e67e2eabd59d7754c814d3e27a0b2 was removing that from
# buildGoPackage.
preInstall = ''
mkdir -p $out
pushd "$NIX_BUILD_TOP/go"
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 < <(find . -type f)
popd
'';
extraSrcs = map mkGoDep [ extraSrcs = map mkGoDep [
{ goPackagePath = "github.com/miekg/pkcs11"; { goPackagePath = "github.com/miekg/pkcs11";
rev = "6dbd569b952ec150d1425722dbbe80f2c6193f83"; rev = "6dbd569b952ec150d1425722dbbe80f2c6193f83";