2022-05-26 09:11:34 +00:00
|
|
|
{ buildGoPackage
|
2022-05-19 15:50:41 +00:00
|
|
|
# object with source attributes
|
|
|
|
, meta, source}:
|
|
|
|
|
2022-05-26 09:11:34 +00:00
|
|
|
buildGoPackage {
|
2022-05-19 15:50:41 +00:00
|
|
|
pname = source.repo;
|
|
|
|
version = "${source.cleanVersion}-${source.shortRev}";
|
|
|
|
|
|
|
|
inherit meta;
|
|
|
|
inherit (source) src goPackagePath;
|
|
|
|
|
|
|
|
phases = ["unpackPhase" "configurePhase" "buildPhase"];
|
|
|
|
|
2024-04-26 12:34:04 +00:00
|
|
|
# https://pkg.go.dev/net#hdr-Name_Resolution
|
|
|
|
# https://github.com/status-im/status-mobile/issues/19736
|
|
|
|
# https://github.com/status-im/status-mobile/issues/19581
|
|
|
|
# TODO: try removing when go is upgraded to 1.22
|
|
|
|
GODEBUG = "netdns=cgo+2";
|
|
|
|
|
2022-05-19 15:50:41 +00:00
|
|
|
preBuild = ''
|
|
|
|
pushd go/src/$goPackagePath
|
|
|
|
go run cmd/library/*.go > $NIX_BUILD_TOP/main.go
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Build the Go library
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2022-11-08 13:17:38 +00:00
|
|
|
go build \
|
|
|
|
-buildmode='c-archive' \
|
2023-09-20 08:45:32 +00:00
|
|
|
-tags='gowaku_skip_migrations gowaku_no_rln' \
|
2022-11-08 13:17:38 +00:00
|
|
|
-o "$out/libstatus.a" \
|
|
|
|
$NIX_BUILD_TOP/main.go
|
2022-05-19 15:50:41 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
}
|