2019-06-09 07:25:00 -07:00
|
|
|
{ writeScriptBin, stdenv, lib }:
|
|
|
|
let
|
|
|
|
# Patching binwrap by NoOp script
|
|
|
|
binwrap = writeScriptBin "binwrap" ''
|
|
|
|
#! ${stdenv.shell}
|
|
|
|
echo "binwrap called: Returning 0"
|
|
|
|
return 0
|
|
|
|
'';
|
|
|
|
binwrap-install = writeScriptBin "binwrap-install" ''
|
|
|
|
#! ${stdenv.shell}
|
|
|
|
echo "binwrap-install called: Doing nothing"
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
targets:
|
|
|
|
pkg:
|
|
|
|
pkg.override {
|
2020-03-18 12:36:36 -07:00
|
|
|
nativeBuildInputs = pkg.nativeBuildInputs ++ [ binwrap binwrap-install ];
|
2019-06-09 07:25:00 -07:00
|
|
|
|
|
|
|
# Manually install targets
|
|
|
|
# by symlinking binaries into `node_modules`
|
|
|
|
postInstall = let
|
|
|
|
binFile = module: lib.strings.removeSuffix ("-" + module.version) module.name;
|
|
|
|
in ''
|
|
|
|
${lib.concatStrings (map (module: ''
|
|
|
|
echo "linking ${binFile module}"
|
|
|
|
ln -sf ${module}/bin/${binFile module} \
|
|
|
|
node_modules/${binFile module}/bin/${binFile module}
|
|
|
|
'') targets)}
|
|
|
|
'';
|
|
|
|
}
|