tailscale: build derpprobe (#364918)
[NixPkgs.git] / pkgs / tools / text / nltk-data / default.nix
blob6a97585d4cfb8dae7881d69a7b1090f3e229cf97
2   lib,
3   newScope,
4   fetchFromGitHub,
5   unzip,
6   stdenvNoCC,
7 }:
8 let
9   base = {
10     version = "0-unstable-2024-07-29";
11     nativeBuildInputs = [ unzip ];
12     dontBuild = true;
13     meta = with lib; {
14       description = "NLTK Data";
15       homepage = "https://github.com/nltk/nltk_data";
16       license = licenses.asl20;
17       platforms = platforms.all;
18       maintainers = with maintainers; [ happysalada ];
19     };
20   };
21   makeNltkDataPackage =
22     {
23       pname,
24       location,
25       hash,
26     }:
27     let
28       src = fetchFromGitHub {
29         owner = "nltk";
30         repo = "nltk_data";
31         rev = "cfe82914f3c2d24363687f1db3b05e8b9f687e2b";
32         inherit hash;
33         sparseCheckout = [ "packages/${location}/${pname}.zip" ];
34       };
35     in
36     stdenvNoCC.mkDerivation (
37       base
38       // {
39         inherit pname src;
40         inherit (base) version;
41         installPhase = ''
42           runHook preInstall
44           mkdir -p $out
45           unzip ${src}/packages/${location}/${pname}.zip
46           mkdir -p $out/${location}
47           cp -R ${pname}/ $out/${location}
49           runHook postInstall
50         '';
51       }
52     );
54 lib.makeScope newScope (self: {
55   punkt = makeNltkDataPackage {
56     pname = "punkt";
57     location = "tokenizers";
58     hash = "sha256-OzMkruoYbFKqzuimOXIpE5lhHz8tmSqOFoLT+fjdTVg=";
59   };
60   punkt_tab = makeNltkDataPackage {
61     pname = "punkt_tab";
62     location = "tokenizers";
63     hash = "sha256-OzMkruoYbFKqzuimOXIpE5lhHz8tmSqOFoLT+fjdTVg=";
64   };
65   averaged_perceptron_tagger = makeNltkDataPackage {
66     pname = "averaged_perceptron_tagger";
67     location = "taggers";
68     hash = "sha256-tl3Cn2okhBkUtTXvAmFRx72Brez6iTGRdmFTwFmpk3M=";
69   };
70   snowball_data = makeNltkDataPackage {
71     pname = "snowball_data";
72     location = "stemmers";
73     hash = "sha256-mNefwOPVJGz9kXV3LV4DuV7FJpNir/Nwg4ujd0CogEk=";
74   };
75   stopwords = makeNltkDataPackage {
76     pname = "stopwords";
77     location = "corpora";
78     hash = "sha256-8lMjW5YI8h6dHJ/83HVY2OYGDyKPpgkUAKPISiAKqqk=";
79   };
80   wordnet = makeNltkDataPackage {
81     pname = "wordnet";
82     location = "corpora";
83     hash = "sha256-8lMjW5YI8h6dHJ/83HVY2OYGDyKPpgkUAKPISiAKqqk=";
84   };