diff --git a/nix/status-go/mobile/build.nix b/nix/status-go/mobile/build.nix index 663c9e4942d..693825002ad 100644 --- a/nix/status-go/mobile/build.nix +++ b/nix/status-go/mobile/build.nix @@ -1,6 +1,6 @@ { callPackage, lib, buildGoPackage , androidPkgs, openjdk, gomobile, xcodeWrapper, removeReferencesTo -, go-bindata, mockgen, protobuf3_20, protoc-gen-go +, go-bindata, mockgen, protobuf3_20, protoc-gen-go, git , meta , source , platform ? "android" @@ -29,7 +29,7 @@ in buildGoPackage rec { extraSrcPaths = [ gomobile ]; nativeBuildInputs = [ - gomobile removeReferencesTo go-bindata mockgen protoc-gen-go protobuf3_20 + gomobile removeReferencesTo go-bindata mockgen protoc-gen-go protobuf3_20 git ] ++ optional isAndroid openjdk ++ optional isIOS xcodeWrapper; @@ -50,12 +50,27 @@ in buildGoPackage rec { SENTRY_CONTEXT_NAME = "status-mobile"; SENTRY_CONTEXT_VERSION = version; - preBuild = '' - echo 'Generate static files' - pushd go/src/$goPackagePath - make generate SHELL=$SHELL GO111MODULE=on GO_GENERATE_CMD='go generate' - popd - ''; + preBuild = '' + # To fix fatal: not a git repository (or any of the parent directories): .git + git init --quiet --initial-branch=main . + git config user.email "nix@builder" + git config user.name "Nix Builder" + git commit --quiet --allow-empty -m "Initial commit" + git tag -a "v${source.cleanVersion}" -m "Version ${source.cleanVersion}" + + # To fix sh: line 1: ../../_assets/scripts/version.sh: cannot execute: required file not found + mkdir -p go/src/github.com/status-im/status-go/_assets/scripts + cat > go/src/github.com/status-im/status-go/_assets/scripts/version.sh <