nixpkgs/pkgs/by-name/ps/pstree/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

40 lines
1.1 KiB
Nix

{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "pstree";
version = "2.39";
src = fetchurl {
urls = [
"https://distfiles.macports.org/${pname}/${pname}-${version}.tar.gz"
"https://fossies.org/linux/misc/${pname}-${version}.tar.gz"
"ftp://ftp.thp.uni-duisburg.de/pub/source/${pname}-${version}.tar.gz"
];
sha256 = "17s7v15c4gryjpi11y1xq75022nkg4ggzvjlq2dkmyg67ssc76vw";
};
sourceRoot = ".";
buildPhase = ''
runHook preBuild
$CC $NIX_CFLAGS -o pstree pstree.c
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm0555 ${pname} -t $out/bin
install -Dm0444 ${pname}.1 -t $out/share/man/man1
runHook postInstall
'';
meta = with lib; {
description = "Show the set of running processes as a tree";
homepage = "http://www.thp.uni-duisburg.de/pstree/";
license = licenses.gpl2;
maintainers = [ maintainers.c0bw3b ];
platforms = platforms.unix;
priority = 5; # Lower than psmisc also providing pstree on Linux platforms
mainProgram = "pstree";
};
}