Skip to content

Commit

Permalink
nix: hack fix for missing git and version script
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Jan 23, 2025
1 parent 239f2ec commit 04b0faa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
25 changes: 17 additions & 8 deletions nix/status-go/mobile/build.nix
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"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"
}

0 comments on commit 04b0faa

Please sign in to comment.