git.iko.soy/typeable/nixpkgs
on master help sign in
libyaml-cpp: apply patch to fix cmake variables
commit7cda65b81a8883817f641b6f9922fc8e17ff2256 authorArtturin <Artturin@artturin.com> dateWed 29 Sep 2021, 14:51 (5 years ago) parent5763d8c
3 files changed+43−14
pkgs/development/libraries/libyaml-cpp/0.3.0.nix+32 pkgs/development/libraries/libyaml-cpp/default.nix+9−7 pkgs/top-level/all-packages.nix+2−7
pkgs/development/libraries/libyaml-cpp/0.3.0.nixnew file+32
@@ -0,0 +1,32 @@
1+{ lib, stdenv, fetchFromGitHub, cmake }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "libyaml-cpp";
5+ version = "0.3.0";
6+
7+ src = fetchFromGitHub {
8+ owner = "jbeder";
9+ repo = "yaml-cpp";
10+ rev = "release-${version}";
11+ sha256 = "sha256-pmgcULTXhl83+Wc8ZsGebnJ1t0XybHhUEJxDnEZE5x8=";
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 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+}
pkgs/development/libraries/libyaml-cpp/default.nix+9−7
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchFromGitHub, cmake }:
1+{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch }:
22
33stdenv.mkDerivation rec {
44 pname = "libyaml-cpp";
@@ -11,12 +11,14 @@ stdenv.mkDerivation rec {
1111 sha256 = "sha256-2tFWccifn0c2lU/U1WNg2FHrBohjx8CXMllPJCevaNk=";
1212 };
1313
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− '';
14+ patches = [
15+ # https://github.com/jbeder/yaml-cpp/issues/774
16+ # https://github.com/jbeder/yaml-cpp/pull/1037
17+ (fetchpatch {
18+ url = "https://github.com/jbeder/yaml-cpp/commit/4f48727b365962e31451cd91027bd797bc7d2ee7.patch";
19+ sha256 = "sha256-jarZAh7NgwL3xXzxijDiAQmC/EC2WYfNMkYHEIQBPhM=";
20+ })
21+ ];
2022
2123 nativeBuildInputs = [ cmake ];
2224
pkgs/top-level/all-packages.nix+2−7
@@ -18152,17 +18152,12 @@ with pkgs;
1815218152
1815318153 libyamlcpp = callPackage ../development/libraries/libyaml-cpp { };
1815418154
18155+ libyamlcpp_0_3 = callPackage ../development/libraries/libyaml-cpp/0.3.0.nix { };
18156+
1815518157 libcyaml = callPackage ../development/libraries/libcyaml { };
1815618158
1815718159 rang = callPackage ../development/libraries/rang { };
1815818160
18159− libyamlcpp_0_3 = pkgs.libyamlcpp.overrideAttrs (oldAttrs: {
18160− src = pkgs.fetchurl {
18161− url = "https://github.com/jbeder/yaml-cpp/archive/release-0.3.0.tar.gz";
18162− sha256 = "12aszqw6svwlnb6nzhsbqhz3c7vnd5ahd0k6xlj05w8lm83hx3db";
18163− };
18164− });
18165−
1816618161 libykclient = callPackage ../development/libraries/libykclient { };
1816718162
1816818163 libykneomgr = callPackage ../development/libraries/libykneomgr { };