From db27acb1c88650284624eaabd2ca535a0a8cf216 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Fri, 8 Jan 2021 15:30:13 -0300 Subject: [PATCH] argtable: 3.0.1 -> 3.1.5 --- .../libraries/argtable/default.nix | 40 ++++++++++++++++++ pkgs/tools/misc/argtable/default.nix | 41 ------------------- pkgs/top-level/all-packages.nix | 4 +- 3 files changed, 42 insertions(+), 43 deletions(-) create mode 100644 pkgs/development/libraries/argtable/default.nix delete mode 100644 pkgs/tools/misc/argtable/default.nix diff --git a/pkgs/development/libraries/argtable/default.nix b/pkgs/development/libraries/argtable/default.nix new file mode 100644 index 000000000000..bf953d87fe2a --- /dev/null +++ b/pkgs/development/libraries/argtable/default.nix @@ -0,0 +1,40 @@ +{ stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation rec { + pname = "argtable"; + version = "3.1.5"; + srcVersion = "v${version}.1c1bb23"; + + src = fetchFromGitHub { + owner = "argtable"; + repo = "argtable3"; + rev = srcVersion; + sha256 = "sha256-sL6mnxsuL1K0DY26jLF/2Czo0RxHYJ3xU3VyavISiMM="; + }; + + nativeBuildInputs = [ cmake ]; + + postPatch = '' + patchShebangs tools/build + ''; + + meta = with stdenv.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 [ AndersonTorres ]: a NixOS test suite diff --git a/pkgs/tools/misc/argtable/default.nix b/pkgs/tools/misc/argtable/default.nix deleted file mode 100644 index 867b2eaba5d0..000000000000 --- a/pkgs/tools/misc/argtable/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ stdenv -, fetchgit -}: -stdenv.mkDerivation { - pname = "argtable"; - version = "3.0.1"; - - src = fetchgit { - url = "https://github.com/argtable/argtable3.git"; - rev = "de93cfd85f755250285b337cba053a709a270721"; - sha256 = "0fbvk78s3dwryrzgafdra0lb8w7lb873c6xgldl94ps9828x85i3"; - }; - - buildPhase = '' - gcc -shared -o libargtable3.so -fPIC argtable3.c - - pushd tests - make - popd - ''; - - installPhase = '' - mkdir -p $out/include - cp argtable3.h $out/include - - mkdir -p $out/lib - cp libargtable3.so $out/lib - - mkdir -p $out/src - cp argtable3.c $out/src - cp -r examples $out/src - ln -s $out/include/argtable3.h $out/src/argtable3.h - ''; - - meta = with stdenv.lib; { - homepage = "https://www.argtable.org/"; - description = "A Cross-Platform, Single-File, ANSI C Command-Line Parsing Library"; - license = licenses.bsd3; - maintainers = with maintainers; [ artuuge ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a63f5652991c..612cedb130ff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -905,14 +905,14 @@ in apitrace = libsForQt514.callPackage ../applications/graphics/apitrace {}; + argtable = callPackage ../development/libraries/argtable { }; + arguments = callPackage ../development/libraries/arguments { }; argus = callPackage ../tools/networking/argus {}; argus-clients = callPackage ../tools/networking/argus-clients {}; - argtable = callPackage ../tools/misc/argtable {}; - argyllcms = callPackage ../tools/graphics/argyllcms {}; arp-scan = callPackage ../tools/misc/arp-scan { };