gqlgenc: add versionCheckHook
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--- a/main.go
|
||||
+++ b/main.go
|
||||
@@ -9,7 +9,7 @@
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
-const version = "0.31.0"
|
||||
+var version string
|
||||
|
||||
var versionCmd = &cli.Command{
|
||||
Name: "version",
|
||||
@@ -2,6 +2,7 @@
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -15,10 +16,27 @@ buildGoModule rec {
|
||||
sha256 = "sha256-AGbE+R3502Igl4/HaN8yvFVJBsKQ6iVff8IEvddJLEo=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./fix-version.patch
|
||||
];
|
||||
|
||||
excludedPackages = [ "example" ];
|
||||
|
||||
vendorHash = "sha256-kBv9Kit5KdPB48V/g1OaeB0ABFd1A1I/9F5LaQDWxUE=";
|
||||
|
||||
ldflags = [
|
||||
"-X"
|
||||
"main.version=${version}"
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgramArg = "version";
|
||||
|
||||
# FAIL: TestLoadConfig_LoadSchema/correct_schema
|
||||
# panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Go tool for building GraphQL client with gqlgen";
|
||||
mainProgram = "gqlgenc";
|
||||
|
||||
Reference in New Issue
Block a user