mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-14 10:46:21 +00:00
e4cba0f663
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
34 lines
678 B
Nix
34 lines
678 B
Nix
{ lib, stdenv, utils, buildGo117Package
|
|
, go, xcodeWrapper
|
|
# object with source attributes
|
|
, meta, source}:
|
|
|
|
let
|
|
inherit (stdenv) isDarwin;
|
|
inherit (lib) optional;
|
|
|
|
in buildGo117Package {
|
|
pname = source.repo;
|
|
version = "${source.cleanVersion}-${source.shortRev}";
|
|
|
|
inherit meta;
|
|
inherit (source) src goPackagePath;
|
|
|
|
phases = ["unpackPhase" "configurePhase" "buildPhase"];
|
|
|
|
preBuild = ''
|
|
pushd go/src/$goPackagePath
|
|
go run cmd/library/*.go > $NIX_BUILD_TOP/main.go
|
|
popd
|
|
'';
|
|
|
|
# Build the Go library
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
go build -buildmode=c-archive -o $out/libstatus.a $NIX_BUILD_TOP/main.go
|
|
|
|
runHook postBuild
|
|
'';
|
|
}
|