nixpkgs/pkgs/applications/misc/fbmenugen/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

76 lines
1.4 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, fluxbox
, gnused
, makeWrapper
, perlPackages
, substituteAll
, xorg
, wrapGAppsHook
}:
perlPackages.buildPerlPackage rec {
pname = "fbmenugen";
version = "0.85";
src = fetchFromGitHub {
owner = "trizen";
repo = pname;
rev = version;
sha256 = "1pmms3wzkm8h41a8zrkpn6gq9m9yy5wr5rrzmb84lbacprqq6q7q";
};
patches = [
(substituteAll {
src = ./0001-Fix-paths.patch;
xmessage = xorg.xmessage;
inherit fluxbox gnused;
})
];
outputs = [ "out" ];
nativeBuildInputs = [
makeWrapper
wrapGAppsHook
];
buildInputs = [
fluxbox
gnused
perlPackages.DataDump
perlPackages.FileDesktopEntry
perlPackages.Gtk3
perlPackages.LinuxDesktopFiles
perlPackages.perl
xorg.xmessage
];
dontConfigure = true;
dontBuild = true;
postPatch = ''
substituteInPlace fbmenugen --subst-var-by fbmenugen $out
'';
installPhase = ''
runHook preInstall
install -D -t $out/bin ${pname}
install -D -t $out/etc/xdg/${pname} schema.pl
runHook postInstall
'';
postFixup = ''
wrapProgram "$out/bin/${pname}" --prefix PERL5LIB : "$PERL5LIB"
'';
meta = with lib; {
homepage = "https://github.com/trizen/fbmenugen";
description = "Simple menu generator for the Fluxbox Window Manager";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = [ maintainers.romildo ];
};
}