nixpkgs/pkgs/applications/misc/ding/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

85 lines
1.7 KiB
Nix

{
aspell,
aspellDicts_de,
aspellDicts_en,
buildEnv,
fetchurl,
fortune,
gnugrep,
makeWrapper,
lib,
stdenv,
tk,
tre,
}:
let
aspellEnv = buildEnv {
name = "env-ding-aspell";
paths = [
aspell
aspellDicts_de
aspellDicts_en
];
};
in
stdenv.mkDerivation rec {
pname = "ding";
version = "1.9";
src = fetchurl {
url = "http://ftp.tu-chemnitz.de/pub/Local/urz/ding/ding-${version}.tar.gz";
sha256 = "sha256-aabIH894WihsBTo1LzIBzIZxxyhRYVxLcHpDQwmwmOU=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
aspellEnv
fortune
gnugrep
tk
tre
];
patches = [ ./dict.patch ];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/dict
mkdir -p $out/share/man/man1
mkdir -p $out/share/applications
mkdir -p $out/share/pixmaps
for f in ding ding.1; do
sed -i "s@/usr/share@$out/share@g" "$f"
done
sed -i "s@/usr/bin/fortune@fortune@g" ding
sed -i "s@/usr/bin/ding@$out/bin/ding@g" ding.desktop
cp -v ding $out/bin/
cp -v de-en.txt $out/share/dict/
cp -v ding.1 $out/share/man/man1/
cp -v ding.png $out/share/pixmaps/
cp -v ding.desktop $out/share/applications/
wrapProgram $out/bin/ding --prefix PATH : ${
lib.makeBinPath [
gnugrep
aspellEnv
tk
fortune
]
} --prefix ASPELL_CONF : "\"prefix ${aspellEnv};\""
'';
meta = with lib; {
description = "Simple and fast dictionary lookup tool";
mainProgram = "ding";
homepage = "https://www-user.tu-chemnitz.de/~fri/ding/";
license = licenses.gpl2Plus;
platforms = platforms.linux; # homepage says: unix-like except darwin
maintainers = [ maintainers.exi ];
};
}