From d4b269d7e5a041d660a370af34f150945f43e123 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Tue, 7 Jan 2025 13:27:28 +0530 Subject: [PATCH] nix: hack fix for missing git and version script --- nix/status-go/mobile/build.nix | 25 +++++++++++++++++-------- status-go-version.json | 6 +++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/nix/status-go/mobile/build.nix b/nix/status-go/mobile/build.nix index 663c9e4942d..ab733bf3a34 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,21 @@ 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 - ''; + gitRoot= "go/src/${goPackagePath}"; + + 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}" + + echo 'Generate static files' + pushd ${gitRoot} + make generate SHELL=$SHELL GO111MODULE=on GO_GENERATE_CMD='go generate' + popd + ''; buildPhase = '' runHook preBuild diff --git a/status-go-version.json b/status-go-version.json index 244c1d7e56f..d39f630a78e 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v9.2.0", - "commit-sha1": "41743c6ca0bb0a1ff4510bfa3575948d477e6284", - "src-sha256": "1awd04bsxkglbgd0nk5mdz2sm17pxkcj47hfslczsppww7yhmc9n" + "version": "fix-path-to-version-sh", + "commit-sha1": "bbeb7078d4f753f9a1bf05feb2b2fea73d9c1a9e", + "src-sha256": "0bck8i63f5pys2lxzgwvgfqjhf475ihsvbv01807l5izvwk94v26" }