fix elm-pages and elm-land builds
authored mostly by @domenkozar
This commit is contained in:
@@ -6,6 +6,20 @@ let
|
||||
inherit pkgs nodejs;
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
};
|
||||
ESBUILD_BINARY_PATH = lib.getExe (
|
||||
pkgs.esbuild.override {
|
||||
buildGoModule = args: pkgs.buildGoModule (args // rec {
|
||||
version = "0.20.2";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "evanw";
|
||||
repo = "esbuild";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-h/Vqwax4B4nehRP9TaYbdixAZdb1hx373dNxNHvDrtY=";
|
||||
};
|
||||
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
|
||||
});
|
||||
}
|
||||
);
|
||||
in
|
||||
with self; with elmLib; {
|
||||
inherit (nodePkgs) elm-live elm-upgrade elm-xref elm-analyse elm-git-install;
|
||||
@@ -22,6 +36,7 @@ with self; with elmLib; {
|
||||
};
|
||||
in
|
||||
patched.override (old: {
|
||||
inherit ESBUILD_BINARY_PATH;
|
||||
preRebuild = (old.preRebuild or "") + ''
|
||||
# This should not be needed (thanks to binwrap* being nooped) but for some reason it still needs to be done
|
||||
# in case of just this package
|
||||
@@ -124,6 +139,7 @@ with self; with elmLib; {
|
||||
patched = patchNpmElm nodePkgs.elm-land;
|
||||
in
|
||||
patched.override (old: {
|
||||
inherit ESBUILD_BINARY_PATH;
|
||||
meta = with lib; nodePkgs."elm-land".meta // {
|
||||
description = "Production-ready framework for building Elm applications";
|
||||
homepage = "https://elm.land/";
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
{ nodePkgs, pkgs, lib, makeWrapper }:
|
||||
|
||||
nodePkgs."elm-pages".overrideAttrs (
|
||||
let
|
||||
ESBUILD_BINARY_PATH = lib.getExe (
|
||||
pkgs.esbuild.override {
|
||||
buildGoModule = args: pkgs.buildGoModule (args // rec {
|
||||
version = "0.21.5";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "evanw";
|
||||
repo = "esbuild";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-FpvXWIlt67G8w3pBKZo/mcp57LunxDmRUaCU/Ne89B8=";
|
||||
};
|
||||
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
|
||||
});
|
||||
}
|
||||
);
|
||||
in nodePkgs."elm-pages".overrideAttrs (
|
||||
old: {
|
||||
inherit ESBUILD_BINARY_PATH;
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ makeWrapper old.nodejs.pkgs.node-gyp-build ];
|
||||
|
||||
preRebuild = ''
|
||||
sed -i 's/"esbuild": "0\.19\.12"/"esbuild": "0.21.5"/' package.json
|
||||
'';
|
||||
|
||||
# can't use `patches = [ <patch_file> ]` with a nodePkgs derivation;
|
||||
# need to patch in one of the build phases instead.
|
||||
# see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem
|
||||
|
||||
@@ -10,3 +10,5 @@ $(nix-build $ROOT -A nodePackages.node2nix --no-out-link)/bin/node2nix \
|
||||
-o node-packages.nix \
|
||||
-c node-composition.nix \
|
||||
--no-copy-node-env -e ../../../../node-packages/node-env.nix
|
||||
# well, elm-pages requires two different version of esbuild so we twist it's wrist to only use one
|
||||
sed -i 's/sources."esbuild-0.19.12"/sources."esbuild-0.21.5"/' node-packages.nix
|
||||
|
||||
@@ -8,7 +8,7 @@ let
|
||||
nodeEnv = import ../../../../node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.hostPlatform.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
|
||||
+2022
-2151
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user