about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/hfst-ospell/default.nix
blob: f0a0bc6bef48afa3ad16b3db7911dc06497fb659 (plain) (blame)
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
55
56
{ lib
, stdenv
, autoreconfHook
, fetchFromGitHub
, fetchpatch
, icu
, libarchive
, pkg-config
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "hfst-ospell";
  version = "0.5.3";

  src = fetchFromGitHub {
    owner = "hfst";
    repo = "hfst-ospell";
    rev = "refs/tags/v${finalAttrs.version}";
    hash = "sha256-16H1nbAIe+G71+TnlLG0WnH9LktZwmc0d0O+oYduH1k=";
  };

  patches = [
    # Pull upstream fix for gcc-13
    (fetchpatch {
      name = "cstdint.patch";
      url = "https://github.com/hfst/hfst-ospell/commit/7481bffbf622bc9aee3547183fbe8db9cf8b22ce.patch";
      hash = "sha256-q/B5mLx8Oc0nIRe3n3gl0OTyjIaEMCBsPc1GvpE226c=";
    })
  ];

  buildInputs = [
    icu
    libarchive
  ];

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];

  # libxmlxx is listed as a dependency but Darwin build fails with it,
  # might also be better in general since libxmlxx in Nixpkgs is 8 years old
  # https://github.com/hfst/hfst-ospell/issues/48#issuecomment-546535653
  configureFlags = [
    "--without-libxmlpp"
    "--without-tinyxml2"
  ];

  meta = with lib; {
    homepage = "https://github.com/hfst/hfst-ospell/";
    description = "HFST spell checker library and command line tool ";
    license = licenses.asl20;
    maintainers = with maintainers; [ lurkki ];
    platforms = platforms.unix;
  };
})