about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/gengetopt/default.nix
blob: 9ef5ec24d545b8c0034bfdfdd83280cdbc063e92 (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
{ fetchurl, lib, stdenv, texinfo, help2man }:

stdenv.mkDerivation rec {
  pname = "gengetopt";
  version = "2.23";

  src = fetchurl {
    url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
    sha256 = "1b44fn0apsgawyqa4alx2qj5hls334mhbszxsy6rfr0q074swhdr";
  };

  doCheck = true;
  # attempts to open non-existent file
  preCheck = ''
    rm tests/test_conf_parser_save.sh
  '';

  # test suite is not thread safe
  enableParallelBuilding = false;

  nativeBuildInputs = [ texinfo help2man ];

  #Fix, see #28255
  postPatch = ''
    substituteInPlace configure --replace \
      'set -o posix' \
      'set +o posix'
  '';

  env = lib.optionalAttrs stdenv.cc.isClang {
    CXXFLAGS = "-std=c++14";
  };

  meta = {
    description = "Command-line option parser generator";
    mainProgram = "gengetopt";

    longDescription =
      '' GNU Gengetopt program generates a C function that uses getopt_long
         function to parse the command line options, to validate them and
         fills a struct
      '';

    homepage = "https://www.gnu.org/software/gengetopt/";

    license = lib.licenses.gpl3Plus;

    maintainers = [ ];
    platforms = lib.platforms.all;
  };
}