|
|
@ -1,6 +1,6 @@
|
|
|
|
# This file originates from node2nix
|
|
|
|
# This file originates from node2nix
|
|
|
|
|
|
|
|
|
|
|
|
{stdenv, nodejs, python2, utillinux, runCommand, writeTextFile}:
|
|
|
|
{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile}:
|
|
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
let
|
|
|
|
python = if nodejs ? python then nodejs.python else python2;
|
|
|
|
python = if nodejs ? python then nodejs.python else python2;
|
|
|
@ -27,7 +27,7 @@ let
|
|
|
|
buildInputs = [ nodejs ];
|
|
|
|
buildInputs = [ nodejs ];
|
|
|
|
buildPhase = ''
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
tgzFile=$(npm pack)
|
|
|
|
tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts)
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/tarballs
|
|
|
|
mkdir -p $out/tarballs
|
|
|
@ -194,26 +194,157 @@ let
|
|
|
|
mv node-* $out
|
|
|
|
mv node-* $out
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
# Builds and composes an NPM package including all its dependencies
|
|
|
|
# Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty)
|
|
|
|
buildNodePackage = { name, packageName, version, dependencies ? [], production ? true, npmFlags ? "", dontNpmInstall ? false, preRebuild ? "", ... }@args:
|
|
|
|
addIntegrityFieldsScript = writeTextFile {
|
|
|
|
|
|
|
|
name = "addintegrityfields.js";
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
|
|
|
|
stdenv.lib.makeOverridable stdenv.mkDerivation (builtins.removeAttrs args [ "dependencies" ] // {
|
|
|
|
function augmentDependencies(baseDir, dependencies) {
|
|
|
|
name = "node-${name}-${version}";
|
|
|
|
for(var dependencyName in dependencies) {
|
|
|
|
buildInputs = [ tarWrapper python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
|
|
|
|
var dependency = dependencies[dependencyName];
|
|
|
|
dontStrip = args.dontStrip or true; # Striping may fail a build for some package deployments
|
|
|
|
|
|
|
|
|
|
|
|
// Open package.json and augment metadata fields
|
|
|
|
|
|
|
|
var packageJSONDir = path.join(baseDir, "node_modules", dependencyName);
|
|
|
|
|
|
|
|
var packageJSONPath = path.join(packageJSONDir, "package.json");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored
|
|
|
|
|
|
|
|
console.log("Adding metadata fields to: "+packageJSONPath);
|
|
|
|
|
|
|
|
var packageObj = JSON.parse(fs.readFileSync(packageJSONPath));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(dependency.integrity) {
|
|
|
|
|
|
|
|
packageObj["_integrity"] = dependency.integrity;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads.
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
|
|
|
|
|
|
|
|
fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Augment transitive dependencies
|
|
|
|
|
|
|
|
if(dependency.dependencies !== undefined) {
|
|
|
|
|
|
|
|
augmentDependencies(packageJSONDir, dependency.dependencies);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(fs.existsSync("./package-lock.json")) {
|
|
|
|
|
|
|
|
var packageLock = JSON.parse(fs.readFileSync("./package-lock.json"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(packageLock.lockfileVersion !== 1) {
|
|
|
|
|
|
|
|
process.stderr.write("Sorry, I only understand lock file version 1!\n");
|
|
|
|
|
|
|
|
process.exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(packageLock.dependencies !== undefined) {
|
|
|
|
|
|
|
|
augmentDependencies(".", packageLock.dependencies);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes
|
|
|
|
|
|
|
|
reconstructPackageLock = writeTextFile {
|
|
|
|
|
|
|
|
name = "addintegrityfields.js";
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var packageObj = JSON.parse(fs.readFileSync("package.json"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var lockObj = {
|
|
|
|
|
|
|
|
name: packageObj.name,
|
|
|
|
|
|
|
|
version: packageObj.version,
|
|
|
|
|
|
|
|
lockfileVersion: 1,
|
|
|
|
|
|
|
|
requires: true,
|
|
|
|
|
|
|
|
dependencies: {}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function augmentPackageJSON(filePath, dependencies) {
|
|
|
|
|
|
|
|
var packageJSON = path.join(filePath, "package.json");
|
|
|
|
|
|
|
|
if(fs.existsSync(packageJSON)) {
|
|
|
|
|
|
|
|
var packageObj = JSON.parse(fs.readFileSync(packageJSON));
|
|
|
|
|
|
|
|
dependencies[packageObj.name] = {
|
|
|
|
|
|
|
|
version: packageObj.version,
|
|
|
|
|
|
|
|
integrity: "sha1-000000000000000000000000000=",
|
|
|
|
|
|
|
|
dependencies: {}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function processDependencies(dir, dependencies) {
|
|
|
|
|
|
|
|
if(fs.existsSync(dir)) {
|
|
|
|
|
|
|
|
var files = fs.readdirSync(dir);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
files.forEach(function(entry) {
|
|
|
|
|
|
|
|
var filePath = path.join(dir, entry);
|
|
|
|
|
|
|
|
var stats = fs.statSync(filePath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(stats.isDirectory()) {
|
|
|
|
|
|
|
|
if(entry.substr(0, 1) == "@") {
|
|
|
|
|
|
|
|
// When we encounter a namespace folder, augment all packages belonging to the scope
|
|
|
|
|
|
|
|
var pkgFiles = fs.readdirSync(filePath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pkgFiles.forEach(function(entry) {
|
|
|
|
|
|
|
|
if(stats.isDirectory()) {
|
|
|
|
|
|
|
|
var pkgFilePath = path.join(filePath, entry);
|
|
|
|
|
|
|
|
augmentPackageJSON(pkgFilePath, dependencies);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
augmentPackageJSON(filePath, dependencies);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
processDependencies("node_modules", lockObj.dependencies);
|
|
|
|
|
|
|
|
|
|
|
|
inherit dontNpmInstall preRebuild;
|
|
|
|
fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2));
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Builds and composes an NPM package including all its dependencies
|
|
|
|
|
|
|
|
buildNodePackage =
|
|
|
|
|
|
|
|
{ name
|
|
|
|
|
|
|
|
, packageName
|
|
|
|
|
|
|
|
, version
|
|
|
|
|
|
|
|
, dependencies ? []
|
|
|
|
|
|
|
|
, buildInputs ? []
|
|
|
|
|
|
|
|
, production ? true
|
|
|
|
|
|
|
|
, npmFlags ? ""
|
|
|
|
|
|
|
|
, dontNpmInstall ? false
|
|
|
|
|
|
|
|
, bypassCache ? false
|
|
|
|
|
|
|
|
, preRebuild ? ""
|
|
|
|
|
|
|
|
, dontStrip ? true
|
|
|
|
|
|
|
|
, unpackPhase ? "true"
|
|
|
|
|
|
|
|
, buildPhase ? "true"
|
|
|
|
|
|
|
|
, ... }@args:
|
|
|
|
|
|
|
|
|
|
|
|
unpackPhase = args.unpackPhase or "true";
|
|
|
|
let
|
|
|
|
|
|
|
|
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
|
|
|
|
|
|
|
|
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
|
|
|
|
name = "node-${name}-${version}";
|
|
|
|
|
|
|
|
buildInputs = [ tarWrapper python nodejs ]
|
|
|
|
|
|
|
|
++ stdenv.lib.optional (stdenv.isLinux) utillinux
|
|
|
|
|
|
|
|
++ stdenv.lib.optional (stdenv.isDarwin) libtool
|
|
|
|
|
|
|
|
++ buildInputs;
|
|
|
|
|
|
|
|
|
|
|
|
buildPhase = args.buildPhase or "true";
|
|
|
|
inherit dontStrip; # Stripping may fail a build for some package deployments
|
|
|
|
|
|
|
|
inherit dontNpmInstall preRebuild unpackPhase buildPhase;
|
|
|
|
|
|
|
|
|
|
|
|
compositionScript = composePackage args;
|
|
|
|
compositionScript = composePackage args;
|
|
|
|
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
|
|
|
|
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
|
|
|
|
|
|
|
|
|
|
|
|
passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
|
|
|
|
passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
|
|
|
|
|
|
|
|
|
|
|
|
installPhase = args.installPhase or ''
|
|
|
|
installPhase = ''
|
|
|
|
# Create and enter a root node_modules/ folder
|
|
|
|
# Create and enter a root node_modules/ folder
|
|
|
|
mkdir -p $out/lib/node_modules
|
|
|
|
mkdir -p $out/lib/node_modules
|
|
|
|
cd $out/lib/node_modules
|
|
|
|
cd $out/lib/node_modules
|
|
|
@ -242,14 +373,25 @@ let
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
cd "${packageName}"
|
|
|
|
cd "${packageName}"
|
|
|
|
runHook preRebuild
|
|
|
|
runHook preRebuild
|
|
|
|
npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
|
|
|
|
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString bypassCache ''
|
|
|
|
|
|
|
|
if [ ! -f package-lock.json ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
echo "No package-lock.json file found, reconstructing..."
|
|
|
|
|
|
|
|
node ${reconstructPackageLock}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node ${addIntegrityFieldsScript}
|
|
|
|
|
|
|
|
''}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$dontNpmInstall" != "1" ]
|
|
|
|
if [ "$dontNpmInstall" != "1" ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
|
|
|
|
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
|
|
|
|
rm -f npm-shrinkwrap.json
|
|
|
|
rm -f npm-shrinkwrap.json
|
|
|
|
|
|
|
|
|
|
|
|
npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
|
|
|
|
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Create symlink to the deployed executable folder, if applicable
|
|
|
|
# Create symlink to the deployed executable folder, if applicable
|
|
|
@ -275,60 +417,107 @@ let
|
|
|
|
# Run post install hook, if provided
|
|
|
|
# Run post install hook, if provided
|
|
|
|
runHook postInstall
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
} // extraArgs);
|
|
|
|
|
|
|
|
|
|
|
|
# Builds a development shell
|
|
|
|
# Builds a development shell
|
|
|
|
buildNodeShell = { name, packageName, version, src, dependencies ? [], production ? true, npmFlags ? "", dontNpmInstall ? false, ... }@args:
|
|
|
|
buildNodeShell =
|
|
|
|
|
|
|
|
{ name
|
|
|
|
|
|
|
|
, packageName
|
|
|
|
|
|
|
|
, version
|
|
|
|
|
|
|
|
, src
|
|
|
|
|
|
|
|
, dependencies ? []
|
|
|
|
|
|
|
|
, buildInputs ? []
|
|
|
|
|
|
|
|
, production ? true
|
|
|
|
|
|
|
|
, npmFlags ? ""
|
|
|
|
|
|
|
|
, dontNpmInstall ? false
|
|
|
|
|
|
|
|
, bypassCache ? false
|
|
|
|
|
|
|
|
, dontStrip ? true
|
|
|
|
|
|
|
|
, unpackPhase ? "true"
|
|
|
|
|
|
|
|
, buildPhase ? "true"
|
|
|
|
|
|
|
|
, ... }@args:
|
|
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
let
|
|
|
|
nodeDependencies = stdenv.mkDerivation {
|
|
|
|
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nodeDependencies = stdenv.mkDerivation ({
|
|
|
|
name = "node-dependencies-${name}-${version}";
|
|
|
|
name = "node-dependencies-${name}-${version}";
|
|
|
|
|
|
|
|
|
|
|
|
buildInputs = [ tarWrapper python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
|
|
|
|
buildInputs = [ tarWrapper python nodejs ]
|
|
|
|
|
|
|
|
++ stdenv.lib.optional (stdenv.isLinux) utillinux
|
|
|
|
|
|
|
|
++ stdenv.lib.optional (stdenv.isDarwin) libtool
|
|
|
|
|
|
|
|
++ buildInputs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inherit dontStrip; # Stripping may fail a build for some package deployments
|
|
|
|
|
|
|
|
inherit dontNpmInstall unpackPhase buildPhase;
|
|
|
|
|
|
|
|
|
|
|
|
includeScript = includeDependencies { inherit dependencies; };
|
|
|
|
includeScript = includeDependencies { inherit dependencies; };
|
|
|
|
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
|
|
|
|
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
|
|
|
|
|
|
|
|
|
|
|
|
passAsFile = [ "includeScript" "pinpointDependenciesScript" ];
|
|
|
|
passAsFile = [ "includeScript" "pinpointDependenciesScript" ];
|
|
|
|
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib
|
|
|
|
mkdir -p $out/${packageName}
|
|
|
|
cd $out/lib
|
|
|
|
cd $out/${packageName}
|
|
|
|
|
|
|
|
|
|
|
|
source $includeScriptPath
|
|
|
|
source $includeScriptPath
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Create fake package.json to make the npm commands work properly
|
|
|
|
|
|
|
|
cp ${src}/package.json .
|
|
|
|
|
|
|
|
chmod 644 package.json
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString bypassCache ''
|
|
|
|
|
|
|
|
if [ -f ${src}/package-lock.json ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
cp ${src}/package-lock.json .
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
''}
|
|
|
|
|
|
|
|
|
|
|
|
# Pinpoint the versions of all dependencies to the ones that are actually being used
|
|
|
|
# Pinpoint the versions of all dependencies to the ones that are actually being used
|
|
|
|
echo "pinpointing versions of dependencies..."
|
|
|
|
echo "pinpointing versions of dependencies..."
|
|
|
|
source $pinpointDependenciesScriptPath
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
|
|
|
|
|
|
|
|
|
|
|
|
# Create fake package.json to make the npm commands work properly
|
|
|
|
source $pinpointDependenciesScriptPath
|
|
|
|
cat > package.json <<EOF
|
|
|
|
cd ${packageName}
|
|
|
|
{
|
|
|
|
|
|
|
|
"name": "${packageName}",
|
|
|
|
|
|
|
|
"version": "${version}"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Patch the shebangs of the bundled modules to prevent them from
|
|
|
|
# Patch the shebangs of the bundled modules to prevent them from
|
|
|
|
# calling executables outside the Nix store as much as possible
|
|
|
|
# calling executables outside the Nix store as much as possible
|
|
|
|
patchShebangs .
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
|
|
|
|
export HOME=$PWD
|
|
|
|
export HOME=$PWD
|
|
|
|
npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
|
|
|
|
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString bypassCache ''
|
|
|
|
|
|
|
|
if [ ! -f package-lock.json ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
echo "No package-lock.json file found, reconstructing..."
|
|
|
|
|
|
|
|
node ${reconstructPackageLock}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node ${addIntegrityFieldsScript}
|
|
|
|
|
|
|
|
''}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
|
|
|
|
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString (!dontNpmInstall) ''
|
|
|
|
${stdenv.lib.optionalString (!dontNpmInstall) ''
|
|
|
|
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
|
|
|
|
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
|
|
|
|
rm -f npm-shrinkwrap.json
|
|
|
|
rm -f npm-shrinkwrap.json
|
|
|
|
|
|
|
|
|
|
|
|
npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
|
|
|
|
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
|
|
|
|
''}
|
|
|
|
''}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mv ${packageName} lib
|
|
|
|
ln -s $out/lib/node_modules/.bin $out/bin
|
|
|
|
ln -s $out/lib/node_modules/.bin $out/bin
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
} // extraArgs);
|
|
|
|
in
|
|
|
|
in
|
|
|
|
stdenv.lib.makeOverridable stdenv.mkDerivation {
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "node-shell-${name}-${version}";
|
|
|
|
name = "node-shell-${name}-${version}";
|
|
|
|
|
|
|
|
|
|
|
|
buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
|
|
|
|
buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
|
|
|
|
buildCommand = ''
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cat > $out/bin/shell <<EOF
|
|
|
|
cat > $out/bin/shell <<EOF
|
|
|
@ -346,4 +535,8 @@ let
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
in
|
|
|
|
{ inherit buildNodeSourceDist buildNodePackage buildNodeShell; }
|
|
|
|
{
|
|
|
|
|
|
|
|
buildNodeSourceDist = stdenv.lib.makeOverridable buildNodeSourceDist;
|
|
|
|
|
|
|
|
buildNodePackage = stdenv.lib.makeOverridable buildNodePackage;
|
|
|
|
|
|
|
|
buildNodeShell = stdenv.lib.makeOverridable buildNodeShell;
|
|
|
|
|
|
|
|
}
|
|
|
|