From 9ce350cdccb51c5245a0823e9290d301c3e6e5f3 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 4 Oct 2020 00:36:47 +0200 Subject: [PATCH] blackfire: init at 1.44.0 --- .../tools/misc/blackfire/default.nix | 52 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/tools/misc/blackfire/default.nix diff --git a/pkgs/development/tools/misc/blackfire/default.nix b/pkgs/development/tools/misc/blackfire/default.nix new file mode 100644 index 000000000000..08496d9f5202 --- /dev/null +++ b/pkgs/development/tools/misc/blackfire/default.nix @@ -0,0 +1,52 @@ +{ stdenv +, lib +, fetchurl +, dpkg +, autoPatchelfHook +, writeShellScript +, curl +, jq +, common-updater-scripts +}: + +stdenv.mkDerivation rec { + pname = "blackfire-agent"; + version = "1.44.1"; + + src = fetchurl { + url = "https://packages.blackfire.io/debian/pool/any/main/b/blackfire-php/blackfire-agent_${version}_amd64.deb"; + sha256 = "1p00flipm5x6r36gblfrfrd14byipilybrhfzv8rzpahz2b7r5hb"; + }; + + nativeBuildInputs = [ + dpkg + autoPatchelfHook + ]; + + dontUnpack = true; + + installPhase = '' + runHook preInstall + + dpkg-deb -x $src $out + mv $out/usr/* $out + rmdir $out/usr + + runHook postInstall + ''; + + passthru = { + updateScript = writeShellScript "update-${pname}" '' + export PATH="${lib.makeBinPath [ curl jq common-updater-scripts ]}" + update-source-version "$UPDATE_NIX_ATTR_PATH" "$(curl https://blackfire.io/api/v1/releases | jq .agent --raw-output)" + ''; + }; + + meta = with lib; { + description = "Blackfire Profiler agent and client"; + homepage = "https://blackfire.io/"; + license = licenses.unfree; + maintainers = with maintainers; [ jtojnar ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1d198778dcea..1c7b541fbc85 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10674,6 +10674,8 @@ in black = with python3Packages; toPythonApplication black; + blackfire = callPackage ../development/tools/misc/blackfire { }; + black-macchiato = with python3Packages; toPythonApplication black-macchiato; blackmagic = callPackage ../development/tools/misc/blackmagic { };