1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 python3,
8}:
9
10stdenv.mkDerivation rec {
11 version = "0.6.3";
12 pname = "docopt.cpp";
13
14 src = fetchFromGitHub {
15 owner = "docopt";
16 repo = "docopt.cpp";
17 rev = "v${version}";
18 sha256 = "0cz3vv7g5snfbsqcf3q8bmd6kv5qp84gj3avwkn4vl00krw13bl7";
19 };
20
21 patches = [
22 (fetchpatch {
23 name = "python3-for-tests";
24 url = "https://github.com/docopt/docopt.cpp/commit/b3d909dc952ab102a4ad5a1541a41736f35b92ba.patch";
25 hash = "sha256-JJR09pbn3QhYaZAIAjs+pe28+g1VfgHUKspWorHzr8o=";
26 })
27 ];
28
29 nativeBuildInputs = [
30 cmake
31 python3
32 ];
33
34 cmakeFlags = [ "-DWITH_TESTS=ON" ];
35
36 strictDeps = true;
37
38 doCheck = true;
39
40 postPatch = ''
41 substituteInPlace docopt.pc.in \
42 --replace "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" \
43 "@CMAKE_INSTALL_LIBDIR@"
44 '';
45
46 checkPhase = "python ./run_tests";
47
48 meta = with lib; {
49 description = "C++11 port of docopt";
50 homepage = "https://github.com/docopt/docopt.cpp";
51 license = with licenses; [
52 mit
53 boost
54 ];
55 platforms = platforms.all;
56 maintainers = with maintainers; [ ];
57 };
58}