nixpkgs/pkgs/servers/dict/dictd-wordnet.nix
piegames 68927918d0 treewide: Fix indentation in strings
The indentation stripping semantics of strings are fairly bad and have a
few gotchas where the resulting string has not the intended indentation.
This commit fixes most if not all such instances in Nixpkgs.

I tried to strive a balance between keeping the diff small and
reformatting/refactoring the code to look better. In general,
reformatting should be left to Nixfmt.

Note that this causes a lot of rebuilds by design. All changes need to
be thoroughly vetted and reviewed for correctness. There is no automatic
way to prove correctness.

List of files to fix generated by running
https://gerrit.lix.systems/c/lix/+/2092 on Nixpkgs and looking at the
warnings.
2024-10-22 21:36:42 +02:00

39 lines
994 B
Nix

{lib, stdenv, python3, wordnet, writeScript, libfaketime}:
stdenv.mkDerivation rec {
version = "542";
pname = "dict-db-wordnet";
buildInputs = [python3 wordnet libfaketime];
convert = ./wordnet_structures.py;
builder = writeScript "builder.sh" ''
. ${stdenv}/setup
mkdir -p $out/share/dictd/
cd $out/share/dictd
for i in ${wordnet}/dict/data.*; do
DATA="$DATA `echo $i | sed -e s,data,index,` $i";
done
source_date=$(date --utc --date=@$SOURCE_DATE_EPOCH "+%F %T")
faketime -f "$source_date" python ${convert} $DATA
echo en_US.UTF-8 > locale
'';
meta = {
description = "dictd-compatible version of WordNet";
longDescription = ''
WordNet® is a large lexical database of English. This package makes
the wordnet data available to dictd and by extension for lookup with
the dict command.
'';
homepage = "https://wordnet.princeton.edu/";
maintainers = [ ];
platforms = lib.platforms.all;
};
}