nixpkgs/pkgs/by-name/ps/psutils/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

36 lines
893 B
Nix

{ lib, stdenv, fetchurl, perl }:
stdenv.mkDerivation rec {
pname = "psutils";
version = "17";
src = fetchurl {
url = "http://knackered.knackered.org/angus/download/${pname}/${pname}-p${version}.tar.gz";
hash = "sha256-OFPreVhLqPvieoFUJbZan38Vsljg1DoFqFa9t11YiuQ=";
};
postPatch = ''
sed -i 's/void main/int main/' *.c
'';
configurePhase = ''
sed -e 's,/usr/local/bin/perl,${perl}/bin/perl,' \
-e "s,/usr/local,$out," \
-e "s,CFLAGS =,CFLAGS = -std=c89," \
Makefile.unix > Makefile
'';
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
preInstall = ''
mkdir -p $out/bin $out/share/man/man1
'';
meta = {
description = "Collection of useful utilities for manipulating PS documents";
homepage = "http://knackered.knackered.org/angus/psutils/";
license = lib.licenses.bsd3;
platforms = lib.platforms.unix;
};
}