nixpkgs/pkgs/applications/misc/wordnet/default.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

58 lines
1.8 KiB
Nix

{ lib, stdenv, fetchurl, tcl, tk, Cocoa, makeWrapper }:
stdenv.mkDerivation rec {
version = "3.0";
pname = "wordnet";
src = fetchurl {
url = "http://wordnetcode.princeton.edu/${version}/WordNet-${version}.tar.bz2";
sha256 = "08pgjvd2vvmqk3h641x63nxp7wqimb9r30889mkyfh2agc62sjbc";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ tcl tk ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ];
hardeningDisable = [ "format" ];
patchPhase = ''
sed "13i#define USE_INTERP_RESULT 1" -i src/stubs.c
'';
# Fails the build on clang-16 and on upcoming gcc-14.
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int";
# Needs the path to `tclConfig.sh' and `tkConfig.sh'.
configureFlags = [
"--with-tcl=${tcl}/lib"
"--with-tk=${tk}/lib"
];
postInstall = ''
wrapProgram $out/bin/wnb --prefix PATH : "$out/bin"
'';
meta = {
description = "Lexical database for the English language";
longDescription = ''
WordNet® is a large lexical database of English. Nouns, verbs,
adjectives and adverbs are grouped into sets of cognitive synonyms
(synsets), each expressing a distinct concept. Synsets are
interlinked by means of conceptual-semantic and lexical relations.
The resulting network of meaningfully related words and concepts can
be navigated with the browser. WordNet is also freely and publicly
available for download. WordNet's structure makes it a useful tool
for computational linguistics and natural language processing.
'';
homepage = "https://wordnet.princeton.edu/";
license = {
fullName = "WordNet 3.0 license";
url = "https://wordnet.princeton.edu/license-and-commercial-use";
};
maintainers = [ ];
platforms = with lib.platforms; linux ++ darwin;
mainProgram = "wn";
};
}