summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/dict/default.nix
blob: 0deed5dcc6092e8d7993c1ecab8c8d311d320c02 (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
55
56
57
58
59
60
{
  lib,
  stdenv,
  fetchurl,
  which,
  bison,
  flex,
  libmaa,
  zlib,
  libtool,
  nixosTests,
}:

stdenv.mkDerivation rec {
  pname = "dictd";
  version = "1.13.3";

  src = fetchurl {
    url = "mirror://sourceforge/dict/dictd-${version}.tar.gz";
    hash = "sha256-GSEp37OPpyP0ipWGx5xRmPxJBP7BdXF2kXMU3Qc/EXE=";
  };

  patches = [
    ./buildfix.diff
  ];

  buildInputs = [
    libmaa
    zlib
  ];

  nativeBuildInputs = [
    bison
    flex
    libtool
    which
  ];

  # In earlier versions, parallel building was not supported but it's OK with 1.13
  enableParallelBuilding = true;

  configureFlags = [
    "--datadir=/run/current-system/sw/share/dictd"
    "--sysconfdir=/etc"
  ];

  postInstall = ''
    install -Dm444 -t $out/share/doc/${pname} NEWS README
  '';

  passthru.tests.nixos = nixosTests.dictd;

  meta = {
    description = "Dict protocol server and client";
    homepage = "http://www.dict.org";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [ sikmir ];
    platforms = lib.platforms.unix;
  };
}