direnv: switch to buildGoModule (#87932)

This commit is contained in:
zowoq 2020-05-16 20:10:39 +10:00 committed by GitHub
parent d028c74c3c
commit 3871cee01c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,9 +1,10 @@
{ stdenv, fetchFromGitHub, buildGoPackage, bash }:
{ stdenv, fetchFromGitHub, buildGoModule, bash }:
buildGoPackage rec {
buildGoModule rec {
pname = "direnv";
version = "2.21.3";
goPackagePath = "github.com/direnv/direnv";
vendorSha256 = null;
src = fetchFromGitHub {
owner = "direnv";
@ -12,17 +13,12 @@ buildGoPackage rec {
sha256 = "1adi6ld9g4zgz0f6q0kkzrywclqrmikyp7yh22zm9lfdvd5hs8wp";
};
postConfigure = ''
cd $NIX_BUILD_TOP/go/src/$goPackagePath
'';
# we have no bash at the moment for windows
makeFlags = stdenv.lib.optional (!stdenv.hostPlatform.isWindows) [
"BASH_PATH=${bash}/bin/bash"
];
installPhase = ''
mkdir -p $out
make install DESTDIR=$out
mkdir -p $out/share/fish/vendor_conf.d
echo "eval ($out/bin/direnv hook fish)" > $out/share/fish/vendor_conf.d/direnv.fish