nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "argtable";
10 version = "3.3.1";
11
12 src = fetchFromGitHub {
13 owner = "argtable";
14 repo = "argtable3";
15 tag = "v" + finalAttrs.version;
16 hash = "sha256-IW4pqOHKjwxQEmv/V40kIRLin+bQE6PAlfJemFgi5bQ=";
17 };
18
19 nativeBuildInputs = [ cmake ];
20
21 cmakeFlags = [
22 (lib.cmakeBool "BUILD_SHARED_LIBS" true)
23 ];
24
25 postPatch = ''
26 patchShebangs tools/build
27
28 substituteInPlace pkgconfig.pc.in \
29 --replace-fail "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" "@CMAKE_INSTALL_FULL_INCLUDEDIR@" \
30 --replace-fail "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "@CMAKE_INSTALL_FULL_LIBDIR@"
31 '';
32
33 meta = {
34 homepage = "https://github.com/argtable/argtable3";
35 description = "Single-file, ANSI C command-line parsing library";
36 longDescription = ''
37 Argtable is an open source ANSI C library that parses GNU-style
38 command-line options. It simplifies command-line parsing by defining a
39 declarative-style API that you can use to specify what your command-line
40 syntax looks like. Argtable will automatically generate consistent error
41 handling logic and textual descriptions of the command line syntax, which
42 are essential but tedious to implement for a robust CLI program.
43 '';
44 license = lib.licenses.bsd3;
45 maintainers = [ ];
46 platforms = lib.platforms.all;
47 };
48})
49# TODO: a NixOS test suite
50# TODO: multiple outputs
51# TODO: documentation
52# TODO: build both shared and static libs