about summary refs log tree commit diff
path: root/pkgs/applications/misc/lttoolbox/default.nix
blob: 25dbeba7d953b942f0fd6690b7bcdf3ceecd4746 (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
57
58
59
60
61
62
63
64
65
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, autoconf
, automake
, pkg-config
, utf8cpp
, libtool
, libxml2
, icu
, python3
}:

stdenv.mkDerivation rec {
  pname = "lttoolbox";
  version = "3.7.1";

  src = fetchFromGitHub {
    owner = "apertium";
    repo = "lttoolbox";
    rev = "refs/tags/v${version}";
    hash = "sha256-3lHXKtwQSrMGQEGOGr27e3kB2qKkTFZcEzeAnIm89Rg=";
  };

  patches = [
    # can be removed once the version goes past this commit
    # https://github.com/apertium/lttoolbox/commit/e682fe18a96d5a865cfbd3e5661dbc7b3ace1821
    (fetchpatch {
      url = "https://github.com/apertium/lttoolbox/commit/e682fe18a96d5a865cfbd3e5661dbc7b3ace1821.patch";
      hash = "sha256-VeP8Mv2KYxX+eVjIRw/jHbURaWN665+fiFaoT3VxAno=";
    })
  ];

  nativeBuildInputs = [
    autoconf
    automake
    pkg-config
    utf8cpp
    libtool
  ];
  buildInputs = [
    libxml2
    icu
  ];
  buildFlags = [
    "CPPFLAGS=-I${utf8cpp}/include/utf8cpp"
  ];
  configurePhase = ''
    ./autogen.sh --prefix $out
  '';
  doCheck = true;
  checkPhase = ''
    ${python3}/bin/python3 tests/run_tests.py
  '';

  meta = with lib; {
    description = "Finite state compiler, processor and helper tools used by apertium";
    homepage = "https://github.com/apertium/lttoolbox";
    maintainers = with maintainers; [ onthestairs ];
    changelog = "https://github.com/apertium/lttoolbox/releases/tag/v${version}";
    license = licenses.gpl2;
    platforms = platforms.linux ++ platforms.darwin;
  };
}