summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/hyphen/default.nix
blob: 214149fc1f23eb858f369e2075c4686d718083cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  stdenv,
  fetchurl,
  perl,
}:

let
  version = "2.8.8";
  folder =
    with builtins;
    let
      parts = splitVersion version;
    in
    concatStringsSep "." [
      (elemAt parts 0)
      (elemAt parts 1)
    ];
in
stdenv.mkDerivation rec {
  pname = "hyphen";
  inherit version;

  nativeBuildInputs = [ perl ];

  src = fetchurl {
    url = "https://sourceforge.net/projects/hunspell/files/Hyphen/${folder}/${pname}-${version}.tar.gz";
    sha256 = "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih";
  };

  # Do not install the en_US dictionary.
  installPhase = ''
    runHook preInstall
    make install-libLTLIBRARIES
    make install-binSCRIPTS
    make install-includeHEADERS

    # license
    install -D -m644 COPYING "$out/share/licenses/${pname}/LICENSE"
    runHook postInstall
  '';

  meta = {
    description = "Text hyphenation library";
    mainProgram = "substrings.pl";
    homepage = "https://sourceforge.net/projects/hunspell/files/Hyphen/";
    platforms = lib.platforms.all;
    license = with lib.licenses; [
      gpl2
      lgpl21
      mpl11
    ];
  };
}