-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85238 from ryantm/linode-cli
linode-cli: remove deprecated perl version, init python version at 2.14.1
- Loading branch information
Showing
2 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,70 @@ | ||
{ stdenv, fetchFromGitHub, perlPackages, makeWrapper}: | ||
{ lib | ||
, buildPythonApplication | ||
, fetchFromGitHub | ||
, fetchpatch | ||
, fetchurl | ||
, terminaltables | ||
, colorclass | ||
, requests | ||
, pyyaml | ||
, setuptools | ||
}: | ||
|
||
perlPackages.buildPerlPackage rec { | ||
let | ||
|
||
spec = fetchurl { | ||
url = "https://developers.linode.com/api/docs/v4/openapi.yaml"; | ||
sha256 = "1l2fahdcmv7sp1qkwr5nv2vls8fypvlybwylqfzhyjmn7jqkw4hq"; | ||
}; | ||
|
||
in | ||
|
||
buildPythonApplication rec { | ||
pname = "linode-cli"; | ||
version = "1.4.7"; | ||
version = "2.14.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "linode"; | ||
repo = "cli"; | ||
rev = "v${version}"; | ||
sha256 = "1wiz067wgxi4z4rz4n9p7dlvx5z4hkl2nxpfvhikl6dri4m2nkkp"; | ||
repo = pname; | ||
rev = version; | ||
sha256 = "1hpdmbzs182iag471yvq3kwd1san04a58sczzbmw6vjv2kswn1c2"; | ||
}; | ||
|
||
buildInputs = [ makeWrapper ]; | ||
propagatedBuildInputs = with perlPackages; [ | ||
JSON | ||
LWP | ||
MozillaCA | ||
TryTiny | ||
WebServiceLinode | ||
patches = [ | ||
# make enum34 depend on python version | ||
( fetchpatch { | ||
url = "https://github.com/linode/linode-cli/pull/184/commits/4cf55759c5da33fbc49b9ba664698875d67d4f76.patch"; | ||
sha256 = "04n9a6yh0abyyymvfzajhav6qxwvzjl2vs8jnqp3yqrma7kl0slj"; | ||
}) | ||
]; | ||
|
||
# Wrap perl scripts so they can find libraries | ||
postInstall = '' | ||
for n in "$out/bin"/*; do | ||
wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB" | ||
done | ||
# remove need for git history | ||
prePatch = '' | ||
substituteInPlace setup.py \ | ||
--replace "version=get_version()," "version='${version}'," | ||
''; | ||
|
||
# Has no tests | ||
doCheck = false; | ||
propagatedBuildInputs = [ | ||
terminaltables | ||
colorclass | ||
requests | ||
pyyaml | ||
setuptools | ||
]; | ||
|
||
# Has no "doc" or "devdoc" outputs | ||
outputs = [ "out" ]; | ||
postConfigure = '' | ||
python3 -m linodecli bake ${spec} --skip-config | ||
cp data-3 linodecli/ | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Command-line interface to the Linode platform"; | ||
homepage = "https://github.com/linode/cli"; | ||
license = with licenses; [ artistic2 gpl2 ]; | ||
maintainers = with maintainers; [ nixy ]; | ||
# requires linode access token for unit tests, and running executable | ||
doCheck = false; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/linode/linode-cli"; | ||
description = "The Linode Command Line Interface"; | ||
license = licenses.bsd3; | ||
maintainers = with maintainers; [ ryantm ]; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters