at master 60 lines 1.5 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 fetchpatch, 6 gitUpdater, 7 cmake, 8 static ? stdenv.hostPlatform.isStatic, 9}: 10 11stdenv.mkDerivation rec { 12 pname = "yaml-cpp"; 13 version = "0.8.0"; 14 15 src = fetchFromGitHub { 16 owner = "jbeder"; 17 repo = "yaml-cpp"; 18 rev = version; 19 hash = "sha256-J87oS6Az1/vNdyXu3L7KmUGWzU0IAkGrGMUUha+xDXI="; 20 }; 21 22 patches = [ 23 (fetchpatch { 24 name = "yaml-cpp-fix-cmake-4.patch"; 25 url = "https://github.com/jbeder/yaml-cpp/commit/c2680200486572baf8221ba052ef50b58ecd816e.patch"; 26 hash = "sha256-1kXRa+xrAbLEhcJxNV1oGHPmayj1RNIe6dDWXZA3mUA="; 27 }) 28 # Fix build with gcc15 29 # https://github.com/jbeder/yaml-cpp/pull/1310 30 (fetchpatch { 31 name = "yaml-cpp-add-include-cstdint-gcc15.patch"; 32 url = "https://github.com/jbeder/yaml-cpp/commit/7b469b4220f96fb3d036cf68cd7bd30bd39e61d2.patch"; 33 hash = "sha256-4Mua6cYD8UR+fJfFeu0fdYVFprsiuF89HvbaTByz9nI="; 34 }) 35 ]; 36 37 strictDeps = true; 38 39 nativeBuildInputs = [ 40 cmake 41 ]; 42 43 cmakeFlags = [ 44 "-DYAML_CPP_BUILD_TOOLS=false" 45 (lib.cmakeBool "YAML_BUILD_SHARED_LIBS" (!static)) 46 "-DINSTALL_GTEST=false" 47 ]; 48 49 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 50 51 passthru.updateScript = gitUpdater { }; 52 53 meta = with lib; { 54 description = "YAML parser and emitter for C++"; 55 homepage = "https://github.com/jbeder/yaml-cpp"; 56 license = licenses.mit; 57 platforms = platforms.all; 58 maintainers = with maintainers; [ OPNA2608 ]; 59 }; 60}