syncthing: fix cross

This commit is contained in:
Yureka 2023-02-16 09:49:25 +01:00
parent 5367c31789
commit d484961ba8

View file

@ -1,4 +1,4 @@
{ buildGoModule, stdenv, lib, procps, fetchFromGitHub, nixosTests }:
{ pkgsBuildBuild, go, buildGoModule, stdenv, lib, procps, fetchFromGitHub, nixosTests }:
let
common = { stname, target, postInstall ? "" }:
@ -22,7 +22,12 @@ let
buildPhase = ''
runHook preBuild
go run build.go -no-upgrade -version v${version} build ${target}
(
export GOOS="${pkgsBuildBuild.go.GOOS}" GOARCH="${pkgsBuildBuild.go.GOARCH}" CC=$CC_FOR_BUILD
go build build.go
go generate github.com/syncthing/syncthing/lib/api/auto github.com/syncthing/syncthing/cmd/strelaypoolsrv/auto
)
./build -goos ${go.GOOS} -goarch ${go.GOARCH} -no-upgrade -version v${version} build ${target}
runHook postBuild
'';