netlify-cli: fix build

This commit uses the ESBUILD_BINARY_PATH env variable of esbuild to
supply a Nix managed esbuild binary. Otherwise the postInstall script
would try to make a network request.

See below links for more info:

https://github.com/evanw/esbuild/pull/597/files
https://docs.netlify.com/configure-builds/file-based-configuration/#functions
This commit is contained in:
Florian Beeres 2021-05-11 00:17:44 +02:00 committed by Jonathan Ringer
parent 0899b830f8
commit 3eac120c3d

View file

@ -1,4 +1,4 @@
{ pkgs, nodejs, stdenv }:
{ pkgs, nodejs, stdenv, fetchFromGitHub }:
let
since = (version: pkgs.lib.versionAtLeast nodejs.version version);
@ -209,6 +209,26 @@ let
'';
};
netlify-cli =
let
esbuild = pkgs.esbuild.overrideAttrs (old: rec {
version = "0.11.14";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
sha256 = "sha256-N7WNam0zF1t++nLVhuxXSDGV/JaFtlFhufp+etinvmM=";
};
});
in
super.netlify-cli.override {
preRebuild = ''
export ESBUILD_BINARY_PATH="${esbuild}/bin/esbuild"
'';
};
ssb-server = super.ssb-server.override {
buildInputs = [ pkgs.automake pkgs.autoconf self.node-gyp-build ];
meta.broken = since "10";