From c31603e6447ca36b0fe7a240666f7187b3e8b643 Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Mon, 14 Apr 2025 14:08:50 +0200 Subject: [PATCH] asitop -> macpm: migrate to maintained fork, fix build Migrate from 'asitop' to maintained fork 'macpm', which fixes an issue related to temp files owned by root. Fix python application build. Symlink 'asitop' in the final package to maintain backwards compatibility. Signed-off-by: Sirio Balmelli Co-authored-by: Aleksana --- pkgs/by-name/ma/macpm/package.nix | 45 ++++++++++++++++++++++ pkgs/os-specific/darwin/asitop/default.nix | 34 ---------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 - 4 files changed, 46 insertions(+), 36 deletions(-) create mode 100644 pkgs/by-name/ma/macpm/package.nix delete mode 100644 pkgs/os-specific/darwin/asitop/default.nix diff --git a/pkgs/by-name/ma/macpm/package.nix b/pkgs/by-name/ma/macpm/package.nix new file mode 100644 index 000000000000..ea9dca568992 --- /dev/null +++ b/pkgs/by-name/ma/macpm/package.nix @@ -0,0 +1,45 @@ +{ + lib, + + python3Packages, + fetchFromGitHub, +}: + +python3Packages.buildPythonApplication { + pname = "macpm"; + version = "0.24-unstable-2024-11-19"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "visualcjy"; + repo = "macpm"; + rev = "7882d4c86c84bb23a8966ca57990de9b11397bd4"; + hash = "sha256-jqaPPvYbuL8q6grmBLyZLf8aDmjugYxMOWAh1Ix82jc="; + }; + + # has no tests + doCheck = false; + + # backwards compatibility for users still expecting 'asitop' + postInstall = '' + ln -rs $out/bin/macpm $out/bin/asitop + ''; + + dependencies = with python3Packages; [ + dashing + humanize + psutil + ]; + + meta = { + description = "Perf monitoring CLI tool for Apple Silicon; previously named 'asitop'"; + homepage = "https://github.com/visualcjy/macpm"; + mainProgram = "macpm"; + platforms = [ "aarch64-darwin" ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + juliusrickert + siriobalmelli + ]; + }; +} diff --git a/pkgs/os-specific/darwin/asitop/default.nix b/pkgs/os-specific/darwin/asitop/default.nix deleted file mode 100644 index 7e20f26889b7..000000000000 --- a/pkgs/os-specific/darwin/asitop/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - lib, - python3, - fetchPypi, -}: - -python3.pkgs.buildPythonApplication rec { - pname = "asitop"; - version = "0.0.24"; - format = "setuptools"; - - disabled = python3.pythonOlder "3.7"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-Xfe1kwRXKpSPcc+UuHrcYThpqKh6kzWVsbPia/QsPjc="; - }; - - # has no tests - doCheck = false; - - propagatedBuildInputs = with python3.pkgs; [ - dashing - psutil - ]; - - meta = with lib; { - homepage = "https://github.com/tlkh/asitop"; - description = "Perf monitoring CLI tool for Apple Silicon"; - platforms = platforms.darwin; - license = licenses.mit; - maintainers = with maintainers; [ juliusrickert ]; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index fa635a073dd7..816f42206132 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -301,6 +301,7 @@ mapAliases { aria = aria2; # Added 2024-03-26 armcord = throw "ArmCord was renamed to legcord by the upstream developers. Action is required to migrate configurations between the two applications. Please see this PR for more details: https://github.com/NixOS/nixpkgs/pull/347971"; # Added 2024-10-11 aseprite-unfree = aseprite; # Added 2023-08-26 + asitop = macpm; # 'macpm' is a better-maintained downstream; keep 'asitop' for backwards-compatibility async = throw "'async' has been removed due to lack of upstream maintenance"; # Added 2025-01-26 atlassian-bamboo = throw "Atlassian software has been removed, as support for the Atlassian Server products ended in February 2024 and there was insufficient interest in maintaining the Atlassian Data Center replacements"; # Added 2024-11-02 atlassian-confluence = throw "Atlassian software has been removed, as support for the Atlassian Server products ended in February 2024 and there was insufficient interest in maintaining the Atlassian Data Center replacements"; # Added 2024-11-02 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a5f2baf5a3bf..27494e8291c8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -282,8 +282,6 @@ with pkgs; extraPackages = [ jdk17 ]; }; - asitop = callPackage ../os-specific/darwin/asitop { }; - cve = with python3Packages; toPythonApplication cvelib; apko = callPackage ../development/tools/apko {