1{ lib, stdenv, fetchFromGitHub, cmake }:
2
3stdenv.mkDerivation rec {
4 pname = "argparse";
5 version = "2.9";
6
7 src = fetchFromGitHub {
8 owner = "p-ranav";
9 repo = "argparse";
10 rev = "v${version}";
11 sha256 = "sha256-vbf4kePi5gfg9ub4aP1cCK1jtiA65bUS9+5Ghgvxt/E=";
12 };
13
14 postPatch = ''
15 substituteInPlace CMakeLists.txt \
16 --replace '$'{CMAKE_INSTALL_LIBDIR_ARCHIND} '$'{CMAKE_INSTALL_LIBDIR}
17 substituteInPlace packaging/pkgconfig.pc.in \
18 --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
19 '';
20
21 nativeBuildInputs = [
22 cmake
23 ];
24
25 meta = with lib; {
26 description = "Argument Parser for Modern C++";
27 homepage = "https://github.com/p-ranav/argparse";
28 maintainers = with maintainers; [ _2gn ];
29 platforms = platforms.unix;
30 license = licenses.mit;
31 };
32}