nixpkgs/pkgs/by-name/pm/pmenu/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

63 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, writeText
, fontconfig
, imlib2
, libX11
, libXext
, libXft
, libXinerama
, libXrender
, conf ? null
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pmenu";
version = "3.1.1";
src = fetchFromGitHub {
owner = "phillbush";
repo = "pmenu";
rev = "v${finalAttrs.version}";
hash = "sha256-7NI5az3LxOYEnsts8Qqi3gvO3dXpNjPDOTW2c5Y25Lc=";
};
buildInputs = [
fontconfig
imlib2
libX11
libXext
libXft
libXinerama
libXrender
];
postPatch = let
configFile =
if lib.isDerivation conf || builtins.isPath conf
then conf else writeText "config.h" conf;
in
lib.optionalString (conf != null) "mv ${configFile} config.h";
makeFlags = [
"INSTALL=install"
"PREFIX=\${out}"
];
meta = {
description = "Pie-menu tool";
homepage = "https://github.com/phillbush/pmenu";
changelog = "https://github.com/phillbush/pmenu/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
longDescription = ''
πmenu is a pie menu utility for X. πmenu receives a menu specification in
stdin, shows a menu for the user to select one of the options, and outputs
the option selected to stdout.
'';
maintainers = [ lib.maintainers.azahi ];
platforms = lib.platforms.unix;
mainProgram = "pmenu";
};
})