2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchPypi
|
2022-01-13 20:06:32 +00:00
|
|
|
, python3
|
2024-04-21 15:54:59 +00:00
|
|
|
, installShellFiles
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
2021-04-15 00:37:46 +00:00
|
|
|
|
|
|
|
let
|
2022-01-13 20:06:32 +00:00
|
|
|
py = python3.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = py;
|
2022-01-13 20:06:32 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
|
|
|
|
click = super.click.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "7.1.2";
|
2021-04-15 00:37:46 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
pname = "click";
|
2022-01-13 20:06:32 +00:00
|
|
|
inherit version;
|
|
|
|
hash = "sha256-0rUlXHxjSbwb0eWeCM0SrLvWPOZJ8liHVXg6qU37axo=";
|
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
disabledTests = [ "test_bytes_args" ]; # https://github.com/pallets/click/commit/6e05e1fa1c2804
|
2022-01-13 20:06:32 +00:00
|
|
|
});
|
2021-04-15 00:37:46 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
jmespath = super.jmespath.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.10.0";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9";
|
2022-09-09 14:08:57 +00:00
|
|
|
hash = "";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
2022-08-21 13:32:41 +00:00
|
|
|
doCheck = false;
|
2022-04-27 09:35:20 +00:00
|
|
|
});
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
};
|
2021-04-15 00:37:46 +00:00
|
|
|
in
|
2022-01-13 20:06:32 +00:00
|
|
|
with py.pkgs;
|
2021-04-15 00:37:46 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
buildPythonApplication rec {
|
2021-04-15 00:37:46 +00:00
|
|
|
pname = "oci-cli";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "3.14.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
format = "setuptools";
|
2021-04-15 00:37:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oracle";
|
2022-08-21 13:32:41 +00:00
|
|
|
repo = pname;
|
2021-04-15 00:37:46 +00:00
|
|
|
rev = "v${version}";
|
2022-08-21 13:32:41 +00:00
|
|
|
hash = "sha256-yooEZuSIw2EMJVyT/Z/x4hJi8a1F674CtsMMGkMAYLg=";
|
2021-04-15 00:37:46 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
arrow
|
|
|
|
certifi
|
|
|
|
click
|
|
|
|
cryptography
|
|
|
|
jmespath
|
|
|
|
oci
|
2022-08-21 13:32:41 +00:00
|
|
|
prompt-toolkit
|
2022-01-13 20:06:32 +00:00
|
|
|
pyopenssl
|
|
|
|
python-dateutil
|
|
|
|
pytz
|
|
|
|
pyyaml
|
|
|
|
retrying
|
|
|
|
six
|
|
|
|
terminaltables
|
2021-04-15 00:37:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2022-08-21 13:32:41 +00:00
|
|
|
--replace "cryptography>=3.2.1,<=37.0.2" "cryptography" \
|
|
|
|
--replace "pyOpenSSL>=17.5.0,<=22.0.0" "pyOpenSSL" \
|
2022-01-13 20:06:32 +00:00
|
|
|
--replace "PyYAML>=5.4,<6" "PyYAML" \
|
2022-08-21 13:32:41 +00:00
|
|
|
--replace "prompt-toolkit==3.0.29" "prompt-toolkit" \
|
2022-09-14 18:05:37 +00:00
|
|
|
--replace "terminaltables==3.1.0" "terminaltables" \
|
|
|
|
--replace "oci==2.78.0" "oci"
|
2021-04-15 00:37:46 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postInstall = ''
|
|
|
|
cat >oci.zsh <<EOF
|
|
|
|
#compdef oci
|
|
|
|
zmodload -i zsh/parameter
|
|
|
|
autoload -U +X bashcompinit && bashcompinit
|
|
|
|
if ! (( $+functions[compdef] )) ; then
|
|
|
|
autoload -U +X compinit && compinit
|
|
|
|
fi
|
|
|
|
|
|
|
|
EOF
|
|
|
|
cat src/oci_cli/bin/oci_autocomplete.sh >>oci.zsh
|
|
|
|
|
|
|
|
installShellCompletion \
|
|
|
|
--cmd oci \
|
|
|
|
--bash src/oci_cli/bin/oci_autocomplete.sh \
|
|
|
|
--zsh oci.zsh
|
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
# https://github.com/oracle/oci-cli/issues/187
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
" oci_cli "
|
|
|
|
];
|
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Command Line Interface for Oracle Cloud Infrastructure";
|
|
|
|
homepage = "https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm";
|
2022-01-13 20:06:32 +00:00
|
|
|
license = with licenses; [ asl20 /* or */ upl ];
|
2021-04-15 00:37:46 +00:00
|
|
|
maintainers = with maintainers; [ ilian ];
|
|
|
|
};
|
|
|
|
}
|