uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,77 @@
{ lib
, fetchFromGitHub
, fetchurl
, buildPythonApplication
, colorclass
, installShellFiles
, pyyaml
, requests
, setuptools
, terminaltables
}:
let
sha256 = "1f0nrdg8hf650qxz79i3a1d2zyf24niyrcnbnhc9i7hzbnqbp5qg";
# specVersion taken from: https://www.linode.com/docs/api/openapi.yaml at `info.version`.
specVersion = "4.119.4";
specSha256 = "057qzpy8da0r0av8wmm640mqqhl4qynqxqalkf3ylsa3xnch5c9m";
spec = fetchurl {
url = "https://raw.githubusercontent.com/linode/linode-api-docs/v${specVersion}/openapi.yaml";
sha256 = specSha256;
};
in
buildPythonApplication rec {
pname = "linode-cli";
version = "5.17.2";
src = fetchFromGitHub {
owner = "linode";
repo = pname;
rev = version;
inherit sha256;
};
patches = [
./remove-update-check.patch
];
# remove need for git history
prePatch = ''
substituteInPlace setup.py \
--replace "version=get_version()," "version='${version}',"
'';
propagatedBuildInputs = [
colorclass
pyyaml
requests
setuptools
terminaltables
];
postConfigure = ''
python3 -m linodecli bake ${spec} --skip-config
cp data-3 linodecli/
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/linode-cli --skip-config --version | grep ${version} > /dev/null
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd linode-cli --bash <($out/bin/linode-cli --skip-config completion bash)
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "The Linode Command Line Interface";
homepage = "https://github.com/linode/linode-cli";
license = licenses.bsd3;
maintainers = with maintainers; [ ryantm ];
};
}

View file

@ -0,0 +1,11 @@
--- a/linodecli/cli.py
+++ b/linodecli/cli.py
@@ -555,7 +555,7 @@
if self.debug_request:
self.print_response_debug_info(result)
- if not self.suppress_warnings:
+ if False:
# check the major/minor version API reported against what we were built
# with to see if an upgrade should be available
api_version_higher = False

View file

@ -0,0 +1,30 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep gnused jq yq-go
set -x -eu -o pipefail
cd $(dirname "${BASH_SOURCE[0]}")
SPEC_VERSION=$(curl -s https://www.linode.com/docs/api/openapi.yaml | yq eval '.info.version' -)
SPEC_SHA256=$(nix-prefetch-url --quiet https://raw.githubusercontent.com/linode/linode-api-docs/v${SPEC_VERSION}/openapi.yaml)
VERSION=$(curl -s ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/linode/linode-cli/tags" \
| jq 'map(.name)' \
| grep '"' \
| sed 's/[ ",(^v)]//g' \
| grep -v -e rc -e list \
| cut -d '"' -f4 | sort -rV | head -n 1)
SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/linode/linode-cli/archive/refs/tags/${VERSION}.tar.gz)
setKV () {
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./default.nix
}
setKV specVersion ${SPEC_VERSION}
setKV specSha256 ${SPEC_SHA256}
setKV version ${VERSION}
setKV sha256 ${SHA256}