Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, fetchFromGitHub
3, python3
4}:
5
6let
7 py = python3.override {
8 packageOverrides = self: super: {
9
10 click = super.click.overridePythonAttrs (oldAttrs: rec {
11 version = "7.1.2";
12
13 src = oldAttrs.src.override {
14 inherit version;
15 hash = "sha256-0rUlXHxjSbwb0eWeCM0SrLvWPOZJ8liHVXg6qU37axo=";
16 sha256 = "";
17 };
18 });
19
20 jmespath = super.jmespath.overridePythonAttrs (oldAttrs: rec {
21 version = "0.10.0";
22 src = oldAttrs.src.override {
23 inherit version;
24 sha256 = "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9";
25 hash = "";
26 };
27 doCheck = false;
28 });
29
30 };
31 };
32in
33with py.pkgs;
34
35buildPythonApplication rec {
36 pname = "oci-cli";
37 version = "3.14.0";
38 format = "setuptools";
39
40 src = fetchFromGitHub {
41 owner = "oracle";
42 repo = pname;
43 rev = "v${version}";
44 hash = "sha256-yooEZuSIw2EMJVyT/Z/x4hJi8a1F674CtsMMGkMAYLg=";
45 };
46
47 propagatedBuildInputs = [
48 arrow
49 certifi
50 click
51 cryptography
52 jmespath
53 oci
54 prompt-toolkit
55 pyopenssl
56 python-dateutil
57 pytz
58 pyyaml
59 retrying
60 six
61 terminaltables
62 ];
63
64 postPatch = ''
65 substituteInPlace setup.py \
66 --replace "cryptography>=3.2.1,<=37.0.2" "cryptography" \
67 --replace "pyOpenSSL>=17.5.0,<=22.0.0" "pyOpenSSL" \
68 --replace "PyYAML>=5.4,<6" "PyYAML" \
69 --replace "prompt-toolkit==3.0.29" "prompt-toolkit" \
70 --replace "terminaltables==3.1.0" "terminaltables" \
71 --replace "oci==2.78.0" "oci"
72 '';
73
74 # https://github.com/oracle/oci-cli/issues/187
75 doCheck = false;
76
77 pythonImportsCheck = [
78 " oci_cli "
79 ];
80
81 meta = with lib; {
82 description = "Command Line Interface for Oracle Cloud Infrastructure";
83 homepage = "https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm";
84 license = with licenses; [ asl20 /* or */ upl ];
85 maintainers = with maintainers; [ ilian ];
86 };
87}