1{ stdenv, fetchFromGitHub, cmake }:
2
3stdenv.mkDerivation rec {
4 pname = "libyaml-cpp";
5 version = "0.6.3";
6
7 src = fetchFromGitHub {
8 owner = "jbeder";
9 repo = "yaml-cpp";
10 rev = "yaml-cpp-${version}";
11 sha256 = "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s";
12 };
13
14 # implement https://github.com/jbeder/yaml-cpp/commit/52a1378e48e15d42a0b755af7146394c6eff998c
15 postPatch = ''
16 substituteInPlace CMakeLists.txt \
17 --replace 'option(YAML_BUILD_SHARED_LIBS "Build Shared Libraries" OFF)' \
18 'option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ''${BUILD_SHARED_LIBS})'
19 '';
20
21 nativeBuildInputs = [ cmake ];
22
23 cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DYAML_CPP_BUILD_TESTS=OFF" ];
24
25 meta = with stdenv.lib; {
26 inherit (src.meta) homepage;
27 description = "A YAML parser and emitter for C++";
28 license = licenses.mit;
29 platforms = platforms.unix;
30 maintainers = with maintainers; [ andir ];
31 };
32}