2022-06-02 14:48:35 +02:00
|
|
|
{ unzip
|
2024-02-07 10:09:30 +01:00
|
|
|
, gqlgenVersion ? "0.17.42"
|
2022-06-02 14:48:35 +02:00
|
|
|
}:
|
2022-05-11 22:07:34 +02:00
|
|
|
{
|
|
|
|
overrideModAttrs = (_: {
|
2023-07-11 20:16:30 +02:00
|
|
|
# No need to workaround -trimpath: it's not used in goModules,
|
2022-05-11 22:07:34 +02:00
|
|
|
# but do download `go generate`'s dependencies nonetheless.
|
|
|
|
preBuild = ''
|
|
|
|
go generate ./loaders
|
|
|
|
go generate ./graph
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2022-06-02 13:44:52 +02:00
|
|
|
# Workaround this error:
|
2022-05-11 22:07:34 +02:00
|
|
|
# go: git.sr.ht/~emersion/go-emailthreads@v0.0.0-20220412093310-4fd792e343ba: module lookup disabled by GOPROXY=off
|
|
|
|
# tidy failed: go mod tidy failed: exit status 1
|
|
|
|
# graph/generate.go:10: running "go": exit status 1
|
|
|
|
proxyVendor = true;
|
|
|
|
|
2022-06-02 13:59:39 +02:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
2022-05-11 22:07:34 +02:00
|
|
|
# Workaround -trimpath in the package derivation:
|
|
|
|
# https://github.com/99designs/gqlgen/issues/1537
|
|
|
|
# This is to give `go generate ./graph` access to gqlgen's *.gotpl files
|
|
|
|
# If it fails, the gqlgenVersion may have to be updated.
|
2022-06-02 14:48:35 +02:00
|
|
|
preBuild = ''
|
2022-06-02 13:59:39 +02:00
|
|
|
unzip ''${GOPROXY#"file://"}/github.com/99designs/gqlgen/@v/v${gqlgenVersion}.zip
|
2022-05-11 22:07:34 +02:00
|
|
|
go generate ./loaders
|
|
|
|
go generate ./graph
|
|
|
|
rm -rf github.com
|
|
|
|
'';
|
|
|
|
}
|