summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/re/recutils/package.nix
blob: 544089b2d46e3bcd31caa33c817d3e9280882173 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  bc,
  check,
  curl,

  withEncryption ? true,
  libgcrypt,
  libgpg-error,

  withUuid ? true,
  libuuid,

  withBashBuiltins ? true,
  bash,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "recutils";
  version = "1.9";

  src = fetchurl {
    url = "mirror://gnu/recutils/recutils-${finalAttrs.version}.tar.gz";
    hash = "sha256-YwFZKwAgwUtFZ1fvXUNNSfYCe45fOkmdEzYvIFxIbg4=";
  };

  patches = [
    (fetchpatch {
      name = "configure-big_sur.diff";
      url = "https://github.com/Homebrew/formula-patches/raw/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff";
      hash = "sha256-NazWrrwZhD8aKzpj6IC6zrD1J4qxrOZh5XpQLZ14yTw=";
    })
  ];

  hardeningDisable = lib.optional stdenv.cc.isClang "format";

  configureFlags = lib.optionals withBashBuiltins [
    "--with-bash-headers=${bash.dev}/include/bash"
  ];

  buildInputs = [
    curl
  ]
  ++ lib.optionals withEncryption [
    libgpg-error.dev
    libgcrypt.dev
  ]
  ++ lib.optionals withUuid [
    libuuid
  ]
  ++ lib.optionals withBashBuiltins [
    bash.dev
  ];

  env.NIX_CFLAGS_COMPILE = toString (
    lib.optionals stdenv.cc.isClang [
      "-Wno-error=implicit-function-declaration"
    ]
    ++ lib.optionals stdenv.cc.isGNU [
      "-Wno-error=implicit-function-declaration"
      "-Wno-error=incompatible-pointer-types"
    ]
  );

  nativeCheckInputs = [
    bc
    check
  ];

  doCheck = true;

  meta = {
    homepage = "https://www.gnu.org/software/recutils/";
    description = "Tools and libraries to access human-editable, text-based databases";
    longDescription = ''
      GNU Recutils is a set of tools and libraries to access human-editable,
      text-based databases called recfiles. The data is stored as a sequence of
      records, each record containing an arbitrary number of named fields.
    '';
    license = lib.licenses.gpl3Plus;
    maintainers = [ ];
    platforms = lib.platforms.all;
  };
})