Add override to make shellcheck-py installable

This commit is contained in:
adisbladis 2021-08-26 12:39:39 -05:00
parent 11f15b8c7d
commit 2f5291f9cd
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -1504,6 +1504,25 @@ self: super:
}
);
shellcheck-py = super.shellcheck-py.overridePythonAttrs (old: {
# Make fetching/installing external binaries no-ops
preConfigure =
let
fakeCommand = "type('FakeCommand', (Command,), {'initialize_options': lambda self: None, 'finalize_options': lambda self: None, 'run': lambda self: None})";
in
''
substituteInPlace setup.py \
--replace "'fetch_binaries': fetch_binaries," "'fetch_binaries': ${fakeCommand}," \
--replace "'install_shellcheck': install_shellcheck," "'install_shellcheck': ${fakeCommand},"
'';
propagatedUserEnvPkgs = (old.propagatedUserEnvPkgs or [ ]) ++ [
pkgs.shellcheck
];
});
shellingham =
if lib.versionAtLeast super.shellingham.version "1.3.2" then
(