about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/argtable/default.nix
blob: f22f81c877099282872916fe002abc8125fd5bde (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation rec {
  pname = "argtable";
  version = "3.2.1";
  srcVersion = "v${version}.52f24e5";

  src = fetchFromGitHub {
    owner = "argtable";
    repo = "argtable3";
    rev = srcVersion;
    hash = "sha256-HFsk91uJXQ0wpvAQxP4/yZwRQx9kLH7KgB3Y/+zcZC0=";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [
    "-DBUILD_SHARED_LIBS=ON"
  ];

  postPatch = ''
    patchShebangs tools/build
  '';

  meta = with lib; {
    homepage = "https://argtable.org";
    description = "A single-file, ANSI C command-line parsing library";
    longDescription = ''
      Argtable is an open source ANSI C library that parses GNU-style
      command-line options. It simplifies command-line parsing by defining a
      declarative-style API that you can use to specify what your command-line
      syntax looks like. Argtable will automatically generate consistent error
      handling logic and textual descriptions of the command line syntax, which
      are essential but tedious to implement for a robust CLI program.
    '';
    license = with licenses; bsd3;
    maintainers = with maintainers; [ AndersonTorres artuuge ];
    platforms = with platforms; all;
  };
}
# TODO: a NixOS test suite
# TODO: multiple outputs
# TODO: documentation
# TODO: build both shared and static libs