From 87aef5e85678a12e636b0735ecc8ef8aaee2c6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 11 Jun 2022 21:27:14 +0000 Subject: [PATCH] rapidfuzz-cpp: 1.0.1 -> 1.0.2 https://github.com/maxbachmann/rapidfuzz-cpp/releases/tag/v1.0.2 --- .../libraries/rapidfuzz-cpp/default.nix | 20 +++++-- .../dont-fetch-project-options.patch | 58 +++++++++++++++++++ 2 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/libraries/rapidfuzz-cpp/dont-fetch-project-options.patch diff --git a/pkgs/development/libraries/rapidfuzz-cpp/default.nix b/pkgs/development/libraries/rapidfuzz-cpp/default.nix index 2e1ad8080fa4..99c3059c7a51 100644 --- a/pkgs/development/libraries/rapidfuzz-cpp/default.nix +++ b/pkgs/development/libraries/rapidfuzz-cpp/default.nix @@ -2,20 +2,29 @@ , stdenv , fetchFromGitHub , cmake -, catch2 +, catch2_3 }: stdenv.mkDerivation rec { pname = "rapidfuzz-cpp"; - version = "1.0.1"; + version = "1.0.2"; src = fetchFromGitHub { owner = "maxbachmann"; repo = "rapidfuzz-cpp"; rev = "v${version}"; - hash = "sha256-331iW0nu5MlxuKNTgMkRSASnglxn+hEWBhRMnw0lY2Y="; + hash = "sha256-Tf7nEMXiem21cvQHPnYnCvOOLg0KBBnNQDaYIcHcm2g="; }; + patches = lib.optionals doCheck [ + ./dont-fetch-project-options.patch + ]; + + postPatch = '' + substituteInPlace test/CMakeLists.txt \ + --replace WARNINGS_AS_ERRORS "" + ''; + nativeBuildInputs = [ cmake ]; @@ -25,11 +34,10 @@ stdenv.mkDerivation rec { ]; checkInputs = [ - catch2 + catch2_3 ]; - # uses unreleased Catch2 version 3 - doCheck = false; + doCheck = true; meta = { description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance"; diff --git a/pkgs/development/libraries/rapidfuzz-cpp/dont-fetch-project-options.patch b/pkgs/development/libraries/rapidfuzz-cpp/dont-fetch-project-options.patch new file mode 100644 index 000000000000..ab88c530d400 --- /dev/null +++ b/pkgs/development/libraries/rapidfuzz-cpp/dont-fetch-project-options.patch @@ -0,0 +1,58 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 5ba4464..ad72319 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -12,39 +12,10 @@ else() + FetchContent_MakeAvailable(Catch2) + endif() + +-# include aminya & jason turner's C++ best practices recommended cmake project utilities +-include(FetchContent) +-FetchContent_Declare(_project_options URL https://github.com/aminya/project_options/archive/refs/tags/v0.20.0.zip) +-FetchContent_MakeAvailable(_project_options) +-include(${_project_options_SOURCE_DIR}/Index.cmake) +- +-project_options( +- # ENABLE_CACHE +- # ENABLE_CONAN +- WARNINGS_AS_ERRORS +- # ENABLE_CPPCHECK +- # ENABLE_CLANG_TIDY +- # ENABLE_INCLUDE_WHAT_YOU_USE +- # ENABLE_COVERAGE +- # ENABLE_PCH +- # PCH_HEADERS +- # ENABLE_DOXYGEN +- # ENABLE_IPO +- # ENABLE_USER_LINKER +- # ENABLE_BUILD_WITH_TIME_TRACE +- # ENABLE_UNITY +- # ENABLE_SANITIZER_ADDRESS +- # ENABLE_SANITIZER_LEAK +- # ENABLE_SANITIZER_UNDEFINED_BEHAVIOR +- # ENABLE_SANITIZER_THREAD +- # ENABLE_SANITIZER_MEMORY +- # CLANG_WARNINGS "-Weverything" +-) +- + function(rapidfuzz_add_test test) + add_executable(test_${test} tests-${test}.cpp) + target_link_libraries(test_${test} ${PROJECT_NAME}) +- target_link_libraries(test_${test} Catch2::Catch2WithMain project_warnings) ++ target_link_libraries(test_${test} Catch2::Catch2WithMain) + add_test(NAME ${test} COMMAND test_${test}) + endfunction() + +diff --git a/test/distance/CMakeLists.txt b/test/distance/CMakeLists.txt +index 2a70054..7a43c88 100644 +--- a/test/distance/CMakeLists.txt ++++ b/test/distance/CMakeLists.txt +@@ -1,7 +1,7 @@ + function(rapidfuzz_add_test test) + add_executable(test_${test} tests-${test}.cpp) + target_link_libraries(test_${test} ${PROJECT_NAME}) +- target_link_libraries(test_${test} Catch2::Catch2WithMain project_warnings) ++ target_link_libraries(test_${test} Catch2::Catch2WithMain) + add_test(NAME ${test} COMMAND test_${test}) + endfunction() +