2021-01-11 07:54:33 +00:00
|
|
|
{ aspell, aspellDicts_de, aspellDicts_en, buildEnv, fetchurl, fortune, gnugrep, makeWrapper, lib, stdenv, tk, tre }:
|
2015-12-29 14:29:35 +00:00
|
|
|
let
|
|
|
|
aspellEnv = buildEnv {
|
|
|
|
name = "env-ding-aspell";
|
|
|
|
paths = [
|
|
|
|
aspell
|
|
|
|
aspellDicts_de
|
|
|
|
aspellDicts_en
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-01-19 12:13:00 +00:00
|
|
|
name = "ding-1.9";
|
2015-12-29 14:29:35 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ftp.tu-chemnitz.de/pub/Local/urz/ding/${name}.tar.gz";
|
2021-01-19 12:13:00 +00:00
|
|
|
sha256 = "sha256-aabIH894WihsBTo1LzIBzIZxxyhRYVxLcHpDQwmwmOU=";
|
2015-12-29 14:29:35 +00:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ aspellEnv fortune gnugrep tk tre ];
|
2015-12-29 14:29:35 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-01-02 02:58:07 +00:00
|
|
|
sed -i "s@/usr/bin/ding@$out/bin/ding@g" ding.desktop
|
|
|
|
|
2017-01-11 14:16:31 +00:00
|
|
|
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/
|
2015-12-29 14:29:35 +00:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
wrapProgram $out/bin/ding --prefix PATH : ${lib.makeBinPath [ gnugrep aspellEnv tk fortune ]} --prefix ASPELL_CONF : "\"prefix ${aspellEnv};\""
|
2015-12-29 14:29:35 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-12-29 14:29:35 +00:00
|
|
|
description = "Simple and fast dictionary lookup tool";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www-user.tu-chemnitz.de/~fri/ding/";
|
2015-12-29 14:29:35 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux; # homepage says: unix-like except darwin
|
|
|
|
maintainers = [ maintainers.exi ];
|
|
|
|
};
|
|
|
|
}
|