From 108bdac3d99b6d94d3740422af5945e510238304 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Fri, 15 Jan 2021 12:42:41 +0700 Subject: pkgs/applications: stdenv.lib -> lib --- .../matrix-recorder/node-env.nix | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'pkgs/applications/networking/instant-messengers/matrix-recorder/node-env.nix') diff --git a/pkgs/applications/networking/instant-messengers/matrix-recorder/node-env.nix b/pkgs/applications/networking/instant-messengers/matrix-recorder/node-env.nix index ff5ca0d99b19..e6131fe8e771 100644 --- a/pkgs/applications/networking/instant-messengers/matrix-recorder/node-env.nix +++ b/pkgs/applications/networking/instant-messengers/matrix-recorder/node-env.nix @@ -1,6 +1,6 @@ # This file originates from node2nix -{stdenv, nodejs, python2, util-linux, libtool, runCommand, writeTextFile}: +{lib, stdenv, nodejs, python2, util-linux, libtool, runCommand, writeTextFile}: let python = if nodejs ? python then nodejs.python else python2; @@ -38,8 +38,8 @@ let }; includeDependencies = {dependencies}: - stdenv.lib.optionalString (dependencies != []) - (stdenv.lib.concatMapStrings (dependency: + lib.optionalString (dependencies != []) + (lib.concatMapStrings (dependency: '' # Bundle the dependencies of the package mkdir -p node_modules @@ -100,7 +100,7 @@ let cd "$DIR/${packageName}" ${includeDependencies { inherit dependencies; }} cd .. - ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} ''; pinpointDependencies = {dependencies, production}: @@ -161,12 +161,12 @@ let '' node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"} - ${stdenv.lib.optionalString (dependencies != []) + ${lib.optionalString (dependencies != []) '' if [ -d node_modules ] then cd node_modules - ${stdenv.lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies} + ${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies} cd .. fi ''} @@ -183,7 +183,7 @@ let cd "${packageName}" ${pinpointDependencies { inherit dependencies production; }} cd .. - ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} fi ''; @@ -344,8 +344,8 @@ let cd "${packageName}" runHook preRebuild - ${stdenv.lib.optionalString bypassCache '' - ${stdenv.lib.optionalString reconstructLock '' + ${lib.optionalString bypassCache '' + ${lib.optionalString reconstructLock '' if [ -f package-lock.json ] then echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!" @@ -361,14 +361,14 @@ let node ${addIntegrityFieldsScript} ''} - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild + npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild if [ "$dontNpmInstall" != "1" ] then # NPM tries to download packages even when they already exist if npm-shrinkwrap is used. rm -f npm-shrinkwrap.json - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install + npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install fi ''; @@ -396,8 +396,8 @@ let stdenv.mkDerivation ({ name = "node_${name}-${version}"; buildInputs = [ tarWrapper python nodejs ] - ++ stdenv.lib.optional (stdenv.isLinux) util-linux - ++ stdenv.lib.optional (stdenv.isDarwin) libtool + ++ lib.optional (stdenv.isLinux) util-linux + ++ lib.optional (stdenv.isDarwin) libtool ++ buildInputs; inherit dontStrip; # Stripping may fail a build for some package deployments @@ -468,8 +468,8 @@ let name = "node-dependencies-${name}-${version}"; buildInputs = [ tarWrapper python nodejs ] - ++ stdenv.lib.optional (stdenv.isLinux) util-linux - ++ stdenv.lib.optional (stdenv.isDarwin) libtool + ++ lib.optional (stdenv.isLinux) util-linux + ++ lib.optional (stdenv.isDarwin) libtool ++ buildInputs; inherit dontStrip; # Stripping may fail a build for some package deployments @@ -489,7 +489,7 @@ let # Create fake package.json to make the npm commands work properly cp ${src}/package.json . chmod 644 package.json - ${stdenv.lib.optionalString bypassCache '' + ${lib.optionalString bypassCache '' if [ -f ${src}/package-lock.json ] then cp ${src}/package-lock.json . @@ -498,13 +498,13 @@ let # Go to the parent folder to make sure that all packages are pinpointed cd .. - ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} # Expose the executables that were installed cd .. - ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} + ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} mv ${packageName} lib ln -s $out/lib/node_modules/.bin $out/bin @@ -514,7 +514,7 @@ let stdenv.mkDerivation { name = "node-shell-${name}-${version}"; - buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) util-linux ++ buildInputs; + buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) util-linux ++ buildInputs; buildCommand = '' mkdir -p $out/bin cat > $out/bin/shell <