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,30 @@
diff --git a/checks/system/unix.py b/checks/system/unix.py
index c37af3c3..58c72626 100644
--- a/checks/system/unix.py
+++ b/checks/system/unix.py
@@ -39,7 +39,7 @@ class IO(Check):
self.value_re = re.compile(r'\d+\.\d+')
def _parse_linux2(self, output):
- recentStats = output.split('Device:')[2].split('\n')
+ recentStats = output.split('Device')[2].split('\n')
header = recentStats[0]
headerNames = re.findall(self.header_re, header)
device = None
@@ -123,14 +123,14 @@ class IO(Check):
# Linux 2.6.32-343-ec2 (ip-10-35-95-10) 12/11/2012 _x86_64_ (2 CPU)
#
- # Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
+ # Device rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
# sda1 0.00 17.61 0.26 32.63 4.23 201.04 12.48 0.16 4.81 0.53 1.73
# sdb 0.00 2.68 0.19 3.84 5.79 26.07 15.82 0.02 4.93 0.22 0.09
# sdg 0.00 0.13 2.29 3.84 100.53 30.61 42.78 0.05 8.41 0.88 0.54
# sdf 0.00 0.13 2.30 3.84 100.54 30.61 42.78 0.06 9.12 0.90 0.55
# md0 0.00 0.00 0.05 3.37 1.41 30.01 18.35 0.00 0.00 0.00 0.00
#
- # Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
+ # Device rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
# sda1 0.00 0.00 0.00 10.89 0.00 43.56 8.00 0.03 2.73 2.73 2.97
# sdb 0.00 0.00 0.00 2.97 0.00 11.88 8.00 0.00 0.00 0.00 0.00
# sdg 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

View file

@ -0,0 +1,110 @@
{ lib, stdenv, fetchFromGitHub, python2
, unzip, makeWrapper }:
let
python' = python2.override {
packageOverrides = self: super: {
docker = self.buildPythonPackage rec {
name = "docker-${version}";
version = "1.10.6";
src = fetchFromGitHub {
owner = "docker";
repo = "docker-py";
rev = version;
sha256 = "1awzpbrkh4fympqzddz5i3ml81b7f0i0nwkvbpmyxjjfqx6l0m4m";
};
propagatedBuildInputs = with self; [
six
requests
websocket-client
docker_pycreds
uptime
] ++ lib.optionals (self.pythonOlder "3.7") [ backports_ssl_match_hostname ];
# due to flake8
doCheck = false;
};
pymongo = super.pymongo.overridePythonAttrs (oldAttrs: rec {
version = "2.9.5";
src = oldAttrs.src.override {
inherit version;
sha256 = "912516ac6a355d7624374a38337b8587afe3eb535c0a5456b3bd12df637a6e70";
};
});
};
};
in stdenv.mkDerivation rec {
version = "5.11.2";
pname = "dd-agent";
src = fetchFromGitHub {
owner = "datadog";
repo = "dd-agent";
rev = version;
sha256 = "1iqxvgpsqibqw3vk79158l2pnb6y4pjhjp2d6724lm5rpz4825lx";
};
patches = [ ./40103-iostat-fix.patch ];
nativeBuildInputs = [ unzip ];
buildInputs = [
makeWrapper
] ++ (with python'.pkgs; [
requests
psycopg2
psutil
ntplib
simplejson
pyyaml
pymongo
python-etcd
consul
docker
]);
propagatedBuildInputs = with python'.pkgs; [ python tornado ];
buildCommand = ''
mkdir -p $out/bin
cp -R $src $out/agent
chmod u+w -R $out
(cd $out/agent; patchPhase)
PYTHONPATH=$out/agent:$PYTHONPATH
ln -s $out/agent/agent.py $out/bin/dd-agent
ln -s $out/agent/dogstatsd.py $out/bin/dogstatsd
ln -s $out/agent/ddagent.py $out/bin/dd-forwarder
# Move out default conf.d so that /etc/dd-agent/conf.d is used
mv $out/agent/conf.d $out/agent/conf.d-system
cat > $out/bin/dd-jmxfetch <<EOF
#!/usr/bin/env bash
exec ${python'.interpreter} $out/agent/jmxfetch.py $@
EOF
chmod a+x $out/bin/dd-jmxfetch
wrapProgram $out/bin/dd-forwarder \
--prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/dd-agent \
--prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/dogstatsd \
--prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/dd-jmxfetch \
--prefix PYTHONPATH : $PYTHONPATH
patchShebangs $out
'';
meta = {
description = ''
Event collector for the DataDog analysis service
-- v5 Python implementation
'';
homepage = "https://www.datadoghq.com";
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ thoughtpolice domenkozar ];
};
}

View file

@ -0,0 +1,82 @@
{ lib, buildGoModule, makeWrapper, fetchFromGitHub, pythonPackages, pkg-config, systemd, hostname, extraTags ? [] }:
let
# keep this in sync with github.com/DataDog/agent-payload dependency
payloadVersion = "4.78.0";
python = pythonPackages.python;
owner = "DataDog";
repo = "datadog-agent";
goPackagePath = "github.com/${owner}/${repo}";
in buildGoModule rec {
pname = "datadog-agent";
version = "7.36.0";
src = fetchFromGitHub {
inherit owner repo;
rev = version;
sha256 = "sha256-pkbgYE58T9QzV7nCzvfBoTt6Ue8cCMUBSuCBeDtdkzo=";
};
vendorSha256 = "sha256-SxdSoZtRAdl3evCpb+3BHWf/uPYJJKgw0CL9scwNfGA=";
subPackages = [
"cmd/agent"
"cmd/cluster-agent"
"cmd/dogstatsd"
"cmd/py-launcher"
"cmd/trace-agent"
];
nativeBuildInputs = [ pkg-config makeWrapper ];
buildInputs = [ systemd ];
PKG_CONFIG_PATH = "${python}/lib/pkgconfig";
preBuild = let
ldFlags = lib.concatStringsSep " " [
"-X ${goPackagePath}/pkg/version.Commit=${src.rev}"
"-X ${goPackagePath}/pkg/version.AgentVersion=${version}"
"-X ${goPackagePath}/pkg/serializer.AgentPayloadVersion=${payloadVersion}"
"-X ${goPackagePath}/pkg/collector/py.pythonHome=${python}"
"-r ${python}/lib"
];
in ''
buildFlagsArray=( "-tags" "ec2 systemd cpython process log secrets ${lib.concatStringsSep " " extraTags}" "-ldflags" "${ldFlags}")
# Keep directories to generate in sync with tasks/go.py
go generate ./pkg/status ./cmd/agent/gui
'';
# DataDog use paths relative to the agent binary, so fix these.
postPatch = ''
sed -e "s|PyChecksPath =.*|PyChecksPath = \"$out/${python.sitePackages}\"|" \
-e "s|distPath =.*|distPath = \"$out/share/datadog-agent\"|" \
-i cmd/agent/common/common_nix.go
sed -e "s|/bin/hostname|${lib.getBin hostname}/bin/hostname|" \
-i pkg/util/hostname_nix.go
'';
# Install the config files and python modules from the "dist" dir
# into standard paths.
postInstall = ''
mkdir -p $out/${python.sitePackages} $out/share/datadog-agent
cp -R $src/cmd/agent/dist/conf.d $out/share/datadog-agent
cp -R $src/cmd/agent/dist/{checks,utils,config.py} $out/${python.sitePackages}
cp -R $src/pkg/status/templates $out/share/datadog-agent
wrapProgram "$out/bin/agent" \
--set PYTHONPATH "$out/${python.sitePackages}" \
--prefix LD_LIBRARY_PATH : ${lib.getLib systemd}/lib
'';
meta = with lib; {
description = ''
Event collector for the DataDog analysis service
-- v6 new golang implementation.
'';
homepage = "https://www.datadoghq.com";
license = licenses.bsd3;
maintainers = with maintainers; [ thoughtpolice domenkozar rvl ];
};
}

View file

@ -0,0 +1,11 @@
{ lib, datadog-agent }:
datadog-agent.overrideAttrs (attrs: {
pname = "datadog-process-agent";
meta = with lib;
attrs.meta // {
description = "Live process collector for the DataDog Agent v7";
maintainers = with maintainers; [ domenkozar rvl ];
};
subPackages = [ "cmd/process-agent" ];
postInstall = null;
})

View file

@ -0,0 +1,92 @@
# The declarations in this file build the Datadog agent's core
# integrations. These integrations are tracked in a separate
# repository[1] outside of the agent's primary repository and provide
# checks for various kinds of services.
#
# Not all services are relevant for all users, however. As some of
# them depend on various tools and Python packages it is nonsensical
# to build *all* integrations by default.
#
# A set of default integrations is defined and built either way.
# Additional integrations can be specified by overriding
# `extraIntegrations` in datadog-integrations-core.
#
# In practice the syntax for using this with additional integrations
# is not the most beautiful, but it works. For example to use
# datadog-agent from the top-level with the `ntp`-integration
# included, one could say:
#
# let
# integrationsWithNtp = datadog-integrations-core {
# # Extra integrations map from the integration name (as in the
# # integrations-core repository) to a function that receives the
# # Python package set and returns the required dependencies.g
# ntp = (ps: [ ps.ntplib ]);
# };
#
# in ddAgentWithNtp = datadog-agent.overrideAttrs(_ : {
# python = integrationsWithNtp.python;
# });
#
# The NixOS module 'datadog-agent' provides a simplified interface to
# this. Please see the module itself for more information.
#
# [1]: https://github.com/DataDog/integrations-core
{ pkgs, python, extraIntegrations ? {} }:
with pkgs.lib;
let
src = pkgs.fetchFromGitHub {
owner = "DataDog";
repo = "integrations-core";
rev = version;
sha256 = "0424zsnf747s10kfzv5y0m0ac9sgczip78yvghhrc2i089i5z2h4";
};
version = "7.30.1";
# Build helper to build a single datadog integration package.
buildIntegration = { pname, ... }@args: python.pkgs.buildPythonPackage (args // {
inherit src version;
name = "datadog-integration-${pname}-${version}";
postPatch = ''
# jailbreak install_requires
sed -i 's/==.*//' requirements.in
cp requirements.in requirements.txt
'';
sourceRoot = "source/${args.sourceRoot or pname}";
doCheck = false;
});
# Base package depended on by all other integrations.
datadog_checks_base = buildIntegration {
pname = "checks-base";
sourceRoot = "datadog_checks_base";
propagatedBuildInputs = with python.pkgs; [
requests protobuf prometheus-client simplejson uptime
];
};
# Default integrations that should be built:
defaultIntegrations = {
disk = (ps: [ ps.psutil ]);
mongo = (ps: [ ps.pymongo ]);
network = (ps: [ ps.psutil ]);
nginx = (ps: []);
postgres = (ps: with ps; [ pg8000 psycopg2 ]);
process = (ps: []);
};
# All integrations (default + extra):
integrations = defaultIntegrations // extraIntegrations;
builtIntegrations = mapAttrs (pname: fdeps: buildIntegration {
inherit pname;
propagatedBuildInputs = (fdeps python.pkgs) ++ [ datadog_checks_base ];
}) integrations;
in builtIntegrations // {
inherit datadog_checks_base;
python = python.withPackages (_: (attrValues builtIntegrations));
}