terraform-providers: remove buildGoPackage

all providers are now using buildGoModule
This commit is contained in:
zowoq 2022-01-03 20:46:10 +10:00
parent 617c643edb
commit 1cd34071df

View file

@ -1,6 +1,5 @@
{ lib
, buildGoModule
, buildGoPackage
, fetchFromGitHub
, callPackage
, config
@ -11,13 +10,12 @@ let
buildWithGoModule = data:
buildGoModule {
pname = data.repo;
version = data.version;
inherit (data) vendorSha256 version;
subPackages = [ "." ];
doCheck = false;
src = fetchFromGitHub {
inherit (data) owner repo rev sha256;
};
vendorSha256 = data.vendorSha256 or null;
deleteVendor = data.deleteVendor or false;
proxyVendor = data.proxyVendor or false;
@ -27,25 +25,9 @@ let
passthru = data;
};
buildWithGoPackage = data:
buildGoPackage {
pname = data.repo;
version = data.version;
goPackagePath = "github.com/${data.owner}/${data.repo}";
subPackages = [ "." ];
doCheck = false;
src = fetchFromGitHub {
inherit (data) owner repo rev sha256;
};
# Terraform allow checking the provider versions, but this breaks
# if the versions are not provided via file paths.
postBuild = "mv $NIX_BUILD_TOP/go/bin/${data.repo}{,_v${data.version}}";
passthru = data;
};
# Our generic constructor to build new providers
mkProvider = attrs:
(if (lib.hasAttr "vendorSha256" attrs) then buildWithGoModule else buildWithGoPackage)
(if (lib.hasAttr "vendorSha256" attrs) then buildWithGoModule else throw /* added 2022/01 */ "vendorSha256 missing: please use `buildGoModule`")
attrs;
# These providers are managed with the ./update-all script