8 , common-updater-scripts
11 stdenv.mkDerivation rec {
15 src = passthru.sources.${stdenv.hostPlatform.system} or (throw "Unsupported platform for blackfire: ${stdenv.hostPlatform.system}");
17 nativeBuildInputs = lib.optionals stdenv.isLinux [
26 if ${ lib.boolToString stdenv.isLinux }
32 # Fix ExecStart path and replace deprecated directory creation method,
34 substituteInPlace "$out/lib/systemd/system/blackfire-agent.service" \
35 --replace '/usr/' "$out/" \
36 --replace 'ExecStartPre=/bin/mkdir -p /var/run/blackfire' 'RuntimeDirectory=blackfire' \
37 --replace 'ExecStartPre=/bin/chown blackfire: /var/run/blackfire' "" \
38 --replace 'User=blackfire' 'DynamicUser=yes' \
39 --replace 'PermissionsStartOnly=true' ""
41 # Modernize socket path.
42 substituteInPlace "$out/etc/blackfire/agent" \
43 --replace '/var/run' '/run'
58 "x86_64-linux" = fetchurl {
59 url = "https://packages.blackfire.io/debian/pool/any/main/b/blackfire/blackfire_${version}_amd64.deb";
60 sha256 = "czFzZ+Z2CYw0ETzsmimAMNKrpiIVufyguOYuZJu2L8s=";
62 "i686-linux" = fetchurl {
63 url = "https://packages.blackfire.io/debian/pool/any/main/b/blackfire/blackfire_${version}_i386.deb";
64 sha256 = "I/7ZESjJjlRSvV41ldEtdymp7fwe0tCCFeS/oouOUi8=";
66 "aarch64-linux" = fetchurl {
67 url = "https://packages.blackfire.io/debian/pool/any/main/b/blackfire/blackfire_${version}_arm64.deb";
68 sha256 = "lJn9iRAPkLCpv+Vbk72a58DaNgNOTfyFiycyHosBiq4=";
70 "aarch64-darwin" = fetchurl {
71 url = "https://packages.blackfire.io/blackfire/${version}/blackfire-darwin_arm64.pkg.tar.gz";
72 sha256 = "puvM/QB8nJgJaw1eDMJTb9aDrIdrqO3WVdDYWeayTAs=";
74 "x86_64-darwin" = fetchurl {
75 url = "https://packages.blackfire.io/blackfire/${version}/blackfire-darwin_amd64.pkg.tar.gz";
76 sha256 = "srv99KyjxzEJNRA4hjoobSqzSab+Ox7g80tTun3G9KY=";
80 updateScript = writeShellScript "update-blackfire" ''
82 export PATH="${lib.makeBinPath [ curl jq common-updater-scripts ]}"
83 NEW_VERSION=$(curl -s https://blackfire.io/api/v1/releases | jq .cli --raw-output)
85 if [[ "${version}" = "$NEW_VERSION" ]]; then
86 echo "The new version same as the old version."
90 for platform in ${lib.escapeShellArgs meta.platforms}; do
91 update-source-version "blackfire" "0" "${lib.fakeSha256}" --source-key="sources.$platform"
92 update-source-version "blackfire" "$NEW_VERSION" --source-key="sources.$platform"
98 description = "Blackfire Profiler agent and client";
99 homepage = "https://blackfire.io/";
100 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
101 license = licenses.unfree;
102 maintainers = with maintainers; [ shyim ];
103 platforms = [ "x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" ];