Commit 905bcfab authored by K900's avatar K900
Browse files

grafana: fix frontend build on aarch64

I think it works on x86_64 because it fallback to the prebuilt version and they only added prebuilt ARM binaries in 2.2.0 https://github.com/parcel-bundler/watcher/commit/062bca4887f17a2f448c11a99bfc2f826eb98c3e
- @tgerbet
parent cd86fce7
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
{ lib, stdenv, buildGoModule, fetchFromGitHub, removeReferencesTo
, tzdata, wire
, yarn, nodejs, cacert
, yarn, nodejs, python3, cacert
, jq, moreutils
, nix-update-script, nixosTests
}:
@@ -74,7 +74,7 @@ buildGoModule rec {

  vendorHash = "sha256-Gf2A22d7/8xU/ld7kveqGonVKGFCArGNansPRGhfyXM=";

  nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo ];
  nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 ];

  postPatch = ''
    ${patchAwayGrafanaE2E}
@@ -121,6 +121,14 @@ buildGoModule rec {

    # Setup node_modules
    export HOME="$(mktemp -d)"

    # Help node-gyp find Node.js headers
    # (see https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#pitfalls-javascript-yarn2nix-pitfalls)
    mkdir -p $HOME/.node-gyp/${nodejs.version}
    echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
    ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
    export npm_config_nodedir=${nodejs}

    yarn config set enableTelemetry 0
    yarn config set cacheFolder $offlineCache
    yarn --immutable-cache