Unverified Commit 6ce04a94 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

node-env: fix for utillinux deprecation (#350815)

parents 5935b06b f9fb59ff
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -3,9 +3,6 @@
{lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile, writeShellScript}:

let
  # Workaround to cope with utillinux in Nixpkgs 20.09 and util-linux in Nixpkgs master
  utillinux = if pkgs ? utillinux then pkgs.utillinux else pkgs.util-linux;

  python = if nodejs ? python then nodejs.python else python2;

  # Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise
@@ -499,7 +496,7 @@ let
    stdenv.mkDerivation ({
      name = "${name}${if version == null then "" else "-${version}"}";
      buildInputs = [ tarWrapper python nodejs ]
        ++ lib.optional (stdenv.hostPlatform.isLinux) utillinux
        ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux
        ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool
        ++ buildInputs;

@@ -591,7 +588,7 @@ let
        name = "node-dependencies-${name}${if version == null then "" else "-${version}"}";

        buildInputs = [ tarWrapper python nodejs ]
          ++ lib.optional (stdenv.hostPlatform.isLinux) utillinux
          ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux
          ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool
          ++ buildInputs;

@@ -662,7 +659,7 @@ let
    stdenv.mkDerivation ({
      name = "node-shell-${name}${if version == null then "" else "-${version}"}";

      buildInputs = [ python nodejs ] ++ lib.optional (stdenv.hostPlatform.isLinux) utillinux ++ buildInputs;
      buildInputs = [ python nodejs ] ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux ++ buildInputs;
      buildCommand = ''
        mkdir -p $out/bin
        cat > $out/bin/shell <<EOF