From bc4ed466562d2941d7726b1f713536633aa4fe9b Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 31 Jan 2023 16:22:21 +0100 Subject: libyamlcpp: Refactor --- pkgs/development/libraries/libyaml-cpp/default.nix | 43 ++++++++++++++++------ 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/libyaml-cpp/default.nix b/pkgs/development/libraries/libyaml-cpp/default.nix index 9b30ce19b1d..c9468b10b99 100644 --- a/pkgs/development/libraries/libyaml-cpp/default.nix +++ b/pkgs/development/libraries/libyaml-cpp/default.nix @@ -1,40 +1,61 @@ -{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch }: +{ lib +, stdenv +, fetchFromGitHub +, gitUpdater +, cmake +, fetchpatch +}: stdenv.mkDerivation rec { - pname = "libyaml-cpp"; + pname = "yaml-cpp"; version = "0.7.0"; src = fetchFromGitHub { owner = "jbeder"; repo = "yaml-cpp"; rev = "yaml-cpp-${version}"; - sha256 = "sha256-2tFWccifn0c2lU/U1WNg2FHrBohjx8CXMllPJCevaNk="; + hash = "sha256-2tFWccifn0c2lU/U1WNg2FHrBohjx8CXMllPJCevaNk="; }; patches = [ # https://github.com/jbeder/yaml-cpp/issues/774 # https://github.com/jbeder/yaml-cpp/pull/1037 (fetchpatch { + name = "yaml-cpp-Fix-generated-cmake-config.patch"; url = "https://github.com/jbeder/yaml-cpp/commit/4f48727b365962e31451cd91027bd797bc7d2ee7.patch"; - sha256 = "sha256-jarZAh7NgwL3xXzxijDiAQmC/EC2WYfNMkYHEIQBPhM="; + hash = "sha256-jarZAh7NgwL3xXzxijDiAQmC/EC2WYfNMkYHEIQBPhM="; }) # TODO: Remove with the next release, when https://github.com/jbeder/yaml-cpp/pull/1058 is available (fetchpatch { - name = "libyaml-cpp-Fix-pc-paths-for-absolute-GNUInstallDirs.patchj"; + name = "yaml-cpp-Fix-pc-paths-for-absolute-GNUInstallDirs.patch"; url = "https://github.com/jbeder/yaml-cpp/commit/328d2d85e833be7cb5a0ab246cc3f5d7e16fc67a.patch"; - sha256 = "12g5h7lxzd5v16ykay03zww5g28j3k69k228yr3v8fnmyv2spkfl"; + hash = "sha256-1M2rxfbVOrRH9kiImcwcEolXOP8DeDW9Cbu03+mB5Yk="; }) ]; - nativeBuildInputs = [ cmake ]; + strictDeps = true; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DYAML_CPP_BUILD_TESTS=OFF" ]; + nativeBuildInputs = [ + cmake + ]; + + cmakeFlags = [ + "-DYAML_CPP_BUILD_TOOLS=false" + "-DYAML_BUILD_SHARED_LIBS=${lib.boolToString (!stdenv.hostPlatform.isStatic)}" + "-DINSTALL_GTEST=false" + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + passthru.updateScript = gitUpdater { + rev-prefix = "yaml-cpp-"; + }; meta = with lib; { - inherit (src.meta) homepage; description = "A YAML parser and emitter for C++"; + homepage = "https://github.com/jbeder/yaml-cpp"; license = licenses.mit; - platforms = platforms.unix; - maintainers = with maintainers; [ ]; + platforms = platforms.all; + maintainers = with maintainers; [ OPNA2608 ]; }; } -- cgit 1.4.1