tvl-depot/nix/buildBazelPackageNG/bazelRulesNodeJS5Hook/default.nix
Aspen Smith 756539a596 chore(3p/sources): Bump channels & overlays (2024-07-28)
* Treewide: re-run depotfmt

* //third_party/nixpkgs:html5validator: build with Python 3.11,
  dependency openstackdocstheme doesn't support 3.12

* //users/sterni/machines/ingeborg: adapt to poorly handled fcgiwrap
  module API change: https://github.com/NixOS/nixpkgs/pull/318599

* //tvix/*-go: regenerate protobuf files

* //third_party/nixpkgs:treefmt: Remove patch for merged pull request

* //users/flokli/ipu6-softisp: rebase, drop upstreamed kernel patches

Change-Id: Ie4e0df007c287e8cd6207683a9a25838aa5bd39a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11971
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-08-01 10:06:33 +00:00

55 lines
1.1 KiB
Nix

{ stdenvNoCC
, lib
, makeSetupHook
, fetchFromGitHub
, coreutils
, gnugrep
, nodejs
, yarn
, git
, cacert
}:
let
rulesNodeJS = stdenvNoCC.mkDerivation rec {
pname = "bazelbuild-rules_nodejs";
version = "5.8.5";
src = fetchFromGitHub {
owner = "bazelbuild";
repo = "rules_nodejs";
rev = version;
hash = "sha256-6UbYRrOnS93+pK4VI016gQZv2jLCzkJn6wJ4vZNCNjY=";
};
dontBuild = true;
postPatch = ''
shopt -s globstar
for i in **/*.bzl **/*.sh **/*.cjs; do
substituteInPlace "$i" \
--replace-quiet '#!/usr/bin/env bash' '#!${stdenvNoCC.shell}' \
--replace-quiet '#!/bin/bash' '#!${stdenvNoCC.shell}'
done
sed -i '/^#!/a export PATH=${lib.makeBinPath [ coreutils gnugrep ]}:$PATH' internal/node/launcher.sh
'';
installPhase = ''
cp -R . $out
'';
};
in
makeSetupHook
{
name = "bazelbuild-rules_nodejs-5-hook";
propagatedBuildInputs = [
nodejs
yarn
git
cacert
];
substitutions = {
inherit nodejs yarn cacert rulesNodeJS;
local_node = ./local_node;
local_yarn = ./local_yarn;
};
} ./setup-hook.sh